mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 19:46:29 +08:00
change transform to return mesh
This commit is contained in:
parent
32b3435e06
commit
ee50835291
@ -280,11 +280,13 @@ TriangleMesh::WriteOBJFile(const std::string &output_file) const {
|
||||
#endif
|
||||
}
|
||||
|
||||
void TriangleMesh::transform(const TransformationMatrix &trafo)
|
||||
TriangleMesh TriangleMesh::transform(const TransformationMatrix &trafo)
|
||||
{
|
||||
TriangleMesh mesh = TriangleMesh::TriangleMesh();
|
||||
std::vector<float> trafo_arr = trafo.matrix3x4f();
|
||||
stl_transform(&this->stl, trafo_arr.data());
|
||||
stl_invalidate_shared_vertices(&this->stl);
|
||||
stl_transform(&this->stl, &(mesh.stl), trafo_arr.data());
|
||||
stl_invalidate_shared_vertices(&(mesh.stl));
|
||||
return mesh;
|
||||
}
|
||||
|
||||
void TriangleMesh::scale(float factor)
|
||||
|
@ -63,7 +63,7 @@ class TriangleMesh
|
||||
bool is_manifold() const;
|
||||
void WriteOBJFile(const std::string &output_file) const;
|
||||
|
||||
void transform(const TransformationMatrix &trafo);
|
||||
TriangleMesh transform(const TransformationMatrix &trafo);
|
||||
|
||||
void scale(float factor);
|
||||
void scale(const Pointf3 &versor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user