Grasshopper

algorithmic modeling for Rhino

Hey!

I'm currently working on my master thesis (generating  neighborhood units near Krakow) and I use Offset component a lot... but it goes crazy with inward direction of offset (both using flip_curve and negative distance) - look at the definition attached. 

I've tried all kinds of solutions - simplifying curves, reducing vertices.... but even with very uniform curves Offset spites out errors.

Anyone know a solid way to offset inward? I'm beginner level python user, so if some script would work I probably could understand it.

Please guys - my deadline is starting to get really close and this offset bugs are costing my to much time... 

Views: 834

Attachments:

Replies to This Discussion

Is it always polyline curves? And are they always convex?

--

David Rutten

david@mcneel.com

I used the Voronoi slicing algorithm to compute offsets using C#.

It only works if the polylines are on the WorldXY plane and if they are convex.

It also behaves a bit weird if the offset goes beyond the center point, you sort of get a negative offset shape.

--

David Rutten

david@mcneel.com

Attachments:

Thank you David! 

I'm only using offset values that are smaller than the smallest distance from center of curve to the outline so it shouldn't be a problem, although it looks interesting when you go through the center point :)

Thanks again!

The errors occur only with polylines (I will be using rounded or nurb curves later on also, but they seem to work ok). 

They are pretty much all convex.

Of course, use David solution (after combining the two vector variables into one :P). But this also seems to work, using only standard component.

It uses the offset loose component to create an offset, deletes the segments that flip, intersects the remaining segments, orders the intersection points using the offset loose curve and constructs a polyline with them.

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service