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

'New Tree' Refactors #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6985593
Simplify: fix scaling of maximum area deviation setting
Piezoid Oct 5, 2022
1adf212
Merge pull request #1738 from Piezoid/area_deviation_scaling
jellespijker Nov 15, 2022
70b4fbf
Revert "Merge pull request #1738 from Piezoid/area_deviation_scaling"
rburema Nov 17, 2022
381c257
Merge branch '5.2' into xmas_alpha
rburema Dec 13, 2022
fa11a4b
Revert "Merge remote-tracking branch 'upstream/main' into tree_suppor…
rburema Dec 13, 2022
a275e9d
New Tree Support: Quick refactors (except the big class).
rburema Dec 14, 2022
ccd74e0
Sync workflows from main
jellespijker Dec 15, 2022
296d38d
Use 5.3.0-alpha dependencies
jellespijker Dec 15, 2022
958bb86
Use latest Arcus
jellespijker Dec 15, 2022
80e50f2
Use PUBLIC targets for deps in _CuraEngine
jellespijker Dec 15, 2022
64e626d
Use range-v3 instead of std
jellespijker Dec 15, 2022
2772aa8
New Tree Support: Refactors part II.
rburema Dec 15, 2022
9e1eb70
New Tree Support: Refactors part III.
rburema Dec 16, 2022
b734714
Switch back to the original 'pass-by-copy' design.
rburema Dec 16, 2022
8b9c8ac
Fix xy_distance overriding overhangs when the overhang angle is small…
ThomasRahm Dec 16, 2022
cf52880
Small refactor: Break some more comments up into lines.
rburema Dec 16, 2022
2a25383
Small refactors (mostly re-lined comments).
rburema Dec 16, 2022
ace3dba
Forgot to rename this instance of mesh for the apple-clang workaround.
rburema Dec 16, 2022
92e39af
Refactor: Use 'using' to abreviate often used types.
rburema Dec 16, 2022
8ce602f
Minimize use of (implict) sqrt operations.
rburema Dec 16, 2022
7427d77
Replaced some of the more common magic numbers with constexprs.
rburema Dec 16, 2022
885fe03
Resolve temporary comments made during review.
rburema Dec 16, 2022
a0dd35d
'Workaround' for crash with tree-branch-pref set to 'flat surfaces'.
rburema Dec 20, 2022
3c41803
Undo small part of refactor that was causing issues.
rburema Dec 22, 2022
99ca0f9
Fix potential edge case: All but one of empty list.
rburema Jan 24, 2023
a0d1e3a
take disallowed areas into account when printing tree support
BagelOrb Feb 14, 2022
d51bfc0
feat: settings.get<Polygons>
BagelOrb Aug 12, 2022
369c74d
Moved PropertyAreasX definitions to where they're used.
rburema Jan 24, 2023
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
26 changes: 13 additions & 13 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
runs_on: 'ubuntu-20.04'
python_version: '3.10.x'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

Expand All @@ -78,11 +78,11 @@ jobs:

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
project_name: curaengine
build_id: 3
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 3
runs_on: 'macos-11'
python_version: '3.10.x'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

Expand All @@ -92,11 +92,11 @@ jobs:

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
project_name: curaengine
build_id: 4
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 4
runs_on: 'windows-2022'
python_version: '3.10.x'
python_version: '3.11.x'
conan_config_branch: ''
conan_logging_level: 'info'
secrets: inherit
Expand All @@ -107,11 +107,11 @@ jobs:

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
project_name: curaengine
build_id: 2
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 1
runs_on: 'ubuntu-20.04'
python_version: '3.10.x'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

Expand All @@ -121,11 +121,11 @@ jobs:

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
project_name: curaengine
build_id: 1
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 2
runs_on: 'ubuntu-22.04'
python_version: '3.10.x'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
- name: Install Python requirements and Create default Conan profile
run: |
pip install -r requirements-conan-package.txt
conan profile new default --detect
working-directory: .github/workflows/

- name: Use Conan download cache (Bash)
Expand All @@ -93,10 +92,21 @@ jobs:

- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: sudo apt install build-essential checkinstall zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y
run: |
sudo apt update
sudo apt upgrade
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y

- name: Use GCC-10 on ubuntu as default
if: ${{ runner.os == 'Linux' }}
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10

- name: Get Conan configuration
run: conan config install https://github.com/Ultimaker/conan-config.git
run: |
conan profile new default --detect
conan config install https://github.com/Ultimaker/conan-config.git

- name: Install dependencies
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -o enable_testing=True -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ endif ()
target_link_libraries(_CuraEngine
PUBLIC
spdlog::spdlog
PRIVATE
range-v3::range-v3
fmt::fmt
clipper::clipper
Expand Down
107 changes: 35 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,47 @@

<br>

<div align = center>

[![Badge Issues]][Issues]   
[![Badge PullRequests]][PullRequests]   
[![Badge Closed]][Closed]

[![Badge Size]][#]   
[![Badge License]][License]   
[![Badge Contributors]][Contributors]

[![Badge Test]][Test]   
[![Badge Conan]][Conan]   

<br>
<br>

<img
src = 'CuraEngine.ico'
width = 200
/>

# CuraEngine

<p align="center">
<a href="https://github.com/Ultimaker/CuraEngine/actions/workflows/unit-test.yml" alt="Unit Tests">
<img src="https://github.com/Ultimaker/CuraEngine/actions/workflows/unit-test.yml/badge.svg" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/actions/workflows/conan-package.yml" alt="Unit Tests">
<img src="https://github.com/Ultimaker/CuraEngine/actions/workflows/conan-package.yml/badge.svg" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/issues" alt="Open Issues">
<img src="https://img.shields.io/github/issues/Ultimaker/CuraEngine" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/issues?q=is%3Aissue+is%3Aclosed" alt="Closed Issues">
<img src="https://img.shields.io/github/issues-closed/ultimaker/CuraEngine?color=g" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/pulls" alt="Pull Requests">
<img src="https://img.shields.io/github/issues-pr/Ultimaker/CuraEngine" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/graphs/contributors" alt="Contributors">
<img src="https://img.shields.io/github/contributors/Ultimaker/CuraEngine" /></a>
<a href="https://github.com/Ultimaker/CuraEngine" alt="Repo Size">
<img src="https://img.shields.io/github/repo-size/Ultimaker/CuraEngine?style=flat" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/blob/master/LICENSE" alt="License">
<img src="https://img.shields.io/github/license/Ultimaker/CuraEngine?style=flat" /></a>
</p>

*C++ console application for 3D printing GCode generation.*

<br>
<br>

[![Button Install]][Install]   
[![Button Dependencies]][Dependencies]   
[![Button Internals]][Internals]

<br>
<br>


Designed as a better and faster alternative to the old <br>
**Skeinforge Engine** and is an integral part of **[Cura]**.

You can use CuraEngine separately, in other <br>
applications and integrate it into your own app.

<br>


<!----------------------------------------------------------------------------->
CuraEngine is a C++ console application for 3D printing GCode generation. It has been made as a better and faster
alternative to the old Skeinforge engine and is an integral part of [Cura](https://github.com/ultimaker/Cura). You can
use CuraEngine separately or in other applications. Feel free to add it to your application. But please take
note of the [License](LICENSE)

[Contributors]: https://github.com/Ultimaker/CuraEngine/graphs/contributors
[Dependencies]: https://github.com/Ultimaker/CuraEngine/wiki/Dependencies
[PullRequests]: https://github.com/Ultimaker/CuraEngine/pulls
[Internals]: https://github.com/Ultimaker/CuraEngine/wiki/Internals
[Install]: https://github.com/Ultimaker/CuraEngine/wiki/Building-CuraEngine-From-Source
[Closed]: https://github.com/Ultimaker/CuraEngine/issues?q=is%3Aissue+is%3Aclosed
[Issues]: https://github.com/Ultimaker/CuraEngine/issues
[Conan]: https://github.com/Ultimaker/CuraEngine/actions/workflows/conan-package.yml
[Test]: https://github.com/Ultimaker/CuraEngine/actions/workflows/unit-test.yml
[Cura]: https://github.com/Ultimaker/Cura
## License

[License]: LICENSE
[#]: #
![License](https://img.shields.io/github/license/ultimaker/curaengine?style=flat)
CuraEngine is released under terms of the AGPLv3 License. Terms of the license can be found in the LICENSE file. Or at
http://www.gnu.org/licenses/agpl.html

> But in general it boils down to:
> **You need to share the source of any CuraEngine modifications if you make an application with the CuraEngine. (Even if
> you make a web-based slicer, you still need to share the source!)**

<!---------------------------------[ Badges ]---------------------------------->
## How to Install & Run

[Badge Contributors]: https://img.shields.io/github/contributors/ultimaker/CuraEngine?style=for-the-badge&logoColor=white&labelColor=db5e8a&color=ab4a6c&logo=GitHub
[Badge PullRequests]: https://img.shields.io/github/issues-pr/ultimaker/CuraEngine?style=for-the-badge&logoColor=white&labelColor=bb9f3e&color=937d31&logo=GitExtensions
[Badge License]: https://img.shields.io/badge/License-AGPL3-336887.svg?style=for-the-badge&labelColor=458cb5&logoColor=white&logo=GNU
[Badge Closed]: https://img.shields.io/github/issues-closed/ultimaker/CuraEngine?style=for-the-badge&logoColor=white&labelColor=629944&color=446a30&logo=AddThis
[Badge Issues]: https://img.shields.io/github/issues/ultimaker/CuraEngine?style=for-the-badge&logoColor=white&labelColor=c34360&color=933349&logo=AdBlock
[Badge Conan]: https://img.shields.io/github/workflow/status/Ultimaker/CuraEngine/conan-package?style=for-the-badge&logoColor=white&labelColor=6185aa&color=4c6987&logo=Conan&label=Conan%20Package
[Badge Test]: https://img.shields.io/github/workflow/status/Ultimaker/CuraEngine/unit-test?style=for-the-badge&logoColor=white&labelColor=4a999d&color=346c6e&logo=Codacy&label=Unit%20Test
[Badge Size]: https://img.shields.io/github/repo-size/ultimaker/CuraEngine?style=for-the-badge&logoColor=white&labelColor=715a97&color=584674&logo=GoogleAnalytics
Please check our [Wiki page](https://github.com/Ultimaker/CuraEngine/wiki/Building-CuraEngine-From-Source) for details on how to install CuraEngine.

## Dependencies

<!---------------------------------[ Buttons ]--------------------------------->
Please check our [Wiki page](https://github.com/Ultimaker/CuraEngine/wiki/Dependencies) for details on CuraEngines dependencies.

[Button Dependencies]: https://img.shields.io/badge/Dependencies-26aae2?style=for-the-badge&logoColor=white&logo=BookStack
[Button Internals]: https://img.shields.io/badge/Internals-00979D?style=for-the-badge&logoColor=white&logo=CodeReview
[Button Install]: https://img.shields.io/badge/Installation-e23345?style=for-the-badge&logoColor=white&logo=DocuSign
## Internals

Please check our [Wiki page](https://github.com/Ultimaker/CuraEngine/wiki/Internals) for details on CuraEngines internals.
18 changes: 18 additions & 0 deletions conandata.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# TODO: Remove before merging to main
"5.3.0-alpha":
requirements:
- "clipper/6.4.2"
- "boost/1.79.0"
- "rapidjson/1.1.0"
- "stb/20200203"
- "spdlog/1.10.0"
- "fmt/9.0.0"
- "range-v3/0.12.0"
requirements_arcus:
- "protobuf/3.21.4"
- "arcus/(latest)@ultimaker/testing"
- "zlib/1.2.12"
build_requirements_arcus:
- "protobuf/3.21.4"
build_requirements_testing:
- "gtest/1.12.1"
"5.2.1":
requirements:
- "clipper/6.4.2"
Expand Down
24 changes: 20 additions & 4 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class ExtruderPlan
std::optional<double> prev_extruder_standby_temp; //!< The temperature to which to set the previous extruder. Not used if the previous extruder plan was the same extruder.

TimeMaterialEstimates estimates; //!< Accumulated time and material estimates for all planned paths within this extruder plan.
double slowest_path_speed;

public:
size_t extruder_nr; //!< The extruder used for this paths in the current plan.
Expand Down Expand Up @@ -129,6 +128,22 @@ class ExtruderPlan
*/
void processFanSpeedAndMinimalLayerTime(bool force_minimal_layer_time, Point starting_position);

/*!
* Set the extrude speed factor. This is used for printing slower than normal.
*
* Leaves the extrusion speed as is for values of 1.0
*
* \param speedFactor The factor by which to alter the extrusion move speed
*/
void setExtrudeSpeedFactor(const Ratio speed_factor);

/*!
* Get the extrude speed factor. This is used for printing slower than normal.
*
* \return The factor by which to alter the extrusion move speed
*/
double getExtrudeSpeedFactor();

/*!
* Get the fan speed computed for this extruder plan
*
Expand Down Expand Up @@ -160,7 +175,10 @@ class ExtruderPlan

const RetractionConfig& retraction_config; //!< The retraction settings for the extruder of this plan

Ratio extrudeSpeedFactor; //!< The factor by which to alter the extrusion move speed

double extraTime; //!< Extra waiting time at the and of this extruder plan, so that the filament can cool
double totalPrintTime; //!< The total naive time estimate for this extruder plan

double fan_speed; //!< The fan speed to be used during this extruder plan

Expand Down Expand Up @@ -600,10 +618,8 @@ class LayerPlan : public NoCopy
* \param flow_ratio The ratio with which to multiply the extrusion amount
* \param near_start_location Optional: Location near where to add the first line. If not provided the last position is used.
* \param fan_speed optional fan speed override for this path
* \param reverse_print_direction Whether to reverse the optimized order and their printing direction.
* \param order_requirements Pairs where first needs to be printed before second. Pointers are pointing to elements of \p polygons
*/
void addLinesByOptimizer(const Polygons& polygons, const GCodePathConfig& config, const SpaceFillType space_fill_type, const bool enable_travel_optimization = false, const coord_t wipe_dist = 0, const Ratio flow_ratio = 1.0, const std::optional<Point> near_start_location = std::optional<Point>(), const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT, const bool reverse_print_direction = false, const std::unordered_set<std::pair<ConstPolygonPointer, ConstPolygonPointer>>& order_requirements = PathOrderOptimizer<ConstPolygonPointer>::no_order_requirements);
void addLinesByOptimizer(const Polygons& polygons, const GCodePathConfig& config, const SpaceFillType space_fill_type, const bool enable_travel_optimization = false, const coord_t wipe_dist = 0, const Ratio flow_ratio = 1.0, const std::optional<Point> near_start_location = std::optional<Point>(), const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT, const bool reverse_print_direction = false);

/*!
* Add polygons to the g-code with monotonic order.
Expand Down
Loading