mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-22 02:12:13 +00:00
7f2598d0d68a85056ae02c8e554201d33acad84d
10 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
dc5897d7b5 |
Update eigen to v5.0.1 and libigl to v2.6.0. (#11311)
* 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; * |
||
|
|
2a3e761ab9 |
Optimize and simplify MarchingSquares.hpp. (#10747)
* 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> |
||
|
|
fe4a72ec94 |
Upgrade clipper & improve multi-thread performance (#7177)
* Clipper: Verify range of int32 coordinates on input. Cherry-picked from prusa3d/PrusaSlicer@fa7debf49d Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * ClipperLib: Optimized PointInPolygon() to calculate cross products with int64s instead of doubles. Cherry-picked from prusa3d/PrusaSlicer@9dca8403fe Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Reworked the ClipperLib / Polygon types to use the tbb::scallable_allocator to better scale on multiple threads. Cherry-picked from prusa3d/PrusaSlicer@9cde96993e Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * use tbb::scallable_allocator for Polygons and ExPolygon::holes to better scale on multiple threads Cherry-picked from prusa3d/PrusaSlicer@b67ad6434d Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Fixed compilation on GCC and CLang Cherry-picked from prusa3d/PrusaSlicer@b3b44681a9 Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Remove clipper2 which is not used * Removed shiny profiler from clipperlib Cherry-picked from prusa3d/PrusaSlicer@7e77048593 Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * ClipperLib: Further optimization of memory allocation using scalable_allocator. ClipperLib: SimplifyPolygon() - changed default winding number to positive, added strictly_simple parameter. ClipperUtlis simplify_polygons() - removed "remove_collinear" parameter Cherry-picked from prusa3d/PrusaSlicer@a7e17df25f Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * ClipperLib: emplace_back() instead of push_back(). Cherry-picked from prusa3d/PrusaSlicer@2e150795b1 Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Fixed issue in a 32bit clipper, where IntersectPoint() checked for the Y coordinate of the calculated intersection point for validity, but the Y coordinate was already rounded to 32bits, thus an overflow may have in rare cases masked invalidity of the result. Cherry-picked from prusa3d/PrusaSlicer@b39c33414f Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Fixed Vojtech's out of boundary assert in Clipper library. Cherry-picked from prusa3d/PrusaSlicer@0a202dcff3 Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> * Update clipper to 6.4.2. Cherry-picked from prusa3d/PrusaSlicer@b8b3cccb40 Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com> * Try fix cmake opencv --------- Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com> Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com> |
||
|
|
d37f1b6a81 |
Fix english strings consistency (#8881)
* "non zero" -> "non-zero" * "Z hop" -> "Z-hop" * "works" -> "is working" * "version at least x" -> "version x or higher" * "printing job" -> "print job" "to print on" -> "printing on" * "is not find" -> "was not found" * "boundary of plate" -> "plate boundaries" * "toolchange" -> "tool change" * "colour" -> "color" * "cancelled" -> "canceled" * "can not" -> "cannot" * "gcode" -> "G-code" |
||
|
|
b3fff4ffd5 | Removed the copyright and credits in the header of each file. This information is outdated and hard to update. Orca Slicer maintains the autoher info in git history so this is not necessary. | ||
|
|
9b2c2bff1d |
Support larger printer sizes by using 64-bit.
SuperSlicer is referenced for some changes. Co-authored-by: Merill <merill@free.fr> |
||
|
|
933aa3050b |
Port Emboss & SVG gizmo from PrusaSlicer (#2819)
* Rework UI jobs to make them more understandable and flexible. * Update Orca specific jobs * Fix progress issue * Fix dark mode and window radius * Update cereal version from 1.2.2 to 1.3.0 (cherry picked from commit prusa3d/PrusaSlicer@057232a275) * Initial port of Emboss gizmo * Bump up CGAL version to 5.4 (cherry picked from commit prusa3d/PrusaSlicer@1bf9dee3e7) * Fix text rotation * Fix test dragging * Add text gizmo to right click menu * Initial port of SVG gizmo * Fix text rotation * Fix Linux build * Fix "from surface" * Fix -90 rotation * Fix icon path * Fix loading font with non-ascii name * Fix storing non-utf8 font descriptor in 3mf file * Fix filtering with non-utf8 characters * Emboss: Use Orca style input dialog * Fix build on macOS * Fix tooltip color in light mode * InputText: fixed incorrect padding when FrameBorder > 0. (ocornut/imgui#4794, ocornut/imgui#3781) InputTextMultiline: fixed vertical tracking with large values of FramePadding.y. (ocornut/imgui#3781, ocornut/imgui#4794) (cherry picked from commit ocornut/imgui@072caa4a90) (cherry picked from commit ocornut/imgui@bdd2a94315) * SVG: Use Orca style input dialog * Fix job progress update * Fix crash when select editing text in preview screen * Use Orca checkbox style * Fix issue that toolbar icons are kept regenerated * Emboss: Fix text & icon alignment * SVG: Fix text & icon alignment * Emboss: fix toolbar icon mouse hover state * Add a simple subtle outline effect by drawing back faces using wireframe mode * Disable selection outlines * Show outline in white if the model color is too dark * Make the outline algorithm more reliable * Enable cull face, which fix render on Linux * Fix `disable_cullface` * Post merge fix * Optimize selection rendering * Fix scale gizmo * Emboss: Fix text rotation if base object is scaled * Fix volume synchronize * Fix emboss rotation * Emboss: Fix advance toggle * Fix text position after reopened the project * Make font style preview darker * Make font style preview selector height shorter --------- Co-authored-by: tamasmeszaros <meszaros.q@gmail.com> Co-authored-by: ocornut <omarcornut@gmail.com> Co-authored-by: SoftFever <softfeverever@gmail.com> |
||
|
|
62df53f86e |
FIX: A mesh with overlapping faces cannot be painted
STUDIO-2591 Change-Id: Iad566cdc45d123b5c8342c732c0dc964c261753a (cherry picked from commit eb9f7297e0ea0557b32e5f59c3a91692ac8afa5b) |
||
|
|
61b271f379 |
ENH: fix for STUDIO-881
Thanks prusa Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: I2e1c1088d29dd5401016ca41d3ed6dec87e0acd1 |
||
|
|
1555904bef |
Add the full source of BambuStudio
using version 1.0.10 |