diff options
author | Angus Stanton <abstanton> | 2021-07-07 06:24:04 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-07 06:24:04 +0300 |
commit | 63a8b3b9720cf2660cb7a6cd431fdd3014534c4a (patch) | |
tree | ba168fa4c02b3d0af038316cc80a1aa72bee449b /source/blender/nodes/geometry/node_geometry_util.hh | |
parent | 31e6f0dc7af6ff1be19da93021b7095fe68da833 (diff) |
Geometry Nodes: Curve Endpoints Node
This node is quite similar to the curve to points node, but creates
points for only the start and end of each spline. This is a separate
node because the sampling from the curve to points node don't apply,
and just for ease of use.
All attributes from the curves are copied, including the data for
instancing: tangents, normals, and the derived rotations. One simple
use case is to make round caps on curves by instancinghalves of a
sphere on each end of the splines.
Differential Revision: https://developer.blender.org/D11719
Diffstat (limited to 'source/blender/nodes/geometry/node_geometry_util.hh')
-rw-r--r-- | source/blender/nodes/geometry/node_geometry_util.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh index 79a98c5ebf0..956b7b8a005 100644 --- a/source/blender/nodes/geometry/node_geometry_util.hh +++ b/source/blender/nodes/geometry/node_geometry_util.hh @@ -70,4 +70,26 @@ void copy_point_attributes_based_on_mask(const GeometryComponent &in_component, Span<bool> masks, const bool invert); +struct CurveToPointsResults { + int result_size; + MutableSpan<float3> positions; + MutableSpan<float> radii; + MutableSpan<float> tilts; + + Map<std::string, GMutableSpan> point_attributes; + + MutableSpan<float3> tangents; + MutableSpan<float3> normals; + MutableSpan<float3> rotations; +}; +/** + * Create references for all result point cloud attributes to simplify accessing them later on. + */ +CurveToPointsResults curve_to_points_create_result_attributes(PointCloudComponent &points, + const CurveEval &curve); + +void curve_create_default_rotation_attribute(Span<float3> tangents, + Span<float3> normals, + MutableSpan<float3> rotations); + } // namespace blender::nodes |