Selection of modifiers in 3D scene

This commit is contained in:
Enrico Turri 2018-11-06 15:51:33 +01:00
parent de981ce8be
commit 57c769b63b
6 changed files with 133 additions and 11 deletions

View file

@ -1038,6 +1038,9 @@ double ModelObject::get_instance_min_z(size_t instance_idx) const
for (const ModelVolume* v : volumes)
{
if (!v->is_model_part())
continue;
#if ENABLE_MODELVOLUME_TRANSFORM
Transform3d mv = mi * v->get_matrix();
const TriangleMesh& hull = v->get_convex_hull();
@ -1152,6 +1155,14 @@ void ModelVolume::set_material(t_model_material_id material_id, const ModelMater
this->object->get_model()->add_material(material_id, material);
}
#if ENABLE_MODELVOLUME_TRANSFORM
void ModelVolume::translate_geometry(const Vec3d& displacement)
{
mesh.translate((float)displacement(0), (float)displacement(1), (float)displacement(2));
m_convex_hull.translate((float)displacement(0), (float)displacement(1), (float)displacement(2));
}
#endif // ENABLE_MODELVOLUME_TRANSFORM
void ModelVolume::calculate_convex_hull()
{
m_convex_hull = mesh.convex_hull_3d();