libslic3r
Library for generating gcode from 3d models
Public Member Functions | Public Attributes | Friends | List of all members
Slic3r::ModelInstance Class Reference

#include <Model.hpp>

Public Member Functions

ModelObjectget_object () const
 
void transform_mesh (TriangleMesh *mesh, bool dont_translate=false) const
 
BoundingBoxf3 transform_mesh_bounding_box (const TriangleMesh *mesh, bool dont_translate=false) const
 
BoundingBoxf3 transform_bounding_box (const BoundingBoxf3 &bbox, bool dont_translate=false) const
 
void transform_polygon (Polygon *polygon) const
 

Public Attributes

double rotation
 Rotation around the Z axis, in radians around mesh center point. More...
 
double x_rotation
 Rotation around the X axis, in radians around mesh center point. Specific to 3MF format. More...
 
double y_rotation
 Rotation around the Y axis, in radians around mesh center point. Specific to 3MF format. More...
 
double scaling_factor
 uniform scaling factor. More...
 
Pointf3 scaling_vector
 scaling vector. Specific to 3MF format. More...
 
Pointf offset
 offset in unscaled coordinates. More...
 
double z_translation
 translation in z axis. Specific to 3MF format. It's not used anywhere in Slic3r except at writing/reading 3mf. More...
 

Friends

class ModelObject
 

Detailed Description

A single instance of a ModelObject. Knows the affine transformation of an object.

Member Function Documentation

◆ get_object()

ModelObject* Slic3r::ModelInstance::get_object ( ) const
inline

Get the owning ModelObject

Returns
ModelObject* pointer to the owner ModelObject

◆ transform_bounding_box()

BoundingBoxf3 Slic3r::ModelInstance::transform_bounding_box ( const BoundingBoxf3 bbox,
bool  dont_translate = false 
) const

Transform an external bounding box.

Parameters
bboxBoundingBoxf3 the bounding box to be transformed
dont_translatebool whether to translate the bounding box or not
Returns
BoundingBoxf3 the bounding box after transformation

◆ transform_mesh()

void Slic3r::ModelInstance::transform_mesh ( TriangleMesh mesh,
bool  dont_translate = false 
) const

Transform an external TriangleMesh object

Parameters
meshTriangleMesh* pointer to the the mesh
dont_translatebool whether to translate the mesh or not

◆ transform_mesh_bounding_box()

BoundingBoxf3 Slic3r::ModelInstance::transform_mesh_bounding_box ( const TriangleMesh mesh,
bool  dont_translate = false 
) const

Calculate a bounding box of a transformed mesh. To be called on an external mesh.

Parameters
meshTriangleMesh* pointer to the the mesh
dont_translatebool whether to translate the bounding box or not
Returns
BoundingBoxf3 the bounding box after transformation

◆ transform_polygon()

void Slic3r::ModelInstance::transform_polygon ( Polygon polygon) const

Rotate or scale an external polygon. It does not translate the polygon.

Parameters
polygonPolygon* a pointer to the Polygon

Friends And Related Function Documentation

◆ ModelObject

friend class ModelObject
friend

Member Data Documentation

◆ offset

Pointf Slic3r::ModelInstance::offset

offset in unscaled coordinates.

◆ rotation

double Slic3r::ModelInstance::rotation

Rotation around the Z axis, in radians around mesh center point.

◆ scaling_factor

double Slic3r::ModelInstance::scaling_factor

uniform scaling factor.

◆ scaling_vector

Pointf3 Slic3r::ModelInstance::scaling_vector

scaling vector. Specific to 3MF format.

◆ x_rotation

double Slic3r::ModelInstance::x_rotation

Rotation around the X axis, in radians around mesh center point. Specific to 3MF format.

◆ y_rotation

double Slic3r::ModelInstance::y_rotation

Rotation around the Y axis, in radians around mesh center point. Specific to 3MF format.

◆ z_translation

double Slic3r::ModelInstance::z_translation

translation in z axis. Specific to 3MF format. It's not used anywhere in Slic3r except at writing/reading 3mf.


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