owned this note changed 4 years ago
Published Linked with GitHub

Procedural Curve Editing in 3.0 and Beyond

Adding a procedural curve editing pipeline in 3.0 has been a large focus for the geometry nodes team and community for the past few months. One of the last larger changes for 3.0, supporting the geometry nodes modifier on curve objects, was committed this week. So I thought it would be a good idea to give an update on the project. Where are we, and what does the future hold?

Just like curve objects, geometry nodes support three types of curves:

  • Bezier With control points and handles, editable as separate attributes
  • Poly A simple series of connected points
  • NURBS A more advanced spline type with different controls exposed

The New Nodes

One of the fundamental ideas of the changes is that it should be clearer when data is a curve and when it is a mesh. Currently Blender doesn't distinguish very well between the two, because it implicitly changes a curve into a mesh. But we can take advantage of the flexibility of nodes to make the process much more visible.

Curve to Mesh

This is the counterpart of the existing "Curve Bevel", except that the node can accept multiple input profiles, and automatically marks sharp edges.

Curve Fill

The fill node creates a 2D mesh from curves, filling the inside with faces. It was contributed by Erik Abrahamsson, building on the triangulation library built by Howard Trickey for exact boolean. It's the counterpart to the existing 2D curve fill in 2.93, but it should give better, more predictable results.

Curve Trim

The trim node makes curve splines shorter, with a length or factor input. The node was contributed by Angus Stanton.

Curve to Points

This node generates a point cloud with evenly spaced points on the curve, generating the data needed for instancing like rotation.

Curve Endpoints

Also contributed by Angus Stanton, this node is a simpler counterpart to the "Curve to Points" node that only outputs the start and end of each spline.

Resample Curve

Drawing Clouds

This node outputs a new curve, sampling consistent lengths from the input. This is just like the "Curve to Points" node, except the output is still a curve.

Curve Subdivide

Like the resample curve node, this node makes a higher resolution curve, but it keeps the original spline type, and doesn't change the shape at all for Bezier curves. Each segment can have its own number of cuts.

Mesh to Curve

Blender hasn't had the ability to create a curve from mesh edges procedurally before. Now it does! With a selection input, any of a mesh's edges can be turned into curve splines, and any extra attributes will be automatically transferred.

Handle Type Nodes

This node procedurally change the left or right handle types of Bezier control points.

Set Spline Type

Contributed by developer Johnny Matthews, this node changes each spline's type between the Bezier, poly, and NURBS types mentioned above, just like the edit mode operator.


Suddenly the star primitive gets much more interesting!

Curve Reverse

Also created by Johnny, this is a simple node that switches the direction of a curve, just like in edit mode.

Curve Length

Another simple node to output a curve's total length. Created by Johnny as well, who shared it on his YouTube channel.

Primitives


The defaults for each primitive node

Just like the existing mesh primitive nodes, there are now curve primitive nodes, again by developer Johnny. These provide a surprisingly useful and flexible base for both 2D and 3D contexts. Many of the nodes have options for different input methods, like finding the circle that passes through three points in space.

The Internals

Curve support in geometry nodes has also provided an opportunity to significantly improve the internals of the curve code. A large portion of the existing curve code in Blender dated back to the Blender's initial open source commit, 19 years ago! While that's not a problem in itself, standard good practices of software development have changed a lot in that time. Existing curve data in Blender also did not support storing generic attributes, which is essential for geometry nodes.

With the aim of replacing most of the existing code, we created a new implementation of the basics of curves, designed to be more efficient, much easier work with, and properly documented. Already this has been worth it. With an improved foundation we could make progress much more quickly than I expected!

The Future

Personally I've been interested in curves since I started working on Blender two years ago, so I've been happy to take on such a specific area and push it forward for a while. Five months actually I've been very invested in the project, so time has really flown by!

What we have now should already be a solid base of features for 3.0, but more is planned for the near future:

  • Curve Fillet Bevel-like behavior in a node from Dilith Jayakody's 2021 GSoC project.
  • Connect Splines A node to join multiple sections of a curve into one.
  • Curve Parameter A field input node, to output how far along the curve each point is.
  • More complete attribute support: Transfer attributes in the "Curve to Mesh" node, expose the handle position attributes.
  • Curve sampling with any arbitrary factor.
  • And much more! Now that the project is mostly wrapping up, the developer community will be essential in adding new features.

Further in the future, these changes can be applied to curve edit mode as well. Editing and painting custom attributes will be particularly important.

Select a repo