OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ModelInstance Class Referencefinal

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

Inheritance diagram for Slic3r::ModelInstance:
Collaboration diagram for Slic3r::ModelInstance:

Public Types

using Timestamp = uint64_t

Public Member Functions

size_t get_labeled_id () const
ModelObject * get_object () const
const Geometry::Transformation & get_transformation () const
void set_transformation (const Geometry::Transformation &transformation)
const Geometry::Transformation & get_assemble_transformation () const
void set_assemble_transformation (const Geometry::Transformation &transformation)
void set_assemble_from_transform (const Transform3d &transform)
Vec3d get_assemble_offset () const
void set_assemble_offset (const Vec3d &offset)
void set_assemble_rotation (const Vec3d &rotation)
void rotate_assemble (double angle, const Vec3d &axis)
void set_offset_to_assembly (const Vec3d &offset)
Vec3d get_offset_to_assembly () const
Vec3d get_offset () const
double get_offset (Axis axis) const
void set_offset (const Vec3d &offset)
void set_offset (Axis axis, double offset)
Vec3d get_rotation () const
double get_rotation (Axis axis) const
void set_rotation (const Vec3d &rotation)
void set_rotation (Axis axis, double rotation)
void rotate (Matrix3d rotation_matrix)
Vec3d get_scaling_factor () const
double get_scaling_factor (Axis axis) const
void set_scaling_factor (const Vec3d &scaling_factor)
void set_scaling_factor (Axis axis, double scaling_factor)
Vec3d get_mirror () const
double get_mirror (Axis axis) const
bool is_left_handed () const
void set_mirror (const Vec3d &mirror)
void set_mirror (Axis axis, double mirror)
void transform_mesh (TriangleMesh *mesh, bool dont_translate=false) const
BoundingBoxf3 transform_bounding_box (const BoundingBoxf3 &bbox, bool dont_translate=false) const
Vec3d transform_vector (const Vec3d &v, bool dont_translate=false) const
void transform_polygon (Polygon *polygon) const
const Transform3d & get_matrix () const
Transform3d get_matrix_no_offset () const
bool is_printable () const
bool is_assemble_initialized ()
double get_auto_brim_width (double deltaT, double adhesion) const
double get_auto_brim_width () const
Polygon convex_hull_2d ()
bool intersects_bed_exclude_region (const BedExcludeRegion &region, indexed_triangle_set *intersection_mesh=nullptr) const
bool intersects_bed_exclude_regions (const std::vector< BedExcludeRegion > &regions, indexed_triangle_set *intersection_mesh=nullptr) const
void invalidate_convex_hull_2d ()
void get_arrange_polygon (void *arrange_polygon, const Slic3r::DynamicPrintConfig &config=Slic3r::DynamicPrintConfig()) const
void apply_arrange_result (const Vec2d &offs, double rotation)
ModelInstanceEPrintVolumeState calc_print_volume_state (const BuildVolume &build_volume) const
ObjectID id () const
virtual Timestamp timestamp () const

Public Attributes

ModelInstanceEPrintVolumeState print_volume_state
bool printable
bool use_loaded_id_for_label {false}
int arrange_order = 0
size_t loaded_id = 0

Protected Member Functions

 ModelInstance (const ModelInstance &rhs)=default
void set_model_object (ModelObject *model_object)
ModelInstanceEPrintVolumeState update_print_volume_state (const BuildVolume &build_volume)
void set_new_unique_id ()
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)
virtual void assign_new_unique_ids_recursive ()

Private Member Functions

 ModelInstance (ModelObject *object)
 ModelInstance (ModelObject *object, const ModelInstance &other)
 ModelInstance (ModelInstance &&rhs)=delete
ModelInstance & operator= (const ModelInstance &rhs)=delete
ModelInstance & operator= (ModelInstance &&rhs)=delete
 ModelInstance ()
template<class Archive>
void serialize (Archive &ar)

Static Private Member Functions

static ObjectID generate_new_id ()
template<class Archive>
static void load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct)

Private Attributes

Geometry::Transformation m_transformation
Geometry::Transformation m_assemble_transformation
Vec3d m_offset_to_assembly { 0.0, 0.0, 0.0 }
bool m_assemble_initialized
ModelObject * object
Polygon convex_hull
ObjectID m_id

Static Private Attributes

static size_t s_last_id = 0

Friends

class Print
class SLAPrint
class Model
class ModelObject
class cereal::access
class UndoRedo::StackImpl

Detailed Description

Member Typedef Documentation

◆ Timestamp

using Slic3r::ObjectBase::Timestamp = uint64_t
inherited

Constructor & Destructor Documentation

◆ ModelInstance() [1/5]

Slic3r::ModelInstance::ModelInstance ( const ModelInstance & rhs)
explicitprotecteddefault

References ModelInstance().

Referenced by ModelInstance(), ModelInstance(), ModelInstance(), intersects_bed_exclude_regions(), operator=(), and operator=().

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

◆ ModelInstance() [2/5]

Slic3r::ModelInstance::ModelInstance ( ModelObject * object)
inlineexplicitprivate
1565 {
1566 assert(this->id().valid());
1567 }
bool m_assemble_initialized
Definition Model.hpp:1426
bool printable
Definition Model.hpp:1432
ModelInstanceEPrintVolumeState print_volume_state
Definition Model.hpp:1430
ModelObject * object
Definition Model.hpp:1559
@ ModelInstancePVS_Inside
Definition Model.hpp:1411

References m_assemble_initialized, Slic3r::ModelInstancePVS_Inside, ModelObject, object, print_volume_state, and printable.

Here is the call graph for this function:

◆ ModelInstance() [3/5]

Slic3r::ModelInstance::ModelInstance ( ModelObject * object,
const ModelInstance & other )
inlineexplicitprivate
1569 :
1570 m_transformation(other.m_transformation)
1571 , m_assemble_transformation(other.m_assemble_transformation)
1572 , m_offset_to_assembly(other.m_offset_to_assembly)
1574 , printable(other.printable)
1575 , object(object)
1576 , m_assemble_initialized(false) { assert(this->id().valid() && this->id() != other.id()); }
Vec3d m_offset_to_assembly
Definition Model.hpp:1425
Geometry::Transformation m_transformation
Definition Model.hpp:1423
Geometry::Transformation m_assemble_transformation
Definition Model.hpp:1424

References ModelInstance(), Slic3r::ObjectBase::id(), m_assemble_initialized, m_assemble_transformation, m_offset_to_assembly, m_transformation, Slic3r::ModelInstancePVS_Inside, ModelObject, object, print_volume_state, and printable.

Here is the call graph for this function:

◆ ModelInstance() [4/5]

Slic3r::ModelInstance::ModelInstance ( ModelInstance && rhs)
explicitprivatedelete

References ModelInstance().

Here is the call graph for this function:

◆ ModelInstance() [5/5]

Slic3r::ModelInstance::ModelInstance ( )
inlineprivate
1585: ObjectBase(-1), object(nullptr) { assert(this->id().invalid()); }
ObjectBase()
Definition ObjectID.hpp:79

References Slic3r::ObjectBase::ObjectBase(), and object.

Here is the call graph for this function:

Member Function Documentation

◆ apply_arrange_result()

void Slic3r::ModelInstance::apply_arrange_result ( const Vec2d & offs,
double rotation )
inline
1532 {
1533 // write the transformation data into the model instance
1534 set_rotation(Z, rotation);
1535 set_offset(X, unscale<double>(offs(X)));
1536 set_offset(Y, unscale<double>(offs(Y)));
1537 this->object->invalidate_bounding_box();
1538 }
void set_rotation(const Vec3d &rotation)
Definition Model.hpp:1479
void set_offset(const Vec3d &offset)
Definition Model.hpp:1473
T unscale(Q v)
Definition libslic3r.h:138
@ Y
Definition libslic3r.h:142
@ Z
Definition libslic3r.h:143
@ X
Definition libslic3r.h:141

References set_offset(), set_rotation(), Slic3r::unscale(), Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by Slic3r::GUI::FillBedJob::prepare().

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

◆ assign_new_unique_ids_recursive()

virtual void Slic3r::ObjectBase::assign_new_unique_ids_recursive ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.

95{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:89

References set_new_unique_id().

Here is the call graph for this function:

◆ calc_print_volume_state()

ModelInstanceEPrintVolumeState Slic3r::ModelInstance::calc_print_volume_state ( const BuildVolume & build_volume) const
3974{
3975 enum {
3976 INSIDE = 1,
3977 OUTSIDE = 2
3978 };
3979
3980 unsigned int inside_outside = 0;
3981 for (const ModelVolume* vol : this->object->volumes) {
3982 if (vol->is_model_part()) {
3983 //BBS: add bounding box empty check logic, for some volume is empty before split(it will be removed after split to object)
3984 BoundingBoxf3 bb = vol->get_convex_hull().bounding_box();
3985 Vec3d size = bb.size();
3986 if ((size.x() == 0.f) || (size.y() == 0.f) || (size.z() == 0.f)) {
3987 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", object %1%'s vol %2% is empty, skip it, box: {%3%, %4%, %5%} to {%6%, %7%, %8%}")%this->object->name %vol->name %bb.min.x() %bb.min.y() %bb.min.z()%bb.max.x() %bb.max.y() %bb.max.z();
3988 continue;
3989 }
3990
3991 const Transform3d matrix = this->get_matrix() * vol->get_matrix();
3992
3993 const auto bboxt = vol->get_convex_hull().transformed_bounding_box(matrix);
3994 const BoundingBoxf bbox2d{to_2d(bboxt.min), to_2d(bboxt.max)};
3996 if (!build_volume.bounding_volume2d().inflated(BuildVolume::SceneEpsilon).overlap(bbox2d))
3998 else {
3999 switch(build_volume.type())
4000 {
4002 {
4003 state = build_volume.volume_state_bbox(bboxt);
4004 break;
4005 }
4009 default:
4010 state = build_volume.object_state(vol->mesh().its, matrix.cast<float>(), true /* may be below print bed */);
4011 break;
4012 }
4013 }
4014
4016 // Volume is completely inside.
4017 inside_outside |= INSIDE;
4018 else if (state == BuildVolume::ObjectState::Outside)
4019 // Volume is completely outside.
4020 inside_outside |= OUTSIDE;
4021 else if (state == BuildVolume::ObjectState::Below) {
4022 // Volume below the print bed, thus it is completely outside, however this does not prevent the object to be printable
4023 // if some of its volumes are still inside the build volume.
4024 } else
4025 // Volume colliding with the build volume.
4026 inside_outside |= INSIDE | OUTSIDE;
4027 }
4028 }
4029
4030 return inside_outside == (INSIDE | OUTSIDE) ? ModelInstancePVS_Partly_Outside :
4031 inside_outside == INSIDE ? ModelInstancePVS_Inside : ModelInstancePVS_Fully_Outside;
4032}
ObjectState
Definition BuildVolume.hpp:94
@ Outside
Definition BuildVolume.hpp:100
@ Inside
Definition BuildVolume.hpp:96
@ Below
Definition BuildVolume.hpp:103
static constexpr const double SceneEpsilon
Definition BuildVolume.hpp:110
const Transform3d & get_matrix() const
Definition Model.hpp:1511
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:96
Eigen::Matrix< typename Derived::Scalar, 2, 1, Eigen::DontAlign > to_2d(const Eigen::MatrixBase< Derived > &ptN)
Definition Point.hpp:147
@ Circle
Definition BuildVolume.hpp:25
@ Convex
Definition BuildVolume.hpp:27
@ Custom
Definition BuildVolume.hpp:29
@ Rectangle
Definition BuildVolume.hpp:23
@ ModelInstancePVS_Partly_Outside
Definition Model.hpp:1413
@ ModelInstancePVS_Fully_Outside
Definition Model.hpp:1414

References Slic3r::BuildVolume::Below, Slic3r::TriangleMesh::bounding_box(), Slic3r::BuildVolume::bounding_volume2d(), calc_print_volume_state(), Slic3r::Circle, Slic3r::Convex, Slic3r::Custom, Slic3r::ModelVolume::get_convex_hull(), get_matrix(), Slic3r::ModelVolume::get_matrix(), Slic3r::BoundingBoxBase< PointType, APointsType >::inflated(), Slic3r::BuildVolume::Inside, Slic3r::ModelVolume::is_model_part(), Slic3r::TriangleMesh::its, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::ModelVolume::mesh(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, Slic3r::ModelInstancePVS_Fully_Outside, Slic3r::ModelInstancePVS_Inside, Slic3r::ModelInstancePVS_Partly_Outside, Slic3r::ModelVolume::name, Slic3r::BuildVolume::object_state(), Slic3r::BuildVolume::Outside, Slic3r::Rectangle, Slic3r::BuildVolume::SceneEpsilon, Slic3r::BoundingBox3Base< PointType >::size(), Slic3r::to_2d(), Slic3r::TriangleMesh::transformed_bounding_box(), Slic3r::BuildVolume::type(), Slic3r::BuildVolume::volume_state_bbox(), and Slic3r::ModelObject::volumes.

Referenced by calc_print_volume_state(), Slic3r::GUI::PartPlate::check_outside(), and update_print_volume_state().

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

◆ convex_hull_2d()

Polygon Slic3r::ModelInstance::convex_hull_2d ( )
3544{
3545 //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": name %1%, is_valid %2%")% this->object->name.c_str()% convex_hull.is_valid();
3546 //if (!convex_hull.is_valid())
3547 { // this logic is not working right now, as moving instance doesn't update convex_hull
3548 const Transform3d& trafo_instance = get_matrix();
3549 convex_hull = get_object()->convex_hull_2d(trafo_instance);
3550 }
3551 //int size = convex_hull.size();
3552 //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": convex_hull, point size %1%")% size;
3553 //for (int i = 0; i < size; i++)
3554 // BOOST_LOG_TRIVIAL(info) << boost::format(": point %1%, position {%2%, %3%}")% i% convex_hull[i].x()% convex_hull[i].y();
3555
3556 return convex_hull;
3557}
ModelObject * get_object() const
Definition Model.hpp:1445
Polygon convex_hull
Definition Model.hpp:1560
Polygon convex_hull_2d(const Transform3d &trafo_instance) const
Definition Model.cpp:1819

References convex_hull, convex_hull_2d(), get_matrix(), and get_object().

Referenced by Slic3r::GUI::PartPlate::check_outside(), convex_hull_2d(), Slic3r::GUI::PartPlate::imex_placement_violation(), intersects_bed_exclude_regions(), Slic3r::GUI::PartPlate::max_broad_phase_intersecting_object_height(), and Slic3r::GUI::PartPlate::update_exclusion_volume_preview_models().

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

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase & rhs)
inlineprotectedinherited
92{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:98

References ObjectBase(), id(), and m_id.

Referenced by Slic3r::CutObjectBase::copy().

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

◆ generate_new_id()

ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
100{ return ObjectID(++ s_last_id); }
static size_t s_last_id
Definition ObjectID.hpp:101

References s_last_id.

Referenced by ObjectBase(), and set_new_unique_id().

Here is the caller graph for this function:

◆ get_arrange_polygon()

void Slic3r::ModelInstance::get_arrange_polygon ( void * arrange_polygon,
const Slic3r::DynamicPrintConfig & config = Slic3r::DynamicPrintConfig() ) const
3921{
3922// static const double SIMPLIFY_TOLERANCE_MM = 0.1;
3923
3924 Vec3d rotation = get_rotation();
3925 rotation.z() = 0.;
3926 Geometry::Transformation t(m_transformation);
3927 t.set_offset(get_offset().z() * Vec3d::UnitZ());
3928 t.set_rotation(rotation);
3929 Polygon p = get_object()->convex_hull_2d(t.get_matrix());
3930
3931// if (!p.points.empty()) {
3932// Polygons pp{p};
3933// pp = p.simplify(scaled<double>(SIMPLIFY_TOLERANCE_MM));
3934// if (!pp.empty()) p = pp.front();
3935// }
3936
3937 arrangement::ArrangePolygon& ret = *(arrangement::ArrangePolygon*)ap;
3938 ret.poly.contour = std::move(p);
3939 ret.translation = Vec2crd{scaled(get_offset(X)), scaled(get_offset(Y))};
3940 ret.rotation = get_rotation(Z);
3941
3942 //BBS: add materials related information
3943 ModelVolume *volume = NULL;
3944 for (size_t i = 0; i < object->volumes.size(); ++i) {
3945 if (object->volumes[i]->is_model_part()) {
3946 volume = object->volumes[i];
3947 if (!volume) {
3948 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "invalid object, should not happen";
3949 return;
3950 }
3951 auto ve = object->volumes[i]->get_extruders();
3952 ret.extrude_ids.insert(ret.extrude_ids.end(), ve.begin(), ve.end());
3953 }
3954 }
3955
3956 // get per-object support extruders
3957 auto op = object->get_config_value<ConfigOptionBool>(config_global, "enable_support");
3958 bool is_support_enabled = op && op->getBool();
3959 if (is_support_enabled) {
3960 auto op1 = object->get_config_value<ConfigOptionInt>(config_global, "support_filament");
3961 auto op2 = object->get_config_value<ConfigOptionInt>(config_global, "support_interface_filament");
3962 int extruder_id;
3963 // id==0 means follow previous material, so need not be recorded
3964 if (op1 && (extruder_id = op1->getInt()) > 0) ret.extrude_ids.push_back(extruder_id);
3965 if (op2 && (extruder_id = op2->getInt()) > 0) ret.extrude_ids.push_back(extruder_id);
3966 }
3967
3968 ret.extrude_ids.erase(std::unique(ret.extrude_ids.begin(), ret.extrude_ids.end()), ret.extrude_ids.end());
3969 if (ret.extrude_ids.empty()) //the default extruder
3970 ret.extrude_ids.push_back(1);
3971}
Vec3d get_rotation() const
Definition Model.hpp:1476
Vec3d get_offset() const
Definition Model.hpp:1470
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:284
Eigen::Matrix< coord_t, 2, 1, Eigen::DontAlign > Vec2crd
Definition Point.hpp:52
Slic3r::Polygon Polygon
Definition Emboss.cpp:101

References Slic3r::ExPolygon::contour, Slic3r::arrangement::ArrangePolygon::extrude_ids, get_arrange_polygon(), Slic3r::ModelVolume::get_extruders(), Slic3r::Geometry::Transformation::get_matrix(), get_object(), get_offset(), get_rotation(), Slic3r::ConfigOptionBool::getBool(), Slic3r::ConfigOptionInt::getInt(), m_transformation, object, Slic3r::arrangement::ArrangePolygon::poly, Slic3r::arrangement::ArrangePolygon::rotation, Slic3r::scaled(), Slic3r::Geometry::Transformation::set_offset(), Slic3r::Geometry::Transformation::set_rotation(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by Slic3r::GUI::Plater::find_new_position(), Slic3r::get_arrange_poly(), get_arrange_polygon(), and Slic3r::get_arrange_polys().

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

◆ get_assemble_offset()

Vec3d Slic3r::ModelInstance::get_assemble_offset ( ) const
inline
1459{return m_assemble_transformation.get_offset(); }

References m_assemble_transformation.

◆ get_assemble_transformation()

const Geometry::Transformation & Slic3r::ModelInstance::get_assemble_transformation ( ) const
inline

◆ get_auto_brim_width() [1/2]

double Slic3r::ModelInstance::get_auto_brim_width ( ) const
3912{
3913 return 0.;
3914 double adhcoeff = getadhesionCoeff(object->volumes);
3915 double DeltaT = getTemperatureFromExtruder(object->volumes);
3916 // get auto brim width (Note even if the global brim_type=btOuterBrim, we can still go into this branch)
3917 return get_auto_brim_width(DeltaT, adhcoeff);
3918}
double get_auto_brim_width() const
Definition Model.cpp:3911
double getTemperatureFromExtruder(const ModelVolumePtrs objectVolumes)
Definition Model.cpp:3888
double getadhesionCoeff(const PrintObject *printObject)
Definition Brim.cpp:160

References get_auto_brim_width(), Slic3r::getadhesionCoeff(), Slic3r::getTemperatureFromExtruder(), and object.

Here is the call graph for this function:

◆ get_auto_brim_width() [2/2]

double Slic3r::ModelInstance::get_auto_brim_width ( double deltaT,
double adhesion ) const
3525{
3526 BoundingBoxf3 raw_bbox = object->raw_mesh_bounding_box();
3527 double maxSpeed = Model::findMaxSpeed(object);
3528
3529 auto bbox_size = transform_bounding_box(raw_bbox).size();
3530 double height_to_area = std::max(bbox_size(2) / (bbox_size(0) * bbox_size(0) * bbox_size(1)),
3531 bbox_size(2) / (bbox_size(1) * bbox_size(1) * bbox_size(0)));
3532 double thermalLength = sqrt(bbox_size(0)* bbox_size(0) + bbox_size(1)* bbox_size(1));
3533 double thermalLengthRef = Model::getThermalLength(object->volumes);
3534
3535 double brim_width = adhesion * std::min(std::min(std::max(height_to_area * 200 * maxSpeed/200, thermalLength * 8. / thermalLengthRef * std::min(bbox_size(2), 30.) / 30.), 20.), 1.5 * thermalLength);
3536 // small brims are omitted
3537 if (brim_width < 5 && brim_width < 1.5 * thermalLength)
3538 brim_width = 0;
3539 return brim_width;
3540}
PointType size() const
Definition BoundingBox.cpp:187
BoundingBoxf3 transform_bounding_box(const BoundingBoxf3 &bbox, bool dont_translate=false) const
Definition Model.cpp:3189
static double getThermalLength(const ModelVolume *modelVolumePtr)
Definition Model.cpp:3498
static double findMaxSpeed(const ModelObject *object)
Definition Model.cpp:3459

References Slic3r::Model::findMaxSpeed(), get_auto_brim_width(), Slic3r::Model::getThermalLength(), object, and transform_bounding_box().

Referenced by get_auto_brim_width(), and get_auto_brim_width().

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

◆ get_labeled_id()

size_t Slic3r::ModelInstance::get_labeled_id ( ) const
inline
1438 {
1440 return loaded_id;
1441 else
1442 return id().id;
1443 }
size_t loaded_id
Definition Model.hpp:1435
bool use_loaded_id_for_label
Definition Model.hpp:1433
ObjectID id() const
Definition ObjectID.hpp:69
size_t id
Definition ObjectID.hpp:39

References Slic3r::ObjectBase::id(), Slic3r::ObjectID::id, loaded_id, and use_loaded_id_for_label.

Referenced by Slic3r::GUI::GLCanvas3D::_set_warning_notification().

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

◆ get_matrix()

◆ get_matrix_no_offset()

Transform3d Slic3r::ModelInstance::get_matrix_no_offset ( ) const
inline
1512{ return m_transformation.get_matrix_no_offset(); }

References m_transformation.

Referenced by Slic3r::ModelObject::get_instance_max_z(), Slic3r::ModelObject::get_instance_min_z(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), transform_bounding_box(), transform_mesh(), and transform_vector().

Here is the caller graph for this function:

◆ get_mirror() [1/2]

Vec3d Slic3r::ModelInstance::get_mirror ( ) const
inline
1495{ return m_transformation.get_mirror(); }

References m_transformation.

Referenced by Slic3r::compacted_tower_print_instance_hull(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), Slic3r::sla::RotfinderBoilerplate< MAX_ITER >::get_mesh_to_rotate(), Slic3r::GUI::Plater::increase_instances(), Slic3r::SLAPrint::sla_trafo(), and Slic3r::GUI::GLCanvas3D::update_sequential_clearance().

Here is the caller graph for this function:

◆ get_mirror() [2/2]

double Slic3r::ModelInstance::get_mirror ( Axis axis) const
inline
1496{ return m_transformation.get_mirror(axis); }

References m_transformation.

◆ get_object()

ModelObject * Slic3r::ModelInstance::get_object ( ) const
inline
1445{ return this->object; }

References ModelObject, and object.

Referenced by Slic3r::GUI::RaycastManager::actualize(), convex_hull_2d(), get_arrange_polygon(), Slic3r::get_instance_arrange_poly(), Slic3r::GUI::OrientJob::get_orient_mesh(), intersects_bed_exclude_region(), Slic3r::orientation::orient(), and Slic3r::GUI::ArrangeJob::prepare_arrange_polygon().

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

◆ get_offset() [1/2]

◆ get_offset() [2/2]

double Slic3r::ModelInstance::get_offset ( Axis axis) const
inline
1471{ return m_transformation.get_offset(axis); }

References m_transformation.

◆ get_offset_to_assembly()

Vec3d Slic3r::ModelInstance::get_offset_to_assembly ( ) const
inline
1468{ return m_offset_to_assembly; }

References m_offset_to_assembly.

Referenced by Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GLGizmoPainterBase::mesh_trafo_matrices(), and Slic3r::GUI::GLGizmoPainterBase::render_cursor_height_range().

Here is the caller graph for this function:

◆ get_rotation() [1/2]

Vec3d Slic3r::ModelInstance::get_rotation ( ) const
inline

◆ get_rotation() [2/2]

double Slic3r::ModelInstance::get_rotation ( Axis axis) const
inline
1477{ return m_transformation.get_rotation(axis); }

References m_transformation.

◆ get_scaling_factor() [1/2]

Vec3d Slic3r::ModelInstance::get_scaling_factor ( ) const
inline

◆ get_scaling_factor() [2/2]

double Slic3r::ModelInstance::get_scaling_factor ( Axis axis) const
inline
1490{ return m_transformation.get_scaling_factor(axis); }

References m_transformation.

◆ get_transformation()

◆ id()

ObjectID Slic3r::ObjectBase::id ( ) const
inlineinherited
69{ return m_id; }

References m_id.

Referenced by Slic3r::CutObjectBase::CutObjectBase(), Slic3r::Model::Model(), Slic3r::ModelInstance::ModelInstance(), Slic3r::ModelMaterial::ModelMaterial(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), ObjectBase(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::_BBS_3MF_Exporter::_add_cut_information_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_slice_info_config_file_to_archive(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Model::add_object(), Slic3r::append_and_translate(), Slic3r::SLAPrint::apply(), Slic3r::GUI::calc_distance(), Slic3r::GUI::calc_surface_offset(), Slic3r::check_model_ids_equal(), Slic3r::check_model_ids_validity(), Slic3r::GUI::GLGizmoTextureDisplacement::close_image_adjust(), Slic3r::Model::collect_reusable_objects(), Slic3r::ModelObject::convert_units(), copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), Slic3r::GUI::create_meshes(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GCode::do_export(), Slic3r::GUI::PartPlate::duplicate_all_instance(), Slic3r::GUI::PartPlateList::duplicate_plate(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::Print::export_cached_data(), Slic3r::GUI::Plater::export_stl(), Slic3r::find_volume_extents(), Slic3r::PreciseSeam::detail::fragment_location(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::ModelObjectStatusDB::get(), Slic3r::Model::get_backup_path(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), Slic3r::ModelInstance::get_labeled_id(), Slic3r::GUI::get_model_volume(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::get_selected_volume(), Slic3r::GUI::get_volume(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::CutObjectBase::is_equal(), Slic3r::GUI::GLGizmoSVG::is_svg_object(), Slic3r::ModelVolume::is_the_only_one_part(), Slic3r::GUI::IMSlider::IsNewPrint(), Slic3r::ModelObject::load(), load_and_construct(), Slic3r::Print::load_cached_data(), Slic3r::GLVolumeCollection::load_object_auxiliary(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GCodeViewer::load_shells(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), Slic3r::ModelConfigObject::object_id_and_timestamp_match(), Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::open_image_adjust(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::outer_inner_brim_area(), Slic3r::GUI::GLGizmoTextureDisplacement::painted_area_mm2(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), anonymous_namespace{GLGizmoEmboss.cpp}::prepare_volumes_to_slice(), Slic3r::GUI::GLGizmoTextureDisplacement::preview_part(), Slic3r::GCode::process_layer(), Slic3r::GUI::NotificationManager::push_slicing_warning_notification(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::GUI::GLGizmoEmboss::re_emboss(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::_BBS_Backup_Manager::remove_backup(), Slic3r::Model::remove_backup_path_if_exist(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), Slic3r::CLI::run(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::Model::set_backup_path(), Slic3r::GUI::GLGizmoBrimEars::set_brim_data(), Slic3r::GUI::PartPlate::set_hover_id(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), Slic3r::GUI::GLGizmoSVG::set_volume_by_selection(), Slic3r::sla_instances(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), anonymous_namespace{EmbossJob.cpp}::start_create_volume_on_surface_job(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), Slic3r::GUI::Emboss::start_update_volume(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::GUI::texture_displacement_bake_volume(), Slic3r::GUI::GLGizmoPainterBase::update_contours(), anonymous_namespace{EmbossJob.cpp}::update_name_in_list(), Slic3r::GUI::ObjectList::update_name_in_model(), Slic3r::GUI::update_object_cut_id(), Slic3r::GUI::GLGizmoTextureDisplacement::v2_recommendation(), Slic3r::verify_update_print_object_regions(), wipe_tower_instance_id, and wipe_tower_object_id.

◆ intersects_bed_exclude_region()

bool Slic3r::ModelInstance::intersects_bed_exclude_region ( const BedExcludeRegion & region,
indexed_triangle_set * intersection_mesh = nullptr ) const
3754{
3755 // With no output mesh this is a fast yes/no test and returns on the first
3756 // hit. With an output mesh it collects all clipped fragments for the red
3757 // GUI intersection preview.
3758 if (intersection_mesh != nullptr)
3759 intersection_mesh->clear();
3760
3761 if (region.polygon.points.size() < 3)
3762 return false;
3763
3764 double z_min = region.z_min;
3765 double z_max = region.z_max;
3766 if (z_min > z_max)
3767 std::swap(z_min, z_max);
3768 if (z_max <= z_min + EPSILON)
3769 return false;
3770
3771 const std::vector<ExclusionPrismFootprintTriangle> footprints = triangulated_prism_footprints(region.polygon);
3772 if (footprints.empty())
3773 return false;
3774
3775 bool intersects = false;
3776 const ModelObject *model_object = get_object();
3777 const Transform3d instance_matrix = get_matrix();
3778
3779 for (const ModelVolume *volume : model_object->volumes) {
3780 if (! volume->is_model_part())
3781 continue;
3782
3783 const indexed_triangle_set &its = volume->mesh().its;
3784 if (its.vertices.empty() || its.indices.empty())
3785 continue;
3786
3787 const Transform3d volume_matrix = instance_matrix * volume->get_matrix();
3788 bool volume_surface_intersects = false;
3789 for (const stl_triangle_vertex_indices &face : its.indices) {
3790 const Vec3d p0 = volume_matrix * its.vertices[face[0]].cast<double>();
3791 const Vec3d p1 = volume_matrix * its.vertices[face[1]].cast<double>();
3792 const Vec3d p2 = volume_matrix * its.vertices[face[2]].cast<double>();
3793
3794 const double tri_min_z = std::min({ p0.z(), p1.z(), p2.z() });
3795 const double tri_max_z = std::max({ p0.z(), p1.z(), p2.z() });
3796 if (tri_max_z < z_min || tri_min_z > z_max)
3797 continue;
3798
3799 for (const ExclusionPrismFootprintTriangle &footprint : footprints) {
3800 if (! triangle_bbox_intersects_prism_footprint(p0, p1, p2, footprint))
3801 continue;
3802
3803 std::vector<Vec3d> clipped = clip_model_triangle_to_prism(p0, p1, p2, z_min, z_max, footprint);
3804 if (polygon_3d_area2(clipped) <= 1e-8)
3805 continue;
3806
3807 volume_surface_intersects = true;
3808 intersects = true;
3809 if (intersection_mesh == nullptr)
3810 return true;
3811
3812 append_clipped_polygon(*intersection_mesh, clipped);
3813 }
3814 }
3815
3816 if (!volume_surface_intersects && !intersects) {
3817 // Surface clipping cannot detect a prism wholly enclosed by a
3818 // solid. In that topology, with no boundary crossing, one point
3819 // inside the connected prism is sufficient to test containment.
3820 const ExclusionPrismFootprintTriangle &footprint = footprints.front();
3821 const Vec2d probe_xy = (footprint.vertices[0] + footprint.vertices[1] + footprint.vertices[2]) / 3.0;
3822 const Vec3d probe_world(probe_xy.x(), probe_xy.y(), z_min + 0.5 * (z_max - z_min));
3823 const Vec3d probe_local = volume_matrix.inverse() * probe_world;
3824
3825 // A linear ray scan keeps this one-off fallback O(n) without
3826 // adding ray tests to the usual surface-intersection path.
3827 if (volume->mesh().bounding_box().contains(probe_local) && mesh_contains_point_linear(its, probe_local)) {
3828 intersects = true;
3829 if (intersection_mesh == nullptr)
3830 return true;
3831 }
3832 }
3833 }
3834
3835 return intersects;
3836}
#define EPSILON
Definition ColorUtils.cpp:64
friend class ModelObject
Definition Model.hpp:1546
static std::vector< ExclusionPrismFootprintTriangle > triangulated_prism_footprints(const Polygon &polygon)
Definition Model.cpp:3616
static std::vector< Vec3d > clip_model_triangle_to_prism(const Vec3d &p0, const Vec3d &p1, const Vec3d &p2, const double z_min, const double z_max, const ExclusionPrismFootprintTriangle &footprint)
Definition Model.cpp:3670
static double polygon_3d_area2(const std::vector< Vec3d > &polygon)
Definition Model.cpp:3694
static bool triangle_bbox_intersects_prism_footprint(const Vec3d &p0, const Vec3d &p1, const Vec3d &p2, const ExclusionPrismFootprintTriangle &footprint)
Definition Model.cpp:3656
static void append_clipped_polygon(indexed_triangle_set &out, const std::vector< Vec3d > &polygon)
Definition Model.cpp:3705
static bool mesh_contains_point_linear(const indexed_triangle_set &its, const Vec3d &point)
Definition Model.cpp:3723
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

References Slic3r::TriangleMesh::bounding_box(), Slic3r::BoundingBox3Base< PointType >::contains(), EPSILON, get_matrix(), Slic3r::ModelVolume::get_matrix(), get_object(), intersects_bed_exclude_region(), Slic3r::ModelVolume::is_model_part(), Slic3r::TriangleMesh::its, Slic3r::ModelVolume::mesh(), ModelObject, Slic3r::MultiPoint::points, Slic3r::BedExcludeRegion::polygon, Slic3r::ModelObject::volumes, Slic3r::BedExcludeRegion::z_max, and Slic3r::BedExcludeRegion::z_min.

Referenced by Slic3r::GUI::PartPlate::check_outside(), intersects_bed_exclude_region(), intersects_bed_exclude_regions(), and Slic3r::GUI::PartPlate::update_exclusion_volume_preview_models().

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

◆ intersects_bed_exclude_regions()

bool Slic3r::ModelInstance::intersects_bed_exclude_regions ( const std::vector< BedExcludeRegion > & regions,
indexed_triangle_set * intersection_mesh = nullptr ) const
3841{
3842 if (intersection_mesh != nullptr)
3843 intersection_mesh->clear();
3844 if (regions.empty())
3845 return false;
3846
3847 const Polygon hull = const_cast<ModelInstance *>(this)->convex_hull_2d();
3848 bool intersects = false;
3849 for (const BedExcludeRegion &region : regions) {
3850 if (intersection(Polygons{ region.polygon }, Polygons{ hull }).empty())
3851 continue;
3852
3853 if (intersection_mesh == nullptr) {
3855 return true;
3856 continue;
3857 }
3858
3859 indexed_triangle_set region_intersection;
3860 if (intersects_bed_exclude_region(region, &region_intersection)) {
3861 intersects = true;
3862 if (!region_intersection.empty())
3863 its_merge(*intersection_mesh, region_intersection);
3864 }
3865 }
3866 return intersects;
3867}
ModelInstance(const ModelInstance &rhs)=default
Polygon convex_hull_2d()
Definition Model.cpp:3543
bool intersects_bed_exclude_region(const BedExcludeRegion &region, indexed_triangle_set *intersection_mesh=nullptr) const
Definition Model.cpp:3753
void its_merge(indexed_triangle_set &A, const indexed_triangle_set &B)
Definition TriangleMesh.cpp:1448
Slic3r::Polygons intersection(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:769
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:22

References ModelInstance(), convex_hull_2d(), Slic3r::intersection(), intersects_bed_exclude_region(), intersects_bed_exclude_regions(), and Slic3r::its_merge().

Referenced by Slic3r::GLVolumeCollection::check_outside_state(), and intersects_bed_exclude_regions().

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

◆ invalidate_convex_hull_2d()

void Slic3r::ModelInstance::invalidate_convex_hull_2d ( )
3871{
3872 convex_hull.clear();
3873}

References convex_hull, and invalidate_convex_hull_2d().

Referenced by invalidate_convex_hull_2d().

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

◆ is_assemble_initialized()

bool Slic3r::ModelInstance::is_assemble_initialized ( )
inline
1515{ return m_assemble_initialized; }

References m_assemble_initialized.

◆ is_left_handed()

bool Slic3r::ModelInstance::is_left_handed ( ) const
inline
1497{ return m_transformation.is_left_handed(); }

References m_transformation.

Referenced by Slic3r::SlicingAdaptive::prepare(), and Slic3r::SLAPrint::sla_trafo().

Here is the caller graph for this function:

◆ is_printable()

bool Slic3r::ModelInstance::is_printable ( ) const
inline
1514{ return object->printable && printable && (print_volume_state == ModelInstancePVS_Inside); }

References Slic3r::ModelInstancePVS_Inside, print_volume_state, and printable.

Referenced by Slic3r::print_objects_from_model_object(), Slic3r::Model::propose_export_file_name_and_path(), Slic3r::sla_instances(), and Slic3r::PrintBase::update_object_placeholders().

Here is the caller graph for this function:

◆ load_and_construct()

template<class Archive>
void Slic3r::ObjectBase::load_and_construct ( Archive & ar,
cereal::construct< ObjectBase > & construct )
inlinestaticprivateinherited
109{ ObjectID id; ar(id); construct(id); }

References id().

Here is the call graph for this function:

◆ operator=() [1/2]

ModelInstance & Slic3r::ModelInstance::operator= ( const ModelInstance & rhs)
privatedelete

References ModelInstance().

Here is the call graph for this function:

◆ operator=() [2/2]

ModelInstance & Slic3r::ModelInstance::operator= ( ModelInstance && rhs)
privatedelete

References ModelInstance().

Here is the call graph for this function:

◆ rotate()

void Slic3r::ModelInstance::rotate ( Matrix3d rotation_matrix)
inline
1483 {
1484 auto rotation = m_transformation.get_rotation_matrix();
1485 rotation = rotation_matrix * rotation;
1486 set_rotation(Geometry::Transformation(rotation).get_rotation());
1487 }

References get_rotation(), m_transformation, and set_rotation().

Referenced by Slic3r::GUI::Plater::_calib_apply_belt_mode(), Slic3r::GUI::OrientJob::get_orient_mesh(), and Slic3r::orientation::orient().

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

◆ rotate_assemble()

void Slic3r::ModelInstance::rotate_assemble ( double angle,
const Vec3d & axis )
inline
1462 {
1463 m_assemble_transformation.set_rotation(m_assemble_transformation.get_rotation() + Geometry::extract_euler_angles(Eigen::Quaterniond(Eigen::AngleAxisd(angle, axis)).toRotationMatrix()));
1464 }
Vec3d extract_euler_angles(const Eigen::Matrix< double, 3, 3, Eigen::DontAlign > &rotation_matrix)
Definition Geometry.cpp:395
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138

References Slic3r::angle(), Slic3r::Geometry::extract_euler_angles(), and m_assemble_transformation.

Here is the call graph for this function:

◆ serialize()

template<class Archive>
void Slic3r::ModelInstance::serialize ( Archive & ar)
inlineprivate

◆ set_assemble_from_transform()

void Slic3r::ModelInstance::set_assemble_from_transform ( const Transform3d & transform)
inline
1455 {
1458 }
Linef3 transform(const Linef3 &line, const Transform3d &t)
Definition Line.cpp:15

References m_assemble_initialized, m_assemble_transformation, and Slic3r::transform().

Referenced by Slic3r::ModelObject::split().

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

◆ set_assemble_offset()

void Slic3r::ModelInstance::set_assemble_offset ( const Vec3d & offset)
inline
1460{ m_assemble_transformation.set_offset(offset); }
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References m_assemble_transformation, and Slic3r::offset().

Here is the call graph for this function:

◆ set_assemble_rotation()

void Slic3r::ModelInstance::set_assemble_rotation ( const Vec3d & rotation)
inline
1461{ m_assemble_transformation.set_rotation(rotation); }

References m_assemble_transformation.

◆ set_assemble_transformation()

void Slic3r::ModelInstance::set_assemble_transformation ( const Geometry::Transformation & transformation)
inline
1451 {
1453 m_assemble_transformation = transformation;
1454 }

References m_assemble_initialized, and m_assemble_transformation.

Referenced by Slic3r::GUI::Selection::paste_objects_from_clipboard().

Here is the caller graph for this function:

◆ set_invalid_id()

void Slic3r::ObjectBase::set_invalid_id ( )
inlineprotectedinherited
90{ m_id = 0; }

References m_id.

Referenced by Slic3r::CutObjectBase::invalidate().

Here is the caller graph for this function:

◆ set_mirror() [1/2]

void Slic3r::ModelInstance::set_mirror ( Axis axis,
double mirror )
inline
1500{ m_transformation.set_mirror(axis, mirror); }

References m_transformation.

◆ set_mirror() [2/2]

void Slic3r::ModelInstance::set_mirror ( const Vec3d & mirror)
inline
1499{ m_transformation.set_mirror(mirror); }

References m_transformation.

Referenced by Slic3r::ModelObject::bake_xy_rotation_into_meshes(), and Slic3r::AMFParserContext::endDocument().

Here is the caller graph for this function:

◆ set_model_object()

void Slic3r::ModelInstance::set_model_object ( ModelObject * model_object)
inlineprotected
1549{ object = model_object; }

References ModelObject.

Referenced by Slic3r::Model::update_links_bottom_up_recursive().

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

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited
89{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:100

References generate_new_id(), and m_id.

Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ModelVolume::assign_new_unique_ids_recursive(), assign_new_unique_ids_recursive(), Slic3r::CutObjectBase::init(), Slic3r::ModelMaterial::set_new_unique_id(), Slic3r::ModelObject::set_new_unique_id(), and Slic3r::ModelVolume::set_new_unique_id().

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

◆ set_offset() [1/2]

void Slic3r::ModelInstance::set_offset ( Axis axis,
double offset )
inline
1474{ m_transformation.set_offset(axis, offset); }

References m_transformation, and Slic3r::offset().

Here is the call graph for this function:

◆ set_offset() [2/2]

◆ set_offset_to_assembly()

void Slic3r::ModelInstance::set_offset_to_assembly ( const Vec3d & offset)
inline

References m_offset_to_assembly, and Slic3r::offset().

Referenced by Slic3r::ModelObject::split().

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

◆ set_rotation() [1/2]

void Slic3r::ModelInstance::set_rotation ( Axis axis,
double rotation )
inline
1480{ m_transformation.set_rotation(axis, rotation); }

References m_transformation.

◆ set_rotation() [2/2]

void Slic3r::ModelInstance::set_rotation ( const Vec3d & rotation)
inline
1479{ m_transformation.set_rotation(rotation); }

References m_transformation.

Referenced by apply_arrange_result(), Slic3r::ModelObject::bake_xy_rotation_into_meshes(), Slic3r::AMFParserContext::endDocument(), Slic3r::GUI::RotoptimizeJob::finalize(), and rotate().

Here is the caller graph for this function:

◆ set_scaling_factor() [1/2]

void Slic3r::ModelInstance::set_scaling_factor ( Axis axis,
double scaling_factor )
inline
1493{ m_transformation.set_scaling_factor(axis, scaling_factor); }

References m_transformation.

◆ set_scaling_factor() [2/2]

void Slic3r::ModelInstance::set_scaling_factor ( const Vec3d & scaling_factor)
inline
1492{ m_transformation.set_scaling_factor(scaling_factor); }

References m_transformation.

Referenced by Slic3r::ModelObject::bake_xy_rotation_into_meshes(), Slic3r::AMFParserContext::endDocument(), and Slic3r::GUI::Plater::priv::load_model_objects().

Here is the caller graph for this function:

◆ set_transformation()

void Slic3r::ModelInstance::set_transformation ( const Geometry::Transformation & transformation)
inline
1448{ m_transformation = transformation; }

References m_transformation.

Referenced by Slic3r::_3MF_Importer::_apply_transform(), Slic3r::_BBS_3MF_Importer::_apply_transform(), and Slic3r::lay_on_face().

Here is the caller graph for this function:

◆ timestamp()

virtual Timestamp Slic3r::ObjectBase::timestamp ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ModelConfigObject, and Slic3r::ObjectWithTimestamp.

74{ return 0; }

◆ transform_bounding_box()

BoundingBoxf3 Slic3r::ModelInstance::transform_bounding_box ( const BoundingBoxf3 & bbox,
bool dont_translate = false ) const
3190{
3191 return bbox.transformed(dont_translate ? get_matrix_no_offset() : get_matrix());
3192}
Transform3d get_matrix_no_offset() const
Definition Model.hpp:1512

References get_matrix(), get_matrix_no_offset(), transform_bounding_box(), and Slic3r::BoundingBoxf3::transformed().

Referenced by get_auto_brim_width(), and transform_bounding_box().

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

◆ transform_mesh()

void Slic3r::ModelInstance::transform_mesh ( TriangleMesh * mesh,
bool dont_translate = false ) const
3185{
3186 mesh->transform(dont_translate ? get_matrix_no_offset() : get_matrix());
3187}

References get_matrix(), get_matrix_no_offset(), Slic3r::TriangleMesh::transform(), and transform_mesh().

Referenced by transform_mesh().

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

◆ transform_polygon()

void Slic3r::ModelInstance::transform_polygon ( Polygon * polygon) const
3200{
3201 // CHECK_ME -> Is the following correct or it should take in account all three rotations ?
3202 polygon->rotate(get_rotation(Z)); // rotate around polygon origin
3203 // CHECK_ME -> Is the following correct ?
3204 polygon->scale(get_scaling_factor(X), get_scaling_factor(Y)); // scale around polygon origin
3205}
Vec3d get_scaling_factor() const
Definition Model.hpp:1489

References get_rotation(), get_scaling_factor(), Slic3r::MultiPoint::rotate(), Slic3r::MultiPoint::scale(), transform_polygon(), Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by transform_polygon().

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

◆ transform_vector()

Vec3d Slic3r::ModelInstance::transform_vector ( const Vec3d & v,
bool dont_translate = false ) const
3195{
3196 return dont_translate ? get_matrix_no_offset() * v : get_matrix() * v;
3197}

References get_matrix(), get_matrix_no_offset(), and transform_vector().

Referenced by transform_vector().

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

◆ update_print_volume_state()

ModelInstanceEPrintVolumeState Slic3r::ModelInstance::update_print_volume_state ( const BuildVolume & build_volume)
inlineprotected
1552 {
1554 return print_volume_state;
1555 }
ModelInstanceEPrintVolumeState calc_print_volume_state(const BuildVolume &build_volume) const
Definition Model.cpp:3973

References calc_print_volume_state(), and print_volume_state.

Here is the call graph for this function:

◆ cereal::access

friend class cereal::access
friend

References cereal::access.

Referenced by cereal::access.

◆ Model

friend class Model
friend

References Model.

Referenced by Model.

◆ ModelObject

friend class ModelObject
friend

◆ Print

friend class Print
friend

References Print.

Referenced by Print.

◆ SLAPrint

friend class SLAPrint
friend

References SLAPrint.

Referenced by SLAPrint.

◆ UndoRedo::StackImpl

friend class UndoRedo::StackImpl
friend

Member Data Documentation

◆ arrange_order

int Slic3r::ModelInstance::arrange_order = 0

◆ convex_hull

Polygon Slic3r::ModelInstance::convex_hull
private

◆ loaded_id

◆ m_assemble_initialized

bool Slic3r::ModelInstance::m_assemble_initialized
private

◆ m_assemble_transformation

◆ m_id

ObjectID Slic3r::ObjectBase::m_id
privateinherited

◆ m_offset_to_assembly

Vec3d Slic3r::ModelInstance::m_offset_to_assembly { 0.0, 0.0, 0.0 }
private
1425{ 0.0, 0.0, 0.0 };

Referenced by ModelInstance(), get_offset_to_assembly(), serialize(), and set_offset_to_assembly().

◆ m_transformation

◆ object

◆ print_volume_state

◆ printable

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

Referenced by generate_new_id().

◆ use_loaded_id_for_label

bool Slic3r::ModelInstance::use_loaded_id_for_label {false}
1433{false};

Referenced by get_labeled_id(), and Slic3r::CLI::run().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Model.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Model.cpp