Grasshopper

algorithmic modeling for Rhino

Hello,

I am struggling trying to offset a set of curves inwards. When I set the distance every of them perfom randomly and I do not know how can I control them..

Any clue?

Views: 1820

Reply to This

Replies to This Discussion

Hi.

Looks like your curves are not consistent in directions. Try "Clipper" plug-in.

The "Polyline offset" component from clipper plug-in allows you to select the polyline as the inner offset result("H" output)measuring the length of shorter one by offsetting a polyline on both sides regardless of direction.

Indeed.

BTW: the classic way to check orientations is to test the DotProduct between the Z derived from a polyline Plane and some suitable "standard" vector (it could be the Z of the first plane in the polyline List, for instance). If is negative you reverse the polyline. There's another Method in RhinoCommon as well for that but requires code (and planar curves).

How it looks in code? :) For checking directionality of polyline winding?

I'll post some C# example soon.

BTW: Given the opportunity I have no idea what Clipper does ... but does that? (yellow is GH/Rhino offset, the other is the correct thing (+ same "orientations"))

this is way more complicated than it needs to be in GH. Just take all your closed curves and flip them with a circle (that only has to be roughly parallel to your curves) as the guide curve. Voila, all your curves are now winding consistently (and will therefore offset consistently)

Most of the time I do that, but as Rhino Offset is bad I tend to use clipper.

I just do the 2 offset positive negative and measure the length of the curve and I take the min length. 

Quite efficient and easy to do the double-offset with selection of shorter curve...

Thank you!!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service