Grasshopper

algorithmic modeling for Rhino

Hi all,

Here's a concept for offsetting 3d polylines and curves:
- Retrieve control points of a curve
- For every point P take its neighbours L & R
- Define vectors LP & RP, add them and unitize the output
- Multiply the resulting "vertex vector" by an offset factor taking into account the angle between LP and RP
- Translate the base control points using "vertex vectors"
- Recreate the curve using the new points

For a 2d input curve this should produce the same result as with a standard offset (by sides) procedure.

Here's what you get when you offset a 3d polyline:

3d Curve (multiple offset):

See attached definitions for details (ghx version 0.7.0048)


There're are probably other methods to do a offset of a spatial curve (example link).

You could also translate curve points in the curvature vector direction.

Anybody find this useful? Maybe this could work as a standalone component?


Waiting to hear your thoughts on the subject.


JJ

Views: 2280

Attachments:

Replies to This Discussion

DEAR Mr Jacek Jaskólski,
I like to get information about our offset.I like to now if with your offset can do offset one or more curves at the same time and if the offset can do with diferentes distances.
Sure, see attached definition. For now it works only for closed curves.
You can input as many curves as you want and specify a different offset value for each of them.
Attachments:
Fantastic result. This should be a regular GH component. thank you for sharing.

Stan

David,

Any plans to add this component in GH?

Thanks!

Any Ideas how this definition may be used for a single polyline?  I suppose I need to somehow be able to declare the vector direction of each point.  Right now each control point points in a different direction

A quick look suggests to me that the original definition is relying on the curves being closed in order to utilize adjacent points to achieve an average vector.  With an open polyline such as you have, there are different questions to be answered, and most likely you'll have to develop a new definition.  Are you trying to have it offset in a particular general direction (like in this image, to either the left or the right) or are you trying to allow for a vector average at each kink (which seems to be happening in your attached image, where each kink flies off in opposite directions depending on the kink being concave or convex relative to each other)?

I did a quick (and very very ugly) fix to the original def. that probably should allow you to do what you want.

It takes into account the directionality of the angle between each two segments (utilizing the cross product between the vectors to find it - more info here) and given that info reverses the node average vector or not.

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service