OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::SolidBody Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/ConnectedBodies.hpp>

Inheritance diagram for Slic3r::SolidBody:
Collaboration diagram for Slic3r::SolidBody:

Public Member Functions

BoundingBoxf3 bounding_box (const Transform3d &trafo) const
MassProperties transformed (const Transform3d &trafo) const

Public Attributes

Polygon hull
double z_min { 0. }
double z_max { 0. }
double mass { 0. }
double volume { 0. }
Vec3d center { Vec3d::Zero() }
Matrix3d spread { Matrix3d::Zero() }

Detailed Description

Member Function Documentation

◆ bounding_box()

BoundingBoxf3 Slic3r::SolidBody::bounding_box ( const Transform3d & trafo) const
176{
177 BoundingBoxf3 box;
178 for (const Point &point : hull.points)
179 for (const double z : { z_min, z_max })
180 box.merge(trafo * Vec3d(unscaled(point.x()), unscaled(point.y()), z));
181 return box;
182}
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
constexpr Eigen::Matrix< Tout, 2, EigenArgs... > unscaled(const Slic3r::Point &v) noexcept
Definition Arrange.cpp:81
Polygon hull
Definition ConnectedBodies.hpp:50
double z_max
Definition ConnectedBodies.hpp:52
double z_min
Definition ConnectedBodies.hpp:51

References hull, Slic3r::BoundingBox3Base< PointType >::merge(), Slic3r::unscaled(), z_max, and z_min.

Here is the call graph for this function:

◆ transformed()

MassProperties Slic3r::MassProperties::transformed ( const Transform3d & trafo) const
inherited
1502{
1503 const Matrix3d linear = trafo.linear();
1504 const double scale = std::abs(linear.determinant());
1505 return { mass * scale, volume * scale, trafo * center, linear * spread * linear.transpose() };
1506}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
Eigen::Matrix< double, 3, 3, Eigen::DontAlign > Matrix3d
Definition Point.hpp:86
Vec3d center
Definition TriangleMesh.hpp:334
Matrix3d spread
Definition TriangleMesh.hpp:335
double mass
Definition TriangleMesh.hpp:332
double volume
Definition TriangleMesh.hpp:333

References center, mass, scale(), spread, transformed(), and volume.

Referenced by Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), and transformed().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ center

Vec3d Slic3r::MassProperties::center { Vec3d::Zero() }
inherited
334{ Vec3d::Zero() };

Referenced by Slic3r::GUI::mass_sum(), and transformed().

◆ hull

Polygon Slic3r::SolidBody::hull

Referenced by bounding_box().

◆ mass

double Slic3r::MassProperties::mass { 0. }
inherited

◆ spread

Matrix3d Slic3r::MassProperties::spread { Matrix3d::Zero() }
inherited
335{ Matrix3d::Zero() };

Referenced by Slic3r::GUI::mass_sum(), and transformed().

◆ volume

double Slic3r::MassProperties::volume { 0. }
inherited
333{ 0. };

Referenced by Slic3r::GUI::mass_sum(), and transformed().

◆ z_max

double Slic3r::SolidBody::z_max { 0. }
52{ 0. };

Referenced by bounding_box().

◆ z_min

double Slic3r::SolidBody::z_min { 0. }
51{ 0. };

Referenced by bounding_box().


The documentation for this struct was generated from the following files: