17 b.add_input<
decl::Bool>(
N_(
"Start Vertices")).default_value(
true).hide_value().supports_field();
18 b.add_input<
decl::Int>(
N_(
"Next Vertex Index")).default_value(-1).hide_value().supports_field();
30 for (
const int first_vert : start_verts_mask) {
31 const int second_vert = next_indices[first_vert];
32 if (first_vert == second_vert) {
35 if (second_vert < 0 || second_vert >=
mesh.
totvert) {
42 int current_vert = first_vert;
43 while (!
visited[current_vert]) {
45 vert_indices.
append(current_vert);
46 const int next_vert = next_indices[current_vert];
50 current_vert = next_vert;
54 const int points_in_curve_num = vert_indices.
size() - curve_offsets.
last();
55 for (
const int vert_in_curve : vert_indices.
as_span().
take_back(points_in_curve_num)) {
85 IndexMask start_verts = evaluator.get_evaluated_as_mask(1);
87 if (start_verts.is_empty()) {
97 params.set_output(
"Curves", std::move(geometry_set));
Low-level operations for curves.
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_CURVE
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_EDGE_PATHS_TO_CURVES
void nodeRegisterType(struct bNodeType *ntype)
static uint8 component(Color32 c, uint i)
constexpr Span take_back(int64_t n) const
void append(const T &value)
const T & last(const int64_t n=0) const
Span< T > as_span() const
Set< ComponentNode * > visited
Curves * curves_new_nomain(int points_num, int curves_num)
bke::CurvesGeometry create_curve_from_vert_indices(const Mesh &mesh, Span< int > vert_indices, Span< int > curve_offsets, IndexRange cyclic_curves)
static Curves * edge_paths_to_curves_convert(const Mesh &mesh, const IndexMask start_verts_mask, const Span< int > next_indices)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_edge_paths_to_curves()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
void keep_only(const blender::Span< GeometryComponentType > component_types)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare