* Add get_json_string_field helper
Introduce get_json_string_field in OrcaCloudServiceAgent.cpp to safely extract string fields from JSON objects.
* Add resolve_display_name helper
Introduce resolve_display_name to normalize provider metadata labels for the UI. The helper returns the first non-empty value from display_name, nickname, full_name, name, falling back to username, resolving human-facing label across varying provider payloads.
* Replace safe_str anonymous function
Replace get_json_string_field for better readability.
* Replace resolution flow for nickname with function
Consolidate both flows into one function for easier maintenance and more consistency.
* Update OrcaCloudServiceAgent.hpp
* Add OrcaCloudServiceAgent display name tests
Add unit tests verifying OrcaCloudServiceAgent resolves a user's display name from various session JSON shapes.
* Update eigen from v3.3.7 to v5.0.1.
This updates eigen from v3.3.7 released on December 11, 2018-12-11 to v5.0.1
released on 2025-11-11. There have be a large number of bug-fixes,
optimizations, and improvements between these releases. See the details at;
https://gitlab.com/libeigen/eigen/-/releases
It retains the previous custom minimal `CMakeLists.txt`, and adds a
README-OrcaSlicer.md that explains what version and parts of the upstream
eigen release have been included, and where the full release can be found.
* Update libigl from v2.0.0 (or older) to v2.6.0.
This updates libigl from what was probably v2.0.0 released on 2018-10-16 to
v2.6.0 released on 2025-05-15. It's possible the old version was even older
than that but there is no version indicators in the code and I ran out of
patience identifying missing changes and only went back as far as v2.0.0.
There have been a large number of bug-fixes, optimizations, and improvements
between these versions. See the following for details;
https://github.com/libigl/libigl/releases
I retained the minimal custom `CMakeLists.txt`, added `README.md` from the
libigl distribution which identifies the version, and added a
README-OrcaSlicer.md that details the version and parts that have been
included.
* Update libslic3r for libigl v2.6.0 changes.
This updates libslic3r for all changes moving to eigen v5.0.1 and libigl
v2.6.0. Despite the large number of updates to both dependencies, no changes
were required for the eigen update, and only one change was required for the
libigl update.
For libigl, `igl::Hit` was changed to a template taking the Scalar type to
use. Previously it was hard-coded to `float`, so to minimize possible impact
I've updated all places it is used from `igl::Hit` to `igl::Hit<float>`.
* Add compiler option `-DNOMINMAX` for libigl with MSVC.
MSVC by default defines `min(()` and `max()` macros that break
`std::numeric_limits<>::max()`. The upstream cmake that we don't include
adds `-DNOMINMAX` for the libigl module when compiling with MSVC, so we need
to add the same thing here.
* Fix src/libslic3r/TriangleMeshDeal.cpp for the unmodified upstream libigl.
This fixes `TriangleMeshDeal.cpp` to work with the unmodified upstream
libigl v2.6.0. loop.{h,cpp} implementation.
This file and feature was added in PR "BBS Port: Mesh Subdivision" (#12150)
which included changes to `loop.{h,cpp}` in the old version of libigl. This PR
avoids modifying the included dependencies, and uses the updated upstream
versions of those files without any modifications, which requires fixing
TriangleMeshDeal.cpp to work with them.
In particular, the modifications made to `loop.{h,cpp}` included changing the
return type from void to bool, adding additional validation checking of the
input meshes, and returning false if they failed validation. These added
checks looked unnecessary and would only have caught problems if the input
mesh was very corrupt.
To make `TriangleMeshDeal.cpp` work without this built-in checking
functionality, I removed checking/handling of any `false` return value.
There was also a hell of a lot of redundant copying and casting back and forth
between float and double, so I cleaned that up. The input and output meshs use
floats for the vertexes, and there would be no accuracy benefits from casting
to and from doubles for the simple weighted average operations done by
igl::loop(). So this just uses `Eigen:Map` to use the original input mesh
vertex data directly without requiring any copy or casting.
* Move eigen from included `deps_src` to externaly fetched `deps`.
This copys what PrusaSlicer did and moved it from an included dependency under
`deps_src` to an externaly fetched dependency under `deps`. This requires
updating some `CMakeList.txt` configs and removing the old and obsolete
`cmake/modules/FindEigen3.cmake`. The details of when this was done in
PrusaSlicer and the followup fixes are at;
* 21116995d7
* https://github.com/prusa3d/PrusaSlicer/issues/13608
* https://github.com/prusa3d/PrusaSlicer/pull/13609
* e3c277b9ee
For some reason I don't fully understand this also required fixing
`src/slic3r/GUI/GUI_App.cpp` by adding `#include <boost/nowide/cstdio.hpp>` to
fix an `error: ‘remove’ is not a member of ‘boost::nowide'`. The main thing I
don't understand is how it worked before. Note that this include is in the
PrusaSlicer version of this file, but it also significantly deviates from what
is currently in OrcaSlicer in many other ways.
* Whups... I missed adding the deps/Eigen/Eigen.cmake file...
* Tidy some whitespace indenting in CMakeLists.txt.
* Ugh... tabs indenting needing fixes.
* Change the include order of deps/Eigen.
It turns out that although Boost includes some references to Eigen, Eigen also
includes some references to Boost for supporting some of it's additional
numeric types.
I don't think it matters much since we are not using these features, but I
think technically its more correct to say Eigen depends on Boost than the
other way around, so I've re-ordered them.
* Add source for Eigen 5.0.1 download to flatpak yml config.
* Add explicit `DEPENDS dep_Boost to deps/Eigen.
I missed this before. This ensures we don't rely on include orders to make
sure Boost is installed before we configure Eigen.
* Add `DEPENDS dep_Boost dep_GMP dep_MPFR` to deps/Eigen.
It turns out Eigen can also use GMP and MPFR for multi-precision and
multi-precision-rounded numeric types if they are available.
Again, I don't think we are using these so it doesn't really matter, but it is
technically correct and ensures they are there if we ever do need them.
* Fix deps DEPENDENCY ordering for GMP, MPFR, Eigen, and CGAL.
I think this is finally correct. Apparently CGAL also optionally depends on
Eigen, so the correct dependency order from lowest to highest is GMP, MPFR, Eigen, and CGAL.
---------
Co-authored-by: Donovan Baarda <dbaarda@google.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
* Add OrcaCloud sync platform and preset bundle sharing system
Introduce OrcaCloud, a cloud sync platform for user presets, alongside
a preset bundle system that enables sharing printer/filament/process
profiles as local exportable bundles or subscribed cloud bundles.
OrcaCloud platform:
- Auth to Orca Cloud
- Encrypted token storage (file-based or system keychain)
- User preset sync with
- Profile migration from default/bambu folders on first login
- Homepage integration with entrance to cloud.orcaslicer.com
Preset bundles:
- Local bundle import/export with bundle_structure.json metadata
- Subscribed cloud bundles with version-based update checking
- Thread-safe concurrent bundle access with read-write mutex
- Canonical bundle preset naming (_local/<id>/... and _subscribed/<id>/...)
- Bundle presets are read-only; grouped under subheaders in combo boxes
- PresetBundleDialog with auto-sync toggle, refresh, update notifications
- Hyperlinked bundle names to cloud bundle pages
Co-authored-by: Sabriel Koh <sabrielkcr@gmail.com>
Co-authored-by: Derrick <derrick992110@gmail.com>
Co-authored-by: Mykola Nahirnyi <mnahirnyi@amcbridge.com>
Co-authored-by: Ian Chua <iancrb00@gmail.com>
Co-authored-by: Draginraptor <draginraptor@gmail.com>
Co-authored-by: ExPikaPaka <112851715+ExPikaPaka@users.noreply.github.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Ocraftyone <Ocraftyone@users.noreply.github.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
Co-authored-by: peterm-m <101202951+peterm-m@users.noreply.github.com>
* Fixed an issue on Windows it failed to login Orca Cloud with Google account
wxWidgets defines _UNICODE globally, which causes Catch2's
catch_main.cpp to provide wmain() instead of main(). This leads to
LNK2001 "unresolved external symbol main" for all test executables
when building with BUILD_TESTS=ON on MSVC.
Add DO_NOT_USE_WMAIN compile definition to Catch2WithMain target
so that Catch2 provides the standard main() entry point.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Get libslic3r tests closer to passing
I can't get geometry tests to do anything useful. I've added extra
output, but it hasn't helped me figure out why they don't work
yet. That's also probably the last broken 3mf test doesn't work.
The config tests were mostly broken because of config name changes.
The placeholder_parser tests have some things that may-or-may-not
still apply to Orca.
* Vendor a 3.x version of Catch2
Everything is surely broken at this point.
* Allow building tests separately from Orca with build_linux.sh
* Remove unnecessary log message screwing up ctest
Same solution as Prusaslicer
* Make 2 TriangleMesh methods const
Since they can be.
* Move method comment to the header where it belongsc
* Add indirectly-included header directly
Transform3d IIRC
* libslic3r tests converted to Catch2 v3
Still has 3 failing tests, but builds and runs.
* Disable 2D convex hull test and comment what I've learned
Not sure the best way to solve this yet.
* Add diff compare method for DynamicConfig
Help the unit test report errors better.
* Perl no longer used, remove comment line
* Clang-format Config.?pp
So difficult to work with ATM
* Remove cpp17 unit tests
Who gives a shit
* Don't need explicit "example" test
We have lots of tests to serve as examples.
* Leave breadcrumb to enable sla_print tests
* Fix serialization of DynamicConfig
Add comments to test, because these code paths might not be even used
anymore.
* Update run_unit_tests to run all the tests
By the time I'm done with the PR all tests will either excluded by
default or passing, so just do all.
* Update how-to-test now that build_linux.sh builds tests separately
* Update cmake regenerate instructions
Read this online; hopefully works.
* Enable slic3rutils test with Catch2 v3
* Port libnest2d and fff_print to Catch2 v3
They build. Many failing.
* Add slightly more info to Objects not fit on bed exception
* Disable failing fff_print tests from running
They're mostly failing for "objects don't fit on bed" for an
infinite-sized bed. Given infinite bed is probably only used in tests,
it probably was incidentally broken long ago.
* Must checkout tests directory in GH Actions
So we get the test data
* Missed a failing fff_print test
* Disable (most/all) broken libnest2d tests
Trying all, not checking yet though
* Fix Polygon convex/concave detection tests
Document the implementation too. Reorganize the tests to be cleaner.
* Update the test script to run tests in parallel
* Get sla_print tests to build
Probably not passing
* Don't cause full project rebuild when updating test CMakeLists.txts
* Revert "Clang-format Config.?pp"
This reverts commit 771e4c0ad2.
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>
* Actually build tests on Linux and allow RelWithDebInfo
They weren't being built.
Also cleaned up --config flags which enables RelWithDebInfo on Linux,
now that Ninja Multi-Config is used, it's quite trivial.
* Remove obsolete Slic3r Perl tests
The directory doesn't exist, they're already gone.
* Add GH job for running unit tests
* Move unit test execution to script and upload test results
* Don't run scheduled builds on forks
* Only deploy from SoftFever/OrcaSlicer
Will stop failures on forks
* Use artifact instead of cache
* Tweak archive and checkout paths
Keep getting error:
```
/home/runner/work/_temp/902d0a0a-6d23-4fe0-a643-8b5cc4efd25b.sh: line 1: scripts/run_unit_tests.sh: Permission denied
```
That seems to be because I didn't use actions/checkout, the working
directory is never setup correctly? So using checkout to get scripts
directory. Unsure if archive will preserve the `build/tests/` prefix;
will find out soon.
* Use tar to package directory and write results to correct directory
Tar preserves filenames and directory structure
* Use tar -xvf not -xzf
Muscle memory failed me
* Add testing wiki page
* Save test logs on failure and choose correct directory for junit
* Consolidate apt install steps, use for unit tests too, disable non-Linux builds
Temporarily disable non-Linux builds to save time while developing
this.
Cache the apt packages to save some time searching apt and downloading
them again (though I realize this is also downloading, but hopefully
by something closer and faster).
Remove all the redundant packages listed in the workflow and debian
distribution lists.
* Remove apt install steps from workflow
`./build-linux.sh -u` is supposed to install all needed packages, so
it should build without needing anything besides that. If I'm wrong
this commit will be dropped.
* Need composite action checked out locally
* Re-enable non-Linux builds now that it's working
* Skip a deploy and a notarize in forks
They only succeed in the main repo.
* Fix multi-build for non-Release builds: share CONFIG
* Correct build errors in unit tests
Indeterminate method signatures resolved. Updated script to build all
the tests.
* Fix -g vs -e for RelWithDebInfo
* Change CONFIG->BUILD_CONFIG
Missed one in prior commits
* Reduce wasteful redundant build artifact copies
1. Don't copy the artifacts and leave them; make a hard link first;
only make a copy only while creating AppImage.
2. Don't tar up the `package` directory; nothing uses this tar AFAICT
* Fix directory name
* Change jigsaw auth test URLs to httpbin.org
No idea why the basic auth doesn't work, but it doesn't work for
`curl` CLI either. This does.
* Remove force-build
It got reverted at
e3f049829b
for unknown reasons.
* Add timeout for unit tests in GitHub Actions workflow (#11146)
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>
* Optimize and simplify MarchingSquares.hpp, and fix it's test.
This changes the implementation to get the possible next directions for a cell
when building the tags and clearing them as the cells are visited during the
march, instead of adding the visited previous direction to the tags during the
march. The Dir enum has been turned into bit flags that for the possible next
directions with boolean operators for testing/setting/clearing them. This
simplifies and optimizes many operations during the march and building the
polygons.
The complicated/broken and unused partial support for cell overlap has been
removed, simplifying the overly confusing grid iteration logic.
The broken test has been fixed by removing the now gone `RasterBase` namespace
from `sla::RasterBase::Pixeldim` and `sla:RasterBase:Resolution`, and the
CMakeLists.txt entry uncommented.
make Dir into flags
* Further optimize MarchingSquares.hpp and improve comments.
* Switch from a single byte-vector containing tags and dirs for each cell to a
m_tags vector of bit-packed tags for each grid corner and an m_dirs vector
of packed 4bit dirs for each cell. Since each grid corner tag is shared by
the 4 adjacent cells this significantly reduces storage space and avoids
redundantly calculating each tag 4x. It also significantly improves memory
locality with each phase of calculating tags, calculating dirs, calculating
rings operating only on the tags or dirs data required without them being
interleaved with the data they don't need.
* Change NEXT_CCW to be initialized with a static constexpr lambda instead of
a manually entered table. This avoids typo errors manually building the
table.
* Optimize search_start_cell() so it can efficiently skip over cleared blocks
of 8 dirs in the packed m_dirs vector.
* Change the tags logical labeling to better suit the packed tags vector data.
This makes it a tiny bit more efficient to extract from the m_tags bitmap.
* Remove the now unused SquareTag enum class.
* Add comments explaining the algorithm, including corner-cases in cell
iteration.
* Remove unused Dir operators and get_dirs() argument, and clang-format.
* Fix some bugs and add stream output operators for debugging.
* Fix a bug building tags where `step(gcrd, Dir::right)` was not assigned to
update the gcrd grid point. Perhaps this should be a mutating method, or
even a += operator? Also when wrapping at the end of a row it was updating
the gcrd grid point by mutating the p raster point instead of itself.
Perhaps Grid and Raster points should be different types? Maybe even
templated?
* Fix a bug in get_tags() when the second row tags are packed into any of the
2 LSB's of the uint32_t blocks. In hind-sight obviously `>>(o - 2)` will not
shift left when `o < 2`.
* Move interpolation of the edge-crossings into a `interpolate()` method, and
make it shift bottom and right side points "out" by one to account for
raster pixel width. This makes the results track the raster shapes much more
accurately for very small windows.
* Make `interpolate_rings()` check for and remove duplicated points. It turns
out it's pretty common that two edge-crossing-points at a corner interpolate
to the same point. This can also happen for the first and last points.
* For Coord add `==` and `!=` operators, and use them wherever Coord's are
compared.
* Add `<<` stream output operators for Coord, Ring, and Dir classes. Add
`streamtags(<stream>)` and `streamdirs(<stream>)` methods for dumping the
tags and dirs data in an easy to understand text format. These make
print-debugging much easier.
* Add `assert(idx < m_gridlen)` in a bunch of places where grid-indexes are
used.
* For test_clipper_utils.cpp fix three "ambiguous overloading" compiler errors.
This just adds three `Polygons` qualifications to fix compiler errors about
ambiguous overloaded methods.
Note this file was formated with a mixture of tabs and spaces and had lots of
trailing whitespace. My editor cleaned these up resulting in a large looking
diff, but if you use `git diff -w` to ignore the whitespace changes you will
see it is actually tiny.
errros
* Update SLA/RasterToPolygons.* for MarchingSquares.hpp improvements.
Change the minimum and default window size from 2x2 to 1x1. Also remove the
strange pixel size re-scaling by (resolution/resolution-1).
The old MarchingSquares implementation had complications around a default
minimum 1 pixel "overlap" between cells which messed with the scaling a tiny
bit and meant when you requested a 2x2 window size it actually used a 1x1
window. Both of these meant you had to specify a window 1 pixel larger than
you really wanted, and you needed to undo the strange scaling artifact for
accurate dimensions of your results.
This has been fixed/removed in the new implementation, so the window is the
window, there is no overlap, and no strange miss-scaling.
* Fix test_marchingsquares.cpp and add StreamUtils.hpp.
This fixes the MarchingSquares unittests to both pass and be more strict than
they were before.
It also adds libslic3r/StreamUtils.hpp which includes some handy streaming
operators for standard libslic3r classes used to show extracted polys in the
unittests.
* Change Format/SL1.cpp to support the min 1x1 window for MarchingSquares.
* Fix the ring-walk termination condition.
Terminate the ring-walk when we return to the starting cell instead of when we
reach a cell with no remaining directions. This ensures we don't merge two
polygons if we started on an ambiguous cell.
* Revert the removal of duplicate points in interpolate_rings().
It turns out that duplicate points are only relatively common when using a 1x1
window. These happen when the line passes through the corner pixel on a
top-left corner in the raster, and the probability of this rapidly declines as
the window increases, so in many cases this filtering is just overhead. It can
also be potentially useful to see the points for every edge crossing even if
they are duplicates. This kind of filtering is already done and done better in
the polygon post-processing.
* rename `interpolate()` to `interpolate_edge()`, make it update the point
in-place, and add asserts to ensure the input point is a valid edge
interpolation point.
* Remove the duplicate point filtering from `interpolate_rings()` and simplify
it.
* Optimize directions building.
This optimizes `get_dirs_block8()` to rapidly skip over blocks where the tags
produce no directions (all tags are 1's or 0's), and also to build the
directions faster when it has to by fetching the whole blocks worth of tags at
once instead of cell-by-cell.
* Rename `get_tags()` to `get_tags9()` and make it fetch a row of nine tags
instead of the tags for a single cell.
* Optimize `get_dirs_block8()` to use `get_tags9()` to get the next nine tags
for the current and next rows and then shift through them to generate the
tags and directions for each cell in the block. Also abort early and just
return an empty block if the tags are all 0's or all 1's.
* Tiny optimization for `get_tags_block32()`.
This avoids using the `step()` method for a simple step-right that can be done
with a simple increment of the column. It also avoids re-calculating the
raster-coodinates for every corner, instead incrementing the column by
`m_window.c` until the end of a row.
* Fix svg output in test_marchingsquares.cpp for recreate_object_from_rasters.
These SVG's were not properly centered...
* Fix 2 static_casts for compiling on Windows.
Thanks to RF47 for pointing this out on the #10747 pull request.
* Make edge iteration use O(ln(N)) binary search instead of linear.
This should be much faster when the window size is large.
* Make `CellIt` into a `std::random_access_iterator_tag` so that
`std::lower_bound()` can use a binary search to find the point on the edge
instead of a linear search.
* Change `step()` to support an optional distance argument and make it modify
the `Coord` in-place instead of return a new one.
* Update tests for the `step()` change.
* Add Catch2 BENCHMARK tests for MarchingSquares.
This required enabling the benchmarks in the tests/CMakeLists.txt config.
* Add a _Loop<> specialization for parallel execution using ExecutionTBB.
This is something that could be added wherever you are going to use this, but
I intend on using this in multiple places so we might as add this once in one
place where it can be reused.
* Fix whitespace in messed up by tab-replacements.
My editor renders, and replaces, tabs as 8 spaces. This messed up the
indenting in tests/libslic3r/CMakeLists.txt and
tests/libslic3r/test_clipper_utils.cpp when I made tiny changes in them.
This fixes the indenting using 4 chars. Note it will still show as a diff
because it is replacing tabs with 4 spaces, and removing trailing whitespace.
But at least it's now indented correctly...
---------
Co-authored-by: Donovan Baarda <dbaarda@google.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>