23 N_(
"Align Bézier handles to create circular arcs at each control point")},
28 N_(
"Add control points along a circular arc (handle type is vector if Bézier Spline)")},
29 {0,
nullptr, 0,
nullptr,
nullptr},
34 b.use_custom_socket_order();
35 b.allow_any_socket_order();
37 .supported_type({GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil})
38 .description(
"Curves to generate rounded corners on");
39 b.add_output<
decl::Geometry>(
"Curve").propagate_all().align_with_previous();
47 .description(
"Limit the maximum value of the radius in order to avoid overlapping fillets");
51 .description(
"How to choose number of vertices on fillet");
71 const bool limit_radius,
75 evaluator.
add(radius_field);
87 evaluator.
add(*count_field);
104 const bool limit_radius,
108 for (
const int layer_index : grease_pencil.layers().index_range()) {
109 Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
110 if (drawing ==
nullptr) {
138 const bool limit_radius =
params.extract_input<
bool>(
"Limit Radius");
140 std::optional<Field<int>> count_field;
166 grease_pencil, mode, count_field, radius_field, limit_radius, attribute_filter);
170 params.set_output(
"Curve", std::move(geometry_set));
178 ntype.
ui_name =
"Fillet Curve";
179 ntype.
ui_description =
"Round corners by generating circular arcs on each control point";
Low-level operations for grease pencil.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_FILLET_CURVE
GeometryNodeCurveFilletMode
@ GEO_NODE_CURVE_FILLET_BEZIER
@ GEO_NODE_CURVE_FILLET_POLY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
IndexRange curves_range() const
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void tag_topology_changed()
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
void * MEM_callocN(size_t len, const char *str)
void curves_copy_parameters(const Curves &src, Curves &dst)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
Curves * curves_new_nomain(int points_num, int curves_num)
bke::CurvesGeometry fillet_curves_bezier(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, bool limit_radius, const bke::AttributeFilter &attribute_filter)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
bke::CurvesGeometry fillet_curves_poly(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, const VArray< int > &counts, bool limit_radius, const bke::AttributeFilter &attribute_filter)
static void node_init(bNodeTree *, bNode *node)
static bke::CurvesGeometry fillet_curve(const bke::CurvesGeometry &src_curves, const GeometryNodeCurveFilletMode mode, const fn::FieldContext &field_context, const std::optional< Field< int > > &count_field, const Field< float > &radius_field, const bool limit_radius, const AttributeFilter &attribute_filter)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void fillet_grease_pencil(GreasePencil &grease_pencil, const GeometryNodeCurveFilletMode mode, const std::optional< Field< int > > &count_field, const Field< float > &radius_field, const bool limit_radius, const AttributeFilter &attribute_filter)
static EnumPropertyItem mode_items[]
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
const Curves * get_curves() const
bool has_grease_pencil() const
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GreasePencil * get_grease_pencil_for_write()
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare