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();
64 .supported_type(GeometryComponent::Type::Mesh)
66 .description(
"Mesh to triangulate");
67 b.add_output<
decl::Geometry>(
"Mesh").propagate_all().align_with_previous();
73 .description(
"Method for splitting the quads into triangles");
78 .description(
"Method for splitting the n-gons into triangles");
102 evaluator.
add(selection_field);
126 params.set_output(
"Mesh", std::move(geometry_set));
135 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)
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(blender::bke::bNodeType *ntype, std::string 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