mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 14:08:58 +08:00
merge bugfixs
This commit is contained in:
parent
b4cff5b8bf
commit
6304f7fc28
@ -1781,7 +1781,7 @@ FillRectilinear2WGapFill::fill_surface_extrusion(const Surface *surface, const F
|
||||
for (ExPolygon &p : rectilinear_areas)rec_area += p.area();
|
||||
double gf_area = 0;
|
||||
for (ExPolygon &p : gapfill_areas)gf_area += p.area();
|
||||
std::cout << unscaled(unscaled(surface->expolygon.area())) << " = " << unscaled(unscaled(rec_area)) << " + " << unscaled(unscaled(gf_area)) << "\n";
|
||||
//std::cout << unscaled(unscaled(surface->expolygon.area())) << " = " << unscaled(unscaled(rec_area)) << " + " << unscaled(unscaled(gf_area)) << "\n";
|
||||
|
||||
// rectilinear
|
||||
Polylines polylines_rectilinear;
|
||||
|
@ -1690,6 +1690,7 @@ void GCode::process_layer(
|
||||
|
||||
for (ObjectByExtruder &object_by_extruder : objects_by_extruder_it->second) {
|
||||
const size_t layer_id = &object_by_extruder - objects_by_extruder_it->second.data();
|
||||
std::cout << "Writing gcode for layer at " << layers[layer_id].print_z() << ", " << ((this->m_layer_index *100 )/ this->m_layer_count) << "%" << std::endl;
|
||||
const PrintObject *print_object = layers[layer_id].object();
|
||||
if (print_object == nullptr)
|
||||
// This layer is empty for this particular object, it has neither object extrusions nor support extrusions at this print_z.
|
||||
|
@ -1328,16 +1328,11 @@ MedialAxis::ensure_not_overextrude(ThickPolylines& pp)
|
||||
void
|
||||
MedialAxis::simplify_polygon_frontier()
|
||||
{
|
||||
//simplify the boundary between us and the bounds.
|
||||
ExPolygon simplified_poly = this->surface;
|
||||
simplified_poly.contour.remove_colinear_points(SCALED_EPSILON);
|
||||
for (Polygon &hole : simplified_poly.holes)
|
||||
hole.remove_colinear_points(SCALED_EPSILON);
|
||||
//it will remove every point in the surface contour that aren't on the bounds contour
|
||||
this->expolygon = this->surface;
|
||||
this->expolygon.contour.remove_collinear_points(SCALED_EPSILON);
|
||||
this->expolygon.contour.remove_colinear_points(SCALED_EPSILON);
|
||||
for (Polygon &hole : this->expolygon.holes)
|
||||
hole.remove_collinear_points(SCALED_EPSILON);
|
||||
hole.remove_colinear_points(SCALED_EPSILON);
|
||||
if (&this->surface != this->bounds) {
|
||||
bool need_intersect = false;
|
||||
for (size_t i = 0; i < this->expolygon.contour.points.size(); i++) {
|
||||
@ -1366,9 +1361,9 @@ MedialAxis::simplify_polygon_frontier()
|
||||
} else {
|
||||
//can't simplify that much, reuse the given one
|
||||
this->expolygon = this->surface;
|
||||
this->expolygon.contour.remove_collinear_points(SCALED_EPSILON);
|
||||
this->expolygon.contour.remove_colinear_points(SCALED_EPSILON);
|
||||
for (Polygon &hole : this->expolygon.holes)
|
||||
hole.remove_collinear_points(SCALED_EPSILON);
|
||||
hole.remove_colinear_points(SCALED_EPSILON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ Point Polygon::point_projection(const Point &point) const
|
||||
return proj;
|
||||
}
|
||||
|
||||
size_t Polygon::remove_collinear_points(coord_t max_offset){
|
||||
size_t Polygon::remove_colinear_points(coord_t max_offset){
|
||||
size_t nb_del = 0;
|
||||
if (points.size() < 3) return 0;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
Point point_projection(const Point &point) const;
|
||||
/// remove points that are (almost) on an existing line from previous & next point.
|
||||
/// return number of point removed
|
||||
size_t remove_collinear_points(coord_t max_offset);
|
||||
size_t remove_colinear_points(coord_t max_offset);
|
||||
};
|
||||
|
||||
extern BoundingBox get_extents(const Polygon &poly);
|
||||
|
@ -1679,7 +1679,7 @@ void TriangleMeshSlicer::make_expolygons(const Polygons &loops, ExPolygons* slic
|
||||
Polygons filered_polys = loops;
|
||||
if (this->model_precision > 0){
|
||||
for (Polygon &hole : filered_polys){
|
||||
hole.remove_collinear_points(scale_(this->model_precision));
|
||||
hole.remove_colinear_points(scale_(this->model_precision));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user