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

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

Inheritance diagram for Slic3r::ModelVolume:
Collaboration diagram for Slic3r::ModelVolume:

Classes

struct  Source
struct  CutInfo

Public Types

using Timestamp = uint64_t

Public Member Functions

bool is_from_upper () const
void reset_from_upper ()
bool is_cut_connector () const
void invalidate_cut_info ()
const TriangleMesh & mesh () const
std::shared_ptr< const TriangleMesh > mesh_ptr () const
void set_mesh (const TriangleMesh &mesh)
void set_mesh (TriangleMesh &&mesh)
void set_mesh (const indexed_triangle_set &mesh)
void set_mesh (indexed_triangle_set &&mesh)
void set_mesh (std::shared_ptr< const TriangleMesh > &mesh)
void set_mesh (std::unique_ptr< const TriangleMesh > &&mesh)
void reset_mesh ()
const std::shared_ptr< const TriangleMesh > & get_mesh_shared_ptr () const
FacetsAnnotation & texture_displacement_facet (int slot)
const FacetsAnnotation & texture_displacement_facet (int slot) const
bool texture_displacement_facets_ids_valid () const
bool texture_displacement_facets_ids_invalid () const
bool texture_displacement_facets_all_empty () const
bool has_texture_uv () const
void reset_texture_uv ()
std::optional< TriangleSelector::SavedPainting > save_painting () const
void restore_painting (const std::optional< TriangleSelector::SavedPainting > &saved, bool keep_existing_paint=false)
ModelObject * get_object () const
ModelVolumeType type () const
void set_type (const ModelVolumeType t)
bool is_model_part () const
bool is_negative_volume () const
bool is_modifier () const
bool is_support_enforcer () const
bool is_support_blocker () const
bool is_support_modifier () const
bool is_precise_seam () const
bool is_precise_seam_strong () const
bool is_precise_seam_weak () const
bool is_text () const
bool is_svg () const
bool is_the_only_one_part () const
t_model_material_id material_id () const
void set_material_id (t_model_material_id material_id)
void reset_extra_facets ()
ModelMaterial * material () const
void set_material (t_model_material_id material_id, const ModelMaterial &material)
int extruder_id () const
void clear_cache ()
bool is_splittable () const
std::vector< int > get_extruders () const
void update_extruder_count (size_t extruder_count)
void update_extruder_count_when_delete_filament (size_t extruder_count, size_t filament_id, int replace_filament_id=-1, const std::vector< unsigned char > &filament_is_mixed={})
size_t split (unsigned int max_extruders, bool remap_paint)
bool repair (bool keep_painting, MeshRepairStats *stats=nullptr, std::string *error=nullptr, const std::function< void(int)> &progress={})
void translate (double x, double y, double z)
void translate (const Vec3d &displacement)
void scale (const Vec3d &scaling_factors)
void scale (double x, double y, double z)
void scale (double s)
void rotate (double angle, Axis axis)
void rotate (double angle, const Vec3d &axis)
void mirror (Axis axis)
void scale_geometry_after_creation (const Vec3f &versor)
void scale_geometry_after_creation (const float scale)
void center_geometry_after_creation (bool update_source_offset=true)
void calculate_convex_hull ()
const TriangleMesh & get_convex_hull () const
const std::shared_ptr< const TriangleMesh > & get_convex_hull_shared_ptr () const
const Polygon & get_convex_hull_2d (const Transform3d &trafo_instance) const
void invalidate_convex_hull_2d ()
int get_repaired_errors_count () const
const Geometry::Transformation & get_transformation () const
void set_transformation (const Geometry::Transformation &transformation)
void set_transformation (const Transform3d &trafo)
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)
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 convert_from_imperial_units ()
void convert_from_meters ()
const Transform3d & get_matrix () const
Transform3d get_matrix_no_offset () const
void set_new_unique_id ()
bool is_fdm_support_painted () const
bool is_seam_painted () const
bool is_mm_painted () const
bool is_fuzzy_skin_painted () const
bool is_texture_displacement_painted () const
bool is_any_painted () const
std::vector< size_t > get_extruders_from_multi_material_painting () const
ObjectID id () const
virtual Timestamp timestamp () const

Static Public Member Functions

static ModelVolumeType type_from_string (const std::string &s)
static std::string type_to_string (const ModelVolumeType t)

Public Attributes

std::string name
Source source
CutInfo cut_info
ModelConfigObject config
FacetsAnnotation supported_facets
FacetsAnnotation seam_facets
FacetsAnnotation mmu_segmentation_facets
FacetsAnnotation fuzzy_skin_facets
FacetsAnnotation texture_displacement_facets_0
FacetsAnnotation texture_displacement_facets_1
FacetsAnnotation texture_displacement_facets_2
FacetsAnnotation texture_displacement_facets_3
FacetsAnnotation texture_displacement_facets_4
FacetsAnnotation texture_displacement_facets_5
FacetsAnnotation texture_displacement_facets_6
FacetsAnnotation texture_displacement_facets_7
std::vector< TextureDisplacementLayer > texture_displacement_layers
TextureDisplacementOptions texture_displacement_options
std::vector< Vec2f > texture_uv
std::vector< int > mmuseg_extruders
Timestamp mmuseg_ts
std::optional< TextConfiguration > text_configuration
std::optional< EmbossShape > emboss_shape

Protected Member Functions

 ModelVolume (const ModelVolume &rhs)=default
void set_model_object (ModelObject *model_object)
void assign_new_unique_ids_recursive () override
void transform_this_mesh (const Transform3d &t, bool fix_left_handed)
void transform_this_mesh (const Matrix3d &m, bool fix_left_handed)
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)

Private Member Functions

void calculate_convex_hull_2d (const Geometry::Transformation &transformation) const
 ModelVolume (ModelObject *object, const TriangleMesh &mesh, ModelVolumeType type=ModelVolumeType::MODEL_PART)
 ModelVolume (ModelObject *object, const std::shared_ptr< const TriangleMesh > &mesh, ModelVolumeType type=ModelVolumeType::MODEL_PART)
 ModelVolume (ModelObject *object, TriangleMesh &&mesh, TriangleMesh &&convex_hull, ModelVolumeType type=ModelVolumeType::MODEL_PART)
 ModelVolume (ModelObject *object, const ModelVolume &other)
 ModelVolume (ModelObject *object, const ModelVolume &other, TriangleMesh &&mesh)
ModelVolume & operator= (ModelVolume &rhs)=delete
 ModelVolume ()
template<class Archive>
void load (Archive &ar)
template<class Archive>
void save (Archive &ar) const
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

ModelObject * object
std::shared_ptr< const TriangleMesh > m_mesh
ModelVolumeType m_type
t_model_material_id m_material_id
std::shared_ptr< const TriangleMesh > m_convex_hull
Polygon m_convex_hull_2d
Transform3d m_cached_trans_matrix
Polygon m_cached_2d_polygon
Geometry::Transformation m_transformation
int m_is_splittable { -1 }
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
void model_volume_list_update_supports_and_seams (ModelObject &model_object_dst, const ModelObject &model_object_new)

Detailed Description

Member Typedef Documentation

◆ Timestamp

using Slic3r::ObjectBase::Timestamp = uint64_t
inherited

Constructor & Destructor Documentation

◆ ModelVolume() [1/7]

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

References ModelVolume().

Referenced by ModelVolume(), ModelVolume(), ModelVolume(), is_the_only_one_part(), model_volume_list_update_supports_and_seams, operator=(), split(), and texture_displacement_facet().

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

◆ ModelVolume() [2/7]

Slic3r::ModelVolume::ModelVolume ( ModelObject * object,
const TriangleMesh & mesh,
ModelVolumeType type = ModelVolumeType::MODEL_PART )
inlineprivate
1205 : m_mesh(new TriangleMesh(mesh)), m_type(type), object(object)
1206 {
1207 assert(this->id().valid());
1208 assert(this->config.id().valid());
1209 assert(this->supported_facets.id().valid());
1210 assert(this->seam_facets.id().valid());
1211 assert(this->mmu_segmentation_facets.id().valid());
1212 assert(this->fuzzy_skin_facets.id().valid());
1214 assert(this->id() != this->config.id());
1215 assert(this->id() != this->supported_facets.id());
1216 assert(this->id() != this->seam_facets.id());
1217 assert(this->id() != this->mmu_segmentation_facets.id());
1218 assert(this->id() != this->fuzzy_skin_facets.id());
1219 if (mesh.facets_count() > 1)
1221 }
void calculate_convex_hull()
Definition Model.cpp:2811
const TriangleMesh & mesh() const
Definition Model.hpp:892
std::shared_ptr< const TriangleMesh > m_mesh
Definition Model.hpp:1184
FacetsAnnotation mmu_segmentation_facets
Definition Model.hpp:913
FacetsAnnotation fuzzy_skin_facets
Definition Model.hpp:916
FacetsAnnotation supported_facets
Definition Model.hpp:907
FacetsAnnotation seam_facets
Definition Model.hpp:910
ModelConfigObject config
Definition Model.hpp:904
ModelVolumeType type() const
Definition Model.hpp:1023
ModelObject * object
Definition Model.hpp:1182
ModelVolumeType m_type
Definition Model.hpp:1186
bool texture_displacement_facets_ids_valid() const
Definition Model.hpp:952

References calculate_convex_hull(), Slic3r::ObjectBase::id(), m_mesh, m_type, mesh(), Slic3r::MODEL_PART, ModelObject, object, texture_displacement_facets_ids_valid(), type(), and Slic3r::ObjectID::valid().

Here is the call graph for this function:

◆ ModelVolume() [3/7]

Slic3r::ModelVolume::ModelVolume ( ModelObject * object,
const std::shared_ptr< const TriangleMesh > & mesh,
ModelVolumeType type = ModelVolumeType::MODEL_PART )
inlineprivate
1222 : m_mesh(mesh), m_type(type), object(object)
1223 {
1224 assert(this->id().valid());
1225 assert(this->config.id().valid());
1226 assert(this->supported_facets.id().valid());
1227 assert(this->seam_facets.id().valid());
1228 assert(this->mmu_segmentation_facets.id().valid());
1229 assert(this->fuzzy_skin_facets.id().valid());
1231 assert(this->id() != this->config.id());
1232 assert(this->id() != this->supported_facets.id());
1233 assert(this->id() != this->seam_facets.id());
1234 assert(this->id() != this->mmu_segmentation_facets.id());
1235 assert(this->id() != this->fuzzy_skin_facets.id());
1236 }

References Slic3r::ObjectBase::id(), m_mesh, m_type, mesh(), Slic3r::MODEL_PART, ModelObject, object, texture_displacement_facets_ids_valid(), type(), and Slic3r::ObjectID::valid().

Here is the call graph for this function:

◆ ModelVolume() [4/7]

Slic3r::ModelVolume::ModelVolume ( ModelObject * object,
TriangleMesh && mesh,
TriangleMesh && convex_hull,
ModelVolumeType type = ModelVolumeType::MODEL_PART )
inlineprivate
1237 :
1238 m_mesh(new TriangleMesh(std::move(mesh))), m_convex_hull(new TriangleMesh(std::move(convex_hull))), m_type(type), object(object) {
1239 assert(this->id().valid());
1240 assert(this->config.id().valid());
1241 assert(this->supported_facets.id().valid());
1242 assert(this->seam_facets.id().valid());
1243 assert(this->mmu_segmentation_facets.id().valid());
1244 assert(this->fuzzy_skin_facets.id().valid());
1246 assert(this->id() != this->config.id());
1247 assert(this->id() != this->supported_facets.id());
1248 assert(this->id() != this->seam_facets.id());
1249 assert(this->id() != this->mmu_segmentation_facets.id());
1250 assert(this->id() != this->fuzzy_skin_facets.id());
1251 }
std::shared_ptr< const TriangleMesh > m_convex_hull
Definition Model.hpp:1189
Polygon convex_hull(Points pts)
Definition ConvexHull.cpp:21

References Slic3r::Geometry::convex_hull(), Slic3r::ObjectBase::id(), m_convex_hull, m_mesh, m_type, mesh(), Slic3r::MODEL_PART, ModelObject, object, texture_displacement_facets_ids_valid(), type(), and Slic3r::ObjectID::valid().

Here is the call graph for this function:

◆ ModelVolume() [5/7]

Slic3r::ModelVolume::ModelVolume ( ModelObject * object,
const ModelVolume & other )
inlineprivate
1254 :
1255 ObjectBase(other),
1256 name(other.name), source(other.source), m_mesh(other.m_mesh), m_convex_hull(other.m_convex_hull),
1257 config(other.config), m_type(other.m_type), object(object), m_transformation(other.m_transformation),
1258 supported_facets(other.supported_facets), seam_facets(other.seam_facets), mmu_segmentation_facets(other.mmu_segmentation_facets),
1259 fuzzy_skin_facets(other.fuzzy_skin_facets),
1260 texture_displacement_facets_0(other.texture_displacement_facets_0), texture_displacement_facets_1(other.texture_displacement_facets_1),
1261 texture_displacement_facets_2(other.texture_displacement_facets_2), texture_displacement_facets_3(other.texture_displacement_facets_3),
1262 texture_displacement_facets_4(other.texture_displacement_facets_4), texture_displacement_facets_5(other.texture_displacement_facets_5),
1263 texture_displacement_facets_6(other.texture_displacement_facets_6), texture_displacement_facets_7(other.texture_displacement_facets_7),
1264 texture_displacement_layers(other.texture_displacement_layers),
1265 texture_displacement_options(other.texture_displacement_options),
1266 texture_uv(other.texture_uv),
1267 cut_info(other.cut_info), text_configuration(other.text_configuration), emboss_shape(other.emboss_shape)
1268 {
1269 assert(this->id().valid());
1270 assert(this->config.id().valid());
1271 assert(this->supported_facets.id().valid());
1272 assert(this->seam_facets.id().valid());
1273 assert(this->mmu_segmentation_facets.id().valid());
1274 assert(this->fuzzy_skin_facets.id().valid());
1275 assert(this->id() != this->config.id());
1276 assert(this->id() != this->supported_facets.id());
1277 assert(this->id() != this->seam_facets.id());
1278 assert(this->id() != this->mmu_segmentation_facets.id());
1279 assert(this->id() == other.id());
1280 assert(this->config.id() == other.config.id());
1281 assert(this->supported_facets.id() == other.supported_facets.id());
1282 assert(this->seam_facets.id() == other.seam_facets.id());
1283 assert(this->mmu_segmentation_facets.id() == other.mmu_segmentation_facets.id());
1284 assert(this->fuzzy_skin_facets.id() == other.fuzzy_skin_facets.id());
1285 this->set_material_id(other.material_id());
1286 }
FacetsAnnotation texture_displacement_facets_6
Definition Model.hpp:934
Geometry::Transformation m_transformation
Definition Model.hpp:1194
FacetsAnnotation texture_displacement_facets_5
Definition Model.hpp:933
FacetsAnnotation texture_displacement_facets_7
Definition Model.hpp:935
CutInfo cut_info
Definition Model.hpp:883
void set_material_id(t_model_material_id material_id)
Definition Model.cpp:2669
FacetsAnnotation texture_displacement_facets_1
Definition Model.hpp:929
std::vector< TextureDisplacementLayer > texture_displacement_layers
Definition Model.hpp:974
FacetsAnnotation texture_displacement_facets_3
Definition Model.hpp:931
FacetsAnnotation texture_displacement_facets_4
Definition Model.hpp:932
TextureDisplacementOptions texture_displacement_options
Definition Model.hpp:979
std::string name
Definition Model.hpp:834
FacetsAnnotation texture_displacement_facets_2
Definition Model.hpp:930
std::vector< Vec2f > texture_uv
Definition Model.hpp:994
Source source
Definition Model.hpp:853
FacetsAnnotation texture_displacement_facets_0
Definition Model.hpp:928
std::optional< EmbossShape > emboss_shape
Definition Model.hpp:1019
std::optional< TextConfiguration > text_configuration
Definition Model.hpp:1015
ObjectBase()
Definition ObjectID.hpp:79

References ModelVolume(), Slic3r::ObjectBase::ObjectBase(), config, cut_info, emboss_shape, fuzzy_skin_facets, Slic3r::ObjectBase::id(), m_convex_hull, m_mesh, m_transformation, m_type, material_id(), mmu_segmentation_facets, ModelObject, name, object, seam_facets, set_material_id(), source, supported_facets, text_configuration, texture_displacement_facets_0, texture_displacement_facets_1, texture_displacement_facets_2, texture_displacement_facets_3, texture_displacement_facets_4, texture_displacement_facets_5, texture_displacement_facets_6, texture_displacement_facets_7, texture_displacement_layers, texture_displacement_options, texture_uv, and Slic3r::ObjectID::valid().

Here is the call graph for this function:

◆ ModelVolume() [6/7]

Slic3r::ModelVolume::ModelVolume ( ModelObject * object,
const ModelVolume & other,
TriangleMesh && mesh )
inlineprivate
1288 :
1289 name(other.name), source(other.source), config(other.config), object(object), m_mesh(new TriangleMesh(std::move(mesh))), m_type(other.m_type), m_transformation(other.m_transformation),
1290 cut_info(other.cut_info), text_configuration(other.text_configuration), emboss_shape(other.emboss_shape)
1291 {
1292 assert(this->id().valid());
1293 assert(this->config.id().valid());
1294 assert(this->supported_facets.id().valid());
1295 assert(this->seam_facets.id().valid());
1296 assert(this->mmu_segmentation_facets.id().valid());
1297 assert(this->fuzzy_skin_facets.id().valid());
1298 assert(this->id() != this->config.id());
1299 assert(this->id() != this->supported_facets.id());
1300 assert(this->id() != this->seam_facets.id());
1301 assert(this->id() != this->mmu_segmentation_facets.id());
1302 assert(this->id() != this->fuzzy_skin_facets.id());
1303 assert(this->id() != other.id());
1304 assert(this->config.id() == other.config.id());
1305 this->set_material_id(other.material_id());
1306 this->config.set_new_unique_id();
1307 if (m_mesh->facets_count() > 1)
1309 assert(this->config.id().valid());
1310 assert(this->config.id() != other.config.id());
1311 assert(this->supported_facets.id() != other.supported_facets.id());
1312 assert(this->seam_facets.id() != other.seam_facets.id());
1313 assert(this->mmu_segmentation_facets.id() != other.mmu_segmentation_facets.id());
1314 assert(this->fuzzy_skin_facets.id() != other.fuzzy_skin_facets.id());
1315 assert(this->id() != this->config.id());
1316 assert(this->supported_facets.empty());
1317 assert(this->seam_facets.empty());
1318 assert(this->mmu_segmentation_facets.empty());
1319 assert(this->fuzzy_skin_facets.empty());
1321 assert(this->texture_displacement_layers.empty());
1322 }
bool texture_displacement_facets_all_empty() const
Definition Model.hpp:964

References ModelVolume(), calculate_convex_hull(), config, cut_info, emboss_shape, Slic3r::FacetsAnnotation::empty(), fuzzy_skin_facets, Slic3r::ObjectBase::id(), m_mesh, m_transformation, m_type, material_id(), mesh(), mmu_segmentation_facets, ModelObject, name, object, seam_facets, set_material_id(), Slic3r::ObjectBase::set_new_unique_id(), source, supported_facets, text_configuration, texture_displacement_facets_all_empty(), and Slic3r::ObjectID::valid().

Here is the call graph for this function:

◆ ModelVolume() [7/7]

Slic3r::ModelVolume::ModelVolume ( )
inlineprivate
1332 object(nullptr) {
1333 assert(this->id().invalid());
1334 assert(this->config.id().invalid());
1335 assert(this->supported_facets.id().invalid());
1336 assert(this->seam_facets.id().invalid());
1337 assert(this->mmu_segmentation_facets.id().invalid());
1338 assert(this->fuzzy_skin_facets.id().invalid());
1340 }
bool texture_displacement_facets_ids_invalid() const
Definition Model.hpp:958

References Slic3r::ObjectBase::ObjectBase(), config, fuzzy_skin_facets, Slic3r::ObjectBase::id(), Slic3r::ObjectID::invalid(), mmu_segmentation_facets, object, seam_facets, supported_facets, texture_displacement_facets_0, texture_displacement_facets_1, texture_displacement_facets_2, texture_displacement_facets_3, texture_displacement_facets_4, texture_displacement_facets_5, texture_displacement_facets_6, texture_displacement_facets_7, and texture_displacement_facets_ids_invalid().

Here is the call graph for this function:

Member Function Documentation

◆ assign_new_unique_ids_recursive()

void Slic3r::ModelVolume::assign_new_unique_ids_recursive ( )
overrideprotectedvirtual

Reimplemented from Slic3r::ObjectBase.

3073{
3075 config.set_new_unique_id();
3076 supported_facets.set_new_unique_id();
3077 seam_facets.set_new_unique_id();
3078 mmu_segmentation_facets.set_new_unique_id();
3079 fuzzy_skin_facets.set_new_unique_id();
3080 // As set_new_unique_id() already does: the undo/redo stack stores FacetsAnnotation contents keyed
3081 // by ObjectID, so a clone left sharing these ids with its source can be handed the source's mask
3082 // on an undo - after which a paint mask and the mesh it was recorded against no longer match.
3083 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
3085}
FacetsAnnotation & texture_displacement_facet(int slot)
Definition Model.hpp:937
void set_new_unique_id()
Definition ObjectID.hpp:89
static constexpr size_t TEXTURE_DISPLACEMENT_MAX_LAYERS
Definition TextureDisplacement.hpp:44

References assign_new_unique_ids_recursive(), config, fuzzy_skin_facets, mmu_segmentation_facets, seam_facets, Slic3r::ObjectBase::set_new_unique_id(), supported_facets, texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by Slic3r::ModelObject::assign_new_unique_ids_recursive(), and assign_new_unique_ids_recursive().

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

◆ calculate_convex_hull()

void Slic3r::ModelVolume::calculate_convex_hull ( )
2812{
2813 m_convex_hull = std::make_shared<TriangleMesh>(this->mesh().convex_hull_3d());
2814 assert(m_convex_hull.get());
2815}

References calculate_convex_hull(), and m_convex_hull.

Referenced by ModelVolume(), ModelVolume(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::apply_painted_mesh_to_volume(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), calculate_convex_hull(), anonymous_namespace{EmbossJob.cpp}::create_volume(), load(), repair(), scale_geometry_after_creation(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), and Slic3r::GUI::Emboss::UpdateJob::update_volume().

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

◆ calculate_convex_hull_2d()

void Slic3r::ModelVolume::calculate_convex_hull_2d ( const Geometry::Transformation & transformation) const
private
2819{
2820 const indexed_triangle_set &its = m_convex_hull->its;
2821 if (its.vertices.empty())
2822 return;
2823
2824 Points pts;
2825 Transform3d new_matrix = transformation.get_matrix_no_offset();
2826
2827 pts.reserve(its.vertices.size());
2828 // Using the shared vertices should be a bit quicker than using the STL faces.
2829 for (size_t i = 0; i < its.vertices.size(); ++ i) {
2830 Vec3d p = new_matrix * its.vertices[i].cast<double>();
2831 pts.emplace_back(coord_t(scale_(p.x())), coord_t(scale_(p.y())));
2832 }
2833 //TODO, do we need to remove the duplicate points before convex_hull?
2835
2837 m_convex_hull_2d.translate(scale_(transformation.get_offset(X)), scale_(transformation.get_offset(Y)));
2838 //int size = m_cached_2d_polygon.size();
2839 //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": size %1%, offset {%2%, %3%}")% size% transformation.get_offset(X)% transformation.get_offset(Y);
2840 //for (int i = 0; i < size; i++)
2841 // BOOST_LOG_TRIVIAL(info) << boost::format(": point %1%, position {%2%, %3%}")% i% m_cached_2d_polygon[i].x()% m_cached_2d_polygon[i].y();
2842 //m_convex_hull_2d.rotate(transformation.get_rotation(Z));
2843 //m_convex_hull_2d.scale(transformation.get_scaling_factor(X), transformation.get_scaling_factor(Y));
2844}
Polygon m_convex_hull_2d
Definition Model.hpp:1191
Polygon m_cached_2d_polygon
Definition Model.hpp:1193
#define scale_(val)
Definition libslic3r.h:106
int64_t coord_t
Definition libslic3r.h:48
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
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73
@ Y
Definition libslic3r.h:142
@ X
Definition libslic3r.h:141

References calculate_convex_hull_2d(), Slic3r::Geometry::convex_hull(), Slic3r::Geometry::Transformation::get_matrix_no_offset(), Slic3r::Geometry::Transformation::get_offset(), m_cached_2d_polygon, m_convex_hull, m_convex_hull_2d, scale_, Slic3r::X, and Slic3r::Y.

Referenced by calculate_convex_hull_2d(), and get_convex_hull_2d().

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

◆ center_geometry_after_creation()

void Slic3r::ModelVolume::center_geometry_after_creation ( bool update_source_offset = true)
2794{
2795 Vec3d shift = this->mesh().bounding_box().center();
2796 if (!shift.isApprox(Vec3d::Zero()))
2797 {
2798 if (m_mesh) {
2799 const_cast<TriangleMesh*>(m_mesh.get())->translate(-(float)shift(0), -(float)shift(1), -(float)shift(2));
2800 const_cast<TriangleMesh*>(m_mesh.get())->set_init_shift(shift);
2801 }
2802 if (m_convex_hull)
2803 const_cast<TriangleMesh*>(m_convex_hull.get())->translate(-(float)shift(0), -(float)shift(1), -(float)shift(2));
2804 translate(shift);
2805 }
2806
2807 if (update_source_offset)
2808 source.mesh_offset = shift;
2809}
PointType center() const
Definition BoundingBox.cpp:237
void translate(double x, double y, double z)
Definition Model.hpp:1073
BoundingBoxf3 bounding_box() const
Definition TriangleMesh.cpp:447

References Slic3r::TriangleMesh::bounding_box(), Slic3r::BoundingBox3Base< PointType >::center(), center_geometry_after_creation(), m_convex_hull, m_mesh, Slic3r::TriangleMesh::set_init_shift(), source, translate(), and Slic3r::TriangleMesh::translate().

Referenced by Slic3r::ModelObject::add_volume(), Slic3r::ModelObject::add_volume(), Slic3r::ModelObject::add_volume(), Slic3r::apply_painted_mesh_to_volume(), and center_geometry_after_creation().

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

◆ clear_cache()

void Slic3r::ModelVolume::clear_cache ( )
inline
1052 {
1053 m_cached_trans_matrix = Transform3d::Identity().inverse(); // get unvelivable matrix
1054 m_convex_hull_2d.clear();
1055 m_cached_2d_polygon.clear();
1056 };
Transform3d m_cached_trans_matrix
Definition Model.hpp:1192

References m_cached_2d_polygon, m_cached_trans_matrix, and m_convex_hull_2d.

Referenced by set_mirror(), set_mirror(), set_offset(), set_offset(), set_rotation(), set_rotation(), set_scaling_factor(), set_scaling_factor(), set_transformation(), and set_transformation().

Here is the caller graph for this function:

◆ convert_from_imperial_units()

void Slic3r::ModelVolume::convert_from_imperial_units ( )
3152{
3153 assert(! this->source.is_converted_from_meters);
3154 this->scale_geometry_after_creation(25.4f);
3155 this->set_offset(Vec3d(0, 0, 0));
3156 this->source.is_converted_from_inches = true;
3157}
void scale_geometry_after_creation(const Vec3f &versor)
Definition Model.cpp:3117
void set_offset(const Vec3d &offset)
Definition Model.hpp:1115

References convert_from_imperial_units(), scale_geometry_after_creation(), set_offset(), and source.

Referenced by convert_from_imperial_units(), Slic3r::GUI::Plater::priv::reload_from_disk(), and Slic3r::GUI::Plater::priv::replace_volume_with_stl().

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

◆ convert_from_meters()

void Slic3r::ModelVolume::convert_from_meters ( )
3160{
3161 assert(! this->source.is_converted_from_inches);
3162 this->scale_geometry_after_creation(1000.f);
3163 this->set_offset(Vec3d(0, 0, 0));
3164 this->source.is_converted_from_meters = true;
3165}

References convert_from_meters(), scale_geometry_after_creation(), set_offset(), and source.

Referenced by convert_from_meters(), Slic3r::GUI::Plater::priv::reload_from_disk(), and Slic3r::GUI::Plater::priv::replace_volume_with_stl().

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:

◆ extruder_id()

int Slic3r::ModelVolume::extruder_id ( ) const
2691{
2692 int extruder_id = -1;
2693 //if (this->is_model_part())
2694 {
2695 const ConfigOption *opt = this->config.option("extruder");
2696 if ((opt == nullptr) || (opt->getInt() == 0))
2697 opt = this->object->config.option("extruder");
2698 extruder_id = (opt == nullptr) ? 1 : opt->getInt();
2699 }
2700 return extruder_id;
2701}
int extruder_id() const
Definition Model.cpp:2690

References config, and extruder_id().

Referenced by extruder_id(), Slic3r::GUI::get_extruder_id_for_volumes(), get_extruders(), Slic3r::Model::getThermalLength(), Slic3r::GUI::GLGizmoMmuSegmentation::init_model_triangle_selectors(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::GLVolume::simple_render(), split(), update_extruder_count(), and update_extruder_count_when_delete_filament().

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_convex_hull()

const TriangleMesh & Slic3r::ModelVolume::get_convex_hull ( ) const
2905{
2906 return *m_convex_hull.get();
2907}

References get_convex_hull(), and m_convex_hull.

Referenced by Slic3r::ModelInstance::calc_print_volume_state(), get_convex_hull(), Slic3r::CLI::run(), Slic3r::GUI::Plater::show_object_info(), transform_this_mesh(), and transform_this_mesh().

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

◆ get_convex_hull_2d()

const Polygon & Slic3r::ModelVolume::get_convex_hull_2d ( const Transform3d & trafo_instance) const
2847{
2848 Transform3d new_matrix;
2849
2850 new_matrix = trafo_instance * m_transformation.get_matrix();
2851
2852 auto need_recompute = [](Geometry::Transformation& old_transform, Geometry::Transformation& new_transform)->bool {
2853 //double old_rot_x = old_transform.get_rotation(X);
2854 //double old_rot_y = old_transform.get_rotation(Y);
2855 //double new_rot_x = new_transform.get_rotation(X);
2856 //double new_rot_y = new_transform.get_rotation(Y);
2857 const Vec3d &old_rotation = old_transform.get_rotation();
2858 const Vec3d &new_rotation = new_transform.get_rotation();
2859 const Vec3d &old_mirror = old_transform.get_mirror();
2860 const Vec3d &new_mirror = new_transform.get_mirror();
2861 const Vec3d &old_scaling = old_transform.get_scaling_factor();
2862 const Vec3d &new_scaling = new_transform.get_scaling_factor();
2863
2864 if ((old_scaling != new_scaling) || (old_rotation != new_rotation) || (old_mirror != new_mirror))
2865 return true;
2866 else
2867 return false;
2868 };
2869
2870 if ((new_matrix.matrix() != m_cached_trans_matrix.matrix()) || !m_convex_hull_2d.is_valid())
2871 {
2872 Geometry::Transformation new_trans(new_matrix), old_trans(m_cached_trans_matrix);
2873
2874 if (need_recompute(old_trans, new_trans) || !m_convex_hull_2d.is_valid())
2875 {
2876 //need to update
2877 calculate_convex_hull_2d(new_trans);
2878 }
2879 else
2880 {
2882 m_convex_hull_2d.translate(scale_(new_trans.get_offset(X)), scale_(new_trans.get_offset(Y)));
2883 //m_convex_hull_2d.rotate(new_trans.get_rotation(Z));
2884 //m_convex_hull_2d.scale(new_trans.get_scaling_factor(X), new_trans.get_scaling_factor(Y));
2885 //int size = m_cached_2d_polygon.size();
2886 //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": use previous cached, size %1%, offset {%2%, %3%}")% size% new_trans.get_offset(X)% new_trans.get_offset(Y);
2887 //for (int i = 0; i < size; i++)
2888 // BOOST_LOG_TRIVIAL(info) << boost::format(": point %1%, position {%2%, %3%}")% i% m_cached_2d_polygon[i].x()% m_cached_2d_polygon[i].y();
2889 }
2890 m_cached_trans_matrix = new_matrix;
2891 }
2892
2893 return m_convex_hull_2d;
2894}
void calculate_convex_hull_2d(const Geometry::Transformation &transformation) const
Definition Model.cpp:2818

References calculate_convex_hull_2d(), get_convex_hull_2d(), Slic3r::Geometry::Transformation::get_mirror(), Slic3r::Geometry::Transformation::get_rotation(), Slic3r::Geometry::Transformation::get_scaling_factor(), m_cached_2d_polygon, m_cached_trans_matrix, m_convex_hull_2d, m_transformation, scale_, Slic3r::X, and Slic3r::Y.

Referenced by get_convex_hull_2d().

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

◆ get_convex_hull_shared_ptr()

const std::shared_ptr< const TriangleMesh > & Slic3r::ModelVolume::get_convex_hull_shared_ptr ( ) const
inline
1092{ return m_convex_hull; }

References m_convex_hull.

Referenced by Slic3r::GLVolumeCollection::load_object_volume().

Here is the caller graph for this function:

◆ get_extruders()

std::vector< int > Slic3r::ModelVolume::get_extruders ( ) const
2714{
2719 || this->is_precise_seam()) // Precise Seam is non-printing helper geometry
2720 return std::vector<int>();
2721
2722 if (mmu_segmentation_facets.timestamp() != mmuseg_ts) {
2723 std::vector<indexed_triangle_set> its_per_type;
2724 mmuseg_extruders.clear();
2725 mmuseg_ts = mmu_segmentation_facets.timestamp();
2726 mmu_segmentation_facets.get_facets(*this, its_per_type);
2727 for (int idx = 1; idx < its_per_type.size(); idx++) {
2728 indexed_triangle_set& its = its_per_type[idx];
2729 if (its.indices.empty())
2730 continue;
2731
2732 mmuseg_extruders.push_back(idx);
2733 }
2734 }
2735
2736 std::vector<int> volume_extruders = mmuseg_extruders;
2737
2738 int volume_extruder_id = this->extruder_id();
2739 if (volume_extruder_id > 0)
2740 volume_extruders.push_back(volume_extruder_id);
2741
2742 return volume_extruders;
2743}
Timestamp mmuseg_ts
Definition Model.hpp:1011
bool is_precise_seam() const
Definition Model.hpp:1032
std::vector< int > mmuseg_extruders
Definition Model.hpp:1010
@ SUPPORT_BLOCKER
Definition Model.hpp:360
@ INVALID
Definition Model.hpp:356
@ NEGATIVE_VOLUME
Definition Model.hpp:358
@ SUPPORT_ENFORCER
Definition Model.hpp:361

References extruder_id(), get_extruders(), Slic3r::INVALID, is_precise_seam(), m_type, mmu_segmentation_facets, mmuseg_extruders, mmuseg_ts, Slic3r::NEGATIVE_VOLUME, Slic3r::SUPPORT_BLOCKER, and Slic3r::SUPPORT_ENFORCER.

Referenced by Slic3r::Print::append_model_object_extruders(), Slic3r::GLVolumeCollection::check_outside_state(), construct_assemble_list(), Slic3r::GUI::ensure_belt_purge_tower(), Slic3r::GUI::PartPlate::exclusion_volume_preview_cache_key(), Slic3r::ModelInstance::get_arrange_polygon(), Slic3r::GUI::PartPlate::get_extruders(), get_extruders(), Slic3r::GUI::PartPlate::get_extruders_under_cli(), Slic3r::GUI::PartPlate::get_extruders_without_support(), Slic3r::PrintObject::object_extruders(), Slic3r::GUI::anonymous_namespace{PublishSettingsDialog.cpp}::project_used_filament_slots(), Slic3r::CLI::run(), update_extruder_count(), and update_extruder_count_when_delete_filament().

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

◆ get_extruders_from_multi_material_painting()

std::vector< size_t > Slic3r::ModelVolume::get_extruders_from_multi_material_painting ( ) const
3169 {
3170 if (!this->is_mm_painted())
3171 return {};
3172
3173 const TriangleSelector::TriangleSplittingData &data = this->mmu_segmentation_facets.get_data();
3174
3175 std::vector<size_t> extruders;
3176 for (size_t state_idx = static_cast<size_t>(EnforcerBlockerType::Extruder1); state_idx < data.used_states.size(); ++state_idx) {
3177 if (data.used_states[state_idx])
3178 extruders.emplace_back(state_idx - 1);
3179 }
3180
3181 return extruders;
3182 }
bool is_mm_painted() const
Definition Model.hpp:1155
@ Extruder1
Definition TriangleSelector.hpp:34

References Slic3r::Extruder1, get_extruders_from_multi_material_painting(), is_mm_painted(), mmu_segmentation_facets, and Slic3r::TriangleSelector::TriangleSplittingData::used_states.

Referenced by get_extruders_from_multi_material_painting().

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

◆ get_matrix()

const Transform3d & Slic3r::ModelVolume::get_matrix ( ) const
inline
1139{ return m_transformation.get_matrix(); }

References m_transformation.

Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_object_components_to_stream(), Slic3r::GUI::ObjectList::apply_object_instance_transfrom_to_all_volumes(), Slic3r::GUI::GLGizmoTextureDisplacement::apply_projection_frame(), Slic3r::GUI::ObjectList::boolean(), Slic3r::GUI::PartPlate::calc_imex_ghosts(), Slic3r::ModelInstance::calc_print_volume_state(), Slic3r::GUI::GLGizmoTextureDisplacement::capture_view_projection(), Slic3r::GUI::Plater::combine_mesh_fff(), Slic3r::distribute_modifiers_from_object(), Slic3r::GUI::do_local_z_rotate(), Slic3r::GUI::PartPlate::exclusion_volume_preview_cache_key(), Slic3r::GUI::Plater::export_stl(), Slic3r::GUI::face_selected_volume_to_camera(), Slic3r::GUI::GLGizmoMeshBoolean::gizmo_event(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::ModelInstance::intersects_bed_exclude_region(), Slic3r::GUI::ObjectList::merge(), Slic3r::merge_solid_parts_inside_object(), Slic3r::GUI::GLGizmoPainterBase::mesh_trafo_matrices(), Slic3r::csg::model_to_csgmesh(), Slic3r::model_volume_list_changed(), model_volume_list_update_supports_and_seams, Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), Slic3r::GUI::Selection::paste_volumes_from_clipboard(), Slic3r::Cut::perform_with_plane(), Slic3r::process_connector_cut(), Slic3r::process_modifier_cut(), Slic3r::process_volume_cut(), Slic3r::GUI::GLGizmoTextureDisplacement::render_adjust_texture_gizmo(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_height_range(), Slic3r::GUI::GLGizmoTextureDisplacement::render_island_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painted_colors(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painter_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_seam_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_shaded_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_subdivide_preview(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoTextureDisplacement::render_uvcheck_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_wireframe_overlay(), Slic3r::CLI::run(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_edge_at(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_vertex_at(), Slic3r::GUI::GLGizmoTextureDisplacement::select_visible_faces(), Slic3r::GUI::Plater::show_object_info(), Slic3r::slice_volume(), Slic3r::ModelObject::split(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), Slic3r::GUI::Emboss::start_update_volume(), Slic3r::texture_displacement_volume_to_world(), Slic3r::GUI::GLGizmoFlatten::update_planes(), and anonymous_namespace{EmbossJob.cpp}::update_volume().

◆ get_matrix_no_offset()

Transform3d Slic3r::ModelVolume::get_matrix_no_offset ( ) const
inline
1140{ return m_transformation.get_matrix_no_offset(); }

References m_transformation.

Referenced by Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), and Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle().

Here is the caller graph for this function:

◆ get_mesh_shared_ptr()

const std::shared_ptr< const TriangleMesh > & Slic3r::ModelVolume::get_mesh_shared_ptr ( ) const
inline
901{ return m_mesh; }

References m_mesh.

◆ get_mirror() [1/2]

Vec3d Slic3r::ModelVolume::get_mirror ( ) const
inline
1130{ return m_transformation.get_mirror(); }

References m_transformation.

Referenced by mirror().

Here is the caller graph for this function:

◆ get_mirror() [2/2]

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

References m_transformation.

◆ get_object()

◆ get_offset() [1/2]

Vec3d Slic3r::ModelVolume::get_offset ( ) const
inline
1111{ return m_transformation.get_offset(); }

References m_transformation.

Referenced by Slic3r::apply_tolerance(), Slic3r::ModelObject::split(), split(), and translate().

Here is the caller graph for this function:

◆ get_offset() [2/2]

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

References m_transformation.

◆ get_repaired_errors_count()

int Slic3r::ModelVolume::get_repaired_errors_count ( ) const
2897{
2898 const RepairedMeshErrors &stats = this->mesh().stats().repaired_errors;
2899
2900 return stats.degenerate_facets + stats.edges_fixed + stats.facets_removed +
2901 stats.facets_reversed + stats.backwards_edges;
2902}
const TriangleMeshStats & stats() const
Definition TriangleMesh.hpp:159
int degenerate_facets
Definition TriangleMesh.hpp:29
RepairedMeshErrors repaired_errors
Definition TriangleMesh.hpp:66

References Slic3r::RepairedMeshErrors::backwards_edges, Slic3r::RepairedMeshErrors::degenerate_facets, Slic3r::RepairedMeshErrors::edges_fixed, Slic3r::RepairedMeshErrors::facets_removed, Slic3r::RepairedMeshErrors::facets_reversed, get_repaired_errors_count(), Slic3r::TriangleMeshStats::repaired_errors, and Slic3r::TriangleMesh::stats().

Referenced by get_repaired_errors_count().

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

◆ get_rotation() [1/2]

Vec3d Slic3r::ModelVolume::get_rotation ( ) const
inline
1118{ return m_transformation.get_rotation(); }

References m_transformation.

Referenced by Slic3r::apply_tolerance(), and rotate().

Here is the caller graph for this function:

◆ get_rotation() [2/2]

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

References m_transformation.

◆ get_scaling_factor() [1/2]

Vec3d Slic3r::ModelVolume::get_scaling_factor ( ) const
inline
1124{ return m_transformation.get_scaling_factor(); }

References m_transformation.

Referenced by Slic3r::apply_tolerance(), and scale().

Here is the caller graph for this function:

◆ get_scaling_factor() [2/2]

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

References m_transformation.

◆ get_transformation()

◆ has_texture_uv()

bool Slic3r::ModelVolume::has_texture_uv ( ) const
inline
996{ return !texture_uv.empty() && texture_uv.size() == mesh().its.indices.size() * 3; }
indexed_triangle_set its
Definition TriangleMesh.hpp:164

References Slic3r::TriangleMesh::its, mesh(), and texture_uv.

Referenced by Slic3r::GUI::GLGizmoTextureDisplacement::add_texture_layer(), Slic3r::apply_painted_mesh_to_volume(), Slic3r::build_texture_displacement(), Slic3r::GUI::GLGizmoTextureDisplacement::model_uv_corners(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), and Slic3r::GUI::texture_displacement_bake_volume().

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

◆ 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.

◆ invalidate_convex_hull_2d()

void Slic3r::ModelVolume::invalidate_convex_hull_2d ( )
inline
1096 {
1097 m_convex_hull_2d.clear();
1098 }

References m_convex_hull_2d.

Referenced by Slic3r::apply_painted_mesh_to_volume(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), repair(), and split().

Here is the caller graph for this function:

◆ invalidate_cut_info()

void Slic3r::ModelVolume::invalidate_cut_info ( )
inline
889{ cut_info.invalidate(); }

References cut_info.

◆ is_any_painted()

bool Slic3r::ModelVolume::is_any_painted ( ) const
inline
1158 {
1160 }
bool is_texture_displacement_painted() const
Definition Model.hpp:1157
bool is_fuzzy_skin_painted() const
Definition Model.hpp:1156
bool is_seam_painted() const
Definition Model.hpp:1154
bool is_fdm_support_painted() const
Definition Model.hpp:1153

References is_fdm_support_painted(), is_fuzzy_skin_painted(), is_mm_painted(), is_seam_painted(), and is_texture_displacement_painted().

Referenced by Slic3r::GUI::ObjectList::boolean(), and save_painting().

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

◆ is_cut_connector()

bool Slic3r::ModelVolume::is_cut_connector ( ) const
inline
888{ return cut_info.is_processed && cut_info.is_connector; }

References cut_info.

Referenced by Slic3r::_BBS_3MF_Exporter::_add_cut_information_file_to_archive(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::can_add_volumes_to_object(), Slic3r::merge_solid_parts_inside_object(), Slic3r::GUI::GLGizmoCut3D::on_is_activable(), and Slic3r::GUI::ObjectList::part_selection_changed().

Here is the caller graph for this function:

◆ is_fdm_support_painted()

bool Slic3r::ModelVolume::is_fdm_support_painted ( ) const
inline
1153{ return !this->supported_facets.empty(); }

References Slic3r::FacetsAnnotation::empty().

Referenced by is_any_painted().

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

◆ is_from_upper()

bool Slic3r::ModelVolume::is_from_upper ( ) const
inline
885{ return cut_info.is_from_upper; }

References cut_info.

Referenced by Slic3r::GUI::GLGizmoCut3D::PartSelection::PartSelection().

Here is the caller graph for this function:

◆ is_fuzzy_skin_painted()

bool Slic3r::ModelVolume::is_fuzzy_skin_painted ( ) const
inline
1156{ return !this->fuzzy_skin_facets.empty(); }

References Slic3r::FacetsAnnotation::empty().

Referenced by is_any_painted().

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

◆ is_left_handed()

bool Slic3r::ModelVolume::is_left_handed ( ) const
inline
1132{ return m_transformation.is_left_handed(); }

References m_transformation.

◆ is_mm_painted()

bool Slic3r::ModelVolume::is_mm_painted ( ) const
inline
1155{ return !this->mmu_segmentation_facets.empty(); }

References Slic3r::FacetsAnnotation::empty().

Referenced by get_extruders_from_multi_material_painting(), and is_any_painted().

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

◆ is_model_part()

bool Slic3r::ModelVolume::is_model_part ( ) const
inline
@ MODEL_PART
Definition Model.hpp:357

References m_type, and Slic3r::MODEL_PART.

Referenced by Slic3r::GUI::GLGizmoCut3D::PartSelection::PartSelection(), Slic3r::GUI::Plater::priv::apply_textured_mesh_import_result(), Slic3r::Print::auto_assign_extruders(), Slic3r::GUI::ObjectList::boolean(), Slic3r::GUI::PartPlate::calc_imex_ghosts(), Slic3r::ModelInstance::calc_print_volume_state(), Slic3r::GUI::can_add_volumes_to_object(), Slic3r::GUI::Plater::combine_mesh_fff(), Slic3r::distribute_modifiers_from_object(), Slic3r::GUI::Plater::export_stl(), anonymous_namespace{EmbossJob.cpp}::find_closest(), Slic3r::find_modifier_volume_extents(), Slic3r::GUI::get_extruder_id_for_volumes(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::GUI::GLGizmoMmuSegmentation::init_model_triangle_selectors(), Slic3r::PaintCLI::inspect_to_json(), Slic3r::ModelInstance::intersects_bed_exclude_region(), Slic3r::GUI::Tab::load_current_preset(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::merge_solid_parts_inside_object(), Slic3r::GUI::GLGizmoPainterBase::mesh_trafo_matrices(), Slic3r::model_has_advanced_features(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::csg::model_to_csgmesh(), Slic3r::GUI::GLGizmoFdmSupports::need_regenerate_support_volumes(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoFuzzySkin::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), Slic3r::GUI::ObjectList::part_selection_changed(), Slic3r::Cut::perform_with_groove(), Slic3r::Cut::perform_with_plane(), Slic3r::region_config_from_model_volume(), Slic3r::GUI::GLGizmoBrimEars::register_single_mesh_pick(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::GUI::CommonGizmosDataObjects::InstancesHider::render_cut(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::CLI::run(), Slic3r::GUI::GLGizmoFdmSupports::run_thread(), save_painting(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::GLGizmoTextureDisplacement::select_whole_model(), Slic3r::slices_to_regions(), Slic3r::PrintObject::slicing_parameters(), Slic3r::GUI::GLGizmoTextureDisplacement::swap_layer_slots(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_parts(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_volume(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_volume_raycaster_index(), Slic3r::GUI::GLGizmoFdmSupports::update_from_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_from_model_object(), Slic3r::GUI::GLGizmoSeam::update_from_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_from_model_object(), Slic3r::GUI::GLGizmoFdmSupports::update_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_model_object(), Slic3r::GUI::GLGizmoMmuSegmentation::update_model_object(), Slic3r::GUI::GLGizmoSeam::update_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_model_object(), Slic3r::Print::update_shrinkage_compensation(), and Slic3r::verify_update_print_object_regions().

◆ is_modifier()

◆ is_negative_volume()

bool Slic3r::ModelVolume::is_negative_volume ( ) const
inline

References m_type, and Slic3r::NEGATIVE_VOLUME.

Referenced by Slic3r::color_from_model_volume(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), and Slic3r::csg::model_to_csgmesh().

Here is the caller graph for this function:

◆ is_precise_seam()

bool Slic3r::ModelVolume::is_precise_seam ( ) const
inline
bool is_precise_seam(ModelVolumeType t)
Definition Model.hpp:373

References Slic3r::is_precise_seam(), and m_type.

Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Importer::_generate_volumes(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::color_from_model_volume(), get_extruders(), Slic3r::PreciseSeam::init_precise_seam_data(), Slic3r::GUI::Selection::Clipboard::is_sla_compliant(), and model_volume_list_update_supports_and_seams.

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

◆ is_precise_seam_strong()

bool Slic3r::ModelVolume::is_precise_seam_strong ( ) const
inline
bool is_precise_seam_strong(ModelVolumeType t)
Definition Model.hpp:374

References Slic3r::is_precise_seam_strong(), and m_type.

Referenced by Slic3r::PreciseSeam::init_precise_seam_data().

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

◆ is_precise_seam_weak()

bool Slic3r::ModelVolume::is_precise_seam_weak ( ) const
inline
bool is_precise_seam_weak(ModelVolumeType t)
Definition Model.hpp:375

References Slic3r::is_precise_seam_weak(), and m_type.

Here is the call graph for this function:

◆ is_seam_painted()

bool Slic3r::ModelVolume::is_seam_painted ( ) const
inline
1154{ return !this->seam_facets.empty(); }

References Slic3r::FacetsAnnotation::empty().

Referenced by is_any_painted().

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

◆ is_splittable()

bool Slic3r::ModelVolume::is_splittable ( ) const
2704{
2705 // the call mesh.is_splittable() is expensive, so cache the value to calculate it only once
2706 if (m_is_splittable == -1)
2707 m_is_splittable = its_is_splittable(this->mesh().its);
2708
2709 return m_is_splittable == 1;
2710}
int m_is_splittable
Definition Model.hpp:1203
bool its_is_splittable(const Its &m)
Definition MeshSplitImpl.hpp:203

References is_splittable(), Slic3r::its_is_splittable(), and m_is_splittable.

Referenced by Slic3r::GUI::ObjectList::is_splittable(), is_splittable(), Slic3r::PrintObject::prepare_infill(), and Slic3r::GUI::ObjectList::split().

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

◆ is_support_blocker()

bool Slic3r::ModelVolume::is_support_blocker ( ) const
inline

References m_type, and Slic3r::SUPPORT_BLOCKER.

Referenced by Slic3r::color_from_model_volume().

Here is the caller graph for this function:

◆ is_support_enforcer()

bool Slic3r::ModelVolume::is_support_enforcer ( ) const
inline

References m_type, and Slic3r::SUPPORT_ENFORCER.

Referenced by Slic3r::color_from_model_volume().

Here is the caller graph for this function:

◆ is_support_modifier()

bool Slic3r::ModelVolume::is_support_modifier ( ) const
inline

References m_type, Slic3r::SUPPORT_BLOCKER, and Slic3r::SUPPORT_ENFORCER.

Referenced by model_volume_list_update_supports_and_seams.

Here is the caller graph for this function:

◆ is_svg()

bool Slic3r::ModelVolume::is_svg ( ) const
inline
1040{ return emboss_shape.has_value() && !text_configuration.has_value(); }

References emboss_shape, and text_configuration.

Referenced by Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::MenuFactory::append_menu_item_edit_svg(), Slic3r::GUI::Plater::priv::on_right_click(), Slic3r::GUI::ObjectList::show_context_menu(), and Slic3r::GUI::ObjectList::split().

Here is the caller graph for this function:

◆ is_text()

bool Slic3r::ModelVolume::is_text ( ) const
inline
1039{ return text_configuration.has_value(); }

References text_configuration.

Referenced by Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::MenuFactory::append_menu_item_edit_text(), Slic3r::GUI::Plater::priv::on_right_click(), Slic3r::GUI::ObjectList::show_context_menu(), and Slic3r::GUI::ObjectList::split().

Here is the caller graph for this function:

◆ is_texture_displacement_painted()

bool Slic3r::ModelVolume::is_texture_displacement_painted ( ) const
inline
1157{ return !this->texture_displacement_facets_all_empty(); }

References texture_displacement_facets_all_empty().

Referenced by is_any_painted(), Slic3r::GUI::GLGizmoTextureDisplacement::render_debug_stage_panel(), and Slic3r::GUI::GLGizmoTextureDisplacement::run_stage_debug().

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

◆ is_the_only_one_part()

bool Slic3r::ModelVolume::is_the_only_one_part ( ) const
2129{
2131 return false;
2132 if (object == nullptr)
2133 return false;
2134 for (const ModelVolume *v : object->volumes) {
2135 if (v == nullptr)
2136 continue;
2137 // is this volume?
2138 if (v->id() == this->id())
2139 continue;
2140 // exist another model part in object?
2141 if (v->type() == ModelVolumeType::MODEL_PART)
2142 return false;
2143 }
2144 return true;
2145}
ModelVolume(const ModelVolume &rhs)=default

References ModelVolume(), Slic3r::ObjectBase::id(), Slic3r::ObjectID::id, is_the_only_one_part(), m_type, Slic3r::MODEL_PART, object, and type().

Referenced by Slic3r::GUI::calc_distance(), anonymous_namespace{GLGizmoEmboss.cpp}::init_text_lines(), is_the_only_one_part(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), and Slic3r::GUI::Emboss::start_update_volume().

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

◆ load()

template<class Archive>
void Slic3r::ModelVolume::load ( Archive & ar)
inlineprivate
1341 {
1342 bool has_convex_hull;
1343 // BBS: add backup, check modify
1344 bool mesh_changed = false;
1345 auto tr = m_transformation;
1347 mesh_changed |= !(tr == m_transformation);
1348 auto t = supported_facets.timestamp();
1350 mesh_changed |= t != supported_facets.timestamp();
1351 t = seam_facets.timestamp();
1353 mesh_changed |= t != seam_facets.timestamp();
1354 t = mmu_segmentation_facets.timestamp();
1356 mesh_changed |= t != mmu_segmentation_facets.timestamp();
1358 mesh_changed |= t != fuzzy_skin_facets.timestamp();
1359 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i) {
1360 FacetsAnnotation &f = texture_displacement_facet(i);
1361 Timestamp tf = f.timestamp();
1363 mesh_changed |= tf != f.timestamp();
1364 }
1369 assert(m_mesh);
1370 if (has_convex_hull) {
1372 if (! m_convex_hull && ! m_mesh->empty())
1373 // The convex hull was released from the Undo / Redo stack to conserve memory. Recalculate it.
1374 this->calculate_convex_hull();
1375 } else
1376 m_convex_hull.reset();
1377 if (mesh_changed && object)
1378 Slic3r::save_object_mesh(*object);
1379 }
t_model_material_id m_material_id
Definition Model.hpp:1187
uint64_t Timestamp
Definition ObjectID.hpp:67
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124
void save_object_mesh(ModelObject &object)
Definition bbs_3mf.cpp:9754
void load_by_value(BinaryInputArchive &ar, T &obj)
Definition UndoRedo.cpp:780
void load(Archive &archive, Slic3r::Matrix2f &m)
Definition Point.hpp:828
void load_optional(BinaryInputArchive &ar, std::shared_ptr< const T > &ptr)
Definition UndoRedo.cpp:808

References calculate_convex_hull(), config, cut_info, emboss_shape, Slic3r::f(), fuzzy_skin_facets, cereal::load(), cereal::load_by_value(), cereal::load_optional(), m_convex_hull, m_is_splittable, m_material_id, m_mesh, m_transformation, m_type, mmu_segmentation_facets, name, Slic3r::save_object_mesh(), seam_facets, source, supported_facets, text_configuration, texture_displacement_facet(), texture_displacement_layers, Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS, texture_displacement_options, and texture_uv.

Here is the call 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); }
ObjectID id() const
Definition ObjectID.hpp:69

References id().

Here is the call graph for this function:

◆ material()

ModelMaterial * Slic3r::ModelVolume::material ( ) const
2678{
2679 return this->object->get_model()->get_material(m_material_id);
2680}

References m_material_id, and material().

Referenced by material(), Slic3r::region_config_from_model_volume(), and set_material().

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

◆ material_id()

t_model_material_id Slic3r::ModelVolume::material_id ( ) const
inline
1042{ return m_material_id; }

References m_material_id.

Referenced by ModelVolume(), ModelVolume(), Slic3r::Print::auto_assign_extruders(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::region_config_from_model_volume(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), set_material(), and set_material_id().

Here is the caller graph for this function:

◆ mesh()

const TriangleMesh & Slic3r::ModelVolume::mesh ( ) const
inline
892{ return *m_mesh.get(); }

References m_mesh.

Referenced by ModelVolume(), ModelVolume(), ModelVolume(), ModelVolume(), Slic3r::GUI::GLGizmoCut3D::PartSelection::PartSelection(), Slic3r::_BBS_3MF_Exporter::_add_mesh_to_object_stream(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::GLGizmoTextureDisplacement::adjust_plane_point(), Slic3r::apply_painted_mesh_to_volume(), Slic3r::build_texture_displacement(), Slic3r::GUI::PartPlate::calc_imex_ghosts(), Slic3r::ModelInstance::calc_print_volume_state(), Slic3r::GUI::Plater::combine_mesh_fff(), Slic3r::anonymous_namespace{bbs_3mf.cpp}::create_fix(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::GLGizmoTextureDisplacement::cut_island(), Slic3r::distribute_modifiers_from_object(), Slic3r::GUI::Plater::export_stl(), Slic3r::GUI::GLGizmoBrimEars::first_layer_slicer(), Slic3r::FacetsAnnotation::get_facets(), Slic3r::FacetsAnnotation::get_facets(), Slic3r::FacetsAnnotation::get_facets_strict(), has_texture_uv(), Slic3r::GUI::GLGizmoMmuSegmentation::init_model_triangle_selectors(), Slic3r::PaintCLI::inspect_to_json(), Slic3r::ModelInstance::intersects_bed_exclude_region(), Slic3r::GUI::GLGizmoTextureDisplacement::layer_projection_frame(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_modifier(), main(), Slic3r::GUI::GLGizmoTextureDisplacement::mark_seam_path(), Slic3r::merge_solid_parts_inside_object(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::csg::model_to_csgmesh(), Slic3r::GUI::GLGizmoTextureDisplacement::model_uv_corners(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), Slic3r::GUI::CommonGizmosDataObjects::InstancesHider::on_update(), Slic3r::GUI::CommonGizmosDataObjects::ObjectClipper::on_update(), Slic3r::GUI::GLGizmoTextureDisplacement::painted_area_mm2(), Slic3r::GUI::Selection::paste_volumes_from_clipboard(), Slic3r::Cut::perform_with_plane(), Slic3r::process_modifier_cut(), Slic3r::process_volume_cut(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::Model::read_from_file(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_island_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_seam_anchor_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_seam_hover_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_seam_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_subdivide_preview(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_wireframe_overlay(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::FacetsAnnotation::remap_states(), Slic3r::GUI::GLGizmoTextureDisplacement::render_adjust_texture_gizmo(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_height_range(), repair(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), restore_painting(), Slic3r::CLI::run(), save_painting(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_edge_at(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_vertex_at(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::GLGizmoTextureDisplacement::select_visible_faces(), Slic3r::GUI::GLGizmoTextureDisplacement::select_whole_model(), Slic3r::FacetsAnnotation::set_enforcer_block_type_limit(), set_mesh(), set_mesh(), set_mesh(), set_mesh(), set_mesh(), set_mesh(), Slic3r::FacetsAnnotation::shift_states_above(), Slic3r::GUI::Plater::show_object_info(), Slic3r::slice_volume(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), Slic3r::GUI::ObjectList::split(), Slic3r::ModelObject::split(), split(), Slic3r::GUI::texture_displacement_bake_volume(), transform_this_mesh(), transform_this_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::update_adjust_anchor(), Slic3r::GUI::GLGizmoFdmSupports::update_from_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_from_model_object(), Slic3r::GUI::GLGizmoSeam::update_from_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_from_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_uv_editor(), and Slic3r::GUI::GLGizmoTextureDisplacement::v2_recommendation().

◆ mesh_ptr()

◆ mirror()

void Slic3r::ModelVolume::mirror ( Axis axis)
3104{
3106 switch (axis)
3107 {
3108 case X: { mirror(0) *= -1.0; break; }
3109 case Y: { mirror(1) *= -1.0; break; }
3110 case Z: { mirror(2) *= -1.0; break; }
3111 default: break;
3112 }
3114}
Vec3d get_mirror() const
Definition Model.hpp:1130
void set_mirror(const Vec3d &mirror)
Definition Model.hpp:1134
void mirror(Axis axis)
Definition Model.cpp:3103
@ Z
Definition libslic3r.h:143

References get_mirror(), mirror(), set_mirror(), Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by mirror(), set_mirror(), and set_mirror().

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

◆ operator=()

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

References ModelVolume().

Here is the call graph for this function:

◆ repair()

bool Slic3r::ModelVolume::repair ( bool keep_painting,
MeshRepairStats * stats = nullptr,
std::string * error = nullptr,
const std::function< void(int)> & progress = {} )
3030{
3031 TriangleMesh mesh = this->mesh();
3032 MeshRepairStats stats;
3033 const bool ok = repair_mesh(mesh, &stats, error, progress);
3034 if (stats_out)
3035 *stats_out = stats;
3036 if (!ok || !stats.modified)
3037 return ok;
3038
3039 const std::optional<TriangleSelector::SavedPainting> saved_painting = keep_painting ? save_painting() : std::nullopt;
3040 this->set_mesh(std::move(mesh));
3041 this->calculate_convex_hull();
3043 // Assign a new unique ID, so that a new GLVolume will be generated.
3044 this->set_new_unique_id();
3045 this->restore_painting(saved_painting);
3046 return true;
3047}
std::optional< TriangleSelector::SavedPainting > save_painting() const
Definition Model.cpp:2164
void invalidate_convex_hull_2d()
Definition Model.hpp:1095
void set_mesh(const TriangleMesh &mesh)
Definition Model.hpp:894
void restore_painting(const std::optional< TriangleSelector::SavedPainting > &saved, bool keep_existing_paint=false)
Definition Model.cpp:2179
void set_new_unique_id()
Definition Model.hpp:1142
bool repair_mesh(TriangleMesh &mesh, MeshRepairStats *stats_out, std::string *error, const std::function< void(int)> &progress)
Definition MeshRepair.cpp:1185

References calculate_convex_hull(), invalidate_convex_hull_2d(), mesh(), Slic3r::MeshRepairStats::modified, repair(), Slic3r::repair_mesh(), restore_painting(), save_painting(), set_mesh(), and set_new_unique_id().

Referenced by Slic3r::fix_model_with_cgal_gui(), repair(), and Slic3r::CLI::run().

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

◆ reset_extra_facets()

void Slic3r::ModelVolume::reset_extra_facets ( )
2148{
2149 this->supported_facets.reset();
2150 this->seam_facets.reset();
2151 this->mmu_segmentation_facets.reset();
2152 this->fuzzy_skin_facets.reset();
2153 // Texture-displacement paint data has no remap-across-topology-change support yet (see
2154 // build_texture_displacement()'s documented limitation), so it must be dropped here rather
2155 // than left referring to a mesh that no longer matches it.
2156 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
2158 // Same reasoning for the model's own UV channel: it is indexed by triangle, so against a mesh
2159 // this no longer matches it would map the texture by another mesh's triangle numbering. A caller
2160 // that can carry it across - see transfer_uv_channel() - puts it back after this.
2161 this->reset_texture_uv();
2162}
void reset()
Definition Model.cpp:4102
void reset_texture_uv()
Definition Model.hpp:999

References fuzzy_skin_facets, mmu_segmentation_facets, reset_extra_facets(), reset_texture_uv(), seam_facets, supported_facets, texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by Slic3r::Cut::perform_with_plane(), reset_extra_facets(), restore_painting(), and split().

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

◆ reset_from_upper()

void Slic3r::ModelVolume::reset_from_upper ( )
inline
886{ cut_info.reset_from_upper(); }

References cut_info.

Referenced by Slic3r::Cut::perform_with_groove().

Here is the caller graph for this function:

◆ reset_mesh()

void Slic3r::ModelVolume::reset_mesh ( )
inline
900{ m_mesh = std::make_shared<const TriangleMesh>(); m_is_splittable = -1; }

References m_is_splittable, and m_mesh.

◆ reset_texture_uv()

void Slic3r::ModelVolume::reset_texture_uv ( )
inline
999{ texture_uv.clear(); }

References texture_uv.

Referenced by Slic3r::apply_painted_mesh_to_volume(), and reset_extra_facets().

Here is the caller graph for this function:

◆ restore_painting()

void Slic3r::ModelVolume::restore_painting ( const std::optional< TriangleSelector::SavedPainting > & saved,
bool keep_existing_paint = false )
2180{
2181 if (!keep_existing_paint) {
2183 }
2184
2185 if (!saved) {
2186 return;
2187 }
2188
2189 auto remap_one = [&](const TriangleSelector::TriangleSplittingData& src_data,
2190 FacetsAnnotation& target_facets) {
2191 if (src_data.bitstream.empty())
2192 return;
2193 auto result =
2194 TriangleSelector::remap_painting(saved->mesh.its, src_data, mesh().its, Geometry::translation_transform(mesh().get_init_shift()),
2195 keep_existing_paint ?
2196 std::optional<std::reference_wrapper<const TriangleSelector::TriangleSplittingData>>{std::ref(target_facets.get_data())} :
2197 std::optional<std::reference_wrapper<const TriangleSelector::TriangleSplittingData>>{});
2198 if (!result.bitstream.empty())
2199 target_facets.set_data(std::move(result));
2200 };
2201 remap_one(saved->supported, supported_facets);
2202 remap_one(saved->seam, seam_facets);
2203 remap_one(saved->mmu, mmu_segmentation_facets);
2204 remap_one(saved->fuzzy, fuzzy_skin_facets);
2205}
void reset_extra_facets()
Definition Model.cpp:2147
static TriangleSplittingData remap_painting(const indexed_triangle_set &source_its, const TriangleSplittingData &source_painting, const indexed_triangle_set &target_its, const Transform3d &target_transform, const std::optional< std::reference_wrapper< const TriangleSplittingData > > &existing_painting)
Definition TriangleSelector.cpp:2498
void translation_transform(Transform3d &transform, const Vec3d &translation)
Definition Geometry.cpp:346

References Slic3r::TriangleSelector::TriangleSplittingData::bitstream, fuzzy_skin_facets, mesh(), mmu_segmentation_facets, Slic3r::TriangleSelector::remap_painting(), reset_extra_facets(), restore_painting(), seam_facets, supported_facets, and Slic3r::Geometry::translation_transform().

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), Slic3r::GUI::ObjectList::boolean(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::Plater::priv::reload_from_disk(), repair(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), restore_painting(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), and Slic3r::ModelObject::split().

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

◆ rotate() [1/2]

void Slic3r::ModelVolume::rotate ( double angle,
Axis axis )
3088{
3089 switch (axis)
3090 {
3091 case X: { rotate(angle, Vec3d::UnitX()); break; }
3092 case Y: { rotate(angle, Vec3d::UnitY()); break; }
3093 case Z: { rotate(angle, Vec3d::UnitZ()); break; }
3094 default: break;
3095 }
3096}
void rotate(double angle, Axis axis)
Definition Model.cpp:3087
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138

References Slic3r::angle(), rotate(), Slic3r::X, Slic3r::Y, and Slic3r::Z.

Referenced by rotate(), and rotate().

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

◆ rotate() [2/2]

void Slic3r::ModelVolume::rotate ( double angle,
const Vec3d & axis )
3099{
3100 set_rotation(get_rotation() + Geometry::extract_euler_angles(Eigen::Quaterniond(Eigen::AngleAxisd(angle, axis)).toRotationMatrix()));
3101}
void set_rotation(const Vec3d &rotation)
Definition Model.hpp:1121
Vec3d get_rotation() const
Definition Model.hpp:1118
Vec3d extract_euler_angles(const Eigen::Matrix< double, 3, 3, Eigen::DontAlign > &rotation_matrix)
Definition Geometry.cpp:395

References Slic3r::angle(), Slic3r::Geometry::extract_euler_angles(), get_rotation(), rotate(), and set_rotation().

Here is the call graph for this function:

◆ save()

template<class Archive>
void Slic3r::ModelVolume::save ( Archive & ar) const
inlineprivate
1380 {
1381 bool has_convex_hull = m_convex_hull.get() != nullptr;
1387 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
1393 if (has_convex_hull)
1395 }
void save_by_value(BinaryOutputArchive &ar, const T &obj)
Definition UndoRedo.cpp:774
void save_optional(BinaryOutputArchive &ar, const std::shared_ptr< const T > &ptr)
Definition UndoRedo.cpp:794
void save(Archive &archive, Slic3r::Matrix2f &m)
Definition Point.hpp:829

References config, cut_info, emboss_shape, fuzzy_skin_facets, m_convex_hull, m_is_splittable, m_material_id, m_mesh, m_transformation, m_type, mmu_segmentation_facets, name, cereal::save(), cereal::save_by_value(), cereal::save_optional(), seam_facets, source, supported_facets, text_configuration, texture_displacement_facet(), texture_displacement_layers, Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS, texture_displacement_options, and texture_uv.

Here is the call graph for this function:

◆ save_painting()

std::optional< TriangleSelector::SavedPainting > Slic3r::ModelVolume::save_painting ( ) const
2165{
2166 if (is_any_painted() && is_model_part() && !mesh().empty()) {
2167 TriangleSelector::SavedPainting sp;
2168 sp.mesh = mesh();
2169 sp.supported = supported_facets.get_data();
2170 sp.seam = seam_facets.get_data();
2171 sp.mmu = mmu_segmentation_facets.get_data();
2172 sp.fuzzy = fuzzy_skin_facets.get_data();
2173 return sp;
2174 }
2175
2176 return {};
2177}
bool is_model_part() const
Definition Model.hpp:1025
bool is_any_painted() const
Definition Model.hpp:1158
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References Slic3r::empty(), Slic3r::TriangleSelector::SavedPainting::fuzzy, fuzzy_skin_facets, is_any_painted(), is_model_part(), mesh(), Slic3r::TriangleSelector::SavedPainting::mesh, Slic3r::TriangleSelector::SavedPainting::mmu, mmu_segmentation_facets, save_painting(), Slic3r::TriangleSelector::SavedPainting::seam, seam_facets, Slic3r::TriangleSelector::SavedPainting::supported, and supported_facets.

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), Slic3r::GUI::ObjectList::boolean(), Slic3r::Cut::perform_with_plane(), Slic3r::GUI::Plater::priv::reload_from_disk(), repair(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), save_painting(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), Slic3r::ModelObject::split(), and split().

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

◆ scale() [1/3]

void Slic3r::ModelVolume::scale ( const Vec3d & scaling_factors)
3055{
3056 set_scaling_factor(get_scaling_factor().cwiseProduct(scaling_factors));
3057}
Vec3d get_scaling_factor() const
Definition Model.hpp:1124
void set_scaling_factor(const Vec3d &scaling_factor)
Definition Model.hpp:1127

References get_scaling_factor(), scale(), and set_scaling_factor().

Referenced by scale(), and scale_geometry_after_creation().

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

◆ scale() [2/3]

void Slic3r::ModelVolume::scale ( double s)
inline
1077{ scale(Vec3d(s, s, s)); }
void scale(const Vec3d &scaling_factors)
Definition Model.cpp:3054

References scale().

Referenced by scale().

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

◆ scale() [3/3]

void Slic3r::ModelVolume::scale ( double x,
double y,
double z )
inline
1076{ scale(Vec3d(x, y, z)); }

References scale().

Referenced by scale().

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

◆ scale_geometry_after_creation() [1/2]

void Slic3r::ModelVolume::scale_geometry_after_creation ( const float scale)
inline
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65

References scale(), and scale_geometry_after_creation().

Referenced by scale_geometry_after_creation().

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

◆ scale_geometry_after_creation() [2/2]

void Slic3r::ModelVolume::scale_geometry_after_creation ( const Vec3f & versor)
3118{
3119 const_cast<TriangleMesh*>(m_mesh.get())->scale(versor);
3120 if (m_convex_hull->empty())
3121 //BBS: recompute the convex hull if it is null for previous too small
3122 this->calculate_convex_hull();
3123 else
3124 const_cast<TriangleMesh*>(m_convex_hull.get())->scale(versor);
3125}

References calculate_convex_hull(), m_convex_hull, m_mesh, Slic3r::TriangleMesh::scale(), and scale_geometry_after_creation().

Referenced by convert_from_imperial_units(), convert_from_meters(), Slic3r::ModelObject::convert_units(), and scale_geometry_after_creation().

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

◆ serialize()

template<class Archive>
void Slic3r::ObjectBase::serialize ( Archive & ar)
inlineprivateinherited
108{ ar(m_id); }

References m_id.

◆ 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_material()

void Slic3r::ModelVolume::set_material ( t_model_material_id material_id,
const ModelMaterial & material )
2683{
2685 if (! material_id.empty())
2686 this->object->get_model()->add_material(material_id, material);
2687}
t_model_material_id material_id() const
Definition Model.hpp:1042
ModelMaterial * material() const
Definition Model.cpp:2677

References m_material_id, material(), material_id(), and set_material().

Referenced by Slic3r::ModelObject::convert_units(), and set_material().

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

◆ set_material_id()

void Slic3r::ModelVolume::set_material_id ( t_model_material_id material_id)
2670{
2672 // ensure m_material_id references an existing material
2673 if (! material_id.empty())
2674 this->object->get_model()->add_material(material_id);
2675}

References m_material_id, material_id(), and set_material_id().

Referenced by ModelVolume(), ModelVolume(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), and set_material_id().

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

◆ set_mesh() [1/6]

void Slic3r::ModelVolume::set_mesh ( const indexed_triangle_set & mesh)
inline
896{ m_mesh = std::make_shared<const TriangleMesh>(mesh); m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Here is the call graph for this function:

◆ set_mesh() [2/6]

void Slic3r::ModelVolume::set_mesh ( const TriangleMesh & mesh)
inline
894{ m_mesh = std::make_shared<const TriangleMesh>(mesh); m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Referenced by Slic3r::apply_painted_mesh_to_volume(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), anonymous_namespace{EmbossJob.cpp}::create_volume(), repair(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), split(), transform_this_mesh(), transform_this_mesh(), and Slic3r::GUI::Emboss::UpdateJob::update_volume().

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

◆ set_mesh() [3/6]

void Slic3r::ModelVolume::set_mesh ( indexed_triangle_set && mesh)
inline
897{ m_mesh = std::make_shared<const TriangleMesh>(std::move(mesh)); m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Here is the call graph for this function:

◆ set_mesh() [4/6]

void Slic3r::ModelVolume::set_mesh ( std::shared_ptr< const TriangleMesh > & mesh)
inline
898{ m_mesh = mesh; m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Here is the call graph for this function:

◆ set_mesh() [5/6]

void Slic3r::ModelVolume::set_mesh ( std::unique_ptr< const TriangleMesh > && mesh)
inline
899{ m_mesh = std::move(mesh); m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Here is the call graph for this function:

◆ set_mesh() [6/6]

void Slic3r::ModelVolume::set_mesh ( TriangleMesh && mesh)
inline
895{ m_mesh = std::make_shared<const TriangleMesh>(std::move(mesh)); m_is_splittable = -1; }

References m_is_splittable, m_mesh, and mesh().

Here is the call graph for this function:

◆ set_mirror() [1/2]

void Slic3r::ModelVolume::set_mirror ( Axis axis,
double mirror )
inline
1135{ clear_cache(); m_transformation.set_mirror(axis, mirror); }
void clear_cache()
Definition Model.hpp:1052

References clear_cache(), m_transformation, and mirror().

Here is the call graph for this function:

◆ set_mirror() [2/2]

void Slic3r::ModelVolume::set_mirror ( const Vec3d & mirror)
inline
1134{ clear_cache(); m_transformation.set_mirror(mirror); }

References clear_cache(), m_transformation, and mirror().

Referenced by Slic3r::ModelObject::bake_xy_rotation_into_meshes(), and mirror().

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

◆ set_model_object()

void Slic3r::ModelVolume::set_model_object ( ModelObject * model_object)
inlineprotected
1175{ 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::ModelVolume::set_new_unique_id ( )
inline
1142 {
1144 this->config.set_new_unique_id();
1145 this->supported_facets.set_new_unique_id();
1146 this->seam_facets.set_new_unique_id();
1147 this->mmu_segmentation_facets.set_new_unique_id();
1148 this->fuzzy_skin_facets.set_new_unique_id();
1149 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
1151 }

References Slic3r::ObjectBase::set_new_unique_id(), texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), Slic3r::GUI::Selection::copy_to_clipboard(), Slic3r::ModelObject::delete_volume(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::Selection::paste_volumes_from_clipboard(), Slic3r::GUI::Plater::priv::reload_from_disk(), repair(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), split(), transform_this_mesh(), transform_this_mesh(), and Slic3r::GUI::Emboss::UpdateJob::update_volume().

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

◆ set_offset() [1/2]

void Slic3r::ModelVolume::set_offset ( Axis axis,
double offset )
inline
1116{ clear_cache(); m_transformation.set_offset(axis, offset); }
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References clear_cache(), m_transformation, and Slic3r::offset().

Here is the call graph for this function:

◆ set_offset() [2/2]

void Slic3r::ModelVolume::set_offset ( const Vec3d & offset)
inline
1115{ clear_cache(); m_transformation.set_offset(offset); }

References clear_cache(), m_transformation, and Slic3r::offset().

Referenced by Slic3r::apply_tolerance(), Slic3r::ModelObject::bake_xy_rotation_into_meshes(), convert_from_imperial_units(), convert_from_meters(), Slic3r::ModelObject::convert_units(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::process_connector_cut(), Slic3r::ModelObject::split(), and translate().

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

◆ set_rotation() [1/2]

void Slic3r::ModelVolume::set_rotation ( Axis axis,
double rotation )
inline
1122{ clear_cache(); m_transformation.set_rotation(axis, rotation); }

References clear_cache(), and m_transformation.

Here is the call graph for this function:

◆ set_rotation() [2/2]

void Slic3r::ModelVolume::set_rotation ( const Vec3d & rotation)
inline
1121{ clear_cache(); m_transformation.set_rotation(rotation); }

References clear_cache(), and m_transformation.

Referenced by Slic3r::ModelObject::bake_xy_rotation_into_meshes(), Slic3r::process_connector_cut(), and rotate().

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

◆ set_scaling_factor() [1/2]

void Slic3r::ModelVolume::set_scaling_factor ( Axis axis,
double scaling_factor )
inline
1128{clear_cache(); m_transformation.set_scaling_factor(axis, scaling_factor); }

References clear_cache(), and m_transformation.

Here is the call graph for this function:

◆ set_scaling_factor() [2/2]

void Slic3r::ModelVolume::set_scaling_factor ( const Vec3d & scaling_factor)
inline
1127{ clear_cache(); m_transformation.set_scaling_factor(scaling_factor); }

References clear_cache(), and m_transformation.

Referenced by Slic3r::apply_tolerance(), Slic3r::ModelObject::bake_xy_rotation_into_meshes(), and scale().

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

◆ set_transformation() [1/2]

◆ set_transformation() [2/2]

void Slic3r::ModelVolume::set_transformation ( const Transform3d & trafo)
inline
1109{ clear_cache(); m_transformation.set_matrix(trafo); }

References clear_cache(), and m_transformation.

Here is the call graph for this function:

◆ set_type()

◆ split()

size_t Slic3r::ModelVolume::split ( unsigned int max_extruders,
bool remap_paint )
2966{
2967 std::vector<TriangleMesh> meshes = this->mesh().split();
2968 if (meshes.size() <= 1)
2969 return 1;
2970
2971 // splited volume should not be text object
2972 if (text_configuration.has_value())
2973 text_configuration.reset();
2974
2975 // Parts without a convex hull enclose no volume; drop them here, as deleting volumes later could delete this one.
2976 std::vector<std::unique_ptr<ModelVolume>> parts;
2977 for (TriangleMesh &mesh : meshes)
2978 if (!mesh.empty()) {
2979 std::unique_ptr<ModelVolume> part(new ModelVolume(object, *this, std::move(mesh)));
2980 if (const std::shared_ptr<const TriangleMesh> &hull = part->get_convex_hull_shared_ptr();
2981 hull != nullptr && !hull->its.vertices.empty() && !hull->its.indices.empty())
2982 parts.emplace_back(std::move(part));
2983 }
2984 if (parts.empty())
2985 return 1;
2986
2987 std::optional<TriangleSelector::SavedPainting> saved_painting = remap_paint ? save_painting() :
2988 std::optional<TriangleSelector::SavedPainting>{};
2989
2990 size_t idx = 0;
2991 size_t ivolume = std::find(this->object->volumes.begin(), this->object->volumes.end(), this) - this->object->volumes.begin();
2992 const std::string name = this->name;
2993
2994 unsigned int extruder_counter = 0;
2995 const Vec3d offset = this->get_offset();
2996
2997 for (std::unique_ptr<ModelVolume> &part : parts) {
2998 if (idx == 0) {
2999 this->set_mesh(part->m_mesh);
3000 m_convex_hull = part->m_convex_hull;
3002 // Assign a new unique ID, so that a new GLVolume will be generated.
3003 this->set_new_unique_id();
3004
3005 // BBS: reset facet annotations
3006 this->reset_extra_facets();
3007 }
3008 else
3009 this->object->volumes.insert(this->object->volumes.begin() + (++ivolume), part.release());
3010
3011 // reset the source to disable reload from disk
3012 this->object->volumes[ivolume]->source = ModelVolume::Source();
3013 this->object->volumes[ivolume]->set_offset(Vec3d::Zero());
3014 this->object->volumes[ivolume]->center_geometry_after_creation();
3015 this->object->volumes[ivolume]->translate(offset);
3016 this->object->volumes[ivolume]->name = name + "_" + std::to_string(idx + 1);
3017 //BBS: always set the extruder id the same as original
3018 this->object->volumes[ivolume]->config.set("extruder", this->extruder_id());
3019 //this->object->volumes[ivolume]->config.set("extruder", auto_extruder_id(max_extruders, extruder_counter));
3020 this->object->volumes[ivolume]->m_is_splittable = 0;
3021 this->object->volumes[ivolume]->restore_painting(saved_painting);
3022
3023 ++ idx;
3024 }
3025
3026 return idx;
3027}
Vec3d get_offset() const
Definition Model.hpp:1111
ModelVolume()
Definition Model.hpp:1329
std::vector< TriangleMesh > split() const
Definition TriangleMesh.cpp:406

References ModelVolume(), extruder_id(), get_offset(), invalidate_convex_hull_2d(), m_convex_hull, mesh(), name, Slic3r::offset(), reset_extra_facets(), save_painting(), set_mesh(), set_new_unique_id(), split(), Slic3r::TriangleMesh::split(), text_configuration, and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::ObjectList::split(), and split().

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

◆ texture_displacement_facet() [1/2]

FacetsAnnotation & Slic3r::ModelVolume::texture_displacement_facet ( int slot)
inline
937 {
938 switch (slot) {
939 case 0: return texture_displacement_facets_0;
940 case 1: return texture_displacement_facets_1;
941 case 2: return texture_displacement_facets_2;
942 case 3: return texture_displacement_facets_3;
943 case 4: return texture_displacement_facets_4;
944 case 5: return texture_displacement_facets_5;
945 case 6: return texture_displacement_facets_6;
946 default: assert(slot == 7); return texture_displacement_facets_7;
947 }
948 }

References texture_displacement_facets_0, texture_displacement_facets_1, texture_displacement_facets_2, texture_displacement_facets_3, texture_displacement_facets_4, texture_displacement_facets_5, texture_displacement_facets_6, and texture_displacement_facets_7.

Referenced by Slic3r::_BBS_3MF_Exporter::_add_mesh_to_object_stream(), Slic3r::_BBS_3MF_Exporter::_add_model_file_to_archive(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), assign_new_unique_ids_recursive(), Slic3r::build_texture_displacement(), Slic3r::GUI::GLGizmoTextureDisplacement::facets_data_of(), load(), main(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::push_uv_pane_state(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), reset_extra_facets(), save(), set_new_unique_id(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), Slic3r::GUI::GLGizmoTextureDisplacement::swap_layer_slots(), Slic3r::GUI::texture_displacement_bake_volume(), texture_displacement_facets_all_empty(), texture_displacement_facets_ids_invalid(), texture_displacement_facets_ids_valid(), Slic3r::GUI::GLGizmoTextureDisplacement::update_adjust_anchor(), Slic3r::GUI::GLGizmoTextureDisplacement::update_from_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_model_object(), and Slic3r::GUI::GLGizmoTextureDisplacement::update_uv_editor().

Here is the caller graph for this function:

◆ texture_displacement_facet() [2/2]

const FacetsAnnotation & Slic3r::ModelVolume::texture_displacement_facet ( int slot) const
inline
949{ return const_cast<ModelVolume*>(this)->texture_displacement_facet(slot); }

References ModelVolume(), and texture_displacement_facet().

Referenced by texture_displacement_facet().

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

◆ texture_displacement_facets_all_empty()

bool Slic3r::ModelVolume::texture_displacement_facets_all_empty ( ) const
inline
964 {
965 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
967 return false;
968 return true;
969 }

References Slic3r::empty(), texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by ModelVolume(), and is_texture_displacement_painted().

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

◆ texture_displacement_facets_ids_invalid()

bool Slic3r::ModelVolume::texture_displacement_facets_ids_invalid ( ) const
inline
958 {
959 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
960 if (texture_displacement_facet(i).id().valid())
961 return false;
962 return true;
963 }

References texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by ModelVolume().

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

◆ texture_displacement_facets_ids_valid()

bool Slic3r::ModelVolume::texture_displacement_facets_ids_valid ( ) const
inline
952 {
953 for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
954 if (!texture_displacement_facet(i).id().valid() || texture_displacement_facet(i).id() == this->id())
955 return false;
956 return true;
957 }

References texture_displacement_facet(), and Slic3r::TEXTURE_DISPLACEMENT_MAX_LAYERS.

Referenced by ModelVolume(), ModelVolume(), and ModelVolume().

Here is the call graph for this function:
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_this_mesh() [1/2]

void Slic3r::ModelVolume::transform_this_mesh ( const Matrix3d & m,
bool fix_left_handed )
protected
3140{
3141 TriangleMesh mesh = this->mesh();
3142 mesh.transform(matrix, fix_left_handed);
3143 this->set_mesh(std::move(mesh));
3144 TriangleMesh convex_hull = this->get_convex_hull();
3145 convex_hull.transform(matrix, fix_left_handed);
3146 m_convex_hull = std::make_shared<TriangleMesh>(std::move(convex_hull));
3147 // Let the rest of the application know that the geometry changed, so the meshes have to be reloaded.
3148 this->set_new_unique_id();
3149}
const TriangleMesh & get_convex_hull() const
Definition Model.cpp:2904
Polygon transform(const Transform3d &trafo) const
Definition Polygon.cpp:409

References Slic3r::Geometry::convex_hull(), get_convex_hull(), m_convex_hull, mesh(), set_mesh(), set_new_unique_id(), and transform_this_mesh().

Here is the call graph for this function:

◆ transform_this_mesh() [2/2]

void Slic3r::ModelVolume::transform_this_mesh ( const Transform3d & t,
bool fix_left_handed )
protected
3128{
3129 TriangleMesh mesh = this->mesh();
3130 mesh.transform(mesh_trafo, fix_left_handed);
3131 this->set_mesh(std::move(mesh));
3132 TriangleMesh convex_hull = this->get_convex_hull();
3133 convex_hull.transform(mesh_trafo, fix_left_handed);
3134 m_convex_hull = std::make_shared<TriangleMesh>(std::move(convex_hull));
3135 // Let the rest of the application know that the geometry changed, so the meshes have to be reloaded.
3136 this->set_new_unique_id();
3137}

References Slic3r::Geometry::convex_hull(), get_convex_hull(), m_convex_hull, mesh(), set_mesh(), set_new_unique_id(), and transform_this_mesh().

Referenced by Slic3r::ModelObject::bake_xy_rotation_into_meshes(), transform_this_mesh(), and transform_this_mesh().

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

◆ translate() [1/2]

void Slic3r::ModelVolume::translate ( const Vec3d & displacement)
3050{
3051 set_offset(get_offset() + displacement);
3052}

References get_offset(), set_offset(), and translate().

Here is the call graph for this function:

◆ translate() [2/2]

void Slic3r::ModelVolume::translate ( double x,
double y,
double z )
inline
1073{ translate(Vec3d(x, y, z)); }

References translate().

Referenced by Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), center_geometry_after_creation(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), translate(), and translate().

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

◆ type()

ModelVolumeType Slic3r::ModelVolume::type ( ) const
inline
1023{ return m_type; }

References m_type.

Referenced by Slic3r::ModelVolume::CutInfo::CutInfo(), ModelVolume(), ModelVolume(), ModelVolume(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Importer::_load_model_from_file(), Slic3r::ModelObject::add_volume(), Slic3r::ModelObject::add_volume_with_shared_mesh(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::color_from_model_volume(), Slic3r::GUI::ObjectGridTable::construct_object_configs(), Slic3r::GUI::face_selected_volume_to_camera(), Slic3r::GUI::GLGizmoBrimEars::first_layer_slicer(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::ObjectList::get_selected_volume_type(), Slic3r::GUI::GLGizmoSVG::is_svg_object(), is_the_only_one_part(), Slic3r::load_amf_archive(), Slic3r::load_amf_file(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), model_volume_list_update_supports_and_seams, Slic3r::model_volume_needs_slicing(), Slic3r::model_volume_solid_or_modifier(), Slic3r::Print::process(), Slic3r::process_connector_cut(), Slic3r::GUI::GLGizmoEmboss::re_emboss(), Slic3r::PreciseSeam::record_extraction(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), Slic3r::ModelObject::sort_volumes(), Slic3r::GUI::ObjectList::split(), Slic3r::ModelObject::split(), and Slic3r::GUI::GLGizmoFlatten::update_planes().

Here is the caller graph for this function:

◆ type_from_string()

ModelVolumeType Slic3r::ModelVolume::type_from_string ( const std::string & s)
static
2911{
2912 // New type (supporting the support enforcers & blockers)
2913 if (s == "normal_part")
2915 if (s == "negative_part")
2917 if (s == "modifier_part")
2919 if (s == "support_enforcer")
2921 if (s == "support_blocker")
2923 // Precise Seam types
2924 if (s == "precise_seam_center")
2926 if (s == "precise_seam_left")
2928 if (s == "precise_seam_right")
2930 if (s == "precise_seam_enforced")
2932 if (s == "precise_seam_blocked")
2934 if (s == "precise_seam_neutral")
2936 //assert(s == "0");
2937 // Default value if invalud type string received.
2939}
@ PRECISE_SEAM_BLOCKED
Definition Model.hpp:368
@ PRECISE_SEAM_LEFT
Definition Model.hpp:365
@ PRECISE_SEAM_ENFORCED
Definition Model.hpp:367
@ PRECISE_SEAM_CENTER
Definition Model.hpp:364
@ PRECISE_SEAM_NEUTRAL
Definition Model.hpp:369
@ PRECISE_SEAM_RIGHT
Definition Model.hpp:366

References Slic3r::MODEL_PART, Slic3r::NEGATIVE_VOLUME, Slic3r::PARAMETER_MODIFIER, Slic3r::PRECISE_SEAM_BLOCKED, Slic3r::PRECISE_SEAM_CENTER, Slic3r::PRECISE_SEAM_ENFORCED, Slic3r::PRECISE_SEAM_LEFT, Slic3r::PRECISE_SEAM_NEUTRAL, Slic3r::PRECISE_SEAM_RIGHT, Slic3r::SUPPORT_BLOCKER, Slic3r::SUPPORT_ENFORCER, and type_from_string().

Referenced by Slic3r::_3MF_Importer::_generate_volumes(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::_BBS_3MF_Importer::_handle_start_config_volume(), and type_from_string().

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

◆ type_to_string()

std::string Slic3r::ModelVolume::type_to_string ( const ModelVolumeType t)
static
2943{
2944 switch (t) {
2945 case ModelVolumeType::MODEL_PART: return "normal_part";
2946 case ModelVolumeType::NEGATIVE_VOLUME: return "negative_part";
2947 case ModelVolumeType::PARAMETER_MODIFIER: return "modifier_part";
2948 case ModelVolumeType::SUPPORT_ENFORCER: return "support_enforcer";
2949 case ModelVolumeType::SUPPORT_BLOCKER: return "support_blocker";
2950 case ModelVolumeType::PRECISE_SEAM_CENTER: return "precise_seam_center";
2951 case ModelVolumeType::PRECISE_SEAM_LEFT: return "precise_seam_left";
2952 case ModelVolumeType::PRECISE_SEAM_RIGHT: return "precise_seam_right";
2953 case ModelVolumeType::PRECISE_SEAM_ENFORCED: return "precise_seam_enforced";
2954 case ModelVolumeType::PRECISE_SEAM_BLOCKED: return "precise_seam_blocked";
2955 case ModelVolumeType::PRECISE_SEAM_NEUTRAL: return "precise_seam_neutral";
2956 default:
2957 assert(false);
2958 return "normal_part";
2959 }
2960}

References Slic3r::MODEL_PART, Slic3r::NEGATIVE_VOLUME, Slic3r::PARAMETER_MODIFIER, Slic3r::PRECISE_SEAM_BLOCKED, Slic3r::PRECISE_SEAM_CENTER, Slic3r::PRECISE_SEAM_ENFORCED, Slic3r::PRECISE_SEAM_LEFT, Slic3r::PRECISE_SEAM_NEUTRAL, Slic3r::PRECISE_SEAM_RIGHT, Slic3r::SUPPORT_BLOCKER, Slic3r::SUPPORT_ENFORCER, and type_to_string().

Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), and type_to_string().

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

◆ update_extruder_count()

void Slic3r::ModelVolume::update_extruder_count ( size_t extruder_count)
2746{
2747 std::vector<int> used_extruders = get_extruders();
2748 for (int extruder_id : used_extruders) {
2749 if (extruder_id > extruder_count) {
2750 mmu_segmentation_facets.set_enforcer_block_type_limit(*this, (EnforcerBlockerType)extruder_count);
2751 break;
2752 }
2753 }
2754 // Clear a stale per-volume filament assignment that no longer exists after the extruder count
2755 // shrank (e.g. printer switch to one with fewer filaments), so downstream readers never index
2756 // per-filament config vectors out of range. Ported from BambuStudio (STUDIO-15763).
2757 if (extruder_id() > extruder_count) {
2758 this->config.erase("extruder");
2759 }
2760}
std::vector< int > get_extruders() const
Definition Model.cpp:2713
EnforcerBlockerType
Definition TriangleSelector.hpp:24

References config, extruder_id(), get_extruders(), mmu_segmentation_facets, and update_extruder_count().

Referenced by Slic3r::GUI::Plater::on_filament_count_change(), Slic3r::GUI::GLCanvas3D::reload_scene(), and update_extruder_count().

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

◆ update_extruder_count_when_delete_filament()

void Slic3r::ModelVolume::update_extruder_count_when_delete_filament ( size_t extruder_count,
size_t filament_id,
int replace_filament_id = -1,
const std::vector< unsigned char > & filament_is_mixed = {} )
2764{
2765 std::vector<int> used_extruders = get_extruders();
2766 for (int extruder_id : used_extruders) {
2767 if (extruder_id >= filament_id) {
2768 mmu_segmentation_facets.set_enforcer_block_type_limit(*this, (EnforcerBlockerType)(extruder_count), (EnforcerBlockerType)(filament_id), (EnforcerBlockerType)(replace_filament_id));
2769 break;
2770 }
2771 }
2772 // Same stale-assignment cleanup as update_extruder_count, for the filament-delete path.
2773 // Ported from BambuStudio (STUDIO-15763).
2774 size_t eid = extruder_id();
2775 // Judge out-of-range against the post-remap id, mirroring update_filament_values_for_items_when_delete_filament.
2776 // Using the pre-remap eid would wrongly erase a high extruder that should remap (e.g. 5 -> 4 after
2777 // deleting filament 1); update_filament_values_for_items_when_delete_filament would then skip it
2778 // (!has("extruder")) and the volume would fall back to the object default color.
2779 size_t remapped = eid;
2780 if (eid == filament_id)
2781 remapped = (replace_filament_id > 0) ? (size_t)replace_filament_id : 1;
2782 else if (eid > filament_id)
2783 remapped = eid - 1;
2784 if (remapped > extruder_count) {
2785 // filament_is_mixed is the pre-delete snapshot; index it with the ORIGINAL eid (1-based),
2786 // not remapped, so we check whether this volume's current slot is a mixed slot.
2787 bool is_mixed = !filament_is_mixed.empty() && eid >= 1 && (eid - 1) < filament_is_mixed.size() && filament_is_mixed[eid - 1];
2788 if (!is_mixed)
2789 this->config.erase("extruder");
2790 }
2791}
zaa_minimize_perimeter_height filament_is_mixed((ConfigOptionStrings, filament_mixed_components))((ConfigOptionStrings

References config, extruder_id(), Slic3r::filament_is_mixed(), get_extruders(), mmu_segmentation_facets, and update_extruder_count_when_delete_filament().

Referenced by Slic3r::GUI::Plater::on_filaments_delete(), and update_extruder_count_when_delete_filament().

Here is the call graph for this function:
Here is the caller 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.

◆ model_volume_list_update_supports_and_seams

void model_volume_list_update_supports_and_seams ( ModelObject & model_object_dst,
const ModelObject & model_object_new )
friend
49{
50 typedef std::pair<const ModelVolume*, bool> ModelVolumeWithStatus;
51 std::vector<ModelVolumeWithStatus> old_volumes;
52 old_volumes.reserve(model_object_dst.volumes.size());
53 for (const ModelVolume *model_volume : model_object_dst.volumes)
54 old_volumes.emplace_back(ModelVolumeWithStatus(model_volume, false));
55 auto model_volume_lower = [](const ModelVolumeWithStatus &mv1, const ModelVolumeWithStatus &mv2){ return mv1.first->id() < mv2.first->id(); };
56 auto model_volume_equal = [](const ModelVolumeWithStatus &mv1, const ModelVolumeWithStatus &mv2){ return mv1.first->id() == mv2.first->id(); };
57 std::sort(old_volumes.begin(), old_volumes.end(), model_volume_lower);
58 model_object_dst.volumes.clear();
59 model_object_dst.volumes.reserve(model_object_new.volumes.size());
60 for (const ModelVolume *model_volume_src : model_object_new.volumes) {
61 ModelVolumeWithStatus key(model_volume_src, false);
62 auto it = std::lower_bound(old_volumes.begin(), old_volumes.end(), key, model_volume_lower);
63 if (it != old_volumes.end() && model_volume_equal(*it, key)) {
64 // The volume was found in the old list. Just copy it.
65 assert(! it->second); // not consumed yet
66 it->second = true;
67 ModelVolume *model_volume_dst = const_cast<ModelVolume*>(it->first);
68 // Type may switch within support family, within precise_seam family, or between them.
69 assert((model_volume_dst->is_support_modifier() && model_volume_src->is_support_modifier()) ||
70 (model_volume_dst->is_precise_seam() && model_volume_src->is_precise_seam()) ||
71 (model_volume_dst->is_support_modifier() && model_volume_src->is_precise_seam()) ||
72 (model_volume_dst->is_precise_seam() && model_volume_src->is_support_modifier()) ||
73 model_volume_dst->type() == model_volume_src->type());
74 model_object_dst.volumes.emplace_back(model_volume_dst);
75 if (model_volume_dst->is_support_modifier() || model_volume_dst->is_precise_seam()) {
76 // Type may have been switched within or between support/precise_seam families.
77 model_volume_dst->set_type(model_volume_src->type());
78 model_volume_dst->set_transformation(model_volume_src->get_transformation());
79 }
80 assert(model_volume_dst->get_matrix().isApprox(model_volume_src->get_matrix()));
81 } else {
82 // The volume was not found in the old list. Create a new copy.
83 assert(model_volume_src->is_support_modifier() || model_volume_src->is_precise_seam());
84 model_object_dst.volumes.emplace_back(new ModelVolume(*model_volume_src));
85 model_object_dst.volumes.back()->set_model_object(&model_object_dst);
86 }
87 }
88 // Release the non-consumed old volumes (those were deleted from the new list).
89 for (ModelVolumeWithStatus &mv_with_status : old_volumes)
90 if (! mv_with_status.second)
91 delete mv_with_status.first;
92}

References ModelVolume(), get_matrix(), get_transformation(), is_precise_seam(), is_support_modifier(), ModelObject, set_transformation(), set_type(), type(), and Slic3r::ModelObject::volumes.

◆ ModelObject

◆ 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

◆ config

ModelConfigObject Slic3r::ModelVolume::config

Referenced by ModelVolume(), ModelVolume(), ModelVolume(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Importer::_generate_volumes(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::Plater::priv::apply_textured_mesh_import_result(), assign_new_unique_ids_recursive(), Slic3r::Print::auto_assign_extruders(), Slic3r::check_model_ids_validity(), Slic3r::GUI::PartPlate::check_single_extruder_mixed_filament_risk(), Slic3r::GUI::ObjectGridTable::construct_object_configs(), Slic3r::ModelObject::convert_units(), anonymous_namespace{EmbossJob.cpp}::create_volume(), extruder_id(), anonymous_namespace{EmbossJob.cpp}::CreateObjectJob::finalize(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::ObjectList::last_volume_is_deleted(), load(), Slic3r::GUI::Tab::load_current_preset(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GUI::ObjectList::merge(), merge_or_add_object(), Slic3r::ModelObject::merge_volumes(), Slic3r::model_has_advanced_features(), Slic3r::model_volume_list_copy_configs(), Slic3r::GUI::ObjectList::object_config_options_changed(), Slic3r::Print::process(), Slic3r::region_config_from_model_volume(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::remap_model_filament_slots(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::CLI::run(), save(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), Slic3r::GUI::ObjectList::split(), Slic3r::ModelObject::split(), update_extruder_count(), update_extruder_count_when_delete_filament(), and Slic3r::GUI::GCodeViewer::update_layers_slider_mode().

◆ cut_info

◆ emboss_shape

◆ fuzzy_skin_facets

◆ m_cached_2d_polygon

Polygon Slic3r::ModelVolume::m_cached_2d_polygon
mutableprivate

◆ m_cached_trans_matrix

Transform3d Slic3r::ModelVolume::m_cached_trans_matrix
mutableprivate

Referenced by clear_cache(), and get_convex_hull_2d().

◆ m_convex_hull

◆ m_convex_hull_2d

Polygon Slic3r::ModelVolume::m_convex_hull_2d
mutableprivate

◆ m_id

ObjectID Slic3r::ObjectBase::m_id
privateinherited

◆ m_is_splittable

int Slic3r::ModelVolume::m_is_splittable { -1 }
mutableprivate

◆ m_material_id

t_model_material_id Slic3r::ModelVolume::m_material_id
private

◆ m_mesh

◆ m_transformation

◆ m_type

◆ mmu_segmentation_facets

◆ mmuseg_extruders

std::vector<int> Slic3r::ModelVolume::mmuseg_extruders
mutable

Referenced by get_extruders().

◆ mmuseg_ts

Timestamp Slic3r::ModelVolume::mmuseg_ts
mutable

Referenced by get_extruders().

◆ name

std::string Slic3r::ModelVolume::name

Referenced by ModelVolume(), ModelVolume(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Importer::_generate_volumes(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::Model::add_object(), Slic3r::Model::add_object(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::GLGizmoCut3D::apply_cut_connectors(), Slic3r::ModelInstance::calc_print_volume_state(), Slic3r::GUI::Plater::priv::can_reload_from_disk(), Slic3r::GUI::check_objects_after_cut(), Slic3r::GUI::ObjectGridTable::construct_object_configs(), Slic3r::ModelObject::convert_units(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::ensure_belt_purge_tower(), Slic3r::fix_model_with_cgal_gui(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::PaintCLI::inspect_to_json(), load(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_mesh_object(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::load_svg(), main(), Slic3r::ModelObject::make_boolean(), Slic3r::merge_solid_parts_inside_object(), Slic3r::ModelObject::merge_volumes(), Slic3r::Step::mesh(), Slic3r::csg::model_to_csgmesh(), Slic3r::model_volume_list_copy_configs(), Slic3r::process_connector_cut(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_all_with_stl(), Slic3r::CLI::run(), save(), Slic3r::GUI::Plater::show_object_info(), Slic3r::GUI::ObjectList::split(), Slic3r::ModelObject::split(), split(), Slic3r::GUI::ObjectGridTable::update_value_to_object(), Slic3r::GUI::Emboss::UpdateJob::update_volume(), Slic3r::GUI::ObjectDataViewModel::UpdateItemNames(), and Slic3r::GUI::Emboss::DataBase::write().

◆ object

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

Referenced by generate_new_id().

◆ seam_facets

◆ source

◆ supported_facets

◆ text_configuration

◆ texture_displacement_facets_0

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_0

◆ texture_displacement_facets_1

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_1

◆ texture_displacement_facets_2

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_2

◆ texture_displacement_facets_3

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_3

◆ texture_displacement_facets_4

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_4

◆ texture_displacement_facets_5

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_5

◆ texture_displacement_facets_6

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_6

◆ texture_displacement_facets_7

FacetsAnnotation Slic3r::ModelVolume::texture_displacement_facets_7

◆ texture_displacement_layers

◆ texture_displacement_options

◆ texture_uv


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