mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-10-05 07:16:29 +08:00
FIX:use flip_triangles when mesh volume < 0
jira: none Change-Id: I682c737398f347a3243b6202132aae65d5415bdf
This commit is contained in:
parent
2ce2d8c94a
commit
8541f5e893
@ -206,6 +206,9 @@ bool TriangleMesh::from_stl(stl_file& stl, bool repair)
|
|||||||
|
|
||||||
stl_generate_shared_vertices(&stl, this->its);
|
stl_generate_shared_vertices(&stl, this->its);
|
||||||
fill_initial_stats(this->its, this->m_stats);
|
fill_initial_stats(this->its, this->m_stats);
|
||||||
|
if (m_stats.volume < 0) {
|
||||||
|
flip_triangles();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1720,8 +1723,7 @@ float its_volume(const indexed_triangle_set &its)
|
|||||||
float height = normal.dot(triangle[0] - p0);
|
float height = normal.dot(triangle[0] - p0);
|
||||||
volume += (area * height) / 3.0f;
|
volume += (area * height) / 3.0f;
|
||||||
}
|
}
|
||||||
|
return volume;
|
||||||
return std::abs(volume);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float its_average_edge_length(const indexed_triangle_set &its)
|
float its_average_edge_length(const indexed_triangle_set &its)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user