WIP: admesh eradication

follow-up to 58d8ab3dea
This commit is contained in:
Vojtech Bubnik 2021-09-14 14:51:28 +02:00
parent 30d2c3787f
commit 9d29eddf16
11 changed files with 61 additions and 43 deletions

View file

@ -84,7 +84,7 @@ void SlicingAdaptive::prepare(const ModelObject &object)
m_faces.reserve(mesh.facets_count());
for (stl_triangle_vertex_indices face : mesh.its.indices) {
stl_vertex vertex[3] = { mesh.its.vertices[face[0]], mesh.its.vertices[face[1]], mesh.its.vertices[face[2]] };
stl_vertex n = (vertex[2] - vertex[1]).cross(vertex[3] - vertex[2]).normalized();
stl_vertex n = face_normal_normalized(vertex);
std::pair<float, float> face_z_span {
std::min(std::min(vertex[0].z(), vertex[1].z()), vertex[2].z()),
std::max(std::max(vertex[0].z(), vertex[1].z()), vertex[2].z())