Commit Graph

72 Commits

Author SHA1 Message Date
xun.zhang f1445ff047 ENH: enhance extruder unprintable area detection
1. Detect unprintable area for extruder when slicing
2. Always do filament map again if object pos changed

jira:STUDIO-9473

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ic01b8be8e3b08ba6b34efb2d3c451c9e985a03e8
2025-03-23 20:14:28 +08:00
xun.zhang 95e49986f3 ENH: seperate statitics for auto for flush mode
1.Compare stats of AutoForFlush with other filament map modes
2.Refine the function signature of filament group

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iec2aff069d8c44343df8b82f045c61354c7d1c2a
2025-03-22 22:10:53 +08:00
xun.zhang 414a2105c9 ENH: refactor filament group
1.Seperate min flush max flow solver
2.Add "best match" mode for filament map
3.Refine code strucuture

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: If4ba09a0320366b862cec59f8ed1f22c392c53b9
2025-03-22 22:10:53 +08:00
xun.zhang e45f8c6dc2 ENH: filament map params switch to global param
1.Add more filament map modes
2.Filament map and mode are set as project config
3.Plate filament map is only valid when plate filament mode is
manual

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I33b2f853e0b77b9d605be1f2f1172b44df43da15
2025-03-22 22:10:52 +08:00
qing.zhang 666e49e299 ENH: get first filaments & non support filament
Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I9370e48b634f21a2d3fd11d437f699b5cdb5ce43
2025-03-22 21:32:41 +08:00
qing.zhang e0508a9e51 ENH: get most used extruder id
Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I9c498cefb07b3bdf89a17bfd75a3075c2294c934
2025-03-22 21:22:25 +08:00
xun.zhang 7b5818fe6c ENH: seperate reorder from toolorder construct
1.Only do reorder if requseted.In by object mode,we only need
to collect the filaments in the object for filament grouping

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Id88f2449c6d3c5d45b9ff87513308d997fa72da1
2025-03-22 21:10:13 +08:00
xun.zhang 242554557b FIX: filament group crash in cli mode
1.Always do filament group to get correct filament map

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ie4e61c310f6c0cfeacb2a49c4f065f9674b6a35f
2025-03-22 21:09:55 +08:00
zhimin.zeng 02c2fb6f6c FIX: fix crash of slice
jira: none
Change-Id: I68b1557d5a361d175abdff99a0542ca105b76f7f
2025-03-22 21:09:55 +08:00
zhimin.zeng 83681128e0 FIX: slice crash with incorrect filament_map of single printer
jira: none
Change-Id: I49bdcf03fc8abb24e41e0545e2d9cd3c55941df4
2025-03-22 21:09:19 +08:00
xun.zhang c6ddd329e3 FIX: disable unprintable logic for single ext
1.Disable unprintable logic for single extruder printers

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iecb4cc80455288925d3acb5688b81aa9ef1c3a8a
2025-03-22 20:58:36 +08:00
xun.zhang e3f4496adf ENH: modify filament group strategy
jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iac837beeb7a5c4684aea38c3e3925a67cd916fe8
2025-03-22 20:58:14 +08:00
xun.zhang 48023e4c15 FIX: empty filament map
1.Caused by uninitialized filament map in mapping for AMS

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I71ce6001fc6f2e72eb9303fcaba0bac16ad70dc9
2025-03-22 20:58:13 +08:00
xun.zhang 3cfb49a1b9 ENH: refine filament group algorithm
1.Use max flow network to handle limit
2.Support setting master extruder id
3.Fix the issue in the KMedoids algorithm where data is overwritten
after each retry.

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Idd2bedf39f61e7a65eb4199852f60b8fbebe0a7d
2025-03-22 20:58:12 +08:00
zhimin.zeng d715353fa6 FIX: fix the crash bug when slicing
jira: none
Change-Id: Ieaec4fda4c653e6595322356bd16226640d2e932
2025-03-22 20:54:17 +08:00
zhimin.zeng 20837717d4 FIX: When the printer is inconsistent with the current preset
when the ams is 0/0, should not consider the print connect status
jira:none

Change-Id: I2288ff15894d5c734a98b830df6678cab2bd12fc
2025-03-22 20:54:17 +08:00
xun.zhang 0b95bdd9d9 ENH: do another map for ams filaments
1.If the group result differs little in flush,we will choose the one
that best fits the ams filaments

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Icd147b406e3494c841ef13564ad1b1231ad798fd
2025-03-22 20:54:16 +08:00
xun.zhang 994e4f4840 ENH: enhance accuracy of weight calculation
1.Use float to store the weight copmputed in the procedure.Avoid the
issue where filament weight remains at 0 after changing filaments

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iff0cfc6e22f34affbc232dbfe196f27ee06d2d9e
2025-03-22 20:53:56 +08:00
xun.zhang f39eabfd9f ENH: add tpu check when printing by object
jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I366aa8387dfc8d1c94fe836ee4898424d04737c3
2025-03-22 20:53:55 +08:00
xun.zhang c53a35856d ENH: add filament cluster algorithm
1.Add new KMediods algorithm
2.Consider physical and geometric printables
3.Refine code structure

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I1412835c3c6380f9cedb44ff6914004365bba889
2025-03-22 20:53:54 +08:00
zhimin.zeng ede9f90a79 ENH: support tpu for multi_extruder
jira: none
Change-Id: I556804aadac00406e7214b86f7925170a90c55ce
2025-03-22 20:53:54 +08:00
xun.zhang 1525c3c3ac ENH: support custom layer sequence
jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I73f030f2009b66aef20e3492f742d85970081e8a
2025-03-22 20:53:17 +08:00
xun.zhang 0716b8518e ENH: add tool order function
1.Use min cost max flow to solve the tool order

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I909845039b67c7fe3ddd42580ad3f1d71d52262d
2025-03-22 20:52:55 +08:00
xun.zhang 0f70c81a7d ENH: optmize code structure of tool order
1.Put reorder functions in ToolOrderUtils

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I49c7b447ba1f41f3747ba3127d842c4e3957b5ff
2025-03-22 20:52:55 +08:00
xun.zhang 2dbc5c9396 ENH: add manual grouping mode stats
1.In auto mode,display the statistics of auto mode and single
extruder
2.In manual mode,display the statistics of manual mode and auto mode
3.Support by object mode

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: If54c4db79f33d5278c0f18d01ab0518e8660f9c7
2025-03-22 20:40:26 +08:00
xun.zhang 0756b51eb2 FIX: wrong filament map in layer filament
1.Should calculate cost if filament used in that layer is 1,because
we should consider the last filament used in previous layer

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I5838af77f1d73bfa07c65bd6ee12ae352dc3b571
2025-03-22 20:40:26 +08:00
xun.zhang c49c0c8f72 ENH: modify forcast limit number
1.Use forcast when filament num in current layer and next layer both
smaller than limit number

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ia21bb22ce353f0c74eeaf748c6d9f9c4b315ec18
2025-03-22 20:40:25 +08:00
xun.zhang ad65cdb909 ENH: add filament saved by multi extruder
1.Add filament flush,filament change count reduced by multi
extruder

NTOE: cases when printing by object haven't been handled

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iaaea5f8ffae2345df5a6f1dc605342d835974d48
2025-03-22 20:40:25 +08:00
xun.zhang 3167e34e60 ENH: add greedy algorithm for filament reorder
1.When n becomes large,the original algorithm to get best filament
sequence will cost too much time and memory.Use a greedy algorithm
instead.Always select the next filament with fewest flush

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iabc924e1bdb0a07af0a6ef0bbdd62e54ce54f052
2025-03-22 20:32:28 +08:00
xun.zhang e95179427f FIX: unable to custom first layer filament order
jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I0107ebf6a85ea0deba93ff558835138981365670
2025-03-22 20:32:28 +08:00
zhimin.zeng da32b878b3 ENH: add extruder_ams_count behavior
1. save to appconfig and project setting
2. use it to group
jira: none

Change-Id: Id4048fc1b47f6904b2e9c0154aaa3a2b03590437
2025-03-22 20:32:27 +08:00
zhimin.zeng 67f67d7688 NEW: Add FilamentMapDialog
support drag drop to modify the filament map
jira: none

Change-Id: I0ed3180a0fa8e95e7c871bb039eb844faccd1344
2025-03-22 20:32:27 +08:00
xun.zhang cffb4a8564 ENH: optimize filament group algorithm
1.When filament <10, do the reorder with next layer.This can reduce
10% flush in some cases
2.Support custom filament seq
3.Use caches to speed the algorithm

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ie1af9841f7165802d350eae962efe8febafbb357
2025-03-22 20:32:27 +08:00
xun.zhang cddf8cae27 ENH: add filament group strategy
1.When capacity is greater than the num of filaments, always choose the
map result that can be accommodated
2.In BestFit strategy,always try to fill up the existing capacity
3.In BestCost strategy, just try the group with fewest flush

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ifd6d64b77774039e57ffff26cf2243a4d3f89054
2025-03-22 20:32:26 +08:00
xun.zhang cc81e57ac9 FIX: compatible with one extruder reorder
jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I7e350ba8728ac4b3dd34093ff4e9647d0a2ba671
2025-03-22 20:32:26 +08:00
xun.zhang 7128e2925a FIX: logic error in filament change
jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I7e2b1333d4b82e4495375fcf4daec3aea08be445
2025-03-22 20:32:26 +08:00
zhimin.zeng ad03fae1eb FIX: Clean up the code
1. Refactor recommended code for print by object
2. Calibration adaptation sends print command

jira: none

Change-Id: I24fd92d6aca07a7067e09bb200854e5bec72a324
2025-03-22 20:32:26 +08:00
xun.zhang 1ab2964ee3 ENH: alternate multi-head printing sequence
jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I739438e8c411b638571d5291f3e5ad3d54650a73
2025-03-22 20:32:26 +08:00
xun.zhang 9ec276d3d7 ENH: new filament group algorithm
1.When n<10, calc all case cost
2.When n>10, first k-medoids algorithm first
3.Enable setting group size

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I625f47e0235c70e440c6d489b052a156fbffca3f
2025-03-22 20:32:25 +08:00
zhimin.zeng 21e6271e59 ENH: calib support multi_extruder
1. backend support multi_extrude data structure
2. Compatible with third-party calibration
3. fix bug when get extruder in gocde export process

Change-Id: I5dac9abdd9907a521a1ba9b480f9e05640591bc1
2025-03-22 20:32:25 +08:00
zhimin.zeng b42d94e1d0 ENH: support recommended filament map when print by object
1. support recommended filament map when print by object
2. placeholder_parser support function filament_change
3. extruder_id of filament_map is start from 1

Change-Id: Ide8019cd4a165a25972f22706ff685c3005aa031
2025-03-22 20:31:44 +08:00
zhimin.zeng dcd9fd5013 FIX: backend get the extruder id based on filament_map
Change-Id: Ib7679c0fc67336e462467dab9f5b4d4684d6eb19
2025-03-22 20:31:44 +08:00
zhimin.zeng 8c8c9a967b ENH: Add recommend filament maps method
Change-Id: I3945a8b9f0a57e10a1d230003f21c9877cc5f342
2025-03-22 20:31:43 +08:00
zhimin.zeng 6fbad9ed33 ENH: flush_volume support multi_extruder and fix bug
Change-Id: Id6b041f71ee6e55e68a6937f24ce791caac8e708
2025-03-22 20:31:42 +08:00
qing.zhang cd3f05b3fe FIX: crash while the first layer is empty
Github: 5376

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I64a0612ec4bf1ead099029db5f8e9f59e0b704af
2025-03-22 20:18:26 +08:00
xun.zhang 2308e2038e FIX: wrong use of reverse iter
jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I914f082f378b3cd195b1e69e166409d7302791d2
2024-11-15 19:17:32 +08:00
xun.zhang 95f24a906e FIX: pause layer not working
1.The stored layer height differs too much from the generated layer
height.Use a more direct way to locate the layer

github:5253,5275

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ie2428e700c72386349a4f2d64076c940ac4eea71
2024-11-15 19:17:32 +08:00
xun.zhang e3c8496a62 FIX: add to incorrect layer when adding pause
1. Caused by floating-point precision.

github:#1937,#4250

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: If7a5dc71a898c1208289b6b89eafef9d4126f17c
2024-10-15 15:50:26 +08:00
xun.zhang 4cf4e640ce FIX: unassigned initial extruder ignored
jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I97dbfac705c890d1c2b16c2b685f31d05e82a292
(cherry picked from commit a5a2909c795c6c99ff7d6c6bbe5741491a2b63e0)
2024-06-11 18:17:08 +08:00
zhimin.zeng 8a965afb1a ENH: add customize other layers print sequence
Jira: 6338
Change-Id: Ic14b2671ade37ab37583b81c5b509447b6c0d8f8
2024-03-25 15:29:19 +08:00