Getting the Parameter of the point on curve

Hi,

Is there a class/method that can calculate the parameter of the curve given the point on that curve? For every Geom_Curve, we can calculate the point on the curve given the parameter, but can we do the inverse somehow?

Thx,
Janko Jerinic

Rob Bachrach's picture

Since it is not guaranteed that the point is precisely on the curve, this requires a projection. Check out ShapeAnalysis_Curve.

jackietsaah's picture

Thanks for the info. While we're on the topic, can we somehow control how many points ShapeAnalysis_Curve::GetSamplePoints yields? It seems that the sample rate is one degree, or PI/180 radians, for, say, circles & ellipses, which is a bit too much if you have many curved edges in a complex scene. Same question goes for spheres and tori, e.g. one torus yields more than 10,000 triangles which means a big waste of render time.

Thanks,
Janko Jerinic

Rob Bachrach's picture

If you have a complete circle or elipse, it will always give you 360 points (or 1 per degree). It will vary of trimmed curves (like a circular arc). If you are looking for a class to use for rendering, you might consider BRepMesh. It is made to create renderable triangles based on a deflection from the surface. Another option may be GCPnts_UniformAbscissa to give you equally spaced points along a curve.