Friday, July 3, 2015

Exaggerated Ribs

CurvatureGraph provides a nice analytical tool to review curves for kinks. It is also a pretty way to "grow" the curve. I wanted to build off of Jittery Lines with a script that thickens polylines relative to its control points, as CurvatureGraph works for a Curve. It's a common effect (that I'm almost certain there's an existing script for) that I want to explore and build on top of.

To go about this, I've broken the script down into 5 parts:

1. Explode polyline to get line segment vectors
2. Calculate bisecting vectors*
3. Calculate angle and direction of "turn" from original vectors
4. Create offset vectors at the kink points
4a. Create Weighted Offsets based on adjacent vector angles
5. Join these points into new polylines

*Just using bisectors for the offsets will result in "twisted" ribbons. That is why I untwist this by "flipping" the bisector when the line segment goes from clockwise to counterclockwise.

Here's a 2D example running on multiple curves:

I've resolved part 4a by creating three options for weighting how I offset the polylines: by a shift slider (shift about center), an equal slider (grows equally), and by duo sliders.

More forms:

No comments:

Post a Comment