Oops...

This website is made for modern browsers. You are seeing this, because your browser is missing a feature or two. Please install the latest update or switch to a modern browser. See you soon.

Divide curves

#curves #divide #lines #split

This how-to guide will focus on how to divide a curve with pattern-based rules. These rules are given by the designer within the algorithm and do not necessarily rely on any event. To see how curves can be split at intersection events, see Split curves.

The components that are introduced below output the coordinates for the division points and the curve parameters t, which can be used with Shatterto actually split the curve into smaller segments.

Divide a curve in n segments (Divide Curve)

The component Divide Curvewill divide a curve into a number N of equal length segments. If input K is set to True, the output will also include the parameters at the kinks. To get the parameters at the kinks only, use the component Discontinuity. After obtaining the curve parameters, we can use Shatterto split the curve into several segments.

Divide a curve by distance (Divide Distance)

The component Divide Distancewill divide a curve by the distance from one division point to the next. The distance is calculated by drawing a radius around one point and setting the next point where the curve meets this radius.

Divide a curve by length (Divide Length)

The component Divide Lengthis similar to the previous one, but it uses the actual length of the curve’s segments to set the division points.

Every segment will be 2 units long.

Divide Length divides the curve into n segments with the same length (except for the last one). To divide a curve into segments with varying length, we can use Evaluate Length: We set input N to False to prevent normalization and provide a list of lengths at input L. Note that the lengths that we provide to not relate to the step size (length of the segments) but to the length parameter from the start of the curve.

Segments will be 2, 1, 2, and 1 unit long.

Divide curve into a dash patter (Dash Pattern)

The component Dash Patternwill divide and shatter a curve into segments given by the pattern at Pt. Output D emits the dash curves and output G the gap curves. Another way to get the dash curves would be to use Divide Length, Shatterand a Cull Pattern.

The dash pattern does not have to be a single number, but can also be a list of numbers. The pattern expresses the step size and is repeated until the curve is consumed (the pattern shown below does the same splitting as the pattern inputted to Evaluate Length in the second last figure).

Divide a curve with contour lines (Contour)

The component Contouris similar to Divide Distance; instead of using the distance from one point to another, the distance D (step size) is set on a guidance vector N, which starts at point P. At each step, a plane normal to the vector is generated and the division points are created where the curve meet the plane.

The component Contour (ex)also divides a curve by contour lines, but uses a pattern instead of a fixed distance. Input P takes the base plane and then either O or D have to be provided. O defines the offsets from the base plane (so every value relates to the origin of the plane). Alternatively, we can set the Distances D between two planes, which can be a list with varying numbers. The division points are created where the curve meets the planes.

This page is open source. Edit it on GitHub or see how you can contribute.

Up next