28 N_(
"Bevel affects vertices")},
30 {0,
nullptr, 0,
nullptr,
nullptr}};
34 b.use_custom_socket_order();
35 b.allow_any_socket_order();
38 b.add_output<
decl::Geometry>(
"Mesh"_ustr).propagate_all_geometry().align_with_previous();
42 .evaluated_geometry_field()
43 .description(
"Selects elements of 'Affect Kind' for beveling");
52 .evaluated_geometry_field()
54 .description(
"Offset for left side of source of edge, viewed from source");
59 .evaluated_geometry_field()
61 .description(
"Offset for right side of source of edge, viewed from source");
66 .evaluated_geometry_field()
68 .description(
"Offset for left side of destination of edge, viewed from source");
73 .evaluated_geometry_field()
75 .description(
"Offset for right side of destination of edge, viewed from source");
80 .evaluated_geometry_field()
82 .description(
"Offset per vertex for vertex bevel (all edges)");
85 .evaluated_geometry_field()
91 .evaluated_geometry_field()
92 .description(
"Per corner specification of 'spread' for arc miters")
93 .usage_by_bool(
"Miter"_ustr,
true);
98 "How many pieces is an edge beveled into, "
99 "or, for vertex bevels, how many segments on the arcs between the edges.");
106 "Superellipse shape parameter, used when there is no Profile, "
107 "and also used for Arc and Patch miters");
111 "If present, the first curve will be sampled to give a custom profile on edges. "
112 "The curve should be in the XY plane, going from (0,1,0) to (1,0,0)");
117 .anonymous_attribute_output()
119 .
description(
"Identifies output faces that are in the new mesh parts for vertices");
121 .anonymous_attribute_output()
123 .
description(
"Identifies output faces that are in the new mesh parts for edges");
125 .anonymous_attribute_output()
127 .
description(
"Identifies output edges that are on the outsides of new mesh parts for edges");
129 .anonymous_attribute_output()
132 "Identifies output edges that are in the middle of new mesh parts of edges "
133 "and continued through vertices (round down if odd number of segments)");
153 if (
curves.curves_num() == 0) {
163 if (eval_pts.
size() < 2) {
169 const float3 &p = eval_positions[eval_pts[i]];
170 samples[i] =
float2(p.x, p.y);
182 const int segments = params.
extract_input<
int>(
"Segments"_ustr);
185 params.
set_output(
"Mesh"_ustr, std::move(geometry_set));
193 "Start Left Offset"_ustr) :
201 const float shape = params.
extract_input<
float>(
"Shape"_ustr);
208 if (
const Curves *profile_curves_id = profile_geometry.get_curves()) {
221 bevel_params.
shape = shape;
229 auto run_bevel = [&](
const IndexMask &selection) {
230 if (selection.is_empty()) {
253 *src_mesh, selection, bevel_params, attribute_filter);
268 vert_evaluator.
add(selection_field);
270 bevel_params.
offsets[0].as_mutable_span());
283 edge_evaluator.
add(selection_field);
285 bevel_params.
offsets[0].as_mutable_span());
287 bevel_params.
offsets[1].as_mutable_span());
289 bevel_params.
offsets[2].as_mutable_span());
291 bevel_params.
offsets[3].as_mutable_span());
299 params.
set_output(
"Mesh"_ustr, std::move(geometry_set));
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
MutableSpan< T > as_mutable_span()
constexpr int64_t size() const
constexpr IndexRange index_range() const
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
int add_with_destination(GField field, GVMutableArray dst)
DeclType::Builder & add_output(UString name, UString identifier=""_ustr)
void error_message_add(const NodeWarningType type, StringRef message) const
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
std::optional< std::string > get_output_anonymous_attribute_id_if_needed(const UString output_identifier, const bool force_create=false)
T extract_input(const UString identifier)
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
Self & default_closed(bool closed)
void node_register_type(bNodeType &ntype)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
std::optional< Mesh * > mesh_bevel(const Mesh &src_mesh, const IndexMask &selection, const BevelParameters ¶ms, const bke::AttributeFilter &attribute_filter)
static void node_register()
static Array< float2 > sample_profile_curve(const bke::CurvesGeometry &curves)
static void node_declare(NodeDeclarationBuilder &b)
static const EnumPropertyItem affect_items[]
static void node_geo_exec(GeoNodeExecParams params)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
const Mesh * get_mesh() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static constexpr int _180
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare
std::optional< std::string > edge_face_id
std::optional< std::string > vertex_face_id
std::optional< std::string > mid_edge_id
std::optional< std::string > outer_edge_id
Array< float2 > custom_profile_samples
std::array< Array< float >, 4 > offsets
geometry::BevelAttributeOutputs attribute_outputs