Surface parameters

Hi,
Is it possible to get parameters from position? (reverse of Value(u,v))

Thanks
xaeroxx

Pawel's picture

Hi xaeroxx,

I use the followin code:

...
double pU, pV;
Handle(Geom_Surface) surface = BRep_Tool::Surface(face);
...
GeomAPI_ProjectPointOnSurf projection( gp_Pnt(x, y, z), surface);

if(projection.NbPoints() > 0)
{
if(projection.LowerDistance() < Precision::Confusion() )
{
projection.LowerDistanceParameters(pU, pV);

}
else
;//your message here
}

Pawel

Bearloga's picture

Two ways:
1. The class GeomAPI_ProjectPointOnSurf.
2. The class ShapeAnalysis_Surface, method ValueOfUV, it tries to do its best to get the result when the previous way fails.

xaeroxx's picture

Thanks, that was great help