change transform to return mesh

This commit is contained in:
Michael Kirsch 2019-03-30 17:30:01 +01:00 committed by Joseph Lenox
parent 32b3435e06
commit ee50835291
2 changed files with 6 additions and 4 deletions

View File

@ -280,11 +280,13 @@ TriangleMesh::WriteOBJFile(const std::string &output_file) const {
#endif #endif
} }
void TriangleMesh::transform(const TransformationMatrix &trafo) TriangleMesh TriangleMesh::transform(const TransformationMatrix &trafo)
{ {
TriangleMesh mesh = TriangleMesh::TriangleMesh();
std::vector<float> trafo_arr = trafo.matrix3x4f(); std::vector<float> trafo_arr = trafo.matrix3x4f();
stl_transform(&this->stl, trafo_arr.data()); stl_transform(&this->stl, &(mesh.stl), trafo_arr.data());
stl_invalidate_shared_vertices(&this->stl); stl_invalidate_shared_vertices(&(mesh.stl));
return mesh;
} }
void TriangleMesh::scale(float factor) void TriangleMesh::scale(float factor)

View File

@ -63,7 +63,7 @@ class TriangleMesh
bool is_manifold() const; bool is_manifold() const;
void WriteOBJFile(const std::string &output_file) 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(float factor);
void scale(const Pointf3 &versor); void scale(const Pointf3 &versor);