Grasshopper

algorithmic modeling for Rhino

I could use some help figuring out a loose offset function where the continuity and control point structure is the first order of importance.  The tolerance is secondary and not absolute, i.e. the ideal offset should be within one percent.  I am hoping someone can point me to an example of a discrete function in c#.  

For example, an input is a single span degree 5 curve.  The control points before the end points share the same YZ, so that continuity exist when mirrored along the Y:

Rhino's offset command creates 4 single span deg 3 curves in order to maintain tolerance and continuity:

This is my desired result.  A single span deg 5 curve with continuity.  The tolerance is much less important.  It just has to pass the judgement of the eye.

Pascal has an OffsetLoose script offsets the input curve (target curve), copies the input curve (result curve), evaluates the distance between the target and result curves and then moves the control point by that distance.  This maintains the degree, weakly asses tolerance and discards continuity.

Views: 2198

Replies to This Discussion

Hi Eric, would simply using Offset followed by RebuildCurve suffice for your goal? (Depicted example exceeeds your tolerance however)

No, because the rebuild destroys the continuity at the ends.  The direction of the vector for control points 1,2 and n-1,n must not change.  Simply offsetting, rebuilding, and rotating points 2 and n-1 to the correct direction would further impact the tolerance.

Plus, seeing the logic of finding the optimal location for the points with these restrictions would really enlighten me and open up other possibilities in the future.  A code example for manually rebuilding or approximating a curve might be enough that I could figure the rest out on my own.

GH has an Offset Loose component. This is not working for you?

Thanks David.  I didn't know it existed.  It's close.  The degree and continuity requirements are met.  

The problem is the tolerance is a bit weaker than I need.  I'm starting to assume that my request is a lot more difficult than I thought.  

So basically what you're after is an offset loose which inserts control-points whenever the result falls outside of some predefined tolerance?

This is basically how the regular Offset works, though the logic which inserts control-points is black boxed and probably hard to control.

Not insert, but use the existing degree/control points to solve for the best tolerance.  If you look at the third image I posted, I solved that by hand.  

You can't tell from the picture, but underneath the outer curve is a locked Rhino offset curve I used for reference. I know it's possible to get a better tolerance, I was just hoping there was a function to do it.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service