Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cura 11821 crash due to permission #2073

Merged
merged 5 commits into from
May 14, 2024
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
2 changes: 1 addition & 1 deletion src/utils/SVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SVG::SVG(std::string filename, AABB aabb, double scale, Point2LL canvas_size, Co
out_ = fopen(filename.c_str(), "w");
if (! out_)
{
spdlog::error("The file %s could not be opened for writing.", filename);
spdlog::error("The file {} could not be opened for writing.", filename);
}
if (output_is_html_)
{
Expand Down
45 changes: 0 additions & 45 deletions src/utils/polygonUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <spdlog/spdlog.h>

#include "utils/AABB.h"
#include "utils/SVG.h"
#endif

namespace cura
Expand Down Expand Up @@ -689,50 +688,6 @@ ClosestPolygonPoint PolygonUtils::ensureInsideOrOutside(
bool overall_is_inside = polygons.inside(overall_inside.location_);
if (overall_is_inside != (preferred_dist_inside > 0))
{
#ifdef DEBUG
static bool has_run = false;
if (! has_run)
{
try
{
int offset_performed = offset / 2;
AABB aabb(polygons);
aabb.expand(std::abs(preferred_dist_inside) * 2);
SVG svg("debug.html", aabb);
svg.writeComment("Original polygon in black");
svg.writePolygons(polygons, SVG::Color::BLACK);
for (auto poly : polygons)
{
for (auto point : poly)
{
svg.writePoint(point, true, 2);
}
}
std::stringstream ss;
svg.writeComment("Reference polygon in yellow");
svg.writePolygon(closest_poly, SVG::Color::YELLOW);
ss << "Offsetted polygon in blue with offset " << offset_performed;
svg.writeComment(ss.str());
svg.writePolygons(insetted, SVG::Color::BLUE);
for (auto poly : insetted)
{
for (auto point : poly)
{
svg.writePoint(point, true, 2);
}
}
svg.writeComment("From location");
svg.writePoint(from, true, 5, SVG::Color::GREEN);
svg.writeComment("Location computed to be inside the black polygon");
svg.writePoint(inside.location_, true, 5, SVG::Color::RED);
}
catch (...)
{
}
spdlog::error("Clipper::offset failed. See generated debug.html! Black is original Blue is offsetted polygon");
has_run = true;
}
#endif
return ClosestPolygonPoint();
}
inside = overall_inside;
Expand Down