mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
New TriangleMesh::convex_hull()
This commit is contained in:
parent
a29eeb7789
commit
9cf138574c
4 changed files with 27 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "TriangleMesh.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
#include "Geometry.hpp"
|
||||
#include <queue>
|
||||
#include <deque>
|
||||
#include <set>
|
||||
|
@ -598,6 +599,19 @@ TriangleMesh::horizontal_projection(ExPolygons &retval) const
|
|||
union_(pp, retval, true);
|
||||
}
|
||||
|
||||
void
|
||||
TriangleMesh::convex_hull(Polygon &hull)
|
||||
{
|
||||
if (this->stl.v_shared == NULL) stl_generate_shared_vertices(&(this->stl));
|
||||
Points pp;
|
||||
pp.reserve(this->stl.stats.shared_vertices);
|
||||
for (int i = 0; i < this->stl.stats.shared_vertices; i++) {
|
||||
stl_vertex* v = this->stl.v_shared;
|
||||
pp.push_back(Point(v->x / SCALING_FACTOR, v->y / SCALING_FACTOR));
|
||||
}
|
||||
Slic3r::Geometry::convex_hull(pp, hull);
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
TriangleMesh::to_SV() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue