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

(Alternate branch) Maybe fix spdlog for npm package. #2215

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
11 changes: 3 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CuraEngineConan(ConanFile):
exports = "LICENSE*"
settings = "os", "compiler", "build_type", "arch"
package_type = "application"
python_requires = "sentrylibrary/1.0.0", "npmpackage/[>=1.0.0]@ultimaker/np_637"
python_requires = "sentrylibrary/1.0.0", "npmpackage/[>=1.0.0]"
python_requires_extend = "sentrylibrary.SentryLibrary"

options = {
Expand Down Expand Up @@ -108,8 +108,6 @@ def validate(self):

def build_requirements(self):
self.test_requires("standardprojectsettings/[>=0.2.0]")
if self.options.enable_arcus or self.options.enable_plugins:
self.tool_requires("protobuf/3.21.12")
if not self.conf.get("tools.build:skip_test", False, check_type=bool):
self.test_requires("gtest/1.14.0")
if self.options.enable_benchmarks:
Expand All @@ -126,19 +124,16 @@ def requirements(self):
self.requires(req)
if self.options.enable_plugins:
self.requires("neargye-semver/0.3.0")
self.requires("asio-grpc/2.9.2")
for req in self.conan_data["requirements_plugins"]:
self.requires(req)
if self.options.with_cura_resources:
for req in self.conan_data["requirements_cura_resources"]:
self.requires(req)
if self.options.enable_arcus or self.options.enable_plugins:
self.requires("protobuf/3.21.12")
self.requires("clipper/6.4.2@ultimaker/stable")
self.requires("boost/1.83.0")
self.requires("boost/1.86.0")
self.requires("rapidjson/cci.20230929")
self.requires("stb/cci.20230920")
self.requires("spdlog/1.12.0")
self.requires("spdlog/1.14.1")
self.requires("fmt/10.2.1")
self.requires("range-v3/0.12.0")
self.requires("zlib/1.3.1")
Expand Down
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
1 change: 1 addition & 0 deletions include/SkeletalTrapezoidationEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#ifndef SKELETAL_TRAPEZOIDATION_EDGE_H
#define SKELETAL_TRAPEZOIDATION_EDGE_H

#include <cassert>
#include <list>
#include <memory> // smart pointers
#include <vector>
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
1 change: 1 addition & 0 deletions src/geometry/LinesSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "geometry/LinesSet.h"

#include <cassert>
#include <numeric>

#include "geometry/ClosedLinesSet.h"
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/Shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ size_t Shape::findInside(const Point2LL& p, bool border_result) const
{
if (empty())
{
return 0;
return NO_INDEX;
}

// NOTE: Keep these vectors fixed-size, they replace an (non-standard, sized at runtime) arrays.
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
18 changes: 18 additions & 0 deletions src/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <fstream> // ifstream.good()
#include <utility> // pair

#include <range/v3/algorithm/all_of.hpp>
#include <range/v3/view/concat.hpp>
#include <range/v3/view/drop.hpp>
#include <range/v3/view/drop_last.hpp>
Expand Down Expand Up @@ -1013,6 +1014,23 @@ void AreaSupport::generateSupportAreasForMesh(
return;
}

if (ranges::all_of(
mesh.overhang_areas,
[](const Shape& overhang_area)
{
return overhang_area.empty();
})
&& ranges::all_of(
mesh.full_overhang_areas,
[](const Shape& overhang_area)
{
return overhang_area.empty();
}))
{
// Mesh has no overhang, skip support generation
return;
}

// Compute the areas that are disallowed by the X/Y distance.
std::vector<Shape> xy_disallowed_per_layer;
xy_disallowed_per_layer.resize(layer_count);
Expand Down
1 change: 1 addition & 0 deletions src/utils/ListPolyIt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "utils/ListPolyIt.h"

#include <cassert>
#include <cmath> // isfinite
#include <sstream> // ostream

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