75 Commits

Author SHA1 Message Date
Lukáš Hejl
ed2cdfec61 SPE-2486: Implement support for PerimeterRegions that will apply configurations affecting just perimeters only to parts of perimeters instead of creating different LayerRegion. 2024-11-12 15:22:58 +01:00
Martin Šach
2cac8c2c37 Fix includes 2024-09-17 11:21:29 +02:00
Martin Šach
0bf8a9b1c5 Fix includes 2024-08-14 00:04:11 +02:00
Martin Šach
a91a7d6b0e Better detection of bridge orientation.
Before, partial bridges were calculated. For each of these an angle
has been choosen and after that all the bridges have been merged.
Becouse of the merge a single angle had to be picked.
The first angle that the algorithm has stumbled upon has been picked,
resulting in sub-optimal bridging directions.

Now the partial bridges are calcualted, then merged and then
the angle is decided over the whole merged bridge.
This approach at least ensures that the orientation is the best possible
for the merged bridge.
2024-07-17 14:14:45 +02:00
Martin Šach
919740fb3e Apply fix includes. 2024-07-08 15:37:02 +02:00
Lukáš Hejl
a3190d94d0 SPE-1804: Single perimeter for top and bottom layers working with both perimeter generators.
Co-authored-by: supermerill <merill@free.fr>
Co-authored-by: Morton Jonuschat <mjonuschat@gmail.com>
Co-authored-by: Vovodroid <vovodroid@users.noreply.github.com>
Co-authored-by: qing.zhang <qing.zhang@bambulab.com>
Co-authored-by: lane.wei <lane.wei@bambulab.com>
2024-04-24 10:06:56 +02:00
Martin Šach
78cd2f9e68 Move IndexRange.hpp to LayerRegion.hpp and fix warnings 2024-03-05 14:35:41 +01:00
Martin Šach
74a38ed4f3 Fix: Anchor bridges to top solid infill.
Fixes SPE-2031.
2024-03-05 14:35:41 +01:00
Martin Šach
bb2186cbcf Refactor: expand_merge_surfaces now uses expansion_zones.
This enables addition of other expansion zones in the future.
For example to make sure bridges are anchored properly even
if there is top fill next to them.
2024-03-05 14:35:41 +01:00
Martin Šach
4d0bae1d3f Refactor: Move bridge expansion to separate function.
This will enable using it in the other expansion calls.
2024-03-05 14:35:41 +01:00
Martin Šach
81d9724436 Refactor: Allow any number of expansion zones in expand_bridges.
Split the function expand_bridges_detect_orientations into
multiple functions. And allow any number of expansion zones
by using a vector instead of explicitly listing the
parameters.
2024-03-05 14:35:41 +01:00
ps_copyright
f32859c302 final copyright headers 2023-09-01 14:49:07 +02:00
Vojtech Bubnik
d657726a22 Follow-up to ce2dd4cb2238550fdfbf69082feecc0619ba5a95
Fixed a typo in typo, Vojtech needs vacation.
    Follow-up to 02f69575ef580ef3dd8ed0ea7a82646157de5335
        Fix of SPE-1752, GH #10736:
        Extended the bridge expansion algorithm to expand into sparse infill
        by a maximum of 1 perimeter width.
2023-06-08 15:54:26 +02:00
Vojtech Bubnik
ce2dd4cb22 Follow-up to 02f69575ef580ef3dd8ed0ea7a82646157de5335
Fix of SPE-1752, GH #10736:
    Extended the bridge expansion algorithm to expand into sparse infill
    by a maximum of 1 perimeter width.
2023-06-08 15:11:24 +02:00
Vojtech Bubnik
02f69575ef Fix of SPE-1752, GH #10736:
Extended the bridge expansion algorithm to expand into sparse infill
by a maximum of 1 perimeter width. This solves a situation, where
the "ensure vertical wall thickness" region is filtered out as
too narrow to be important for print stability while the bridge expansion
only happened into the "ensure vertical wall thickness" regions before.

Partial revert of cf6b6ff4e4c47ebbe08f97cf80d923cde81c29af, reverts
	Fix SPE-1726 - hole between bridges and perimeters caused by thin internal fill surface
    GithubIssue https://github.com/prusa3d/PrusaSlicer/issues/10231#issuecomment-1546779200
    During sorting of surfaces into top, bottom and internal, expand bottom bridges by one spacing unit, to ensure better anchoring
2023-06-07 14:24:09 +02:00
Pavel Mikus
b20dfac403 update fix of SPE-1685 - make the closing raidus half the size, it was unnecesarily large 2023-06-02 16:20:13 +02:00
Pavel Mikus
f1e287e0c9 Fix SPE-1685 Tiny holes in external bridges and top solid
During external surfaces processing, the regions are expanded a little to
absorb unassigned regions that emerge during ensuring regularization
2023-06-02 12:35:22 +02:00
Pavel Mikus
5b21a343c6 revert fix of 1728, it causes worse problems with top solid expanding out of model boundaries. 2023-05-25 10:12:32 +02:00
Pavel Mikus
b1c0bf17af SPE-1728 Fix external bridges expansion - allow expansion into top solid
Github issue: https://github.com/prusa3d/PrusaSlicer/issues/10493
2023-05-23 16:06:54 +02:00
Vojtech Bubnik
00ea0847b8 Fix of merging bridging regions:
Fixed building a DAG of overlapping regions in expand_bridges_detect_orientations()
2023-05-04 17:25:26 +02:00
PavelMikus
0eb2a2cf04 Disable "infill only where needed" option
Note: only commented out for now.
2023-03-27 13:27:57 +02:00
Vojtech Bubnik
66abc34e88 Fixed wrong direction of bridges after "ensure vertical wall thickness"
rework. Fixes SPE-1598
2023-03-15 18:51:04 +01:00
Vojtech Bubnik
f2f9b89096 Fix of #9963 Bridge angle not accept degree but rad
Fixes SPE-1583
2023-03-14 19:32:27 +01:00
Lukas Matena
1fbbaaae9b Fixed several warnings 2023-03-07 14:47:25 +01:00
PavelMikus
39df7582c0 Fix freeze/crash happening when slicing with 0 perimeters 2023-03-03 11:45:06 +01:00
Vojtech Bubnik
1a91d85e7e Fixes of recent RegionExpansion implementation.
Enabled thick internal bridges even if external thick bridges are disabled.
Fixed compilation of conditionally compiled debugging code.
2023-01-06 17:53:49 +01:00
Vojtech Bubnik
479a39ce0e Fixed some compiler warnings 2023-01-04 16:41:42 +01:00
Vojtech Bubnik
60f6766aab Apply FillBoundedRectilinear on narrow internal solid infills
to reduce zig-zag movements of the print head on overhangs.
Always use thick bridges on internal bridges.
Co-authored-by: lane.wei <lane.wei@bambulab.com>
2023-01-03 17:42:10 +01:00
Vojtech Bubnik
fbed29e209 WIP Ensure vertical wall thickness rework: bugfixes 2023-01-03 10:06:52 +01:00
Vojtech Bubnik
fde0d68c40 WIP Reworking of "ensure vertical wall thickness".
1) Flipped the order of "discover_vertical_shells" and "process_external_surfaces",
   now the external surfaces are expanded after "discover_vertical_shells"
   aka "ensure vertical wall thickness" is solved.
2) Reworked LayerRegion::process_external_surfaces() to only expand into
   "ensure vertical wall thickness" regions, also the expansion is done
   in small steps to avoid overflowing into neighbor regions.

also:
Utility functions reserve_more(), reserve_power_of_2(), reserve_more_power_of_2()
Various SurfaceCollecion::filter_xxx() modified to accept an initializer list of surface types.
New bridges detector refactored to accept overhang boundaries.
BoundingBoxWrapper was moved from RetractCrossingPerimeters to AABBTreeIndirect.
2023-01-02 13:19:27 +01:00
Vojtech Bubnik
a98467f661 Merge remote-tracking branch 'remotes/origin/master' into vb_treesupports 2022-11-18 13:26:48 +01:00
Pavel Mikuš
06fbab12fe
Pm overhang extra perimeters (#7)
Implementation of extra perimeters on steep overhangs/flat unsupported parts
Also contains:
Principal components computation over polygon area
New fast bridge direction estimation which minimizes amount of unanchored bridge endpoints
2022-11-09 10:38:36 +01:00
Vojtech Bubnik
409fae6183 WIP Refactoring of Layers: LayerIslands filled in with perimeter
extrusions, gap fill extrusions and fill regions.
2022-11-02 12:59:31 +01:00
Vojtech Bubnik
d041fa6c0c Refactored PerimeterGenerator to output out_fill_surfaces as ExPolygons,
not SurfaceCollection.

Reworked combineinfill.t, 07_extrusionpath.t, 08_extrusionloop.t to c++.
Removed Layer / ExtrusionPath / ExtrusionLoop / ExtrusionEntityCollection
from Perl bindings.
2022-10-27 19:08:43 +02:00
Vojtech Bubnik
237e56c7ce Follow-up to ee626eb65a1a41ec7fd3e00f7b39d048c2795516
Refactored PerimeterGenerator for functional style, better constness
with the goal of calling PerimeterGenerator::process_xxx()
for each surface at once to collect its fill expolygons.
2022-10-27 13:04:52 +02:00
Vojtech Bubnik
ee626eb65a WIP: Layers split into islands, islands overlapping in Z interconnected
into a graph with links to the layer above / below.

In addition:
Members of LayerRegion were made private, public interface const only.
this->m_xxx replaced with just m_xxx
SurfacesPtr was made a vector of const pointers.
2022-10-26 18:41:39 +02:00
Lukáš Hejl
499c2253bb Fix of #8704 - Travels in spiral vase mode when Arachne is used.
Now Arachne is used just for bottom layers, and for spiralizer layers is used Classic perimeter generator.
2022-08-18 11:22:47 +02:00
Lukáš Hejl
6f5813a849 Fix of #8648 - Lightning infill wasn't connected to perimeters when it was combined with the option "Only infill where needed".
Now Lightning infill will ignore this setting and treat it as off. Because Lightning infill and "Only infill where needed" do a similar thing, and their combination doesn't make much sense.
2022-08-18 11:22:45 +02:00
Lukáš Hejl
c76c497234 Renamed slicing engine to perimeter generator and slightly rearrangement of Arachne parameters. 2022-06-01 21:43:00 +02:00
Lukáš Hejl
adf2d21c67 Allowed "Slicing engine" and all Arachne parameters to be settable per object. 2022-06-01 21:40:15 +02:00
Lukáš Hejl
556e2b71cc Initial port of Arachne from Cura. 2022-06-01 21:40:13 +02:00
Lukas Matena
5c616c5931 Sync to 2.4.1-beta1 2022-02-01 14:16:13 +01:00
Lukas Matena
ebb9041041 Merge branch 'master' into stable - no conflicts fixed 2022-02-01 14:15:18 +01:00
Vojtech Bubnik
c9727b5a57 Fix of Random placment of top fill throughout model #7442
For this particular model, ClipperLib numerical instability causes
one of the internal surfaces to turn into bridging surfaces
on reslicing. The issue was fixed by reverting to untyped slices if possible.
2021-12-08 09:45:59 +01:00
Vojtech Bubnik
556e0c53c7 Some more refactoring of ClipperLib / closing() / opening() 2021-10-18 14:51:30 +02:00
Vojtech Bubnik
5b90033b31 Cherry-pick of 2e55898d78ddca4753adb60c9222c52bc9ee8ba8
Fix of an extremely slow bridging calculation, caused by an extremely
slow bridged area detection function, of which the results were never used.
Fixes "slicing fails or takes too long #5974"
2021-06-25 14:44:09 +02:00
Vojtech Bubnik
ee15f00574 FDM backend refactoring: Return PrintRegion by reference, not by pointer.
Added PrintRegion hashing.
2021-05-05 18:13:58 +02:00
Vojtech Bubnik
72ce8cb28d PrintRegion refactoring: Getting rid of the Print pointer. 2021-05-05 14:17:36 +02:00
Vojtech Bubnik
7d4b3f2992 Fix of safety_offset() after ClipperUtils refactoring.
Fixes Solid infill where there should be none #6482
Also the safety offsetting was revised to be enabled only where needed,
the "do safety offset" is now easy to discover by
a new ApplySafetyOffset::Yes enum, and safety offset over union, which
is better done by offset() / offset_ex() has been replaced with
new union_safety_offset() / union_safety_offset_ex() functions, which
better convey their meaning and which could be better optimized than
union() with the safety offset applied.
2021-05-05 12:16:47 +02:00
Vojtech Bubnik
09a80d954c Further rework of ClipperUtils: Replaced many to_polygons() /
to_expolygons() calls with templated ClipperUtils variants to avoid
memory allocation and copying.
2021-05-03 11:39:53 +02:00