I have committed a Wrappers file i use for everyones use in the users
contrib folder.

Most of the code is quite rough-- I am limited in time today but wanted not
to forget to upload it. Please understand this is not production quality
code, but hopefully its good enough to determine if there's value.

One pattern I think is particularly useful is the Edge().discretePoints. It
is a python generator, so it nicely wraps up GcPnts_QuasiUniformAbscissa
without any scoping issues, and without having to create an in memory list
to return.

The beauty of the generator approach is that the C++ objects are stored in a
closure while the caller is retriving points. Example usage would be:

 myEdge = BRepBuilderAPI_MakeEdge(...);

ew = Edge(myEdge);
DEFLECTION=0.1

for pt in ew.discretePoints(DEFLECTION):
   #do whatever you want with your point. As long as you are iterating,
   #GcPnts is still retained in a closure, and is destroyed when you are
done
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to