17 "Geometry to compute the bounding box of. Instances have to be realized before the full "
18 "bounding box can be computed");
22 "For curves, point clouds, and Grease Pencil, take the radius attribute into account "
23 "when computing the bounds.");
25 .propagate_all_instance_attributes()
26 .
description(
"A cube mesh enclosing the input geometry");
34 const bool use_radius =
params.extract_input<
bool>(
"Use Radius");
52 if (
params.output_is_required(
"Bounding Box")) {
54 std::optional<Bounds<float3>> sub_bounds;
57 if (&sub_geometry == &geometry_set) {
68 const float3 scale = sub_bounds->max - sub_bounds->min;
69 const float3 center = sub_bounds->min + scale / 2.0f;
73 sub_geometry.
keep_only({GeometryComponent::Type::Mesh, GeometryComponent::Type::Edit});
77 params.set_output(
"Bounding Box", std::move(geometry_set));
87 "Calculate the limits of a geometry's positions and generate a box mesh with those "
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_BOUNDING_BOX
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void node_register_type(bNodeType &ntype)
Mesh * create_cuboid_mesh(const float3 &size, int verts_x, int verts_y, int verts_z, std::optional< StringRef > uv_id)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void transform_mesh(Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void keep_only(Span< GeometryComponent::Type > component_types)
std::optional< Bounds< float3 > > compute_boundbox_without_instances(bool use_radius=true, bool use_subdiv=false) 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
static QuaternionBase identity()