mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Support larger printer sizes by using 64-bit.
SuperSlicer is referenced for some changes. Co-authored-by: Merill <merill@free.fr>
This commit is contained in:
@@ -1504,7 +1504,7 @@ indexed_triangle_set polygons2model_unique(
|
||||
const Points &points)
|
||||
{
|
||||
// CW order of triangle indices
|
||||
std::vector<Vec3i> shape_triangles=Triangulation::triangulate(shape2d, points);
|
||||
std::vector<Vec3i32> shape_triangles=Triangulation::triangulate(shape2d, points);
|
||||
uint32_t count_point = points.size();
|
||||
|
||||
indexed_triangle_set result;
|
||||
@@ -1525,10 +1525,10 @@ indexed_triangle_set polygons2model_unique(
|
||||
std::make_move_iterator(back_points.end()));
|
||||
result.indices.reserve(shape_triangles.size() * 2 + points.size() * 2);
|
||||
// top triangles - change to CCW
|
||||
for (const Vec3i &t : shape_triangles)
|
||||
for (const Vec3i32 &t : shape_triangles)
|
||||
result.indices.emplace_back(t.x(), t.z(), t.y());
|
||||
// bottom triangles - use CW
|
||||
for (const Vec3i &t : shape_triangles)
|
||||
for (const Vec3i32 &t : shape_triangles)
|
||||
result.indices.emplace_back(t.x() + count_point,
|
||||
t.y() + count_point,
|
||||
t.z() + count_point);
|
||||
@@ -1564,7 +1564,7 @@ indexed_triangle_set polygons2model_duplicit(
|
||||
{
|
||||
// CW order of triangle indices
|
||||
std::vector<uint32_t> changes = Triangulation::create_changes(points, duplicits);
|
||||
std::vector<Vec3i> shape_triangles = Triangulation::triangulate(shape2d, points, changes);
|
||||
std::vector<Vec3i32> shape_triangles = Triangulation::triangulate(shape2d, points, changes);
|
||||
uint32_t count_point = *std::max_element(changes.begin(), changes.end()) + 1;
|
||||
|
||||
indexed_triangle_set result;
|
||||
@@ -1596,10 +1596,10 @@ indexed_triangle_set polygons2model_duplicit(
|
||||
|
||||
result.indices.reserve(shape_triangles.size() * 2 + points.size() * 2);
|
||||
// top triangles - change to CCW
|
||||
for (const Vec3i &t : shape_triangles)
|
||||
for (const Vec3i32 &t : shape_triangles)
|
||||
result.indices.emplace_back(t.x(), t.z(), t.y());
|
||||
// bottom triangles - use CW
|
||||
for (const Vec3i &t : shape_triangles)
|
||||
for (const Vec3i32 &t : shape_triangles)
|
||||
result.indices.emplace_back(t.x() + count_point, t.y() + count_point,
|
||||
t.z() + count_point);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user