mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 00:31:11 -06:00
Added Vec3d ModelInstance::transform_vector() method
This commit is contained in:
parent
b9287d51dd
commit
c8f1369824
4 changed files with 17 additions and 9 deletions
|
@ -1016,6 +1016,11 @@ BoundingBoxf3 ModelInstance::transform_bounding_box(const BoundingBoxf3 &bbox, b
|
|||
return bbox.transformed(world_matrix(dont_translate));
|
||||
}
|
||||
|
||||
Vec3d ModelInstance::transform_vector(const Vec3d& v, bool dont_translate) const
|
||||
{
|
||||
return world_matrix(dont_translate) * v;
|
||||
}
|
||||
|
||||
void ModelInstance::transform_polygon(Polygon* polygon) const
|
||||
{
|
||||
polygon->rotate(this->rotation); // rotate around polygon origin
|
||||
|
|
|
@ -239,6 +239,8 @@ public:
|
|||
BoundingBoxf3 transform_mesh_bounding_box(const TriangleMesh* mesh, bool dont_translate = false) const;
|
||||
// Transform an external bounding box.
|
||||
BoundingBoxf3 transform_bounding_box(const BoundingBoxf3 &bbox, bool dont_translate = false) const;
|
||||
// Transform an external vector.
|
||||
Vec3d transform_vector(const Vec3d& v, bool dont_translate = false) const;
|
||||
// To be called on an external polygon. It does not translate the polygon, only rotates and scales.
|
||||
void transform_polygon(Polygon* polygon) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue