> As a beginner, one of the difficulties I am having is navigating the data. > Bottom up it seems ok - start from points, create geometry, then create > topology > > p1 = gp_Pnt(0,0,0) > p2 = gp_Pnt(0,0,10) > handle_geom_trimmed_curve = GC_MakeSegment(p1, p2).Value() > topods_edge = BRepBuilderAPI_MakeEdge(handle_geom_trimmed_curve).Edge() > topods_wire = BRepBuilderAPI_MakeWire(topods_edge).Wire() > topods_face = BRepBuilderAPI_MakeFace(topods_wire ).Face() > > But going the other way seems to be difficult. For example, if I start with > the face, how do I get the wire, the edges and the curves? I don't see any > methods to do this. I see something to do with TShape - but I am not sure > what that is... > > handle_topods_tshape = topods_face.TShape() > topods_tshape = handle_topods_tshape.GetObject() > > Any suggestions?
Sure. from OCC.Utils.Topology import Topo topo = Topo(topods_face) topo.number_of_edges() wi = topo.wires_from_face(aFace) edg = topo.edges_from_wire(wi) verts = topo.vertices_from_edge(edg) also, can I advice you to use: OCC.Utils.Construct there are functions such as make_edge, make_face that let you write: face = make_face(make_wire(make_edge(p1,p2))) ( however a face from 2 vertices… I dont think that works ) Have you seen all the examples on the SVN version Patrick? Their an essential reference, as is the doxygen documentation found on opencascade.org. That's a pretty ok documentation of the API. Cheers, -jelle
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users