32 const int second_vert = next_indices[first_vert];
33 if (first_vert == second_vert) {
36 if (second_vert < 0 || second_vert >= mesh.verts_num) {
43 int current_vert = first_vert;
44 while (!
visited[current_vert]) {
46 vert_indices.
append(current_vert);
47 const int next_vert = next_indices[current_vert];
48 if (next_vert < 0 || next_vert >= mesh.verts_num) {
51 current_vert = next_vert;
55 const int points_in_curve_num = vert_indices.
size() - curve_offsets.
last();
56 for (
const int vert_in_curve : vert_indices.
as_span().take_back(points_in_curve_num)) {
65 mesh.attributes(), vert_indices, curve_offsets,
IndexRange(0), attribute_filter));
75 if (mesh ==
nullptr) {
86 IndexMask start_verts = evaluator.get_evaluated_as_mask(1);
88 if (start_verts.is_empty()) {
94 *mesh, start_verts, next_vert,
params.get_attribute_filter(
"Curves")));
98 params.set_output(
"Curves", std::move(geometry_set));
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void append(const T &value)
const T & last(const int64_t n=0) const
Span< T > as_span() const
int add(GField field, GVArray *varray_ptr)
void foreach_index(Fn &&fn) const
local_group_size(16, 16) .push_constant(Type b
Set< ComponentNode * > visited
void node_register_type(bNodeType *ntype)
Curves * curves_new_nomain(int points_num, int curves_num)
bke::CurvesGeometry create_curve_from_vert_indices(const bke::AttributeAccessor &mesh_attributes, Span< int > vert_indices, Span< int > curve_offsets, IndexRange cyclic_curves, const bke::AttributeFilter &attribute_filter)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static Curves * edge_paths_to_curves_convert(const Mesh &mesh, const IndexMask &start_verts_mask, const Span< int > next_indices, const AttributeFilter &attribute_filter)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void keep_only(Span< GeometryComponent::Type > component_types)
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Mesh * get_mesh() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare