Thanks, now I'm facing two type of problems:
I have to extrude the face to make a relief, so i probably have to find the normal to project correctly the face obtained with the correct curvature.
1) for a cylinder it would be not a problem, but how to obtain a proper "extrude vector"?
2) When creating the face, as in the code below the "i" charcter is ok but the "g" is not, so I have to determine if one wire is internal to another so I could make one the "hole" of the other. I think that making an assumption that first wire is the "outer" wire, could lead to wrong results, but I could see some cases maybe in some nordic accented letters where there could be some characters with "holes" and optional part like the accent or other "decorations", so I'm wonder how to deal with these cases, in a more generic way?
I attached the modified code as a file to make more easy to work.
Below the portion of code
Code: Select all
mwrs = []
for s_idx, s_wire in enumerate(wire_s):
wire_idx = f"m_wire_{s_idx}"
if len(s_wire) > 1:
subwrs = []
for sw_idx, sub_wire in enumerate(s_wire):
mw = map_wire(sub_wire, surf.Surface, quad_face)
wire_n = f"{wire_idx}_{sw_idx}"
subwrs.append([wire_n, mw])
mwrs.append(subwrs)
else:
mw = map_wire(s_wire[0], surf.Surface, quad_face)
wire_n = wire_idx
mwrs.append([wire_n, mw])
for mwr in mwrs:
if type(mwr[0]) == str:
face = Part.Face(mwr[1])
Part.show(face, mwr[0])
else:
for smwr in mwr:
face = Part.Face(smwr[1])
Part.show(face, smwr[0])
Carlo D.