Thank you, Jelle. There may be other ways to create a simple rectangular wire. My problem is that ShapeAnalysis_FreeBounds and many other classes don't function in python, and I would like to understand why, in order to be able to fix it. There is a very good reason, why opencascade offers all these algorithms, and in my opinion pythonocc should a) include functioning bindings or b) hide non-functioning bindings or c) document which pythonic ways replace opencascades algorithms. OCC.Utils.Construct.make_wire does *not* replace ShapeAnalysis_FreeBounds::ConnectEdgesToWires, because make_wire just adds one edge after the other, assuming they are ordered and connected. This works for the simple example, but not in situations which the shapehealing toolkit was designed for. I am sorry, I do not want to threaten or give homework, but give feedback what should happen so that my coworkers will return to pythonocc again in the future. You are welcome to ignore the feedback. I am more used to other open source projects, where the limitations a clearly communicated and a higher priority is given to understand what is causing the limitations instead of providing hundreds of workarounds.
Regards, Björn ----- Ursprüngliche Mail ---- > Von: Jelle Feringa <jelleferi...@gmail.com> > An: pythonOCC users mailing list. <pythonocc-users@gna.org> > Gesendet: Mittwoch, den 18. August 2010, 11:59:50 Uhr > Betreff: Re: [Pythonocc-users] face from self-intersecting wire, ShapeFix > > > vs=[[0,0,0],[1,0,0],[1,1,0],[0,1,0]]; > > es=TopTools_HSequenceOfShape() > > es.Append(BRepBuilderAPI_MakeEdge(gp_Pnt(*vs[0]),gp_Pnt(*vs[1])).Edge()) > > es.Append(BRepBuilderAPI_MakeEdge(gp_Pnt(*vs[1]),gp_Pnt(*vs[2])).Edge()) > > es.Append(BRepBuilderAPI_MakeEdge(gp_Pnt(*vs[2]),gp_Pnt(*vs[3])).Edge()) > > es.Append(BRepBuilderAPI_MakeEdge(gp_Pnt(*vs[3]),gp_Pnt(*vs[0])).Edge()) > > ws=TopTools_HSequenceOfShape() > > safb=ShapeAnalysis_FreeBounds() > > safb.ConnectEdgesToWires(es.GetHandle(),1e-3,False,ws.GetHandle()) > > > Hi Björn, > > I'm getting a little annoyed by a somewhat threatening and demanding tone > on >this list; giving our readers homework ( last thread ) and now threatening to >abandon pythonocc if we do not fix some issue in a week. Be a little more >respectful, please. > > Back to the problem; > > Just to understand your issue in more detail; let me ask you why you would >create in the suggested manner. > There's a pythonic way to do it. > > > ( oops… from OCC.Utils.Construct import * ) > In [25]: vs = map( lambda x: gp_Pnt(*x), [[0,0,0],[1,0,0],[1,1,0],[0,1,0]]) > > In [26]: vs > Out[26]: > [<OCC.gp.gp_Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x10b409b50> >, > <OCC.gp.gp_Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x10b409b70> >, > <OCC.gp.gp_Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x10b409b90> >, > <OCC.gp.gp_Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x10b409bb0> >] > > In [27]: edg1 = make_edge(vs[0], vs[1]) > > In [28]: edg2 = make_edge(vs[1], vs[2]) > > In [29]: edg2 = make_edge(vs[2], vs[3]) > > In [30]: edg3 = make_edge(vs[2], vs[3]) > > In [31]: edg4 = make_edge(vs[3], vs[0]) > > In [32]: wire = make_wire([edg1,edg2,edg3,edg4]) > > In [33]: wire > Out[33]: <OCC.TopoDS.TopoDS_Wire; proxy of <Swig Object of type 'TopoDS_Wire >*' at 0x102b04040> > > > Take care, be nice, > > -jelle > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users