Calculate next U V parameter in certain distances on surface

I want to calculate points on a surface that have certain distances along the U and V parameters.
Like the GCPnts_AbscissaPoint class work with BRepAdaptor_CompCurve class.

Anyone known which class can calculate next u v parameters with certain distances ?

Roman Lygin's picture

(It's been a long time since I posted at this forum. Some forums have been moved somehow between this 'old' and 'new' websites).

Let me offer some thoughts.

Unlike the 1D case with the curve, where going along the curve is well-defined, moving along the surface can be ill-defined.

If you are talking about the new 3D point P being distant by N mm from your original 3D point O then you are essentially solving a problem of surface-surface intersection : intersecting your original surface with a sphere of radius N with the center at O. 

Otherwise, if you are talking about the point P being N mm apart from O along the surface itself then it can be undefined at all. Imagine you are standing on a rocky mountain's slope and are thinking about a point 20 steps from where you are standing. There is infinity of them: you take 5 steps downhill, 5 to the right, 5 uphill, 5 to the left, etc. Depending on a surface, you may even arrive at your original point.

So I bet you are rather thinking about the former case (P being N mm apart from O in 3D). In this case, in general, you will essentially need to solve a system of four non-linear equations F(u1, v1, u2, v2) = 0 (or find a minimum of F). And thus, just need to apply the typical Newton method and some start point (u1_0,v1_0, u2_0, v2_0). The 'Numerical Recipes' book will provide you with a framework if needed. In Open CASCADE, you will find numerical method support in the math package (e.g. math_FunctionSetRoot).

Hope this helps in some way.


Roman Lygin's picture

Argh, if you only need to move along U- or V-isolines, things can be MUCH simpler.

Just compute Geom_Curve as Geom_Surface::UIso() or ::VIso() and use GCPnts_AbscissaPoint to move along the curve.

This can be very slow if you need to make a lot of computations but will do the job.

Shen Tung Huang's picture

Thanks, I'm using these two functions now.