20 N_(
"Split the quads in nice triangles, slower method")},
25 N_(
"Split the quads on the first and third vertices")},
29 N_(
"Fixed Alternate"),
30 N_(
"Split the quads on the 2nd and 4th vertices")},
34 N_(
"Shortest Diagonal"),
35 N_(
"Split the quads along their shortest diagonal")},
39 N_(
"Longest Diagonal"),
40 N_(
"Split the quads along their longest diagonal")},
41 {0,
nullptr, 0,
nullptr,
nullptr},
49 N_(
"Arrange the new triangles evenly (slow)")},
54 N_(
"Split the polygons with an ear clipping algorithm")},
55 {0,
nullptr, 0,
nullptr,
nullptr},
60 b.use_custom_socket_order();
61 b.allow_any_socket_order();
66 .description(
"Mesh to triangulate");
67 b.add_output<
decl::Geometry>(
"Mesh"_ustr).propagate_all_geometry().align_with_previous();
70 .evaluated_geometry_field()
76 .description(
"Method for splitting the quads into triangles");
81 .description(
"Method for splitting the n-gons into triangles");
106 evaluator.
add(selection_field);
130 params.
set_output(
"Mesh"_ustr, std::move(geometry_set));
139 ntype.
ui_description =
"Convert all faces in a mesh to triangular faces";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_TRIANGULATE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
bool is_default_link_socket
void node_register_type(bNodeType &ntype)
void debug_randomize_edge_order(Mesh *mesh)
std::optional< Mesh * > mesh_triangulate(const Mesh &src_mesh, const IndexMask &selection, TriangulateNGonMode ngon_mode, TriangulateQuadMode quad_mode, const bke::AttributeFilter &attribute_filter)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void debug_randomize_face_order(Mesh *mesh)
static void node_register()
static const EnumPropertyItem rna_node_geometry_triangulate_quad_method_items[]
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static const EnumPropertyItem rna_node_geometry_triangulate_ngon_method_items[]
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)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare