Given a 3d point on an edge(on a face), how to evaluate its parameter in 2d curve.

Thanks in advance. Any suggestion is welcome.

Rob Bachrach's picture

Just to make sure I understand your question:
- You have an edge on a face.
- You have a 3D point on that edge
- You want the parameter along the 2D curve defined in the parametric space of the surface.

If this is correct, you might try the following:
- Get the 2D curve for the edge in the parametric space of the face using BRep_Tool::CurveOnSurface.
- Get the underlying surface for the face using BRep_Tool::Surface
- Get the 2D location of the point in the parametric space of the surface using ShapeAnalysis_Surface::ValueOfUV
- Get the parameter of the 2d point by projecting it on the 2d curve with Geom2dAPI_ProjectPointOnCurve

There are other ways, but this is the first to come to mind.


Cauchy Ding's picture

Great! It works well now. Thank u very much.