Skip to content

Commit a21a8f5

Browse files
author
Andrea Mola
committed
updated CAD interface in ffd.py
1 parent b5f4773 commit a21a8f5

File tree

1 file changed

+6
-43
lines changed

1 file changed

+6
-43
lines changed

pygem/cad/ffd.py

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def __call__(self, obj):
325325
modified_edge= BRepBuilderAPI_MakeEdge(occ_edge.GetHandle()).Edge()
326326
shapesList.Append(modified_edge)
327327
#if new_curve.IsClosed()==False:
328-
#fixer_edge = BRepBuilderAPI_MakeEdge(new_curve.Value(new_curve.LastParameter()),new_curve.Value(new_curve.FirstParameter())).Edge()
328+
#fixer_edge = BRepBuilderAPI_MakeEdge(new_curve.Value(new_curve.LastParameter()),new_curve.Value(new_curve.FirstParameter())).Edge()
329329
#shapesList.Append(fixer_edge)
330330
#display.DisplayShape(modified_edge,update=True,color="BLUE1")
331331

@@ -359,55 +359,18 @@ def __call__(self, obj):
359359
# finally, we get our trimmed face with all its holes
360360
brep_surf = face_maker.Face()
361361
#brep_surf = faceFilling.Face()
362-
IGESControl_Controller_Init()
363-
writer = IGESControl_Writer()
364-
writer.AddShape(brep_surf)
365-
nomefile = nomedir+"trimmed_face"+str(faceCount)+".iges"
366-
writer.Write(nomefile)
362+
#IGESControl_Controller_Init()
363+
#writer = IGESControl_Writer()
364+
#writer.AddShape(brep_surf)
365+
#nomefile = nomedir+"trimmed_face"+str(faceCount)+".iges"
366+
#writer.Write(nomefile)
367367

368-
# we add the face to the comound of the color we are working on
369-
compound_builder.Add(compound, brep_surf)
370-
face_list.append(brep_surf)
371368

372369
# and move to the next face
373370
faceCount += 1
374371
faces_explorer.Next()
375-
376-
#sew = BRepBuilderAPI_Sewing(100.0)
377-
#for sh in face_list:
378-
#sew.Add(sh)
379-
#print("??")
380-
#sew.SetNonManifoldMode(True)
381-
#sew.Perform()
382-
#shell = sew.SewedShape()
383-
#if shell.ShapeType() == TopAbs_SHELL:
384-
#print("It's a shell")
385-
#else:
386-
#print("No luck here")
387-
##shell = sew_shapes( face_list, 0.1 )
388372

389373

390-
# after looping on all the faces of a color to modifiy them, we save the color compound in an iges file
391-
IGESControl_Controller_Init()
392-
writer = IGESControl_Writer()
393-
writer.AddShape(compound)
394-
nomefile = nomedir+"Color_"+str(color_count)+".iges"
395-
writer.Write(nomefile)
396-
#display.DisplayShape(compound,update=True,color="RED")
397-
print(faceCount)
398-
colors_mod.append(compound)
399-
else:
400-
# if the color was not to be modified with this procedure (like the top and transom), we just skip them
401-
print("Non modified color")
402-
#IGESControl_Controller_Init()
403-
#writer = IGESControl_Writer()
404-
#writer.AddShape(color)
405-
#nomefile = nomedir+"Color_"+str(color_count)+".iges"
406-
#writer.Write(nomefile)
407-
##display.DisplayShape(compound,update=True,color="RED")
408-
print(color_count)
409-
colors_mod.append(color)
410-
411374

412375
## END SURFACES #######################################################
413376

0 commit comments

Comments
 (0)