Skip to content

Commit

Permalink
Fixed some possible issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Apr 11, 2024
1 parent 2e82935 commit 53e566b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
17 changes: 5 additions & 12 deletions include/geometry/polyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class OpenPolyline;
* \brief Base class for various types of polylines. A polyline is basically a set of points, but
* we geometrically interpret them forming a chain of segments between each other.
*
* * Open Polyline : this represents a line that does not closes, i.e. the last point is different
* from the initial point
* * Open Polyline : this represents a line that does not close, i.e. the last point is different
* from the initial point (think of the U letter)
* * Closed Polyline : a closed polyline has a final segment joining the last point and the
* initial one
* * Filled Polyline : this is a particular type of closed polyline, for which we consider that the
* "inside" part of the line forms a surface
* initial one (think of the O letter)
* * Polygon : this is a particular type of closed polyline, for which we consider that the
* "inside" part of the line forms a surface
*
* \note Historically, the open and closed polylines were not explicitely differenciated, so
* sometimes we would use an open polyline with an extra point at the end, which virtually
Expand Down Expand Up @@ -134,13 +134,6 @@ class Polyline : public PointsSet
*/
void simplify(const coord_t smallest_line_segment_squared = MM2INT(0.01) * MM2INT(0.01), const coord_t allowed_error_distance_squared = 25);

/*void pseudoClose()
{
if (size() >= 2)
{
push_back(front());
}
}*/

private:
/*!
Expand Down
7 changes: 1 addition & 6 deletions src/SkirtBrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,7 @@ coord_t SkirtBrim::generateOffset(const Offset& offset, Shape& covered_area, std
const int reference_idx = std::get<int>(offset.reference_outline_or_index_);
const coord_t offset_dist = extruder_config.line_width_;

Shape local_brim = storage_.skirt_brim[offset.extruder_nr_][reference_idx].offset(offset_dist, ClipperLib::jtRound);

#warning Is this required now we do all the offsetting in one pass ?
local_brim.unionPolygons();

brim.push_back(local_brim);
brim.push_back(storage_.skirt_brim[offset.extruder_nr_][reference_idx].offset(offset_dist, ClipperLib::jtRound));
}

// limit brim lines to allowed areas, stitch them and store them in the result
Expand Down
3 changes: 0 additions & 3 deletions src/infill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,7 @@ void Infill::generateCrossInfill(const SierpinskiFillProvider& cross_fill_provid
else
{
// make the polyline closed in order to handle cross_pattern_polygon as a polyline, rather than a closed polygon
cross_pattern_polygon.push_back(cross_pattern_polygon[0]);

LinesSet<OpenPolyline> cross_pattern_polylines;
#warning No sure we should add the last point in this case
cross_pattern_polylines.push_back(cross_pattern_polygon.toPseudoOpenPolyline());
LinesSet<OpenPolyline> poly_lines = inner_contour_.intersection(cross_pattern_polylines);
OpenPolylineStitcher::stitch(poly_lines, result_lines, result_polygons, infill_line_width_);
Expand Down
2 changes: 0 additions & 2 deletions src/utils/PolylineStitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,12 @@ void ExtrusionLineStitcher::pushToClosedResult(VariableWidthLines& result_polygo
template<>
void OpenPolylineStitcher::pushToClosedResult(Shape& result_polygons, const OpenPolyline& polyline)
{
#warning Check whether the polyline is explicitely closed
result_polygons.emplace_back(polyline.getPoints(), true);
}

template<>
void PolylineStitcher<OpenLinesSet, ClosedLinesSet, OpenPolyline, Point2LL>::pushToClosedResult(ClosedLinesSet& result_polygons, const OpenPolyline& polyline)
{
#warning Check whether the polyline is explicitely closed
result_polygons.emplace_back(polyline.getPoints(), true);
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/mixed_polyline_stitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ void MixedPolylineStitcher::stitch(const LinesSet<OpenPolyline>& lines, MixedLin
{
// Base stitch method will create explicitely closed polylines, but won't tag them as such
// because it is a generic algorithm. Tag them now.
#warning Make sure that what is said here is true
closed_line.setExplicitelyClosed(true);
}

Expand Down

0 comments on commit 53e566b

Please sign in to comment.