* Add CGAL-based mesh repair, drop Netfabb remnants
Add repair_mesh() in MeshRepair.cpp, a CGAL-based repair that replaces MeshBoolean::cgal::repair(). It welds cracks, cancels coincident triangles, fixes orientation, fills holes (including planar annular regions), removes local self-intersections, and unites crossing shells with libigl's exact boolean while following the nonzero winding rule used by slicing.
FixModelByCgal now repairs each volume in place without splitting it into parts, and reports whether the mesh was modified so unchanged meshes keep their painting and ids. The texture import repair prompt no longer depends on the Windows SDK, and the FIX_THROUGH_CGAL_ALWAYS conditionals are removed. The commented-out Netfabb/WIN10SDK build code is deleted.
libslic3r_cgal now builds with CGAL_LINKED_WITH_TBB and links TBB. Add docs/HLSD/mesh-repair.md and unit tests in test_mesh_repair.cpp.
* Parallelize repair while preserving separate shells
Repair connected mesh units and shells independently in parallel, keep crossing shells separate, and limit self-intersection remeshing to local defects. Update mesh-repair documentation and tests for the revised behavior.
* Make mesh repair deterministic and report its progress
Flags written from parallel loops were std::vector<bool>, whose neighbouring
bits share a word, so shells could be kept or dropped at random; they are now
std::vector<char>. Holes of up to 100 edges are filled with the search over all
triangles: the search restricted to a 3D Delaunay triangulation picks between
equally good fills differently from run to run.
Shells of fewer than four faces are dropped, as the volumes of two triangles
back to back need not cancel exactly, and a shell that self-intersection removal
changed is split again so the pieces it cut off are dropped too.
repair_mesh() takes a progress callback in place of the cancel callback, and
Fix Model reports each stage. The object's bounding box is now invalidated even
when a cancel or an error stops the repair after some volumes were replaced.
The edge-use sort, union-find and box-overlap code shared by several stages is
factored out, the topology analysed for welding is reused to build the work
units, the orientation pass checks only the edges it cut, and the output is
written from the shells without joining them first.
* Fix Split to parts crashing on flat pieces and staying offered after a repair
ModelVolume::split() added every piece to the object and then deleted the
pieces without a convex hull. When the first piece was flat, as often in a
triangle soup, that deleted the volume being split while split() and its
caller kept using it. A part made only of flat pieces lost all its volumes,
and a soup added thousands of pieces, saving a backup of the object for each
one it deleted. Pieces without a convex hull are now dropped before any joins
the object, the volume being split keeps the first remaining piece, and a part
with no solid piece is left whole. Other parts of the object without a convex
hull are no longer deleted as a side effect.
ModelVolume caches whether its mesh can be split, and set_mesh() kept the
cached value, so after Fix Model, Simplify or Emboss replaced a mesh, Split to
parts could still be offered for a single piece. set_mesh() and reset_mesh()
now clear the cache.
* Import STEP surface models with Split compound enabled
Splitting a compound kept only its solids, so a surface model, which OCCT
reads as a compound of loose faces, gave nothing to mesh and the import failed
with "Meshing of a model file failed or no valid shape". Each shell outside a
solid now becomes a part too, and loose faces stay together as one part, as
they do without splitting.
* Add Fix All for plates and re-enable --repair on the command line
ModelVolume::repair() applies repair_mesh() to a part and replaces the mesh
only when the repair changed it. Fix Model, the new Fix All and Fix All Plates
items of the plate context menu, and the command line's --repair option, which
had been commented out since the Win10 SDK repair was dropped, all use it.
With Keep painted feature after mesh change off, Fix Model cleared the painting
of every part of an object before repairing. Now only a part whose mesh changes
loses its painting, so fixing a whole project does not wipe it. The
notification counts the models that needed no repair instead of listing them as
repaired, and objects that did not change are not refreshed.
46 files include the same header twice at file scope, outside any #if,
66 times in all:
Model.cpp included Model.hpp twice, Utils.hpp <algorithm> and
<string_view> twice, seven GUI headers <wx/dataview.h> and
<wx/artprov.h> twice. The second include of each is removed.
GCodeSender.cpp and GCodeSender.hpp have been commented out of
libslic3r/CMakeLists.txt since 2022 and their only two includes are
commented out as well. Both files go, with the commented lines, and
the CMake entry for SLA/SupportTreeIGL.cpp, a file that no longer
exists.
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced
Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.
clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.
* Remove Unused Project Includes From Files With Platform-Specific Code
A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block.
* Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass
The platform-file pass treated pchheader.hpp as an ordinary header and
emptied it, and left GUI_Preview.hpp and 14 other files relying on
headers they no longer reached directly.
* Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call
* Include Headers That Files Reached Through Ones the Cleanup Removed
* Drop Includes Duplicated by the Cleanup or by Main's Own Additions
* Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
Every file that included STEP.hpp, directly or not, got namespace fs = boost::filesystem at global scope, and 29 sources and three headers relied on it without saying so. Headers now spell out boost::filesystem, and each source that uses fs declares the alias itself.
* Add Missing Includes Across src/libslic3r
Every libslic3r source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, with libslic3r headers spelled libslic3r/... so they resolve outside the library's private include paths. MultiMaterialSegmentation.hpp, Support/SupportParameters.hpp and Format/STEP.hpp are made self-contained by hand.
* Make the libslic3r Headers Compile on Their Own
Each now includes, or forward-declares, what it uses instead of relying on what its includers happened to include first. Left out: I18N.hpp, which errors on purpose when included from GUI code, and VoxelizeCSGMesh.hpp and SLA/bicubic.h, which nothing includes and which no longer compile at all.
* Add the Includes Missing From the Hand-Fixed libslic3r Headers
clang-tidy would not edit these headers while they failed to compile on their own, so the first pass skipped them. With the headers now self-contained, a second pass adds the rest.
* Keep Windows Setup Ahead of the Added libslic3r Includes
Print.cpp and Thread.cpp open with a _WIN32 block that has to come first; without the precompiled header, Print.cpp otherwise reaches windows.h through OCCT with NONLS defined and boost/regex fails. OpenVDBUtils.cpp and SLA/SupportTreeBuilder.cpp had includes inside #ifndef NOMINMAX, which libslic3r defines on Windows, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory.
* Re-Add libslic3r Includes After the Clipper2 2.0.1 Migration
Rebasing onto main took main's version of the files the Clipper2 migration rewrote, so their added includes are restored here, along with includes for main's new code. Clipper2's individual headers are now ignored by clang-tidy: they only build the Z variant through clipper2_z.hpp, which defines USINGZ first, so including clipper.core.h and the like directly broke ClipperZUtils.cpp.
* Add missing TopTools includes to GeometryEngine.cpp
* Add missing TDF_LabelSequence include in STEP.cpp
---------
Co-authored-by: yw4z <ywsyildiz@gmail.com>
* build: remove std::move that blocks copy elision
std::move wrapped around a temporary, or around a local being returned,
stops the compiler constructing it in place. Each edit is the fix clang
suggests, which is to delete the std::move call and keep its argument.
Three of the 39 sites save a move, the two return std::move(local) in
Print.cpp and TreeSupport.cpp:2749. The rest are equivalent either way
and match how the codebase already writes this elsewhere.
Clears 39 -Wpessimizing-move warnings.
* build: drop null checks on references and this
A reference cannot be bound to null and this cannot be null, so the
compiler folds these conditions to true and drops the guard. Seven are
if (&bitmap && bitmap.IsOk()), where IsOk() already does the work; two
test this directly. The guarded code runs either way, so removing the
dead operand changes nothing.
Clears 11 -Wundefined-bool-conversion warnings.
* fixes: %g directive writing between 1 and 13 bytes into a region of size between 6 and 18 [-Wformat-overflow=]
* fixes: %5s directive writing between 5 and 63 bytes into a region of size 58 [-Wformat-overflow=]
* fixes: catching polymorphic type by value [-Wcatch-value=]
* fixes: [-Wcomment]; removes whitespaces
* increases buffer size from 71B to 90B to avoid potential ovfl.
1.Put commctrl.h into pch precompilation(OCCT conflicts)
2.Replace input wxWidgets to support loss focus verification(STUDIO-8101)
3.Optimize slider interaction and trigger mesh when push up slider(STUDIO-8099)
4.Optimize step loading method, separate import of step and mesh
5.Fix dialog cancel button logic;
6.mesh tasks into sub-threads to prevent blocking the UI;
JIRA: STUDIO-8101 STUDIO-8099
Change-Id: I50bbb43953a5128f358c6880032d20693531333b
(cherry picked from commit ed7ab6b505a2becf8f38edb3c43b96e51eac3317)
* FIX: the logic of buried points that were not buried
JIRA: none
Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
Change-Id: Id95174659c5fce7feba409eb5e14916608745fa4
* ci: update network module based on commit bc7ca98
Change-Id: I923526f0bf9ce5a288144fa1f9b0f2fc640f41b7
* Fix Firefox
Co-authored-by: hadess <hadess@hadess.net>
* FIX: cali: custom created filament from AMS displayed as incompatible
jira: new
remove the condition: is_system
Change-Id: Ib1366966bbdbe01bc9e2483d9914d270ebefa976
* FIX: duplicated items in comboBox at calibration completed page
jira: new
Change-Id: I4749a2206df16c438e0d3098e36274b2a20f313e
* ENH:update support for P1S plus
jira:[for p1s plus]
Change-Id: Id577d4e94e2162cb0045d261dfaa5f396ecded2f
* ENH: CLI: add mk information support
JIRA: no jira
Change-Id: Idd89b143d439de50d9f52eb8aec95b262d66875d
* ENH:calibration support p1p plus
jira:[plus]
Change-Id: Ia290d3a8a8b9adaac7a6ee26d9a8b5ea0c1b3aee
* FIX: add log for base_id and filament_id
github: #3087
Change-Id: Iebfbd0f224fce49f33fc81c71e6108f6e3abb5ff
* FIX: sync whole preset vendor directory
Change-Id: I191dbe979a87ff35d38cab1149b7975664344838
Jira: STUDIO-5534
(cherry picked from commit 628866608116336453804aa1217dd55db04d47ad)
* FIX: use t_utc for debug only
Change-Id: Ia05d8969d4de3dd38908980d6e17a3ebb11ca279
Github 3045
Change-Id: I77935df53bbf2772b1146e5c330c537165a3a2e6
* FIX:make sort_volumes right
Jira: STUDIO-5645
Change-Id: If324c9115bfaaf0c1b7b4be7c7ee96ba6b8ac890
* ENH:keep an unload logic
jira:[for unload]
Change-Id: Id30ec71ffa5b2dac89346ea47ca48a62479e3ab1
* FIX: several problems with mesh boolean
1. Cut with multiple volumes are OK now.
2. Close mesh boolean fail error with new object or open object
3. Fix wrong name and config of boolean resulting object
github: #3118
jira: none
Change-Id: If2c9dbfb36cbdfe4917a2371217923891bb7909c
(cherry picked from commit 982c0ecb92cf7c2b5ae5972ab900a6b10e7dda50)
* NEW:limit the length of project name
jira:[project name]
Change-Id: I955620f7073b3b7fda280d1118524f561d047751
* ENH:adjusting the warning level of timelpase
jira:[STUDIO-5662]
Change-Id: I4902b22d316f5e09a97a62c88b8a98e55c405434
* FIX: 3mf specification: change namespace form slic3rpe to BambuStudio
Jira: XXXX
Change-Id: Id705affc875ef23fdf2ac6d79f0cb0aafc4f7050
* NEW: Open MakerWorld With BambuStudio GetParam
JIRA: none
Change-Id: I0d65b364f1cd2d634a88882ab072c3e61ea89167
(cherry picked from commit 8eaf45e5359439a7c796fd79876c86775abcf48e)
* FIX: Filament issue generated when creating a printer
Jira: XXXX
Change-Id: I976770b69b47641bd54aa7a9c56fba7f58d1ab68
(cherry picked from commit ba42188b93c58b3954234d72acdd9769a68e3d3c)
* FIX: Blank page appears when editing presets
Jira: 5563
Change-Id: I4c49e05515b1beff55991e92f8079c4499c27eab
(cherry picked from commit e86517d290f4cd0765a230d811b0ddf2c9f34c17)
* FIX: context menu didn't update UI
jira: STUDIO-5691
Change-Id: Ia66b8623d832eba805aff5320941233a68ff258b
* FIX: crash of "filling bed"
"get_arrange_settings() const" gets trapped in infinite recursive calling.
Now we delete this function.
jira: STUDIO-5688
Change-Id: Ia39974734bb37b2a2f06b5bf78185f01be726872
* FIX: boolean hangs in the middle of color painting
Can't do splits in combine_mesh_fff, as do_boolean of mcut will split meshes.
jira: STUDIO-5693
Change-Id: Idddb7d20dd7ca386c39ddd3d87d9defc3136aa5d
(cherry picked from commit 6c67d015941458e37faaf0015b6509b5a0eadc0e)
* Fix: Fix a number of compilation problems
issues found when using gcc version 13.2.0 (GCC) in a Flatpak sandbox
github : https://github.com/bambulab/BambuStudio/issues/3074
github pull request: https://github.com/bambulab/BambuStudio/pull/3096
Change-Id: I08aeac593eb1ce7675894df72e8489200bae713d
(cherry picked from commit 069d133d66bfa682de4a860e379d5dc16b3d907c)
* fix: macos icns issue when icon was not attached
github pull request:https://github.com/bambulab/BambuStudio/pull/3116
Change-Id: I49072ad49f3af7669a6d307c791594ade210da50
(cherry picked from commit c977e5582e3a30ad16dd267810037423aad9a53c)
* FIX: Add flush_length for change_filament_gcode
Change-Id: I30f4b97d3d61c2a57f0e92f157cbd31c38aa7265
Jira: XXXX
(cherry picked from commit 92eb2bac977a0c4095b316cbbc6580fb5228b710)
* FIX: edit preset dialog can't close on mac
Jira: 5696
Change-Id: Ib33dfd07cc588ddd3805e3490a4d8c36dcd890ac
* ENH: add dev_ota_version in ssdp
JIRA: STUDIO-5740
Change-Id: Ic80e6d4b9bf82813fdc4a76604a3d36213d12b03
Signed-off-by: Stone Li <stone.li@bambulab.com>
* NEW:Adapt to multicolour and gradient colour
JIRA:xxxx
Change-Id: I8084cab603d5681cbcaf2d6f5e0d7ad5419cb2af
* NEW:Adaptation of semi transparent materials
JIRA: XXXX
Change-Id: Ie32d8ce67c37b85eb6d7d6594cb514a696307e68
* FIX: disable flush options if prime tower is unchecked
jira: STUDIO-5639
Change-Id: I25081584d430bc7d062e14bcc2cdbf7522cf9d99
* ENH: refine GetVersion for HMS query
JIRA: STUDIO-5763
Change-Id: Ia3ccc07d79cc0736eb12e9782da50211abb74772
Signed-off-by: Stone Li <stone.li@bambulab.com>
* FIX: Prefer old selection when sync AMS not compatible
Change-Id: I6b18db51887132a997cf78d70fff9a92e23bc44a
Jira: STUDIO-5416
(cherry picked from commit 077fae29823cf4f3071d408b1b40f55ee0cb33c6)
* FIX: The flushing was not auto-calc when sync ams list
JIRA: STUDIO-5551
1. flushing volume auto-calc when sync ams list
2. flushing volume takes the larger calculation value when filament has
multi-colors
Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
Change-Id: I72e6f9780ea56103a44c2da6068440a4615c254d
* FIX:fixed invalid links
jira:[fixed link]
Change-Id: I036a38b6e8e94da762f93805bd7be706538771fe
* FIX: Prompt to delete problematic presets
Jira: XXXX
Change-Id: Ic43f7bb782794d7ab0b6acbffbb5d73e94f6ed73
* FIX:fixed incorrect HMS content
jira:[STUDIO-5818]
Change-Id: Ia2896d6f0ab1ffedbc850e54168acece8e47bdbb
* FIX:external transparent material display error
JIRA: STUDIO-5845
Change-Id: I0a4f05ac5d5c0ac49d85a704ee65a7221c5f1e1d
* FIX: [5846] Custom Filament Page show System Filament
Simultaneously solve: When downloading Preset from the cloud, the filament_id of the preset in m_preset is null.
Jira: 5846
Change-Id: I6ba1b46fe92e345614b6a4af3fffa87d81fa2456
* FIX:A1 and p1 series do not support custom materials
JIRA:XXXX
Change-Id: Ib0459273d1f9a7152a5563757204634a8d0cd6f5
* FIX: exception when comparing profiles
jira:[NEW]
Signed-off-by: XunZhangBambu <xun.zhang@bambulab.com>
Change-Id: I946b5fcd35f779d271df2b3de731fdcada5aab29
(cherry picked from commit 00e739570812e5c4be3e0f7702ce8c72c0f9e72b)
* FIX: hide_id_middle_string
Change-Id: I28f32ec526b443d31d7992971b80ab1cb737deb6
Github: STUDIO-5825
* ENH: modify some logs level
JIRA: STUDIO-5958
Change-Id: I5a8592dfb8ffa9a81952535cb30944f867aa0e22
Signed-off-by: Stone Li <stone.li@bambulab.com>
* NEW:build plate marker detect
Change-Id: I70f03efea688bb6ce71c3f5990bb3c50605ab184
* FIX: Studio UI Freeze when saving user preset
github: #3335
Change-Id: Idaf53f673a3e46408826c06bdde2c592395d358b
* update bbl plugin version
* fix build errors
* update bbl profiles
* update color
---------
Signed-off-by: Kunlong Ma <kunlong.ma@bambulab.com>
Signed-off-by: Stone Li <stone.li@bambulab.com>
Co-authored-by: Kunlong Ma <kunlong.ma@bambulab.com>
Co-authored-by: gerrit <gerrit@bambulab.com>
Co-authored-by: liz.li <liz.li@bambulab.com>
Co-authored-by: tao wang <tao.wang@bambulab.com>
Co-authored-by: lane.wei <lane.wei@bambulab.com>
Co-authored-by: maosheng.wei <maosheng.wei@bambulab.com>
Co-authored-by: chunmao.guo <chunmao.guo@bambulab.com>
Co-authored-by: zhou.xu <zhou.xu@bambulab.com>
Co-authored-by: Arthur <arthur.tang@bambulab.com>
Co-authored-by: Bastien Nocera <hadess@hadess.net>
Co-authored-by: zhimin.zeng <zhimin.zeng@bambulab.com>
Co-authored-by: hu.wang <hu.wang@bambulab.com>
Co-authored-by: Stone Li <stone.li@bambulab.com>
Co-authored-by: XunZhangBambu <xun.zhang@bambulab.com>
Previous precision is not enough, and some mesh is not
of good quality.
This is handling for github issue #825
Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I68901b41c1a3279c61678dbbcc93c887020f18a7
This is fix for crash issue for some specific step
file, which generate empty mesh.
Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I910e3d2da670b623570665265a12361492bd706b