
Wed, 06/06/2007 - 22:41
Forums:
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
Wed, 06/06/2007 - 22:48
Since it is not guaranteed that the point is precisely on the curve, this requires a projection. Check out ShapeAnalysis_Curve.
Thu, 06/07/2007 - 04:02
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
Thu, 06/07/2007 - 15:36
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.