Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/FffGcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class FffGcodeWriter : public NoCopy
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part,
SliceLayerPart& part,
LayerPlan& gcode_layer) const;

/*!
Expand Down Expand Up @@ -448,7 +448,7 @@ class FffGcodeWriter : public NoCopy
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part) const;
SliceLayerPart& part) const;

/*!
* Generate the a spiralized wall for a given layer part.
Expand Down
2 changes: 1 addition & 1 deletion include/utils/SVG.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class SVG : NoCopy

void writePolygons(const Shape& polys, const ColorObject color = Color::BLACK, const double stroke_width = 1.0, const bool flush = true) const;

void writePolygon(Polygon poly, const ColorObject color = Color::BLACK, const double stroke_width = 1.0, const bool flush = true) const;
void writePolygon(const Polygon& poly, const ColorObject color = Color::BLACK, const double stroke_width = 1.0, const bool flush = true) const;

void writePolylines(const Shape& polys, const ColorObject color = Color::BLACK, const double stroke_width = 1.0, const bool flush = true) const;

Expand Down
25 changes: 17 additions & 8 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ void FffGcodeWriter::addMeshLayerToGCode(
const MeshPathConfigs& mesh_config,
LayerPlan& gcode_layer) const
{
const auto& mesh = *mesh_ptr;
auto& mesh = *mesh_ptr;
if (gcode_layer.getLayerNr() > mesh.layer_nr_max_filled_layer)
{
return;
Expand All @@ -1801,7 +1801,7 @@ void FffGcodeWriter::addMeshLayerToGCode(
return;
}

const SliceLayer& layer = mesh.layers[gcode_layer.getLayerNr()];
SliceLayer& layer = mesh.layers[gcode_layer.getLayerNr()];

if (layer.parts.empty())
{
Expand All @@ -1819,8 +1819,8 @@ void FffGcodeWriter::addMeshLayerToGCode(
mesh.settings.get<EZSeamCornerPrefType>("z_seam_corner"),
mesh.settings.get<coord_t>("wall_line_width_0") * 2);
}
PathOrderOptimizer<const SliceLayerPart*> part_order_optimizer(gcode_layer.getLastPlannedPositionOrStartingPosition(), z_seam_config);
for (const SliceLayerPart& part : layer.parts)
PathOrderOptimizer<SliceLayerPart*> part_order_optimizer(gcode_layer.getLastPlannedPositionOrStartingPosition(), z_seam_config);
for (SliceLayerPart& part : layer.parts)
{
if (part.outline.empty())
{
Expand All @@ -1831,7 +1831,7 @@ void FffGcodeWriter::addMeshLayerToGCode(

part_order_optimizer.optimize(false);

for (const PathOrdering<const SliceLayerPart*>& path : part_order_optimizer.paths_)
for (const PathOrdering<SliceLayerPart*>& path : part_order_optimizer.paths_)
{
addMeshPartToGCode(storage, mesh, extruder_nr, mesh_config, *path.vertices_, gcode_layer);
}
Expand All @@ -1853,7 +1853,7 @@ void FffGcodeWriter::addMeshPartToGCode(
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part,
SliceLayerPart& part,
LayerPlan& gcode_layer) const
{
const Settings& mesh_group_settings = Application::getInstance().current_slice_->scene.current_mesh_group->settings;
Expand Down Expand Up @@ -2976,7 +2976,7 @@ bool FffGcodeWriter::processInsets(
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part) const
SliceLayerPart& part) const
{
bool added_something = false;
if (extruder_nr != mesh.settings.get<ExtruderTrain&>("wall_0_extruder_nr").extruder_nr_ && extruder_nr != mesh.settings.get<ExtruderTrain&>("wall_x_extruder_nr").extruder_nr_)
Expand Down Expand Up @@ -3099,7 +3099,16 @@ bool FffGcodeWriter::processInsets(
// which is required because when the walls are being generated, the vertices do not fall on the part's outline
// but, instead, are 1/2 a line width inset from the outline

gcode_layer.setBridgeWallMask(compressed_air.offset(max_air_gap + half_outer_wall_width));
Shape bridge_mask = compressed_air.offset(max_air_gap + half_outer_wall_width);
gcode_layer.setBridgeWallMask(bridge_mask);

// Override flooring/skin areas to register bridging areas to be treated as normal skin
for (SkinPart& skin_part : part.skin_parts)
{
Shape moved_area = skin_part.flooring_fill.intersection(bridge_mask).offset(10);
skin_part.flooring_fill = skin_part.flooring_fill.difference(moved_area);
skin_part.skin_fill = skin_part.skin_fill.unionPolygons(moved_area);
}
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions src/path_ordering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const PointsSet& PathOrdering<const SliceLayerPart*>::getVertexData()
return vertices_->outline.outerPolygon();
}

template<>
const PointsSet& PathOrdering<SliceLayerPart*>::getVertexData()
{
return vertices_->outline.outerPolygon();
}

template<>
const PointsSet& PathOrdering<const SupportInfillPart*>::getVertexData()
{
Expand Down
21 changes: 10 additions & 11 deletions src/utils/SVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ void SVG::handleFlush(const bool flush) const


SVG::SVG(std::string filename, AABB aabb, Point2LL canvas_size, ColorObject background)
: SVG(
filename,
aabb,
std::min(
static_cast<double>(canvas_size.X - canvas_size.X / 5 * 2) / static_cast<double>(aabb.max_.X - aabb.min_.X),
static_cast<double>(canvas_size.Y - canvas_size.Y / 5) / static_cast<double>(aabb.max_.Y - aabb.min_.Y)),
canvas_size,
background)
: SVG(filename,
aabb,
std::min(
static_cast<double>(canvas_size.X - canvas_size.X / 5 * 2) / static_cast<double>(aabb.max_.X - aabb.min_.X),
static_cast<double>(canvas_size.Y - canvas_size.Y / 5) / static_cast<double>(aabb.max_.Y - aabb.min_.Y)),
canvas_size,
background)
{
}

Expand Down Expand Up @@ -355,7 +354,7 @@ void SVG::writePolygons(const Shape& polys, const ColorObject color, const doubl
handleFlush(flush);
}

void SVG::writePolygon(const Polygon poly, const ColorObject color, const double stroke_width, const bool flush) const
void SVG::writePolygon(const Polygon& poly, const ColorObject color, const double stroke_width, const bool flush) const
{
if (poly.size() == 0)
{
Expand All @@ -364,7 +363,7 @@ void SVG::writePolygon(const Polygon poly, const ColorObject color, const double
int size = static_cast<int>(poly.size());
Point2LL p0 = poly.back();
int i = 0;
for (Point2LL p1 : poly)
for (const Point2LL& p1 : poly)
{
if (color.color_ == Color::RAINBOW)
{
Expand All @@ -382,7 +381,7 @@ void SVG::writePolygon(const Polygon poly, const ColorObject color, const double
}
else
{
writeLine(p0, p1, color, stroke_width);
writeLine(p0, p1, color, stroke_width, false);
}
p0 = p1;
i++;
Expand Down
Loading