Why is the maximum of a curve domain different from curve length?

:thinking:
crv_dom_max_vs_crv_length.gh (5.8 KB)

Domain and curve length are independent of eachother. Domain relates to the knot vector.

You may have a look here:https://www.rhino3d.com/download/rhino/5.0/essentialmathematicsthirdedition/

2 Likes

Pfff I guess I have to dig deeper into what nurbs are.

This is so counter-intuitive.

Can you (anyone) show me practical examples of curve domain usage?

The curve domain isn’t a feature, it’s how the nurbs equations work, there’s no getting away from it.

Think of the standard sine graph as a parallel. It goes up and down forever, but we can turn it into a finite curve by adding a domain, say from [0.0, 5.0]. We now have a 2D curve which starts at the coordinate (0.0, 0.0) and ends at coordinate (5.0, \text{sin}(5.0)).

Every number in between zero and five is a parameter on the interior of this curve. We can describe the curve (let’s restrict ourselves to two dimensions only for now) parameterically using two equations: x(t) = t and y(t) = \text{sin}(t). If you want to know the coordinate of this curve at a given parameter, you just plug that parameter into the equations for x and y and out pops the coordinate.

How long is this curve? That’s not so easy to answer. Certainly longer than five though. Also, if you imagine picking any parameter t on the interior and then evaluating the curve coordinate at t and t+dt (where dt is a small number), you’ll get two points close together. But how close together? It depends on the value of t. At some places on the curve where it is very nearly horizontal, the distance between C(t) and C(t+dt) will be very close to dt. However at other places where the sine wave is travelling at about 45 degrees as it crosses the x-axis, the distance will instead be close to \sqrt{2} \cdot dt. A constant step in the parameter space does not result in a constant step in xy space. Curves are squished and stretched in space in ways that have little to do with the lengths along the curve.

Sine curves and nurbs curve like to work in parameter-space, not length-space. It is the mathematically natural way to think about these shapes. Lengths are difficult and often impossible to compute, they have to be approximated instead using iterative algorithms that improve upon a solution until we’re happy with the tolerance we’ve reached.

6 Likes

Have some fun with C# on curve matters

Trim_Curves_AndOtherStuff_V1.gh (124.7 KB)

1 Like

Thanks David,

Your description caused something “forgotten” to pop up in my head.

Geometrical approximation of a trochoid:
3

I guess you never really think about what’s inside the CAD when start working with it.

@ivelin.peychev
I remember telling you this at least twice. Just saying. You might start to believe me now? :slight_smile: :wink:

2 Likes

Clearly it’s a matter of the Garmin alternative thingy (and that avatar). Solution: want respect? use this :

2 Likes

I just named me tomtom because some idiot already named himself tom.
Didn’t expect me becoming so famous…

Sadly you cannot change the username…

Genau! I do have trust issues.

1 Like

Peter, if Tom uses this as avatar then he’ll be your master :stuck_out_tongue:

1 Like

Fear not > there’s Plan B > let the Emperor do the dirty work > then > just kill > elementary my dear Watson.

BTW: Get some hypo curves stuff (and modify the code and do some “animation”)

Curves_Hypo_V2.gh (130.2 KB)

2 Likes