Grasshopper

algorithmic modeling for Rhino

I think I've found what may be a bug in Grasshopper, or maybe I don't understand the way this should operate.

I create a rectangle, put  a radius on it, and then move the seam point of the resulting curve.  If I measure the length of the original curve and the moved seam point curve they are both the same. 

If I extract a subcurve from the original everything looks great.  However, if I extract from the moved seam point curve I get an incomplete subcurve from the moved seam point curve.

 

Everything I do has the subcurve extraction ending at the location of the original seam point, which is not what I would expect.

 

Is this correct behavior or a bug?

 

Views: 970

Attachments:

Replies to This Discussion

Moved to the Errors and Bugs forums as this sure seems to be a bug to me rather than just a discussion.

Your original curve's domain is [0.0 to 91.415927].

When you changed the seam point to the parameter 2.5*pi, the curve's domain became

[2.5*pi to 91.415927+2.5*pi]  : different domain, thus different subcurve.

This is the way nurbs curves work, domains are not always [0 to length] and not linearly linked to the curve (for example the half of the domain doesnt necessarily correspond to the half of the curve).

More on this by David: http://www.grasshopper3d.com/forum/topics/evaluate-curve-at-t?comme...

Thanks Systemiq... I believe I understand what you are saying (although I wish it didn't work that way.)

But I just don't get some of the behavior... logic would tell me that if I extract the starting point of the curve (after the seam was moved) and then get the length as the ending domain that the subcurve would start at the starting point (which it does) and go for x length (which it doesn't).  I understand what you are saying, but it just doesn't seem "logical" (or maybe a better word would be "expected")

So if I can't determine the domain of a curve by going from 0 to length, what is a good way of determining the domain of a curve?  Any suggestions?

You can get the domain by using the Domain component.

The Evaluate Length component can then help you to get the correct subdomain you want to extract

Thanks @Systemiq... I'll give your domain solution and try and see if that's a good workaround.  I see what you are doing in the diagram above and it should work.

My opinion though is that once the seam of a curve is moved and a "new" curve is then produced by the move seam component, the new curve should have its starting point be at "0" of the curve and not at e.g. 2.5*pi.  I would think that:

Curve starting point would always = "0"

Curve ending point would always = end of the curve which would always = max of the domain which would always = total length of curve.

Just my way of thinking :).  Thanks so much for your alternate method; I really appreciate it.

Hi Norm,

probably a bug. I'll dig around in the code to see if I can find the problem after the next version goes out.

--

David Rutten

david@mcneel.com

Tirol, Austria

Thanks David.  I appreciate you looking at this as there does seem to be a bug (either with the component or my brain).  I think the gh file I attached to this thread demonstrates the problem, but if you need anything else from me please let me know.

It turns out this isn't so much a bug as yet another example of why you shouldn't read too much into curve domains.

I don't like changing the way native Rhino SDK algorithms work, but in this case I think it does make sense to retain the original curve domain after seam adjustment. I'll update the component for the next release.

--

David Rutten

david@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service