Shatter component - what's it about?

I am finding the shatter component useful how I understand the ‘parameter’ must be wrong. Can anyone shed some light on how it is defined? what format of data it can read.

An example is that I tried to shatter at a list of points intersecting the curve - this would not work. processing the points via ‘curve closet point’ helped. The output ‘parameter’ from that could be fed into shatter. I don’t have an issue with that working but isn’t it logical to have a component split at intersecting points?

The curve is a one-dimensional object, you can evaluate it using a single number, the curve parameter, usually called t, to obtain a point, a tangent vector, a plane… at that position (t) on the curve. You can evaluate a curve using a number within the domain of the curve, which is a property of nurbs curves, where the middle value of the domain will give you a point on the middle of the curve, and the maximum value of the domain gives you the final position of the curve. This domain can be reparametrize via right click on an input of type curve, this makes the domain of the curve from 0 to 1, so it is easier to evaluate some position using normalized values, ie, the parameter 0.5 gives you a point on the middle of the curve and the parameter 1 gives you the final position.

If you want to cut curves, you have to give the positions (in the curve dimension) where to cut. If your cutting process depends on points, then you have to calculate the parameter of the closest point using the Curve Closest Point component.

2 Likes

Dani - so for a curve of length N this parameter ‘t’ is a number between 0 and N? once reparametrized it is 0 to 1?

That is a definition I can understand - because of its name ‘parameter’ I has assumed it would accept a wider variety of data.

Yes, but remind that the parameter of a curve is unrelated to its length.
If you evaluate t=0.5 of a reparametrized curve, you might not pick its mid-point.
To pick the correct fraction of a curve use “Evaluate Length” component.


Yes, there is a mix-up with the terms.
Parameter can be intended as “t” (a number) on curves, like the one needed for shatter, or “UV” (a point) for surfaces.
Then, there are the “parameters”:
2020-05-11 23_48_34-Window
that are “containers” that store data.

Depending on the context you might understand what it is referring to.
If i don’t remember wrong, there are plans for different names for GH2.
(but my memory sucks so this coul be a made-up XD … )

So cluster it! pSnip


pSnip_2020May11a
pSnip_2020May11a.gh (11.6 KB)

2 Likes

Joseph - thanks for the two examples

@maje90 Can you explain the reparametrize point in more detail. if something has be normalized and the domain is 0 to 1. Then what does 0.5 relate to if not length?

“two examples”? I posted only one, a reusable cluster that accepts points to shatter a curve.

Ah I wasn’t familiar with cluster - I had assumed it was a component I hadn’t seen before rather than a custom grouping. i.e. two methods, one slightly more concise.

Double-click the pSnip cluster to edit its contents (shown with blue background). It took me only a minute to create it.

A curve parameter domain can be also from negative to positive or it can start not from zero.
It is not a bad practice to always reparametrize, but if you do so, remember to reparametrize the curve once for all at it source or everywhere it is used.

Parameter is unrelated to length, more like it is related to control points locations.
See how much length is covered at start vs the end, even tough the slider is changing almost constantly:
parameter

4 Likes

Quite right. Which is why we have Point On Curve (purple group) and Evaluate Length:

eval_length_2020May11a
eval_length_2020May11a.gh (5.2 KB)

Other people have answered your technical questions, but you’ve also made me want to ask another question:

Why the hell isn’t there a point input on every component that has a parameter input? Why not both? What would be the disadvantage?

Making the learning curve steeper and making common tasks take extra steps is not good UX design.

Using a point is drastically slower than using a parameter. If the component used parameters and you wanted it to use a point then this is what needs to happen. The point needs to be pulled to the curve, the parameter needs to be found, then the parameter is used. Point evaluation is heavy in mass.

Aside from that, using a point isn’t the only way to get a parameter and that is the deconstructed nature of Grasshopper. If you need to use a point then you can use curve closest point or pull point etc. to get the parameters in that way.

As David described it once.
Length = distance traveled.
Parameter = Amount of time traveled.
:grinning:

1 Like

OK, then let’s do it in reverse. Why don’t components like “curve middle” return both parameter and point?

I get that it makes sense to do it the way it’s currently done from a programming efficiency perspective. And having the most deconstructed components possible must be part of what makes Grasshopper capable of the astounding things it can do in experienced hands.

But from a UX perspective, if, for instance, you’ve got a rhino user who wants to use Grasshopper to do something more mundane like drawing up some shelving they can adjust in a bunch of ways, what the current UX and learning curve seems likely to create is… yet another fusion360 user.

I know from a previous thread that the curve middle component was made on a whim for some user asking for it because they refused to use the normal ways to get curve middle, my guess it was just an after thought component (in Pufferfish I’ve had a curve middle point component for awhile before that which does get you the parameter and length also). That’s not to say things shouldn’t be consistent but I remember when this middle component was made from that thread :grinning:

Points do have some tricky situations when using instead of parameters, one that comes to mind is seams of closed curves. If a point is on the seam and you want to use that point, should it be parameter 0.0 or 1.0 on a reparameterized curve? Or what if you have two points there and you intended one to be 0.0 and the other 1.0? If using parameters it is very easy to define.

I forgot to mention that the default value of the ‘N’ (Normalized) input to Evaluate Length is ‘True’ which makes it behave very much like Evaluate Curve with a reparameterized curve. There is a difference between them that depends on the curvature of the curve.


eval_length_2020May12a.gh (5.8 KB)

So evaluate curve uses ‘t’ which is related to how curve is defined so the distribution of points isn’t linear around along the curve.

Whereas evaluate length can provide be a point at say X% of the length of the line. I think this would be the component I require more often than evaluate curve.

Yes.