Commit Graph

88 Commits

Author SHA1 Message Date
Arthur 0964b5bb0a FIX: tree support generates floating hybrid supports
Jira: STUDIO-4763
Github: #2660

Change-Id: I13d5a1443af8bc82f0cadd177e0db3fc3db971f1
(cherry picked from commit 04cb09b1f63db232854e6ce0734fbff6f5945b8d)
2023-11-09 10:09:10 +08:00
Arthur d7a4623380 FIX: improve tree support generation speed
1. Improve generation speed by removing unnecessary get_avoidance.
2. Fix a bug of hybrid support's interface (Jira: STUDIO-4878,
   STUDIO-4726, Github#2614)
3. Fix a bug of tree support pass through objects (Jira: STUDIO-4252, STUDIO-4608
STUDIO-4298)
4. Fix a bug with first layer + Arachne (Jira: STUDIO-4281, Github #2423)

Change-Id: I40978c93ab93fa6964483514dad552d73a66c710
(cherry picked from commit 2ccbbe49c74d4aab4f086e79a6f8262b7fc80f15)
2023-11-09 10:09:10 +08:00
arthur 76f876a3c6 ENH: improve tree support
1. add a hook inside tree branches for improved strength
2. fix the issue that interface may fly as a mess (delete the logic
  where gap nodes can skip dropping down)
3. fix the issue that base nodes may fly as a mess (smoothing should
  skip polygon nodes, see Jira:STUDIO-4403)

Change-Id: Ie9f2039813c2ca3127ed8913304cc455fec8e7ee
(cherry picked from commit 83cef5f91d49ff3d275a89ec3df8b5f0fd573f8c)
2023-11-09 10:09:10 +08:00
lane.wei 4d1eae0046 ENH: CLI: return error when the printable size exceeds the default one
also refine some logs

JIRA: XXXX
Change-Id: Ibec090e98b8d93b1396e691ecff97ced13b1d8c8
2023-11-01 09:33:21 +08:00
Arthur 6612086816 ENH: do not leave a gap for top interface if the top z distance is 0
Previously when the overhang is a slop, it's controled by the xy
distance. Now we control it with top z distance as long as it's an
interface.

Note: Not working with Snug support, which has a different mechanism of
support interface.

Jira: STUDIO-3991

Change-Id: I1b7c4cf892b4c4ec2f3e668bd966ab0971212364
(cherry picked from commit c094b5ec83dc98dca7a8b8c0438b8f1994134db6)
2023-11-01 09:33:21 +08:00
Arthur a631e6cb99 FIX: tree support detect overhang inaccurate
Jira: STUDIO-3657
Change-Id: I1ef4ca3ec299b121eb467afc12acee68e0f12b39
(cherry picked from commit 36f8937ae0d0d79c7558662903fffef20b528cb8)
2023-11-01 09:33:21 +08:00
Arthur 2bd6b11505 ENH: improve auto-arranging objects with tree support
We decide to set brim width of all objects to MAX_BRANCH_RADIUS_FIRST_LAYER if there is an object with tree support after discussion.

Jira: MAK-2009
Change-Id: I4c4940800632c433235966b01c44ac910e33a51c
2023-11-01 09:33:21 +08:00
Arthur 181b05c236 ENH: tree support uses accurate lslices
For tree support, use lslices as tree support island when generating brim,
as this is faster and more accurate.
For normal support, still use "support_fills.polygons_covered_by_spacing()" as support island when generating brim;

Jira: studio 4332

Change-Id: Ibfadd3a166606f824e5780b57112fff221470aaf
(cherry picked from commit 64960b19818c7029eaaaf3d8a89804aeaa26f11d)
2023-11-01 09:33:21 +08:00
Arthur ad9fa81b01 ENH: add a new support style "Tree Organic"
Add a new suport style "Tree Organic" from Prusa, as organic support is
faster and seems more strong in some cases. Thanks to Prusa.

Feature detection including sharp tail, small overhang, long cantilever,
are still kept.

Known issue: first layer support path may go outside build plate.

Jira: STUDIO-2358
Github: #2420

Change-Id: I4cec149bf4fa9eb733ae720ac1a7f65098e3b951
(cherry picked from commit d977bc5d3b4609f4fec0aa68152a33cacf184c4a)
2023-11-01 09:33:21 +08:00
Arthur 855c3d61ff FIX: tree support + raft may fail to slice
Do not skip generate_toolpaths if has no overhang but has raft.

Jira: STUDIO-4341
Change-Id: I0bdadb5f778e0e1fda686341c0860d0f0c160f0f
2023-11-01 09:33:21 +08:00
Arthur 04ce14ca90 FIX: crash when support spacing set to 0
Jira: STUDIO-4339
Change-Id: Ic9198e21fbaa8992cc08628aefa8673ba82194b3
2023-11-01 09:33:21 +08:00
Arthur edcdad162e FIX: tree support bottom interface layers were not correct
The bottom interface layers were not right when "independent support layer height" is enabled.
This commit ensures there are always 2 bottom interface layers and the gap
is not less than specified. However, the gap may be slightly larger.

Jira: STUDIO-3842, STUDIO-2138
Github: #2127

Change-Id: Ifd8fbc4c7bc6dd92f2534fdd0179458a9e93c79a
2023-11-01 09:11:19 +08:00
Arthur 25f9cccf2a FIX: disordered support interfaces in tree support
Can't delete nodes with no children, otherwise the parent-child relations may be corrupted.

Jira: STUDIO-3737, MAK-1557

Change-Id: I1de39e182bac4a55a8739c00e59fdf7b9b5e4dfb
2023-11-01 09:11:19 +08:00
Scott Mudge 9fde7861c4 FIX: Bugfix for zero-width tree supports from @scottmudge (#1367)
fix bug with zero width tree supports throwing exception.

This a PR from @scottmudge commited to OrcaSlicer.

More than the original commit, we also unify the usage of line_width and
support_extrusion_width, making things simpler.

Change-Id: I0b7a4344cbda4fdf05dfd9f8965f598ad6844429
2023-11-01 09:11:19 +08:00
Arthur ade248cc2f FIX: tree support's enforcers inside a hole were wrong
Previously holes of enforcer_polygons was taken as contours,
which caused enforcers inside a hole were too large.

Jira: STUDIO-3877
Change-Id: If38c34e2469b822012a2ed0b082783563fe99228
2023-11-01 09:11:19 +08:00
Arthur 9d9673116d FIX: tree support didn't work with enforcer
Enforcers should also subtract the lower polygons to get overhang areas.

Jira: STUDIO-3692
Github: #2045
Change-Id: I70f4aaae13826efc624e9bc942d2d11e9b1df1a1
(cherry picked from commit fc3d9b24ac1eb14e259488c94fca3469f319b368)
2023-07-31 14:29:15 +08:00
Arthur 44fdfe8fff FIX: tree(manual) didn't support well
1. We have a logic to add supports at corners for tree(auto), now I extend
it to tree(manual) also.
2. Only show support_critical_regions_only option to tree(auto).

Github: #2008
Change-Id: I161444da93464fd2ef0e0f3b40a0c5852beba351
(cherry picked from commit af4efb4aadc2a4d16de3eea881c6610955985fff)
2023-07-31 14:29:15 +08:00
Arthur 04bfe7e405 ENH: ease removal of tree supports
Previously tree supports are harder to remove than normal
supports. We learn from normal supports and improve the gap between
object and supports.

Jira: STUDIO-3530

Change-Id: I229a7b869b334bdf4c5aba96c9450213b83457f2
2023-07-07 17:52:43 +08:00
Arthur 0ce835dcd4 ENH: add option "remove_small_overhang"
Let the user choose remove or not.

Github issue: #1810
Jira: STUDIO-2992

Change-Id: I9c5e087d171d16d8d7318b36efe825a6cbc29c33
2023-07-07 17:29:08 +08:00
Arthur 2e0a8dcf30 FIX: reduce normal node in buildplate_only mode
If support_on_buildplate_only is enabled, and a node will fall into the object,
this node should not be a normal node.

Jira: STUDIO-3047
Change-Id: I65dc6d69d28729732907111c3b34b4d32edff806
(cherry picked from commit d04dc35d45c171e20899cb391d3b192fa123c10e)
2023-07-07 17:29:08 +08:00
Arthur 3c1f7f9e16 ENH: improve small overhang detection
Small overhang diameter threshold is reduced,
and use bounding box size instead of area for final decision.

Github: issue 1681
Change-Id: Iabbb49dfc47345bb609214749104c808608c4d65
2023-07-07 17:25:51 +08:00
Arthur 12d0a51362 FIX: do not merge overhangs when buildplate_only is on
Jira: STUDIO-3024
Change-Id: I87f73a556945d1b1640c515336ca108f65b88bdf
(cherry picked from commit 1c09513324bb965647bbb157be1cacaf9371ce07)
2023-07-07 17:25:51 +08:00
Arthur 3d1f61c7ed NEW: add tree_support_brim_width option
Jira: STUDIO-2921

Change-Id: Id5fddc0b6f5ffe3beb9afb0be5f81a766fc5b21e
(cherry picked from commit 86d7b6016e48143aad03744a58d44042ff0a0b4c)
2023-07-07 17:25:51 +08:00
Arthur 55a1141e67 FIX: sharp tail detection misses some sharp tails
1. Previously if there are multiple sharp tails in a layer, some will be
 missed. To fix this, we should not skip if the current layer is already
 detected as sharp tails.
2. Do not mistakenly detect sharp horns as sharp tails by only detecting
 the overhang areas larger than half of the extrusion line width.

Github: #1578
Jira: STUDIO-2659
Change-Id: If7ba5c9ae547d3051551aa6fa34eb6214d01a46d
2023-07-07 17:25:51 +08:00
Arthur 3d8383f127 ENH: upgrade some deps libraries
CGAL to 5.4
 TBB to 2021.5
 OpenVDB to 8.2

Change-Id: I08992fce104e6f56001643c3c5dbf6c3f59ffc3d
(cherry picked from commit 1571f176fc37dda1c3e889776e13fa49bba4ae42)
2023-07-07 17:25:51 +08:00
Arthur e7a21ce0e1 FIX: support blockers in tree support not working after mirroring
This is caused by the inverse-order polgyons after mirroring. Adding
a union_ before offset_ex fixes this bug.

Github: #1621
Jira: 2738
Change-Id: I885a3ca6af4e5fadb2158d913cf67525bfffa91e
(cherry picked from commit 4ea95d89e7ec058ac21218e1839cfe16b486893a)
2023-07-07 17:25:51 +08:00
Arthur ef109ca170 FIX: tree support may generate floating circles
Github: #1687
Change-Id: Ib762bd2f43e1a3671404a85e234c51a0f159d919
(cherry picked from commit adf84cb6e618b60eff57c66c9f4d2fc703a87cae)
2023-07-07 17:25:51 +08:00
Arthur 1a7b12fa38 FIX: auto-arranging result may fail clearance check
We add 0.001mm tolerance.

Change-Id: I630cc680db0a3a65a6a44e177de686fbac1e1f15
(cherry picked from commit 170f9c2a89d03060f9a9aa43952c0759ffbe7c1f)
2023-04-17 15:39:02 +08:00
Arthur 719f273fa2 ENH: improve smoothness of tree supports
1. Instead of smoothing top-down, now we smooth tree branches bottom-up, and do not stop at merged nodes.
2. Fix a bug where some nodes don't have child. This is critical for bottom-up smoothing.

Change-Id: Iac0fecd81dac541ca390bcf5cbdfe7fd66cfd3a2
(cherry picked from commit 536a8a4f0ef76fa0358f4b4b181c4c7e7fff8bc7)
2023-04-17 15:39:02 +08:00
Arthur fbbfb06f6b ENH: make tree support much smoother
We increase the smooth iterations from 1 to 50.

Change-Id: Iba883fd67d7a9a71c92b364dcc9b76e00fc45820
(cherry picked from commit 945fba20a5629148bfd8cee47f492d42c50f9824)
2023-04-17 15:39:02 +08:00
Arthur 1d4a25ed20 FIX: bring back Tree Strong style
Tree Strong is too similar to Tree Slim and people don't like it.

Jira: STUDIO-2660
Github: #1579
Change-Id: I52d7e8e674f0fc332e4ab2813261ffbc4b4cfb7a
(cherry picked from commit 9eb209b4c1737d2f10b9b8bd78c9f876f3d32bce)
2023-04-17 15:39:02 +08:00
manch1n f49c151611 FIX: avoid arrange to nonprefered region
Previously we assume the NFP of exclude regions are rectangle, which was
not always right. Now we calculate the NFP and find a best new position
to shift.

Change-Id: I02c075603cf71dd3c9146d7ac7a6706c0f850669
(cherry picked from commit 713ebd666c90d5dcfaf89914c37d211e9a470e99)
2023-04-17 15:39:02 +08:00
Arthur 87abd65ea4 FIX: do not allow support thresh angle to be 90 degrees
tan(90\degrees) is too large and will make detect_overhangs very slow.

Jira: STUDIO-2620
Change-Id: I55901a6bc1b56216549f66e1a7e77c0da680997b
(cherry picked from commit e58cc8a4665808580e84107f54661447000d64f3)
2023-04-17 15:39:02 +08:00
Arthur 3d710609d9 ENH: improve cantilever detection's speed and accuracy
Cantilever detection should be done layer by layer, instead of using
merged_poly of clusters.

Jira: STUDIO-2198

Change-Id: Ifea017fc4c13425a944ee80f7dedb603a8e14cc2
(cherry picked from commit 0803a439a458ffeb9c6d91e90344a5b78794a6bd)
2023-04-17 15:39:02 +08:00
Arthur 74d558e612 FIX: tree support crashes when lower_layer is null
Change-Id: I942bdf1dfc253be5ebf659274f230290c5260d63
(cherry picked from commit 05b033cd0dfacadab9ea3e725e364a6156d068f2)
2023-04-17 15:39:02 +08:00
Arthur 15ba872d1c ENH: only draw infill in normal nodes of hybrid support
1. Only draw infill in normal nodes of hybrid support.
  Previously when hybrid support was selected, all nodes would have
  infill including the circle nodes which don't need infill. Now we draw
  infill only when there are normal nodes.
2. Move remove_bridge after small overhang removal because the trimmed
  bridge may be detected as small overhangs.
3. Only split circle nodes in draw_circles to prevent floating circles.
4. Fix the issue where tree support infills may not be aligned,
   which is caused by the changing spacing of filler.
5. Fix a bug where lightning infill in tree support may crash.
   Note: it is still not prepared to set lightning infill as default,
   as for some models the generation time of lightning infill is still
   too long.

Change-Id: I556e5097041d09afae1e2957d4dc9914d4610149
(cherry picked from commit 4c0849a81b60cde0c3b8ca54f03f63ea7c62dcd9)
2023-04-17 15:39:02 +08:00
Arthur 6facd65530 FIX: sharp tail detection in normal support was wrong
1. Fix sharp tail detection in normal support.
The not operator in front of overlaps was missing.
2. Fix bridge removal.
After adopting Prusa's smart bridge direction detection, the bridge
angle may be pi, so our previous method (comparing angle to 0 and pi/2)
was not right. Now we simply check if the bridge direction normal vector
is aligned to x-axis or y-axis.

Change-Id: I4e1fd937e432aca97cdd374ba66a0d869794126e
(cherry picked from commit c0d82003a5e4c44345219294072c54051fc5711a)
2023-04-17 15:39:02 +08:00
Arthur 0c2ba2b0a2 ENH: improve sharp detection for small regions
1. improve sharp detection for small regions.
   When the region is around 1 extrsion width, previous method may miss some sharp tails.
Now we reduce the width threshold to 0.1*extrusion_width for sharp
tails.
   When checking "nothing below", need to expand the poly a little. Example:
benchy.
2. improve is_support_necessary.
   Only popup warning for sharp tail and large cantilever (longer than 6mm).

Jira: STUDIO-2567
Change-Id: I5e977e7766b35409891d1b41e36278e3f07fa372
(cherry picked from commit c9d8a7c1c3bbd4367c7fc44408c67e5c534167f4)
2023-04-17 15:39:02 +08:00
Arthur af0fca211b ENH: add grid & rectilinear_interlaced interface pattern
Github: #1018, #1221
Jira: STUDIO-2534

Change-Id: I8c766b5b934364253c0344e39f474e4ac3b81add
(cherry picked from commit e7d46fe60856ab511905b46799943bfde8a71826)
2023-04-17 15:39:02 +08:00
Arthur 1ac8013fa5 ENH: improve normal support's efficiency
Similar to tree support, make as many steps parallel as possible.
Jira: STUDIO-2525

Change-Id: Iee310bbf6911d8d3e4262ee8ed6bd133d09670a9
(cherry picked from commit 3798f1a3ecb85bbfb81925b3702fb4384e18994d)
2023-04-17 15:39:02 +08:00
Arthur Tang 617cb5490b ENH: tree support style default to Tree Hybrid
1. tree support style default to Tree Hybrid
2. fix an assert bug with MedialAxis::build:
    assert(polyline.width.size() == polyline.points.size() * 2 - 2)
  This is caused by the incorrect clear function of ThickPolyline.

Change-Id: I8d6507ad366d253493e2749e0cbac8d3d837ee8a
(cherry picked from commit bd31e962c11e82005944bef40b17471075e79898)
2023-04-17 15:39:02 +08:00
arthur.tang 6c489808a7 ENH: boost is_support_necessary's performance
1. Parallelize the majority of overhang detection, leaving only a small
part of sharp tail detection as sequential. This strategy makes
is_support_necessary 10 times faster.
2. Use the overlaps function to detect overlapping, instead of using
intersection().empty()
3. Control the max recursion depth to prevent crashing due to too deep
recursion.

Jira: STUDIO-2445, STUDIO-2458
Change-Id: I35283da3e4a22d7afe251b804ce30b90a9d754df
(cherry picked from commit 1a6fedd1a0c82906f1807234ea1b816247ca6fd7)
2023-04-17 15:39:02 +08:00
salt.wei 61b271f379 ENH: fix for STUDIO-881
Thanks prusa

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I2e1c1088d29dd5401016ca41d3ed6dec87e0acd1
2023-04-17 15:39:02 +08:00
Arthur 017707e575 FIX: sharp tail detection may fail
1. In small overhang detection, some sharp tail cases are missed because
  the max_layer was not compared.
2. In normal support, previously the lower layer's expolys were not right,
  should only keep the ones that won't vanish when extruding.

Jira: STUDIO-1977, STUDIO-2200
Change-Id: Ia09ff1ab4870b7e3c199a827932536867644c76c
(cherry picked from commit e3ba3a3114821e951d6eb00b4c95e6e63ffe00d4)
2023-04-17 15:39:02 +08:00
Arthur bf8f163b5a ENH: improve tree support and fix a bug
1. use tree slim's merge strategy in hybrid support
2. do not break bridge in hybrid support
3. fix "support on buildplate only" not working. The cause is: with
   independent support layer height, contact_nodes are not synced with
   object layers, so the previous way of accessing contact nodes in
   unsupported_branch_leaves no longer works. To fix that, we add
   obj_layer_nr.
   Jira: STUDIO-2250

Change-Id: Idfc9b0bb10425de6414f7eae2cf5467cedf1d669
(cherry picked from commit 8780d5a7e92e298cbbccbb3bd1825197d387a340)
2023-02-22 20:09:17 +08:00
lane.wei 5df5cb9ff4 FIX: smooth_nodes may crash due to broken parent-child chain
Change-Id: I770df691b41c6f18a0cb97e49e9e2251afe02e1a
(cherry picked from commit 2b5cdf0337fff277f7b949da568d6cdaa28a0d35)
2023-02-22 20:09:17 +08:00
Arthur 63222d50de FIX: unsupported cantilever was not warned
1. fix unsupported cantilever was not warned. We need to set support
  type to stTreeAuto in is_support_necessary() to fully utilize the
  power of feature detection.
2. fix tree support not generated on non-first plate.

Change-Id: I5b8aa827c9d62df0119db4e8e9212f33ce75ddaa
(cherry picked from commit 60f21b6fcb45fe56f7fc867a7fcad433282bc055)
2023-02-02 16:53:45 +08:00
Joshua Wise 040af5fa98 slic3r: address sanitizer cleanup in TreeSupport::generate_contact_points
In generate_contact_points, the rotated_dims don't actually generate a
Point, but generate an abstract expression that holds a reference to
bounding_box_size.  Unfortunately, this goes wrong because bounding_box_size
ages out instantly; GCC's Address Sanitizer complains that this is a
"stack-use-after-scope" issue.

Interestingly, the Eigen documentation says that this is a known problem
with using C++11 "auto" to generate matrices (which a Point is)!  It is
buried here: https://eigen.tuxfamily.org/dox/TopicPitfalls.html

This is probably an extremely theoretical correctness improvement, and also
an extremely theoretical performance improvement.  But it is an improvement
nonetheless, and, more importantly, it enables me to continue to run the
slicer with Address Sanitizer turned on to find other potential issues.
2023-02-01 16:24:44 +08:00
Arthur Tang c07dcffe16 ENH: use print volume to clip tree support
So tree supports won't go outside the bed.

Known issue:
1. moving won't trigger support re-calculating, so if you want to
  clip the supports in a different way after moving, you need to change
  the support settings (eg change threshold angle to 31 degrees).
2. clipping with the occlusion region is not complete, and an error
  message of "outside toolpath" will still be popped because we use
  convex hull to detection confliction.

Jira: STUDIO-2036

Change-Id: I643b14618eb18ffa9825072c44f677e51b0ff937
(cherry picked from commit a6217824dc0f490027e16f80f810d176dec6004b)
2023-02-01 16:24:44 +08:00
Arthur 81ee7bb99b ENH: improve is_support_necessary
Use tree support to detect if there are sharp tails and so on.

Jira: STUDIO-1898

Change-Id: I148e14ca4024849875133a646a8fdd36c265b2fb
(cherry picked from commit bc74015d45e96e409d34d611876e3a24e289e029)
2023-02-01 16:24:44 +08:00