mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-10-04 12:06:30 +08:00
change object's mesh functions to get trafo'd meshes
This commit is contained in:
parent
bf464572a0
commit
3c05edd170
@ -609,13 +609,14 @@ TriangleMesh
|
|||||||
ModelObject::mesh() const
|
ModelObject::mesh() const
|
||||||
{
|
{
|
||||||
TriangleMesh mesh;
|
TriangleMesh mesh;
|
||||||
TriangleMesh raw_mesh = this->raw_mesh();
|
TransformationMatrix trafo;
|
||||||
|
|
||||||
for (ModelInstancePtrs::const_iterator i = this->instances.begin(); i != this->instances.end(); ++i) {
|
for (ModelInstancePtrs::const_iterator i = this->instances.begin(); i != this->instances.end(); ++i) {
|
||||||
TriangleMesh m(raw_mesh);
|
TransformationMatrix instance_trafo = (*i)->get_trafo_matrix();
|
||||||
(*i)->transform_mesh(&m);
|
for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) {
|
||||||
mesh.merge(m);
|
mesh.merge((*v)->get_transformed_mesh(&instance_trafo));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,7 +626,7 @@ ModelObject::raw_mesh() const
|
|||||||
TriangleMesh mesh;
|
TriangleMesh mesh;
|
||||||
for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) {
|
for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) {
|
||||||
if ((*v)->modifier) continue;
|
if ((*v)->modifier) continue;
|
||||||
mesh.merge((*v)->mesh);
|
mesh.merge((*v)->get_transformed_mesh());
|
||||||
}
|
}
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user