For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Projection of point on surface

Anonymous's picture
Forums: 

Hi,

When reading the file GeomAPI_ProjectPointOnSurf.cdl in the GeomAPI directory I found that it should be possible to split up a projection process into an init phase and a perform phase. This should probably give better performance when projecting more than one point onto a surface.

I tried the following code:

gp_Pnt CurrentPoint;

TColGeom_Array1OfSurface arrayOfSurfaces(1,NumberOfFaces);

...

arrayOfSurfaces(i)->Bounds(U1,U2,V1,V2);

GeomAPI_ProjectPointOnSurf PPS.Init(arrayOfSurfaces(i),U1,U2,V1,V2);

PPS.Perform(CurrentPoint);

Unfortunately the program crashes during the perform step.

Doing all in one step works perfect, but a bit slow:

PPS.Init(CurrentPoint,arrayOfSurfaces(i));

Does anyone have an idea what is wrong?

Thanks in advance

Thomas