Hi Charles, I'm not sure what you mean by segments? But I am interested in an example!
The leak is indeed in BrepExtrema_DistShapeShape. My current approach is to calculate a midpoint for each of the blue edges, which is fast even for 6000 edges. Then I use scipy.spatial.KDTree for a nearest neighbour search. In cases where two or more edges are found, I still use BRepExtrema_DistShapeShape to select the edge closest to that node. https://dl.dropboxusercontent.com/u/32772/pythonOCC/findverticesnearedge.png Uwe On 07/08/13 06:44, Charles Sharman wrote: > Hi Uwe, > > Are your edges segments? It seemed like they might be from the edgeScaling > and edgeDirection lines. If so, there are closed-form methods you could use > with numpy to calculate this very, very fast. (Just dig up an old parametric > calculus book.) I can write a quick example for you if this is indeed the > case. > > If not, BrepExtrema_DistShapeShape looked like a good choice to me. (I'm not > aware of alternatives.) Have you profiled your program to find where the > time and memory sink occurs? Is it in the BrepExtrema_DistShapeShape routine > or the math at the bottom? I would assume it's in > BRepExtrema_DistShapeShape. If so, since your edges are short, couldn't you > prefilter many of the edges out before BrepExtrema_DistShapeShape is called > by putting a bounding box around the edge and see if the bounding box points > are close to the vertex with numpy? > > - Charles > > > > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > -- INTALES GmbH Engineering Solutions Uwe Schlifkowitz -- Software Engineer Innsbrucker Str. 1, A-6161 Natters Phone: +43 512 54611120 -- schlifkow...@intales.com _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users