Hi,

i use pythonOCC to create .stp files in order to import them in Abaqus CAE.

Somehow, i seem to not manage to export my example as a solid. When
importing in Abaqus, it says that it is imported as shell instead of solid.

Any ideas why? What am i doing wrong?

Here's the example code:
______________
def make_face(p1, p2, p3, p4):
    poly = BRepBuilderAPI_MakePolygon()
    map(poly.Add, [p1,p2,p3,p4])
    poly.Build()
   
    wire = poly.Wire()
    face = BRepBuilderAPI_MakeFace(wire)
    return face


faces = {}
p1,p2,p3,p4 = gp_Pnt(0,0,0),gp_Pnt(-5,-5,-5),gp_Pnt(5,-5,-5),gp_Pnt(0,0,0)
faces[0] = make_face(p1,p2,p3,p4).Shape()

p1,p2,p3,p4 = gp_Pnt(0,0,0),gp_Pnt(-5,-5,-5),gp_Pnt(-5,5,-5),gp_Pnt(0,0,0)
faces[1] = make_face(p1,p2,p3,p4).Shape()

p1,p2,p3,p4 = gp_Pnt(0,0,0),gp_Pnt(-5,5,-5),gp_Pnt(5,5,-5),gp_Pnt(0,0,0)
faces[2] = make_face(p1,p2,p3,p4).Shape()

p1,p2,p3,p4 = gp_Pnt(0,0,0),gp_Pnt(5,5,-5),gp_Pnt(5,-5,-5),gp_Pnt(0,0,0)
faces[3] = make_face(p1,p2,p3,p4).Shape()

p1,p2,p3,p4,p5 = gp_Pnt(-5,-5,-5),gp_Pnt(-5,5,-5),gp_Pnt(5,5,-5),
gp_Pnt(5,-5,-5), gp_Pnt(-5,-5,-5)
poly = BRepBuilderAPI_MakePolygon()
map(poly.Add, [p1,p2,p3,p4,p5])
poly.Build()

wire = poly.Wire()
faces[4] = BRepBuilderAPI_MakeFace(wire).Shape()

sewing = BRepBuilderAPI_Sewing()

for i in range(5):
    sewing.Add(faces[i])

sewing.Perform()
sewed_shape = sewing.SewedShape()

tds = TopoDS()
solid = BRepBuilderAPI_MakeSolid(tds.Shell(sewed_shape))

# Export to STEP
my_step_exporter = STEPExporter("vogon.stp")
my_step_exporter.SetTolerance()
my_step_exporter.AddShape(solid.Solid())
my_step_exporter.WriteFile()
____________

Thanks a lot in advance!

Cheers,

JC


_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to