23 b.use_custom_socket_order();
24 b.allow_any_socket_order();
28 .description(
"Curve to convert to a mesh using the given profile");
32 .
description(
"Curves that are swept along the main curve");
36 .evaluated_geometry_field({0})
37 .description(
"Scale of the profile at each point");
40 "If the profile spline is cyclic, fill the ends of the generated mesh with N-gons");
42 auto &p =
b.add_panel(
"Miter Scale"_ustr).default_closed(
true);
46 "Scale the profile along the axis of the corner's turn to maintain a constant visual "
53 .description(
"Angle at which the miter scale stops increasing");
62 const std::optional<float> miter_limit_angle,
70 evaluator.
add(scale_field);
75 profile_curves->geometry.wrap(),
92 const std::optional<float> miter_limit_angle,
100 for (
const int layer_index :
grease_pencil.layers().index_range()) {
102 if (drawing ==
nullptr) {
109 curves, profile_set, context, scale_field, fill_caps, miter_limit_angle, attribute_filter);
116 auto instances = std::make_unique<bke::Instances>(mesh_by_layer.
size());
136 instances->attributes_for_write());
151 const bool fill_caps = params.
extract_input<
bool>(
"Fill Caps"_ustr);
152 const bool use_miter_limit_angle = params.
extract_input<
bool>(
"Miter Scale"_ustr);
153 const std::optional<float> miter_limit_angle = use_miter_limit_angle ?
154 std::make_optional<float>(
156 "Miter Scale Limit"_ustr))) :
174 if (
mesh !=
nullptr) {
182 geometry_set, profile_set, scale_field, fill_caps, miter_limit_angle, attribute_filter);
189 params.
set_output(
"Mesh"_ustr, std::move(curve_set));
197 ntype.
ui_name =
"Curve to Mesh";
199 "Convert curves into a mesh, optionally with a custom profile shape defined by curves";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_TO_MESH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
IndexRange index_range() const
constexpr void fill(const T &value) const
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
void replace(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const bke::CurvesGeometry & strokes() const
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
Mesh * curve_to_mesh_sweep(const CurvesGeometry &main, const CurvesGeometry &profile, const VArray< float > &scales, bool fill_caps, std::optional< float > miter_limit_angle, const bke::AttributeFilter &attribute_filter={})
void node_register_type(bNodeType &ntype)
void copy_attributes(const AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, MutableAttributeAccessor dst_attributes)
Mesh * curve_to_wire_mesh(const CurvesGeometry &curve, const bke::AttributeFilter &attribute_filter={})
bke::GeometrySet join_geometries(Span< bke::GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< bke::GeometryComponent::Type > > &component_types_to_join=std::nullopt, bool allow_merging_instance_references=true)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void debug_randomize_mesh_order(Mesh *mesh)
static void node_declare(NodeDeclarationBuilder &b)
static void grease_pencil_to_mesh(GeometrySet &geometry_set, const GeometrySet &profile_set, const Field< float > &scale_field, const bool fill_caps, const std::optional< float > miter_limit_angle, const AttributeFilter &attribute_filter)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static Mesh * curve_to_mesh(const bke::CurvesGeometry &curves, const GeometrySet &profile_set, const fn::FieldContext &context, const Field< float > &scale_field, const bool fill_caps, const std::optional< float > miter_limit_angle, const AttributeFilter &attribute_filter)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
static MatBase identity()
void keep_only(Span< GeometryComponent::Type > component_types)
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
const GreasePencil * get_grease_pencil() const
const Curves * get_curves() const
bool has_grease_pencil() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
static AngleRadianBase from_degree(const float °rees)
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet from_instances(std::unique_ptr< Instances > instances)