mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step
This commit is contained in:
parent
077680b806
commit
86da661097
60 changed files with 1228 additions and 1206 deletions
|
@ -24,14 +24,14 @@ void FillPlanePath::_fill_surface_single(
|
|||
Point shift = this->_centered() ?
|
||||
bounding_box.center() :
|
||||
bounding_box.min;
|
||||
expolygon.translate(-shift.x, -shift.y);
|
||||
bounding_box.translate(-shift.x, -shift.y);
|
||||
expolygon.translate(-shift.x(), -shift.y());
|
||||
bounding_box.translate(-shift.x(), -shift.y());
|
||||
|
||||
Pointfs pts = _generate(
|
||||
coord_t(ceil(coordf_t(bounding_box.min.x) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.min.y) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.max.x) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.max.y) / distance_between_lines)));
|
||||
coord_t(ceil(coordf_t(bounding_box.min.x()) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.min.y()) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.max.x()) / distance_between_lines)),
|
||||
coord_t(ceil(coordf_t(bounding_box.max.y()) / distance_between_lines)));
|
||||
|
||||
Polylines polylines;
|
||||
if (pts.size() >= 2) {
|
||||
|
@ -41,8 +41,8 @@ void FillPlanePath::_fill_surface_single(
|
|||
polyline.points.reserve(pts.size());
|
||||
for (Pointfs::iterator it = pts.begin(); it != pts.end(); ++ it)
|
||||
polyline.points.push_back(Point(
|
||||
coord_t(floor(it->x * distance_between_lines + 0.5)),
|
||||
coord_t(floor(it->y * distance_between_lines + 0.5))));
|
||||
coord_t(floor(it->x() * distance_between_lines + 0.5)),
|
||||
coord_t(floor(it->y() * distance_between_lines + 0.5))));
|
||||
// intersection(polylines_src, offset((Polygons)expolygon, scale_(0.02)), &polylines);
|
||||
polylines = intersection_pl(polylines, to_polygons(expolygon));
|
||||
|
||||
|
@ -62,7 +62,7 @@ void FillPlanePath::_fill_surface_single(
|
|||
|
||||
// paths must be repositioned and rotated back
|
||||
for (Polylines::iterator it = polylines.begin(); it != polylines.end(); ++ it) {
|
||||
it->translate(shift.x, shift.y);
|
||||
it->translate(shift.x(), shift.y());
|
||||
it->rotate(direction.first);
|
||||
}
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ Pointfs FillHilbertCurve::_generate(coord_t min_x, coord_t min_y, coord_t max_x,
|
|||
line.reserve(sz2);
|
||||
for (size_t i = 0; i < sz2; ++ i) {
|
||||
Point p = hilbert_n_to_xy(i);
|
||||
line.push_back(Pointf(p.x + min_x, p.y + min_y));
|
||||
line.push_back(Pointf(p.x() + min_x, p.y() + min_y));
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue