Hi all, architecture student and new Grasshopper user here. I’m trying to offset some curves I’ve taken into Rhino and created surfaces from. For about half of the brepped surfaces, this works as intended, but for the other half the offset goes inwards rather than outwards.
Anyone got any idea how I can fix this? Ultimatley I’m just looking to get a curve or surface that shows the ‘free’ areas between the buildings on the plan, which I may then do additional processing on like smoothing edges further, etc.
Attached a screenshot and my rhino & grasshopper files. Thanks!
Urban Proposal v6a.3dm
(4.4 MB) Urban proposal v6a.gh
With regard the Plane.WorldXY if a Polyline is clockwise then the offset with a pos value yields an outwards result (a neg value yields an inwards one). The inverse happens with an counter-clockwise orientation.
So for each Polyline you should check the orientation and flip accordingly.
Thanks, didn’t know that! Some of the curves still behaved oddly after reversing their direction, but slicing them into simpler shapes did the trick on the stubborn ones.
If your Polylines are OK (valid, flat, no back-forward loops and the likes) the orientation rule is rather robust. This means that the DotProduct of Z+ VS the CrossProduct (vL-v0, v1-v0) is > 0: case counter-clockwise. (v0: the first vertex, v1 the next, vL the last that is not v0). Given the opportunity do some Google search for these Vector products.
Anyway better safe than sorry: mastermind some proper check(s) for your polys. In an ideal world you should remove the colinear nodes (vertices) - if any.
Or … welll … I could provide a black box (C#) that does all that freaky (and maybe ominous) stuff for you.