Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

GeomAPI_ProjectPointOnSurf slow in 6.5.4? Use Extrema_ExtAlgo_Tree instead of Extrema_ExtAlgo_Grad?

GeomAPI_ProjectPointOnSurf slow in 6.5.4? Use Extrema_ExtAlgo_Tree instead of Extrema_ExtAlgo_Grad?
Thorsten 2013/02/13 15:17
Hi,

I switched from OCE-0.9.1 (OCCT 6.5.2) to OCE-0.11 (OCCT 6.5.4). Now the projections via GeomAPI_ProjectPointOnSurf seems to be very slow:

---snip---
gp_Pnt pnt = ...
const TopoDS_Face & aktface = ...
const Handle_Geom_Surface & geomsurf = BRep_Tool::Surface(aktface);
Proj_punkt.Init(pnt, geomsurf);
---snap---


If I use the alternative alg "Extrema_ExtAlgo_Tree" (new in 6.5.4, see release notes) I get the "old good" performance back:

---snip---
const TopoDS_Face & aktface = ...
const Handle_Geom_Surface & geomsurf = BRep_Tool::Surface(aktface);
Proj_punkt.Init(newPnt, geomsurf, Extrema_ExtAlgo_Tree);
---snap---

Why there are 2 algorithms (Extrema_ExtAlgo_Grad, Extrema_ExtAlgo_Tree)? The default algorithms seems to be "Extrema_ExtAlgo_Grad" although it seems to be slower than "Extrema_ExtAlgo_Tree". And last but not least: why is the same call "Proj_punkt.Init(pnt, geomsurf)" in 6.5.2 slower than in 6.5.4?

Are there any drawbacks in using "Extrema_ExtAlgo_Tree" instead of "Extrema_ExtAlgo_Grad"?

Thorsten
Albert 2013/10/03 06:38
Hi Thorsten,

I also wonder the same question.

Additionally, I need to iterate through several faces to find the closest projection of a point in a TopoDS_Edge or TopoDS_Wire. I'm importing from IGES and STEP.

Is there a way to quickly find the closest projection among several Faces (TopoDS_Face)?

Thanks,
Mauro Mariotti 2013/10/03 11:59
Thorsten,
I cannot find any reference to Extrema_ExtAlgo_Tree
in http://www.opencascade.com/pub/doc/Release_Notes_6.5.4.pdf
Could you give me a hint?

Albert,
if your faces are all the faces of a solid or a shell, you could try with BRepExtrema_DistShapeShape (after making a vertex from the point).

Regards.
Mauro
Thorsten 2013/10/03 12:17
Search for "22826" in release notes

"The ability to use UBTree algorithm to find projection in Extrema_GenExtPS has been
added in GeomAPI_ProjectPointOnSurf."

and "22883"

Albert 2013/10/03 20:27
Thanks a lot for your quick reply.
I'm trying to code that.

Do you know if there is any way to retreive the TopoDS_Face that contains a TopoDS_Edge or TopoDS_Wire?
In other words, the face that was used to generate the edge or wire...

Thanks again,

Albert
Mauro Mariotti 2013/10/03 20:55
Unfortunately in OpenCascade, in contrast to other kernels, subshapes do not "know" their "parent" shapes.

You can get the faces which contain an edge only if you know an "ancestor" for them.
E.g., if the face is inside a solid, you pass it to TopExp::MapShapesAndAncestors this way:

TopoDS_Edge anEdge;
TopoDS_Solid aSolid;
TopExp::MapShapesAndAncestors(aSolid,TopAbs_EDGE,TopAbs_FACE,edgeMap);
Standard_Integer i = edgeMap.FindIndex(anEdge);
if (i) {
TopTools_ListIteratorOfListOfShape it;
it.Initialize(edgeMap.FindFromIndex(i));
for (; it.More(); it.Next()) {
const TopoDS_Face &aFace = TopoDS::Face(it.Value());
//...
}
}

Bye.
Mauro
Albert 2013/10/05 17:51
Hi Mauro,

Thank you very much for all your advice. I tried to compute distances between Shape and Shape but it was still very slow. So finally I decided to compute distances between point and triangle (from the triangulated surfaces) and it is way faster.

Thank you anyways :)

Albert
 
 
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map