Skip to content

Commit

Permalink
Merge branch 'main' into boyscout_1
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/communication/CommandLine.cpp
  • Loading branch information
jellespijker committed Aug 8, 2022
2 parents 5daa7ba + 33fbeff commit f0550f7
Show file tree
Hide file tree
Showing 50 changed files with 4,402 additions and 4,303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Run Unit Test CuraEngine
id: run-test
run: ctest --output-junit engine_test.xml
working-directory: cmake-build-release
working-directory: build/Release

- name: Publish Unit Test Results
id: test-results
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Expand Up @@ -121,7 +121,6 @@ set(engine_SRCS # Except main.cpp.
src/utils/gettime.cpp
src/utils/LinearAlg2D.cpp
src/utils/ListPolyIt.cpp
src/utils/logoutput.cpp
src/utils/MinimumSpanningTree.cpp
src/utils/Point3.cpp
src/utils/PolygonConnector.cpp
Expand Down Expand Up @@ -184,12 +183,14 @@ find_package(clipper REQUIRED)
find_package(rapidjson REQUIRED)
find_package(stb REQUIRED)
find_package(Boost REQUIRED)
find_package(spdlog REQUIRED)
find_package(fmt REQUIRED)

if (ENABLE_TESTING)
find_package(GTest REQUIRED)
endif ()

target_link_libraries(_CuraEngine PRIVATE clipper::clipper rapidjson::rapidjson stb::stb boost::boost $<$<BOOL:${ENABLE_TESTING}>:GTest::gtest>)
target_link_libraries(_CuraEngine PUBLIC spdlog::spdlog PRIVATE fmt::fmt clipper::clipper rapidjson::rapidjson stb::stb boost::boost $<$<BOOL:${ENABLE_TESTING}>:GTest::gtest>)

if (NOT WIN32)
add_executable(CuraEngine src/main.cpp) # Then compile main.cpp as separate executable, and link the library to it.
Expand Down
12 changes: 8 additions & 4 deletions conandata.yml
Expand Up @@ -4,12 +4,14 @@
- "boost/1.79.0"
- "rapidjson/1.1.0"
- "stb/20200203"
- "spdlog/1.10.0"
- "fmt/9.0.0"
requirements_arcus:
- "protobuf/3.17.1"
- "protobuf/3.21.4"
- "arcus/(latest)@ultimaker/testing"
- "zlib/1.2.12"
build_requirements_arcus:
- "protobuf/3.17.1"
- "protobuf/3.21.4"
build_requirements_testing:
- "gtest/1.12.1"
"5.1.0":
Expand Down Expand Up @@ -60,11 +62,13 @@
- "boost/1.79.0"
- "rapidjson/1.1.0"
- "stb/20200203"
- "spdlog/1.10.0"
- "fmt/9.0.0"
requirements_arcus:
- "protobuf/3.17.1"
- "protobuf/3.21.4"
- "arcus/(latest)@ultimaker/testing"
- "zlib/1.2.12"
build_requirements_arcus:
- "protobuf/3.17.1"
- "protobuf/3.21.4"
build_requirements_testing:
- "gtest/1.12.1"
38 changes: 16 additions & 22 deletions include/BeadingStrategy/BeadingStrategy.h
@@ -1,26 +1,25 @@
// Copyright (c) 2021 Ultimaker B.V.
// CuraEngine is released under the terms of the AGPLv3 or higher.
// Copyright (c) 2022 Ultimaker B.V.
// CuraEngine is released under the terms of the AGPLv3 or higher

#ifndef BEADING_STRATEGY_H
#define BEADING_STRATEGY_H

#include <memory>

#include "../utils/IntPoint.h"
#include "../utils/logoutput.h"
#include "../settings/types/Angle.h"
#include "../settings/types/Ratio.h" //For the wall transition threshold.
#include "../utils/IntPoint.h"

namespace cura
{

/*!
* Mostly virtual base class template.
*
*
* Strategy for covering a given (constant) horizontal model thickness with a number of beads.
*
*
* The beads may have different widths.
*
*
* TODO: extend with printing order?
*/
class BeadingStrategy
Expand All @@ -37,24 +36,19 @@ class BeadingStrategy
coord_t left_over; //! The distance not covered by any bead; gap area.
};

BeadingStrategy
(
coord_t optimal_width,
Ratio wall_split_middle_threshold,
Ratio wall_add_middle_threshold,
coord_t default_transition_length,
float transitioning_angle = pi_div(3)
);
BeadingStrategy(coord_t optimal_width, Ratio wall_split_middle_threshold, Ratio wall_add_middle_threshold, coord_t default_transition_length, float transitioning_angle = pi_div(3));

BeadingStrategy(const BeadingStrategy& other);

virtual ~BeadingStrategy() {}
virtual ~BeadingStrategy()
{
}

/*!
* Retrieve the bead widths with which to cover a given thickness.
*
*
* Requirement: Given a constant \p bead_count the output of each bead width must change gradually along with the \p thickness.
*
*
* \note The \p bead_count might be different from the \ref BeadingStrategy::optimal_bead_count
*/
virtual Beading compute(coord_t thickness, coord_t bead_count) const = 0;
Expand All @@ -76,26 +70,26 @@ class BeadingStrategy

/*!
* The length of the transitioning region along the marked / significant regions of the skeleton.
*
*
* Transitions are used to smooth out the jumps in integer bead count; the jumps turn into ramps with some incline defined by their length.
*/
virtual coord_t getTransitioningLength(coord_t lower_bead_count) const;

/*!
* The fraction of the transition length to put between the lower end of the transition and the point where the unsmoothed bead count jumps.
*
*
* Transitions are used to smooth out the jumps in integer bead count; the jumps turn into ramps which could be positioned relative to the jump location.
*/
virtual float getTransitionAnchorPos(coord_t lower_bead_count) const;

/*!
* Get the locations in a bead count region where \ref BeadingStrategy::compute exhibits a bend in the widths.
* Ordered from lower thickness to higher.
*
*
* This is used to insert extra support bones into the skeleton, so that the resulting beads in long trapezoids don't linearly change between the two ends.
*/
virtual std::vector<coord_t> getNonlinearThicknesses(coord_t lower_bead_count) const;

virtual std::string toString() const;

coord_t getOptimalWidth() const;
Expand Down
15 changes: 7 additions & 8 deletions include/BeadingStrategy/LimitedBeadingStrategy.h
@@ -1,12 +1,11 @@
//Copyright (c) 2020 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
// Copyright (c) 2022 Ultimaker B.V.
// CuraEngine is released under the terms of the AGPLv3 or higher

#ifndef LIMITED_BEADING_STRATEGY_H
#define LIMITED_BEADING_STRATEGY_H

#include "BeadingStrategy.h"
#include "../utils/logoutput.h"
#include "../utils/macros.h"
#include "BeadingStrategy.h"

namespace cura
{
Expand All @@ -29,17 +28,17 @@ class LimitedBeadingStrategy : public BeadingStrategy
{
public:
LimitedBeadingStrategy(const coord_t max_bead_count, BeadingStrategyPtr parent);

virtual ~LimitedBeadingStrategy() override = default;

Beading compute(coord_t thickness, coord_t bead_count) const override;
coord_t getOptimalThickness(coord_t bead_count) const override;
coord_t getTransitionThickness(coord_t lower_bead_count) const override;
coord_t getOptimalBeadCount(coord_t thickness) const override;
virtual std::string toString() const override;

coord_t getTransitioningLength(coord_t lower_bead_count) const override;

float getTransitionAnchorPos(coord_t lower_bead_count) const override;

protected:
Expand Down
1 change: 0 additions & 1 deletion include/utils/ThreadPool.h
Expand Up @@ -88,7 +88,6 @@ class ThreadPool
/// `std::make_signed_t` fails for non integral types in a way that doesn't allows SFINAE fallbacks. This alias solves that.
template<typename T> using make_signed_if_integral_t = typename std::enable_if_t<std::is_integral_v<T>, std::make_signed<T>>::type;

using std::distance;
/// Overloads `std::distance()` to work on integral types
template<typename Int, typename Signed=make_signed_if_integral_t<Int>>
inline Signed distance(const Int& first, const Int& last)
Expand Down
59 changes: 0 additions & 59 deletions include/utils/logoutput.h

This file was deleted.

0 comments on commit f0550f7

Please sign in to comment.