Baltor Get started

Gallery / Mesh algorithms

Chaikin corner cutting

In your harnessMesh algorithmMIT

Round polygons and polylines by repeated corner cutting at the quarter points, converging to the quadratic B-spline. Use it for smooth outlines, organic 2D shapes and softening hand-drawn strokes.

Render of Chaikin corner cutting
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Entry points
chaikin, build, main
Parameters
iterations, ratio
Complexity
O(n * 2^iterations)
Axes
+Y up, metres; 2D (x, y) maps to (x, 0, -y)

Limits. The curve shrinks inside the control polygon (it approximates, it does not interpolate). Point counts double every round. Ratios other than 1/4 converge to curves that are not the quadratic B-spline.

Details

Kind
Mesh algorithm
Engine
Python 3.10 or later
Files
10 files, 176.4 KB
Licence
MIT
Declared effects
reads files, runs commands, writes files
Checked with
Godot 4.7.2, gl_compatibility, OpenGL 3 driver, Mesa llvmpipe under Xvfb
Checks
generator runs system python, generator runs verifier python, gltf strict structure, interpreters agree, example matches generator, godot headless gltf load, godot compatibility render
Techniques
Chaikin corner cutting (1974), Uniform quadratic B-spline as the limit curve
Tags
chaikin, corner cutting, subdivision, curve smoothing, 2d, b-spline
Identity
library.supply.creative_originals.deeaa8ed1788e23b2003c856.6b02cf43e3bc1d34
Version
6b02cf43e3bc1d345637f08baf5bfdf1ad2a9ddfa5a0d1a4a5e9edfa1cfda10e

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.