How to retrieve the coordinate parameter z from a given Geom_BSplineSurface by means of (x ,y)?

Hi, folks,

Define a BSpline surface, how can I obtain the parameter z by means of (x,y)?

In fact, I can give two parameters (u,v) to retrieve a point (gp_Pnt) by using the class method Value(u,v). On the contrary, how can I retrieve the z parameters, if giving two coordinates (x,y)?

I don’t know the class method “GeomAPI_ProjectPointOnSurf” is suitable to my question. Do you other methods for solving my problem?

Thank in advance!

Stephane Routelous's picture

basically, a BSpline curve can have more than 1 z for a given (x,y) ( think about a curve in S ).
Did you think making a line and intersecting the line with the curve ?

HTH

francisco castillo's picture

You can use
GeomAPI_IntCS(const Handle(Geom_Curve)& C,
const Handle(Geom_Surface)& S);

To greate a Geom_Curve use the point (X, Y, 0) and the vector (0,0,1) on the
GC_MakeLine (const gp_Pnt& P,const gp_Dir& V) class and your BSpline surface as Geom_Surface. Then you have to check the number of intersections and his values.