Grasshopper

algorithmic modeling for Rhino

Hello,

I am having an issue when using the curve offset to offset a PolyLine curve. If the offset distance is increased more than the length of the shortest segment of the polyline the offset curve function fails and does not generate a closed polyline.

Is there any way around this issue or should I try and figure out how to script a component to behave life the Offset command in Rhino.

Thanks,
Matt

Views: 3370

Attachments:

Replies to This Discussion

This is a known bug, and its the offset algorithm within the Rhino SDK that is failing, not Grasshopper.

I often end up writing my own offset routines for situations like these.. If you have a convex polyline, then you can:

- find its centroid
- connect all cvs of the polyline to this centroid with lines
- measure the length (L) of each line, and based on the offset distance (D) required, get the parametre of the required point on the line (D/L).
- once you get these points, connect them with a new polyline in the same order.

This method is not the most accurate, as the offset distance is evaluated in a diagonal manner instead of being straight on perpendicular to the segment.

If your polyline is not convex, then you could make an interpCrv through its CVs, and move points along the 'curve normals' (curve tangents rotated by 90 degrees) at the cv points, but this is a lot trickier considering that the other end of the line is not known here.. hmm.. now I am thinking how to solve that one.. to be continued.

Hi Matthew/Suryanch,

I faced this issue, however I found a trick that worked with me fine..

my target was to offset the curve and close the ends on the two curves for fabrication.

After I offset the curves, I add all flattened curves to BoundarySurface component, then I extract BrepWireframe, which actually got me what I want exactly.

sample script attached.

Hope you found that useful.

B.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service