Curve to surface parameters ?

Hi: For a given face bounded by edge X, and given a parameter (abscissa) along (underlying) curve of edge, I like to obtain the (u,v) parameters on (underlying) surface of face. I know I can do it by just projecting the xyz loc corresponding to the parameter on curve, but this is quite inefficient, so is there another way. Any help appreciated. Thanks.

Maxim ZVEREV's picture

Hello!

You can do it by following:

1) Obtain 2d curve (curve representation of edge in parametric space of surface) for the desired face.

Handle(Geom_Curve2d) PC = BRep_Tool::CurveOnSurface(anEdge, aFace, first, last);

2) Obtain UV point by computing D0 of this 2d curve in desired parameter (it is possible because of SameParameter property of edges. It means that all curves (3d, 2d) dedicated to the given edge must have the same parametrisation along the curve. So, parameter obtained from the one of the curves will give you the same mapping in all edge curves):

gp_Pnt2d aUV;

PC->D0(parameter, aUV).

if you have no 2d curve for the face, you need to use projection.

Best regards,

Maxim Zverev.