libslic3r
Library for generating gcode from 3d models
|
#include <Model.hpp>
Public Member Functions | |
Model * | get_model () const |
ModelVolume * | add_volume (const TriangleMesh &mesh) |
ModelVolume * | add_volume (const ModelVolume &volume) |
void | delete_volume (size_t idx) |
void | clear_volumes () |
Delete all ModelVolumes in the. More... | |
ModelInstance * | add_instance () |
ModelInstance * | add_instance (const ModelInstance &instance) |
void | delete_instance (size_t idx) |
void | delete_last_instance () |
Delete the last created ModelInstance object. More... | |
void | clear_instances () |
Delete all ModelInstance objects found in the current ModelObject. More... | |
BoundingBoxf3 | bounding_box () |
Get the bounding box of the transformed instances. More... | |
void | invalidate_bounding_box () |
Invalidate the bounding box in the current ModelObject. More... | |
void | repair () |
Repair all TriangleMesh objects found in each ModelVolume. More... | |
TriangleMesh | mesh () const |
Flatten all volumes and instances into a single mesh and applying all the ModelInstances transformations. More... | |
TriangleMesh | raw_mesh () const |
Flatten all volumes into a single mesh. More... | |
BoundingBoxf3 | raw_bounding_box () const |
BoundingBoxf3 | instance_bounding_box (size_t instance_idx) const |
void | align_to_ground () |
Align the current ModelObject to ground by translating the ModelVolumes in the z axis the needed units. More... | |
void | center_around_origin () |
Center the current ModelObject to origin by translating the ModelVolumes. More... | |
void | translate (const Vectorf3 &vector) |
void | translate (coordf_t x, coordf_t y, coordf_t z) |
void | scale (float factor) |
void | scale (const Pointf3 &versor) |
void | scale_to_fit (const Sizef3 &size) |
void | rotate (float angle, const Axis &axis) |
void | mirror (const Axis &axis) |
void | transform_by_instance (ModelInstance instance, bool dont_translate=false) |
size_t | materials_count () const |
size_t | facets_count () const |
bool | needed_repair () const |
void | cut (Axis axis, coordf_t z, Model *model) const |
void | split (ModelObjectPtrs *new_objects) |
void | update_bounding_box () |
Update the bounding box in this ModelObject. More... | |
void | print_info () const |
Print the current info of this ModelObject. More... | |
Public Attributes | |
std::string | name |
This ModelObject name. More... | |
std::string | input_file |
Input file path. More... | |
ModelInstancePtrs | instances |
ModelVolumePtrs | volumes |
DynamicPrintConfig | config |
Configuration parameters specific to a single ModelObject, overriding the global Slic3r settings. More... | |
t_layer_height_ranges | layer_height_ranges |
Variation of a layer thickness for spans of Z coordinates. More... | |
int | part_number |
It's used for the 3MF items part numbers in the build element. More... | |
LayerHeightSpline | layer_height_spline |
Spline based variations of layer thickness for interactive user manipulation. More... | |
Pointf3 | origin_translation |
BoundingBoxf3 | _bounding_box |
bool | _bounding_box_valid |
Friends | |
class | Model |
Model Object class A printable object, possibly having multiple print volumes (each with its own set of parameters and materials), and possibly having multiple modifier volumes, each modifier volume with its set of parameters and materials. Each ModelObject may be instantiated multiple times, each instance having different placement on the print bed, different rotation and different uniform scaling.
ModelInstance * Slic3r::ModelObject::add_instance | ( | ) |
Add a new ModelInstance to the current ModelObject.
ModelInstance * Slic3r::ModelObject::add_instance | ( | const ModelInstance & | instance | ) |
Add a new ModelInstance to the current ModelObject.
instance | the ModelInstance to be copied |
ModelVolume * Slic3r::ModelObject::add_volume | ( | const TriangleMesh & | mesh | ) |
Add a new ModelVolume to the current ModelObject. The mesh is copied into the newly created ModelVolume.
mesh | TriangularMesh |
ModelVolume * Slic3r::ModelObject::add_volume | ( | const ModelVolume & | volume | ) |
Add a new ModelVolume to the current ModelObject.
volume | the ModelVolume object to be copied |
void Slic3r::ModelObject::align_to_ground | ( | ) |
Align the current ModelObject to ground by translating the ModelVolumes in the z axis the needed units.
BoundingBoxf3 Slic3r::ModelObject::bounding_box | ( | ) |
Get the bounding box of the transformed instances.
void Slic3r::ModelObject::center_around_origin | ( | ) |
Center the current ModelObject to origin by translating the ModelVolumes.
void Slic3r::ModelObject::clear_instances | ( | ) |
Delete all ModelInstance objects found in the current ModelObject.
void Slic3r::ModelObject::clear_volumes | ( | ) |
Delete all ModelVolumes in the.
Cut (Slice) the current ModelObject along a certain axis at a certain coordinate.
void Slic3r::ModelObject::delete_instance | ( | size_t | idx | ) |
Delete a ModelInstance.
idx | size_t the index of the ModelInstance to be deleted |
void Slic3r::ModelObject::delete_last_instance | ( | ) |
Delete the last created ModelInstance object.
void Slic3r::ModelObject::delete_volume | ( | size_t | idx | ) |
Delete a ModelVolume object.
idx | size_t the index of the ModelVolume to be deleted |
size_t Slic3r::ModelObject::facets_count | ( | ) | const |
Get the number of the facets found in all ModelVolume objects in this ModelObject which are not modifier volumes.
|
inline |
BoundingBoxf3 Slic3r::ModelObject::instance_bounding_box | ( | size_t | instance_idx | ) | const |
Get the bounding box of the transformed given instance.
instance_idx | size_t the index of the ModelInstance in the ModelInstance vector |
void Slic3r::ModelObject::invalidate_bounding_box | ( | ) |
Invalidate the bounding box in the current ModelObject.
size_t Slic3r::ModelObject::materials_count | ( | ) | const |
Get the number of the unique ModelMaterial objects in this ModelObject.
TriangleMesh Slic3r::ModelObject::mesh | ( | ) | const |
Flatten all volumes and instances into a single mesh and applying all the ModelInstances transformations.
void Slic3r::ModelObject::mirror | ( | const Axis & | axis | ) |
Mirror the current Model around a certain axis.
axis | Axis enum member |
bool Slic3r::ModelObject::needed_repair | ( | ) | const |
Know whether there exists a TriangleMesh object that needed repair or not.
void Slic3r::ModelObject::print_info | ( | ) | const |
Print the current info of this ModelObject.
BoundingBoxf3 Slic3r::ModelObject::raw_bounding_box | ( | ) | const |
Get the raw bounding box. This function croaks when there are no ModelInstances for this ModelObject
TriangleMesh Slic3r::ModelObject::raw_mesh | ( | ) | const |
Flatten all volumes into a single mesh.
void Slic3r::ModelObject::repair | ( | ) |
Repair all TriangleMesh objects found in each ModelVolume.
void Slic3r::ModelObject::rotate | ( | float | angle, |
const Axis & | axis | ||
) |
Rotate the current ModelObject by rotating ModelVolumes.
angle | float the angle in radians |
axis | Axis the axis to be rotated around |
void Slic3r::ModelObject::scale | ( | float | factor | ) |
Scale the current ModelObject by scaling its ModelVolumes. This function calls scale(const Pointf3 &versor) to scale every TriangleMesh in each ModelVolume.
factor | float the scaling factor |
void Slic3r::ModelObject::scale | ( | const Pointf3 & | versor | ) |
Scale the current ModelObject by scaling its ModelVolumes.
versor | Pointf3 the scaling factor in a 3d vector. |
void Slic3r::ModelObject::scale_to_fit | ( | const Sizef3 & | size | ) |
Scale the current ModelObject to fit by altering the scaling factor of ModelInstances. It operates on the total size by duplicating the object according to all the instances.
size | Sizef3 the size vector |
void Slic3r::ModelObject::split | ( | ModelObjectPtrs * | new_objects | ) |
Split the meshes of the ModelVolume in this ModelObject if there exists only one ModelVolume in this ModelObject.
new_objects | ModelObjectPtrs the generated ModelObjects after the single ModelVolume split |
void Slic3r::ModelObject::transform_by_instance | ( | ModelInstance | instance, |
bool | dont_translate = false |
||
) |
Transform the current ModelObject by a certain ModelInstance attributes. Inverse transformation is applied to all the ModelInstances, so that the final size/position/rotation of the transformed objects doesn't change.
instance | ModelInstance the instance used to transform the current ModelObject |
dont_translate | bool whether to translate the current ModelObject or not |
void Slic3r::ModelObject::translate | ( | const Vectorf3 & | vector | ) |
Translate the current ModelObject by translating ModelVolumes with (x,y,z) units. This function calls translate(coordf_t x, coordf_t y, coordf_t z) to translate every TriangleMesh in each ModelVolume.
vector | Vectorf3 the translation vector |
Translate the current ModelObject by translating ModelVolumes with (x,y,z) units.
x | coordf_t the x units |
y | coordf_t the y units |
z | coordf_t the z units |
void Slic3r::ModelObject::update_bounding_box | ( | ) |
Update the bounding box in this ModelObject.
|
friend |
BoundingBoxf3 Slic3r::ModelObject::_bounding_box |
bool Slic3r::ModelObject::_bounding_box_valid |
DynamicPrintConfig Slic3r::ModelObject::config |
Configuration parameters specific to a single ModelObject, overriding the global Slic3r settings.
std::string Slic3r::ModelObject::input_file |
Input file path.
ModelInstancePtrs Slic3r::ModelObject::instances |
Instances of this ModelObject. Each instance defines a shift on the print bed, rotation around the Z axis and a uniform scaling. Instances are owned by this ModelObject.
t_layer_height_ranges Slic3r::ModelObject::layer_height_ranges |
Variation of a layer thickness for spans of Z coordinates.
LayerHeightSpline Slic3r::ModelObject::layer_height_spline |
Spline based variations of layer thickness for interactive user manipulation.
std::string Slic3r::ModelObject::name |
This ModelObject name.
Pointf3 Slic3r::ModelObject::origin_translation |
This vector accumulates the total translation applied to the object by the center_around_origin() method. Callers might want to apply the same translation to new volumes before adding them to this object in order to preserve alignment when user expects that.
int Slic3r::ModelObject::part_number |
It's used for the 3MF items part numbers in the build element.
ModelVolumePtrs Slic3r::ModelObject::volumes |
Printable and modifier volumes, each with its material ID and a set of override parameters. ModelVolumes are owned by this ModelObject.