Grasshopper

algorithmic modeling for Rhino

I had tried to do some vb stuff a while back involving extracting subcurves but i gave up on it since it was a bit too involved. I noticed you can now get subcurves with a readymade component and it works for the most part. the problem I'm having is that regardless of the order of my interval inputs I am getting the same portion of the curve - I want the inverse of what I'm getting and I figured just changing the order should do it - but it's not.

any advice?

Views: 1742

Replies to This Discussion

Hi Gabriel,

an interval is defined by two numbers. If you switch the numbers, nothing changes since it still defines the same range.

Have a look at the following curve:


This is a curve which has a domain of {0.0 to 4.5}. These numbers tell us nothing about the shape or even the size of the curve. We could scale it up to a length of 15 light-years or down to the Planck length, it wouldn't matter to the domain. We can drag the control-points around as much as we want and the domain would still be {0.0 to 4.5}.

The only thing the domains tells us is that all the numbers between 0.0 and 4.5 map to a valid point somewhere on the inside of the curve. If you're trying to "solve" this curve for numbers (parameters) lower than 0.0 or higher than 4.5 you'll end up somewhere in outer space.

When we use the subcurve component to trim a curve, we need to supply a domain which indicates the section of the curve we wish to keep (the trimming interval has to be a subset of the original curve domain, you cannot gain curve length by trimming any more than your barber can make your hair longer).

So let's assume our trimming domain is {1.2 to 2.4}. This is represented by the orange section. It doesn't matter whether the interval is defined as {1.2 to 2.4} or {2.4 to 1.2}, it's still the same piece of the curve.

If you want to keep everything that is NOT inside the interval, then you have to get smart. In this case, it actually requires two intervals {0.0 to 1.2} and {2.4 to 4.5} to reverse the trimming behaviour. If your interval touches upon one of the extremes, then you'll only have to supply the other bit.

--
David Rutten
david@mcneel.com
Seattle, WA
David, thanks for the detailed explanation. I had the domain mapping bit before, I just assumed that the reversed domain definition would do the job by wrapping at the extremity back around to the first value - I guess not...

thanks so much.

Hi David,

you wrote: It doesn't matter whether the interval is defined as {1.2 to 2.4} or {2.4 to 1.2}, it's still the same piece of the curve.

What about if the curve is closed?  In this case it should mean a different thing, isnt it?

How can I "inverse" the subcurve in case of a closed curve?

No, the only thing that might matter is whether the domain crosses the seam of a closed curve. If that's an issue then it'll be an issue either way.

You cannot reverse part of a curve, only entire curves can be reversed/flipped.

In other words if I have the short subcurve of a closed curve, there is no way to calclute the long subcurve  from the short one?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service