mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 01:16:01 +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();
|
for (ExPolygon &p : rectilinear_areas)rec_area += p.area();
|
||||||
double gf_area = 0;
|
double gf_area = 0;
|
||||||
for (ExPolygon &p : gapfill_areas)gf_area += p.area();
|
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
|
// rectilinear
|
||||||
Polylines polylines_rectilinear;
|
Polylines polylines_rectilinear;
|
||||||
|
@ -1689,7 +1689,8 @@ void GCode::process_layer(
|
|||||||
gcode+="; PURGING FINISHED\n";
|
gcode+="; PURGING FINISHED\n";
|
||||||
|
|
||||||
for (ObjectByExtruder &object_by_extruder : objects_by_extruder_it->second) {
|
for (ObjectByExtruder &object_by_extruder : objects_by_extruder_it->second) {
|
||||||
const size_t layer_id = &object_by_extruder - objects_by_extruder_it->second.data();
|
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();
|
const PrintObject *print_object = layers[layer_id].object();
|
||||||
if (print_object == nullptr)
|
if (print_object == nullptr)
|
||||||
// This layer is empty for this particular object, it has neither object extrusions nor support extrusions at this print_z.
|
// 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
|
void
|
||||||
MedialAxis::simplify_polygon_frontier()
|
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
|
//it will remove every point in the surface contour that aren't on the bounds contour
|
||||||
this->expolygon = this->surface;
|
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)
|
for (Polygon &hole : this->expolygon.holes)
|
||||||
hole.remove_collinear_points(SCALED_EPSILON);
|
hole.remove_colinear_points(SCALED_EPSILON);
|
||||||
if (&this->surface != this->bounds) {
|
if (&this->surface != this->bounds) {
|
||||||
bool need_intersect = false;
|
bool need_intersect = false;
|
||||||
for (size_t i = 0; i < this->expolygon.contour.points.size(); i++) {
|
for (size_t i = 0; i < this->expolygon.contour.points.size(); i++) {
|
||||||
@ -1366,9 +1361,9 @@ MedialAxis::simplify_polygon_frontier()
|
|||||||
} else {
|
} else {
|
||||||
//can't simplify that much, reuse the given one
|
//can't simplify that much, reuse the given one
|
||||||
this->expolygon = this->surface;
|
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)
|
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;
|
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;
|
size_t nb_del = 0;
|
||||||
if (points.size() < 3) return 0;
|
if (points.size() < 3) return 0;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
Point point_projection(const Point &point) const;
|
Point point_projection(const Point &point) const;
|
||||||
/// remove points that are (almost) on an existing line from previous & next point.
|
/// remove points that are (almost) on an existing line from previous & next point.
|
||||||
/// return number of point removed
|
/// 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);
|
extern BoundingBox get_extents(const Polygon &poly);
|
||||||
|
@ -1679,7 +1679,7 @@ void TriangleMeshSlicer::make_expolygons(const Polygons &loops, ExPolygons* slic
|
|||||||
Polygons filered_polys = loops;
|
Polygons filered_polys = loops;
|
||||||
if (this->model_precision > 0){
|
if (this->model_precision > 0){
|
||||||
for (Polygon &hole : filered_polys){
|
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