mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-16 14:22:43 -07:00
Move centering outside the Print object
This commit is contained in:
@@ -191,10 +191,8 @@ TriangleMesh::slice(const std::vector<double> &z, std::vector<Polygons> &layers)
|
||||
FUTURE: parallelize slice_facet() and make_loops()
|
||||
*/
|
||||
|
||||
if (!this->repaired) this->repair();
|
||||
|
||||
// build a table to map a facet_idx to its three edge indices
|
||||
if (this->stl.v_shared == NULL) stl_generate_shared_vertices(&(this->stl));
|
||||
this->require_shared_vertices();
|
||||
typedef std::pair<int,int> t_edge;
|
||||
typedef std::vector<t_edge> t_edges; // edge_idx => a_id,b_id
|
||||
typedef std::map<t_edge,int> t_edges_map; // a_id,b_id => edge_idx
|
||||
@@ -607,7 +605,7 @@ TriangleMesh::horizontal_projection(ExPolygons &retval) const
|
||||
void
|
||||
TriangleMesh::convex_hull(Polygon* hull)
|
||||
{
|
||||
if (this->stl.v_shared == NULL) stl_generate_shared_vertices(&(this->stl));
|
||||
this->require_shared_vertices();
|
||||
Points pp;
|
||||
pp.reserve(this->stl.stats.shared_vertices);
|
||||
for (int i = 0; i < this->stl.stats.shared_vertices; i++) {
|
||||
@@ -617,6 +615,13 @@ TriangleMesh::convex_hull(Polygon* hull)
|
||||
Slic3r::Geometry::convex_hull(pp, hull);
|
||||
}
|
||||
|
||||
void
|
||||
TriangleMesh::require_shared_vertices()
|
||||
{
|
||||
if (!this->repaired) this->repair();
|
||||
if (this->stl.v_shared == NULL) stl_generate_shared_vertices(&(this->stl));
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
TriangleMesh::to_SV() {
|
||||
|
||||
Reference in New Issue
Block a user