Shatter component / Crv-Crv intersection: does not always work

BUG (27.2 KB)

Hello !

I have a problem with the shatter component. (I am still using Rhino 5).
It does not always work: sometimes I get the mention “object reference not set to an instance of an object”. I think it comes from a tolerence that isnt respected, so I tried to make the parameters that are too small disappear, but then I saw that those parameters, coming from the curve-curve intersection component, are sometimes negative…

I don´t understand how it is possible - those parameters seem to be sometimes between 0 and 1, sometimes between 0 and MaxLength, which is also something I do not understand.

I have attached the file corresponding to the problem - if someone could help it would be so nice, I just cant get this truss working :frowning:

(My aim was to create a truss with posts on each intersection points and more posts inbetween)

Thank you in advance :slight_smile:

Some basic info on curve parameters:

The curve domain is a non-zero-length, increasing numeric interval. An interval is delineated by two extremes and these values could be anything, as long as they aren’t the same and as long as the domain start value is less than the domain end value.

The curve ‘exists’ everywhere inside this domain. The first (i.e. smallest) value represents the curve start point. The last (i.e. largest) value represents the curve end point. Any value (or parameter) in between represents a point somewhere on the curve interior.

When Rhino makes curves it typically picks a domain from zero to the length of the curve. There is no stringent need for such a choice, except that many algorithms ‘like’ it when the physical size of a curve is roughly equal to its parametric size. When a curve is scaled, its physical length will change but its domain will remain the same, so it is entirely possible to end up with curves that have a wildly different length and domain.

It is possible to reparameterize a curve, which essentially just assigns a new domain to it. This will neither change the curve shape, nor its derivatives or control-point locations, or greville-points or what have you. The domain of a curve can be freely chosen. One common action is to assign the unit interval (0,1) to a curve domain. This makes certain mathematical operations easier to write down, and this is what the ‘reparameterize’ option in Grasshopper does.

Certain special types of curves have an intrinsic domain. Lines are always (0,1), circles are always (0, \pi), arcs are always (\alpha_0, \alpha_1), where the \alpha's represent the start and end angles of the arc.

However even lines, circles and arcs can be embedded into curve types whose domain is adjustable.

Parameters are usually the way we choose to address curves, because they are fast and unambiguous. If you were to use 3d-points for example then it wouldn’t be clear exactly where on the curve you meant for something to be measured if you happened to pick a point where the curve self-intersects. Or a point far away from the curve. Similarly, using lengths or percentages–albeit unambiguous–is counter to the way curves are mathematically defined and it takes a lot of CPU heavy lifting to figure out exactly where along the curve 25mm really is.

To recap, it is perfectly fine to have negative curve parameters. The curve domain may be entirely negative, partially negative, or entirely positive, provided it has a measurable length.

Your file contains a bunch of non-standard objects from (at least) Karamba.

Probably best if you narrow it down to the smallest possible case that still represents the problem. Point #3 in this post shows how you can reduce the complexity of a file.

Thank you so much for your explanation, it was very clear !

I tried to make a clean file, I still have the “remove duplicate pts” component but I am worried it won t work without it.

I grouped in a gray color what doesnt directly touch to my problem, but, I think, helps to see the problem (Shatter Bug) - and one with only the problem (Shatter bug 2), so you can choose which one is better for you.

BUG (29.8 KB)
BUG (15.0 KB)

Thank you again for your time :slight_smile: