24 .evaluated_geometry_field();
25 b.add_input<
decl::Int>(
"Next Vertex Index"_ustr)
28 .evaluated_geometry_field();
41 const int second_vert = next_indices[first_vert];
42 if (first_vert == second_vert) {
45 if (second_vert < 0 || second_vert >=
mesh.verts_num) {
52 int current_vert = first_vert;
53 while (!visited[current_vert]) {
54 visited[current_vert] =
true;
55 vert_indices.
append(current_vert);
56 const int next_vert = next_indices[current_vert];
57 if (next_vert < 0 || next_vert >=
mesh.verts_num) {
60 current_vert = next_vert;
64 const int points_in_curve_num = vert_indices.
size() - curve_offsets.
last();
65 for (
const int vert_in_curve : vert_indices.
as_span().take_back(points_in_curve_num)) {
66 visited[vert_in_curve] =
false;
74 mesh.attributes(), vert_indices, curve_offsets,
IndexRange(0), attribute_filter));
84 if (
mesh ==
nullptr) {
97 if (start_verts.is_empty()) {
107 params.
set_output(
"Curves"_ustr, std::move(geometry_set));
115 ntype.
ui_name =
"Edge Paths to Curves";
116 ntype.
ui_description =
"Output curves following paths across mesh edges";
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_EDGE_PATHS_TO_CURVES
#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)
IndexMask get_evaluated_as_mask(int field_index)
const GVArray & get_evaluated(const int field_index) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
T extract_input(const UString identifier)
T get_input(const UString identifier) const
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
Curves * curves_new_nomain(int points_num, int curves_num)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
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(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void keep_only(Span< GeometryComponent::Type > component_types)
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Mesh * get_mesh() const
static constexpr int _160
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare