Page MenuHome

Geometry Nodes: Curve Sample Node
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 20 2021, 2:17 AM.

Details

Summary

This node allows sampling positions, tangents, and normals at any
arbitrary point along a curve. The curve can include multiple splines,
and all are taken into account. The node does not yet support transferring
generic attributes like radius, because some more general tooling will
make that much more feasible and useful in different scenarios.

This is a field node, so it is evaluated in the context of a data-flow
node like "Set Position". One nice thing about that is it can easily
be used to move an entire geometry like the follow path constraint.

The point along the curve is chosen either with a factor of the total
length of the curve, or a length into the curve, the same choice used in
the curve trim node.

This isn't a new idea, and this node has appeared in various forms in
the last few months. In other words, the design has proven useful byt this
point, and the idea has been tested.

Currently I'm facing a bug with field evaluation when using the position
input node with this node. I'm not sure why yet.

Diff Detail

Repository
rB Blender
Branch
geometry-nodes-curve-sample-node (branched from master)
Build Status
Buildable 17132
Build 17132: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Sep 20 2021, 2:17 AM
Hans Goudey (HooglyBoogly) created this revision.

I got a crash when the curve only contains one point.


Besides the mentioned issues, this looks fine. Don't need to review it again.

source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
141

Put this loop into a #ifdef DEBUG block. length is unused in release builds.

142

How can you be sure that no length outside of this interval is passed in? Might need a comment.

This revision is now accepted and ready to land.Sep 20 2021, 7:26 PM
Hans Goudey (HooglyBoogly) marked 2 inline comments as done.Sep 21 2021, 2:10 AM
This revision was automatically updated to reflect the committed changes.