Merge remote-tracking branch 'BS/v1.7.2'

Signed-off-by: SoftFever <103989404+SoftFever@users.noreply.github.com>

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/workflows/build_ubuntu.yml
#	.gitignore
#	Containerfile
#	Dockerfile
#	README.md
#	deps/Boost/Boost.cmake
#	deps/OpenEXR/OpenEXR.cmake
#	deps/OpenVDB/OpenVDB.cmake
#	doc/How to build - Mac OS.md
#	localization/i18n/OrcaSlicer.pot
#	localization/i18n/de/OrcaSlicer_de.po
#	localization/i18n/en/OrcaSlicer_en.po
#	localization/i18n/es/OrcaSlicer_es.po
#	localization/i18n/fr/OrcaSlicer_fr.po
#	localization/i18n/hu/OrcaSlicer_hu.po
#	localization/i18n/it/OrcaSlicer_it.po
#	localization/i18n/ja/OrcaSlicer_ja.po
#	localization/i18n/list.txt
#	localization/i18n/nl/OrcaSlicer_nl.po
#	localization/i18n/sv/OrcaSlicer_sv.po
#	localization/i18n/zh_cn/OrcaSlicer_zh_CN.po
#	resources/i18n/de/BambuStudio.mo
#	resources/i18n/en/BambuStudio.mo
#	resources/i18n/es/BambuStudio.mo
#	resources/i18n/fr/BambuStudio.mo
#	resources/i18n/hu/BambuStudio.mo
#	resources/i18n/it/BambuStudio.mo
#	resources/i18n/ja/BambuStudio.mo
#	resources/i18n/nl/BambuStudio.mo
#	resources/i18n/sv/BambuStudio.mo
#	resources/i18n/zh_cn/BambuStudio.mo
#	resources/images/im_all_plates_stats.svg
#	resources/profiles/Anker.json
#	resources/profiles/Anker/filament/Generic ASA @Anker.json
#	resources/profiles/Anker/filament/Generic PA @Anker.json
#	resources/profiles/Anker/filament/Generic PA-CF @Anker.json
#	resources/profiles/Anker/filament/Generic PC @Anker.json
#	resources/profiles/Anker/filament/Generic PETG @Anker.json
#	resources/profiles/Anker/filament/Generic PLA-CF @Anker.json
#	resources/profiles/Anker/filament/Generic PVA @Anker.json
#	resources/profiles/Anker/filament/Generic TPU @Anker.json
#	resources/profiles/Anker/machine/Anker M5 0.4 nozzle.json
#	resources/profiles/Anker/machine/Anker M5.json
#	resources/profiles/Anker/machine/Anker M5C 0.4 nozzle.json
#	resources/profiles/Anker/machine/Anker M5C.json
#	resources/profiles/Anker/machine/fdm_machine_common.json
#	resources/profiles/Anker/process/0.05mm Ultradetail @Anker.json
#	resources/profiles/Anker/process/0.15mm Fast @Anker.json
#	resources/profiles/Anker/process/0.20mm Fast @Anker.json
#	resources/profiles/Anker/process/0.20mm Standard @Anker.json
#	resources/profiles/Anker/process/0.25mm Fast @Anker.json
#	resources/profiles/Anker/process/fdm_process_common.json
#	resources/profiles/Anycubic.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 2 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 2.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro.json
#	resources/profiles/Anycubic/machine/Anycubic Chiron 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Chiron.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra 2 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra Max 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra Max.json
#	resources/profiles/Anycubic/machine/Anycubic Vyper 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Vyper.json
#	resources/profiles/Anycubic/machine/Anycubic i3 Mega S 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic i3 Mega S.json
#	resources/profiles/Anycubic/machine/fdm_machine_common.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic 4MaxPro.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/fdm_process_common.json
#	resources/profiles/BBL.json
#	resources/profiles/BBL/process/fdm_process_bbl_common.json
#	resources/profiles/Creality.json
#	resources/profiles/Creality/filament/fdm_filament_abs.json
#	resources/profiles/Creality/filament/fdm_filament_pla.json
#	resources/profiles/Creality/machine/Creality CR-10 Max 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality CR-10 Max.json
#	resources/profiles/Creality/machine/Creality CR-10 V2 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality CR-10 V2.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 Pro 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 Pro.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1.json
#	resources/profiles/Creality/machine/Creality Ender-3 V2 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 V2.json
#	resources/profiles/Creality/machine/Creality Ender-5 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 Plus 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 Plus.json
#	resources/profiles/Creality/machine/Creality Ender-5 S1 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 S1.json
#	resources/profiles/Creality/machine/Creality Ender-5.json
#	resources/profiles/Creality/machine/Creality Ender-5S 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5S.json
#	resources/profiles/Creality/machine/Creality Ender-6 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-6.json
#	resources/profiles/Creality/machine/fdm_creality_common.json
#	resources/profiles/Creality/machine/fdm_machine_common.json
#	resources/profiles/Creality/process/0.12mm Fine @Creality CR10Max.json
#	resources/profiles/Creality/process/0.12mm Fine @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.15mm Optimal @Creality CR10Max.json
#	resources/profiles/Creality/process/0.15mm Optimal @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality CR10V2.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender3S1.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender3S1Pro.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5Plus.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5S.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5S1.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender6.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality CR10Max.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality CR10V2.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3S1.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3S1Pro.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5Plus.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5S.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5S1.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender6.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality CR10Max.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality.json
#	resources/profiles/Creality/process/fdm_process_creality_common.json
#	resources/profiles/Custom/filament/My Generic PETG.json
#	resources/profiles/Custom/filament/My Generic PLA.json
#	resources/profiles/Elegoo.json
#	resources/profiles/Elegoo/filament/fdm_filament_common.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2D 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2D.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2S 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2S.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune X 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune X.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune.json
#	resources/profiles/Elegoo/machine/fdm_machine_common.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo NeptuneX.json
#	resources/profiles/Prusa.json
#	resources/profiles/Prusa/filament/fdm_filament_common.json
#	resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json
#	resources/profiles/Prusa/machine/Prusa MINI.json
#	resources/profiles/Prusa/machine/Prusa MK3S 0.4 nozzle.json
#	resources/profiles/Prusa/machine/Prusa MK3S.json
#	resources/profiles/Prusa/machine/fdm_machine_common.json
#	resources/profiles/Prusa/process/0.20mm Standard @MINI.json
#	resources/profiles/Prusa/process/0.20mm Standard @MK3S.json
#	resources/profiles/Qidi.json
#	resources/profiles/Qidi/filament/fdm_filament_abs.json
#	resources/profiles/Qidi/filament/fdm_filament_asa.json
#	resources/profiles/Qidi/filament/fdm_filament_common.json
#	resources/profiles/Qidi/filament/fdm_filament_pa.json
#	resources/profiles/Qidi/filament/fdm_filament_pc.json
#	resources/profiles/Qidi/filament/fdm_filament_pet.json
#	resources/profiles/Qidi/filament/fdm_filament_pla.json
#	resources/profiles/Qidi/filament/fdm_filament_pva.json
#	resources/profiles/Qidi/filament/fdm_filament_tpu.json
#	resources/profiles/Qidi/machine/Qidi X-CF Pro 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-CF Pro.json
#	resources/profiles/Qidi/machine/Qidi X-Max 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Max 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Max 3.json
#	resources/profiles/Qidi/machine/Qidi X-Max.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 3.json
#	resources/profiles/Qidi/machine/Qidi X-Plus.json
#	resources/profiles/Qidi/machine/Qidi X-Smart 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Smart 3.json
#	resources/profiles/Qidi/machine/fdm_machine_common.json
#	resources/profiles/Qidi/machine/fdm_qidi_common.json
#	resources/profiles/Qidi/machine/fdm_qidi_x3_common.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XMax.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XMax.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XMax.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XMax.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XMax.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XSmart3.json
#	resources/profiles/Qidi/process/fdm_process_common.json
#	resources/profiles/Qidi/process/fdm_process_qidi_common.json
#	resources/profiles/Qidi/process/fdm_process_qidi_x3_common.json
#	resources/profiles/Tronxy/filament/Tronxy Generic ABS.json
#	resources/profiles/Tronxy/process/0.12mm Fine @Tronxy.json
#	resources/profiles/Tronxy/process/0.15mm Optimal @Tronxy.json
#	resources/profiles/Tronxy/process/0.20mm Standard @Tronxy.json
#	resources/profiles/Tronxy/process/0.24mm Draft @Tronxy.json
#	resources/profiles/Voron.json
#	resources/profiles/Voron/filament/Generic ABS @Voron.json
#	resources/profiles/Voron/filament/Generic ASA @Voron.json
#	resources/profiles/Voron/filament/Generic PA @Voron.json
#	resources/profiles/Voron/filament/Generic PETG @Voron.json
#	resources/profiles/Voron/filament/Generic PVA @Voron.json
#	resources/profiles/Voron/filament/Voron Generic PA-CF.json
#	resources/profiles/Voron/filament/Voron Generic PC.json
#	resources/profiles/Voron/filament/Voron Generic PLA-CF.json
#	resources/profiles/Voron/filament/Voron Generic PLA.json
#	resources/profiles/Voron/filament/Voron Generic TPU.json
#	resources/profiles/Voron/machine/Voron 0.1.json
#	resources/profiles/Voron/machine/Voron 2.4 250.json
#	resources/profiles/Voron/machine/Voron 2.4 300.json
#	resources/profiles/Voron/machine/Voron 2.4 350.json
#	resources/profiles/Voron/machine/Voron Trident 250.json
#	resources/profiles/Voron/machine/Voron Trident 300.json
#	resources/profiles/Voron/machine/Voron Trident 350.json
#	resources/profiles/Voron/process/fdm_process_voron_common.json
#	resources/profiles/Voxelab.json
#	resources/profiles/Voxelab/filament/Generic ABS @Voxelab.json
#	resources/profiles/Voxelab/filament/Generic PLA @Voxelab.json
#	resources/profiles/Voxelab/filament/fdm_filament_common.json
#	resources/profiles/Voxelab/machine/Voxelab Aquila X2 0.4 nozzle.json
#	resources/profiles/Voxelab/machine/Voxelab Aquila X2.json
#	resources/profiles/Voxelab/machine/fdm_machine_common.json
#	resources/profiles/Voxelab/process/0.16mm Optimal @Voxelab AquilaX2.json
#	resources/profiles/Voxelab/process/0.20mm Standard @Voxelab AquilaX2.json
#	resources/web/data/text.js
#	resources/web/guide/21/21.js
#	resources/web/guide/24/24.js
#	src/BaseException.cpp
#	src/OrcaSlicer.cpp
#	src/libslic3r/AppConfig.cpp
#	src/libslic3r/BoundingBox.hpp
#	src/libslic3r/Extruder.hpp
#	src/libslic3r/Fill/Fill.cpp
#	src/libslic3r/Format/bbs_3mf.cpp
#	src/libslic3r/GCode.cpp
#	src/libslic3r/GCode.hpp
#	src/libslic3r/GCode/CoolingBuffer.cpp
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/libslic3r/GCode/WipeTower.cpp
#	src/libslic3r/GCodeWriter.cpp
#	src/libslic3r/GCodeWriter.hpp
#	src/libslic3r/Model.cpp
#	src/libslic3r/PerimeterGenerator.cpp
#	src/libslic3r/Preset.cpp
#	src/libslic3r/Preset.hpp
#	src/libslic3r/PresetBundle.cpp
#	src/libslic3r/PresetBundle.hpp
#	src/libslic3r/Print.cpp
#	src/libslic3r/Print.hpp
#	src/libslic3r/PrintBase.hpp
#	src/libslic3r/PrintConfig.cpp
#	src/libslic3r/PrintConfig.hpp
#	src/libslic3r/PrintObject.cpp
#	src/libslic3r/TreeSupport.cpp
#	src/libslic3r/Utils.hpp
#	src/mcut/CMakeLists.txt
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/3DBed.cpp
#	src/slic3r/GUI/AMSMaterialsSetting.cpp
#	src/slic3r/GUI/AMSMaterialsSetting.hpp
#	src/slic3r/GUI/BBLTopbar.cpp
#	src/slic3r/GUI/BBLTopbar.hpp
#	src/slic3r/GUI/BackgroundSlicingProcess.hpp
#	src/slic3r/GUI/BindDialog.cpp
#	src/slic3r/GUI/ConfigManipulation.cpp
#	src/slic3r/GUI/DeviceManager.cpp
#	src/slic3r/GUI/Field.cpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GUI_App.cpp
#	src/slic3r/GUI/GUI_App.hpp
#	src/slic3r/GUI/GUI_Factories.cpp
#	src/slic3r/GUI/GUI_Factories.hpp
#	src/slic3r/GUI/GUI_ObjectList.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp
#	src/slic3r/GUI/Jobs/ArrangeJob.cpp
#	src/slic3r/GUI/Jobs/FillBedJob.cpp
#	src/slic3r/GUI/MainFrame.cpp
#	src/slic3r/GUI/MediaPlayCtrl.cpp
#	src/slic3r/GUI/Monitor.cpp
#	src/slic3r/GUI/PartPlate.cpp
#	src/slic3r/GUI/PartPlate.hpp
#	src/slic3r/GUI/PlateSettingsDialog.cpp
#	src/slic3r/GUI/PlateSettingsDialog.hpp
#	src/slic3r/GUI/Plater.cpp
#	src/slic3r/GUI/Plater.hpp
#	src/slic3r/GUI/PresetComboBoxes.cpp
#	src/slic3r/GUI/ReleaseNote.cpp
#	src/slic3r/GUI/SelectMachine.cpp
#	src/slic3r/GUI/StatusPanel.cpp
#	src/slic3r/GUI/Tab.cpp
#	src/slic3r/GUI/Widgets/Label.cpp
#	src/slic3r/GUI/Widgets/Label.hpp
#	src/slic3r/GUI/Widgets/SideButton.cpp
#	src/slic3r/GUI/calib_dlg.cpp
#	src/slic3r/GUI/calib_dlg.hpp
#	src/slic3r/GUI/wxExtensions.hpp
#	src/slic3r/Utils/NetworkAgent.cpp
#	src/slic3r/Utils/bambu_networking.hpp
#	version.inc
This commit is contained in:
SoftFever 2023-08-26 16:13:57 +08:00
commit e65b11a831
734 changed files with 72573 additions and 47919 deletions

View file

@ -1,23 +1,23 @@
#include "calib.hpp"
#include "BoundingBox.hpp"
#include "Calib.hpp"
#include "Config.hpp"
#include "Model.hpp"
#include "GCode.hpp"
#include <cmath>
namespace Slic3r {
// Calculate the optimal Pressure Advance speed
float CalibPressureAdvance::find_optimal_PA_speed(const DynamicPrintConfig &config, double line_width, double layer_height,
int filament_idx) {
const double general_suggested_min_speed = 100.0;
double filament_max_volumetric_speed = config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
Flow pattern_line = Flow(line_width, layer_height, config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0));
auto pa_speed = std::min(std::max(general_suggested_min_speed,config.option<ConfigOptionFloat>("outer_wall_speed")->value), filament_max_volumetric_speed / pattern_line.mm3_per_mm());
namespace Slic3r {
float CalibPressureAdvance::find_optimal_PA_speed(const DynamicPrintConfig &config, double line_width, double layer_height, int filament_idx)
{
const double general_suggested_min_speed = 100.0;
double filament_max_volumetric_speed = config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
Flow pattern_line = Flow(line_width, layer_height, config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0));
auto pa_speed = std::min(std::max(general_suggested_min_speed, config.option<ConfigOptionFloat>("outer_wall_speed")->value),
filament_max_volumetric_speed / pattern_line.mm3_per_mm());
return std::floor(pa_speed);
}
std::string CalibPressureAdvance::move_to(Vec2d pt, GCodeWriter& writer, std::string comment)
std::string CalibPressureAdvance::move_to(Vec2d pt, GCodeWriter &writer, std::string comment)
{
std::stringstream gcode;
@ -27,18 +27,12 @@ std::string CalibPressureAdvance::move_to(Vec2d pt, GCodeWriter& writer, std::st
m_last_pos = Vec3d(pt.x(), pt.y(), 0);
return gcode.str();
return gcode.str();
}
double CalibPressureAdvance::e_per_mm(
double line_width,
double layer_height,
float nozzle_diameter,
float filament_diameter,
float print_flow_ratio
) const
double CalibPressureAdvance::e_per_mm(double line_width, double layer_height, float nozzle_diameter, float filament_diameter, float print_flow_ratio) const
{
const Flow line_flow = Flow(line_width, layer_height, nozzle_diameter);
const Flow line_flow = Flow(line_width, layer_height, nozzle_diameter);
const double filament_area = M_PI * std::pow(filament_diameter / 2, 2);
return line_flow.mm3_per_mm() / filament_area * print_flow_ratio;
@ -54,19 +48,12 @@ std::string CalibPressureAdvance::convert_number_to_string(double num) const
}
std::string CalibPressureAdvance::draw_digit(
double startx,
double starty,
char c,
CalibPressureAdvance::DrawDigitMode mode,
double line_width,
double e_per_mm,
GCodeWriter& writer
)
double startx, double starty, char c, CalibPressureAdvance::DrawDigitMode mode, double line_width, double e_per_mm, GCodeWriter &writer)
{
const double len = m_digit_segment_len;
const double gap = line_width / 2.0;
const auto dE = e_per_mm * len;
const auto dE = e_per_mm * len;
const auto two_dE = dE * 2;
Vec2d p0, p1, p2, p3, p4, p5;
@ -79,33 +66,33 @@ std::string CalibPressureAdvance::draw_digit(
// | | |
// | | |
// 0-------3-------4
p0 = Vec2d(startx, starty);
p0 = Vec2d(startx, starty);
p0_5 = Vec2d(startx, starty + len / 2);
p1 = Vec2d(startx, starty + len);
p2 = Vec2d(startx + len, starty + len);
p3 = Vec2d(startx + len, starty);
p4 = Vec2d(startx + len * 2, starty);
p1 = Vec2d(startx, starty + len);
p2 = Vec2d(startx + len, starty + len);
p3 = Vec2d(startx + len, starty);
p4 = Vec2d(startx + len * 2, starty);
p4_5 = Vec2d(startx + len * 2, starty + len / 2);
p5 = Vec2d(startx + len * 2, starty + len);
p5 = Vec2d(startx + len * 2, starty + len);
gap_p0_toward_p3 = p0 + Vec2d(gap, 0);
gap_p2_toward_p3 = p2 + Vec2d(0, gap);
dot_direction = Vec2d(-len / 2, 0);
} else {
// 0-------1
// 0-------1
// | |
// 3-------2
// | |
// 4-------5
p0 = Vec2d(startx, starty);
p0 = Vec2d(startx, starty);
p0_5 = Vec2d(startx + len / 2, starty);
p1 = Vec2d(startx + len, starty);
p2 = Vec2d(startx + len, starty - len);
p3 = Vec2d(startx, starty - len);
p4 = Vec2d(startx, starty - len * 2);
p1 = Vec2d(startx + len, starty);
p2 = Vec2d(startx + len, starty - len);
p3 = Vec2d(startx, starty - len);
p4 = Vec2d(startx, starty - len * 2);
p4_5 = Vec2d(startx + len / 2, starty - len * 2);
p5 = Vec2d(startx + len, starty - len * 2);
p5 = Vec2d(startx + len, starty - len * 2);
gap_p0_toward_p3 = p0 - Vec2d(0, gap);
gap_p2_toward_p3 = p2 - Vec2d(gap, 0);
@ -191,120 +178,71 @@ std::string CalibPressureAdvance::draw_digit(
gcode << move_to(p4_5, writer, "Glyph: .");
gcode << writer.extrude_to_xy(p4_5 + dot_direction, dE);
break;
default:
break;
default: break;
}
return gcode.str();
}
std::string CalibPressureAdvance::draw_number(
double startx,
double starty,
double value,
CalibPressureAdvance::DrawDigitMode mode,
double line_width,
double e_per_mm,
double speed,
GCodeWriter& writer
)
double startx, double starty, double value, CalibPressureAdvance::DrawDigitMode mode, double line_width, double e_per_mm, double speed, GCodeWriter &writer)
{
auto sNumber = convert_number_to_string(value);
auto sNumber = convert_number_to_string(value);
std::stringstream gcode;
gcode << writer.set_speed(speed);
for (std::string::size_type i = 0; i < sNumber.length(); ++i) {
if (i > m_max_number_len) {
break;
}
if (i > m_max_number_len) { break; }
switch (mode) {
case DrawDigitMode::Bottom_To_Top:
gcode << draw_digit(
startx,
starty + i * number_spacing(),
sNumber[i],
mode,
line_width,
e_per_mm,
writer
);
break;
default:
gcode << draw_digit(
startx + i * number_spacing(),
starty,
sNumber[i],
mode,
line_width,
e_per_mm,
writer
);
case DrawDigitMode::Bottom_To_Top: gcode << draw_digit(startx, starty + i * number_spacing(), sNumber[i], mode, line_width, e_per_mm, writer); break;
default: gcode << draw_digit(startx + i * number_spacing(), starty, sNumber[i], mode, line_width, e_per_mm, writer);
}
}
return gcode.str();
}
CalibPressureAdvanceLine::CalibPressureAdvanceLine(GCode *gcodegen)
: mp_gcodegen(gcodegen)
, m_nozzle_diameter(gcodegen->config().nozzle_diameter.get_at(0))
{
}
std::string CalibPressureAdvanceLine::generate_test(double start_pa /*= 0*/, double step_pa /*= 0.002*/, int count /*= 10*/)
{
BoundingBoxf bed_ext = get_extents(mp_gcodegen->config().printable_area.values);
if (is_delta()) {
CalibPressureAdvanceLine::delta_scale_bed_ext(bed_ext);
}
if (is_delta()) { CalibPressureAdvanceLine::delta_scale_bed_ext(bed_ext); }
auto bed_sizes = mp_gcodegen->config().printable_area.values;
const auto &w = bed_ext.size().x();
const auto &h = bed_ext.size().y();
count = std::min(count, int((h - 10) / m_space_y));
auto bed_sizes = mp_gcodegen->config().printable_area.values;
const auto &w = bed_ext.size().x();
const auto &h = bed_ext.size().y();
count = std::min(count, int((h - 10) / m_space_y));
m_length_long = 40 + std::min(w - 120.0, 0.0);
auto startx = (w - m_length_short * 2 - m_length_long - 20) / 2;
auto starty = (h - count * m_space_y) / 2;
if (is_delta()) {
CalibPressureAdvanceLine::delta_modify_start(startx, starty, count);
}
if (is_delta()) { CalibPressureAdvanceLine::delta_modify_start(startx, starty, count); }
return print_pa_lines(startx, starty, start_pa, step_pa, count);
}
bool CalibPressureAdvanceLine::is_delta() const
{
return mp_gcodegen->config().printable_area.values.size() > 4;
}
bool CalibPressureAdvanceLine::is_delta() const { return mp_gcodegen->config().printable_area.values.size() > 4; }
std::string CalibPressureAdvanceLine::print_pa_lines(double start_x, double start_y, double start_pa, double step_pa, int num)
{
auto& writer = mp_gcodegen->writer();
const auto& config = mp_gcodegen->config();
auto & writer = mp_gcodegen->writer();
const auto &config = mp_gcodegen->config();
const auto filament_diameter = config.filament_diameter.get_at(0);
const auto print_flow_ratio = config.print_flow_ratio;
const auto print_flow_ratio = config.print_flow_ratio;
const double e_per_mm = CalibPressureAdvance::e_per_mm(
m_line_width,
m_height_layer,
m_nozzle_diameter,
filament_diameter,
print_flow_ratio
);
const double thin_e_per_mm = CalibPressureAdvance::e_per_mm(
m_thin_line_width,
m_height_layer,
m_nozzle_diameter,
filament_diameter,
print_flow_ratio
);
const double number_e_per_mm = CalibPressureAdvance::e_per_mm(
m_number_line_width,
m_height_layer,
m_nozzle_diameter,
filament_diameter,
print_flow_ratio
);
const double e_per_mm = CalibPressureAdvance::e_per_mm(m_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, print_flow_ratio);
const double thin_e_per_mm = CalibPressureAdvance::e_per_mm(m_thin_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, print_flow_ratio);
const double number_e_per_mm = CalibPressureAdvance::e_per_mm(m_number_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, print_flow_ratio);
const double fast = CalibPressureAdvance::speed_adjust(m_fast_speed);
const double slow = CalibPressureAdvance::speed_adjust(m_slow_speed);
const double fast = CalibPressureAdvance::speed_adjust(m_fast_speed);
const double slow = CalibPressureAdvance::speed_adjust(m_slow_speed);
std::stringstream gcode;
gcode << mp_gcodegen->writer().travel_to_z(m_height_layer);
double y_pos = start_y;
@ -336,47 +274,28 @@ std::string CalibPressureAdvanceLine::print_pa_lines(double start_x, double star
gcode << writer.extrude_to_xy(Vec2d(start_x + m_length_short + m_length_long, y_pos + (num - 1) * m_space_y + 2), thin_e_per_mm * 7);
for (int i = 0; i < num; i += 2) {
gcode << draw_number(
start_x + m_length_short + m_length_long + m_length_short + 3,
y_pos + i * m_space_y + m_space_y / 2,
start_pa + i * step_pa,
m_draw_digit_mode,
m_number_line_width,
number_e_per_mm,
3600,
writer
);
gcode << draw_number(start_x + m_length_short + m_length_long + m_length_short + 3, y_pos + i * m_space_y + m_space_y / 2, start_pa + i * step_pa, m_draw_digit_mode,
m_number_line_width, number_e_per_mm, 3600, writer);
}
}
return gcode.str();
}
void CalibPressureAdvanceLine::delta_modify_start(double& startx, double& starty, int count)
void CalibPressureAdvanceLine::delta_modify_start(double &startx, double &starty, int count)
{
startx = -startx;
starty = -(count * m_space_y) / 2;
}
CalibPressureAdvancePattern::CalibPressureAdvancePattern(
const Calib_Params& params,
const DynamicPrintConfig& config,
bool is_bbl_machine,
Model& model,
const Vec3d& origin
) :
m_params(params)
CalibPressureAdvancePattern::CalibPressureAdvancePattern(const Calib_Params &params, const DynamicPrintConfig &config, bool is_bbl_machine, Model &model, const Vec3d &origin)
: m_params(params)
{
this->m_draw_digit_mode = DrawDigitMode::Bottom_To_Top;
refresh_setup(config, is_bbl_machine, model, origin);
};
void CalibPressureAdvancePattern::generate_custom_gcodes(
const DynamicPrintConfig& config,
bool is_bbl_machine,
Model& model,
const Vec3d& origin
)
void CalibPressureAdvancePattern::generate_custom_gcodes(const DynamicPrintConfig &config, bool is_bbl_machine, Model &model, const Vec3d &origin)
{
std::stringstream gcode;
gcode << "; start pressure advance pattern for layer\n";
@ -390,29 +309,18 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(
const DrawBoxOptArgs default_box_opt_args(*this);
// create anchoring frame
gcode << draw_box(
m_starting_point.x(),
m_starting_point.y(),
print_size_x(),
frame_size_y(),
default_box_opt_args
);
gcode << draw_box(m_starting_point.x(), m_starting_point.y(), print_size_x(), frame_size_y(), default_box_opt_args);
// create tab for numbers
DrawBoxOptArgs draw_box_opt_args = default_box_opt_args;
draw_box_opt_args.is_filled = true;
draw_box_opt_args.is_filled = true;
draw_box_opt_args.num_perimeters = wall_count();
gcode << draw_box(
m_starting_point.x(),
m_starting_point.y() + frame_size_y() + line_spacing_first_layer(),
glyph_tab_max_x() - m_starting_point.x(),
max_numbering_height() + line_spacing_first_layer() + m_glyph_padding_vertical * 2,
draw_box_opt_args
);
gcode << draw_box(m_starting_point.x(), m_starting_point.y() + frame_size_y() + line_spacing_first_layer(), glyph_tab_max_x() - m_starting_point.x(),
max_numbering_height() + line_spacing_first_layer() + m_glyph_padding_vertical * 2, draw_box_opt_args);
std::vector<CustomGCode::Item> gcode_items;
const DrawLineOptArgs default_line_opt_args(*this);
const int num_patterns = get_num_patterns(); // "cache" for use in loops
const DrawLineOptArgs default_line_opt_args(*this);
const int num_patterns = get_num_patterns(); // "cache" for use in loops
// draw pressure advance pattern
for (int i = 0; i < m_num_layers; ++i) {
@ -420,13 +328,13 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(
gcode << "; end pressure advance pattern for layer\n";
CustomGCode::Item item;
item.print_z = height_first_layer() + (i - 1) * height_layer();
item.type = CustomGCode::Type::Custom;
item.extra = gcode.str();
item.type = CustomGCode::Type::Custom;
item.extra = gcode.str();
gcode_items.push_back(item);
gcode = std::stringstream(); // reset for next layer contents
gcode << "; start pressure advance pattern for layer\n";
const double layer_height = height_first_layer() + (i * height_layer());
gcode << m_writer.travel_to_z(layer_height, "Move to layer height");
}
@ -435,49 +343,29 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(
if (i == 1) {
gcode << m_writer.set_pressure_advance(m_params.start);
double number_e_per_mm = e_per_mm(
line_width(),
height_layer(),
m_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_flow_ratio")->get_at(0)
);
double number_e_per_mm = e_per_mm(line_width(), height_layer(), m_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_flow_ratio")->get_at(0));
// glyph on every other line
for (int j = 0; j < num_patterns; j += 2) {
gcode << draw_number(
glyph_start_x(j),
m_starting_point.y() + frame_size_y() + m_glyph_padding_vertical + line_width(),
m_params.start + (j * m_params.step),
m_draw_digit_mode,
line_width(),
number_e_per_mm,
speed_first_layer(),
m_writer
);
gcode << draw_number(glyph_start_x(j), m_starting_point.y() + frame_size_y() + m_glyph_padding_vertical + line_width(), m_params.start + (j * m_params.step),
m_draw_digit_mode, line_width(), number_e_per_mm, speed_first_layer(), m_writer);
}
}
DrawLineOptArgs draw_line_opt_args = default_line_opt_args;
double to_x = m_starting_point.x() + pattern_shift();
double to_y = m_starting_point.y();
double to_x = m_starting_point.x() + pattern_shift();
double to_y = m_starting_point.y();
double side_length = m_wall_side_length;
// shrink first layer to fit inside frame
if (i == 0) {
double shrink =
(
line_spacing_first_layer() * (wall_count() - 1) +
(line_width_first_layer() * (1 - m_encroachment))
) / std::sin(to_radians(m_corner_angle) / 2)
;
side_length = m_wall_side_length - shrink;
double shrink = (line_spacing_first_layer() * (wall_count() - 1) + (line_width_first_layer() * (1 - m_encroachment))) / std::sin(to_radians(m_corner_angle) / 2);
side_length = m_wall_side_length - shrink;
to_x += shrink * std::sin(to_radians(90) - to_radians(m_corner_angle) / 2);
to_y +=
line_spacing_first_layer() * (wall_count() - 1) +
(line_width_first_layer() * (1 - m_encroachment))
;
to_y += line_spacing_first_layer() * (wall_count() - 1) + (line_width_first_layer() * (1 - m_encroachment));
}
double initial_x = to_x;
@ -492,12 +380,12 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(
for (int k = 0; k < wall_count(); ++k) {
to_x += std::cos(to_radians(m_corner_angle) / 2) * side_length;
to_y += std::sin(to_radians(m_corner_angle) / 2) * side_length;
draw_line_opt_args = default_line_opt_args;
draw_line_opt_args.height = i == 0 ? height_first_layer() : height_layer();
draw_line_opt_args.line_width = line_width(); // don't use line_width_first_layer so results are consistent across all layers
draw_line_opt_args.speed = i == 0 ? speed_adjust(speed_first_layer()) : speed_adjust(speed_perimeter());
draw_line_opt_args.comment = "Print pattern wall";
draw_line_opt_args = default_line_opt_args;
draw_line_opt_args.height = i == 0 ? height_first_layer() : height_layer();
draw_line_opt_args.line_width = line_width(); // don't use line_width_first_layer so results are consistent across all layers
draw_line_opt_args.speed = i == 0 ? speed_adjust(speed_first_layer()) : speed_adjust(speed_perimeter());
draw_line_opt_args.comment = "Print pattern wall";
gcode << draw_line(Vec2d(to_x, to_y), draw_line_opt_args);
to_x -= std::cos(to_radians(m_corner_angle) / 2) * side_length;
@ -530,23 +418,18 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(
CustomGCode::Item item;
item.print_z = max_layer_z();
item.type = CustomGCode::Type::Custom;
item.extra = gcode.str();
item.type = CustomGCode::Type::Custom;
item.extra = gcode.str();
gcode_items.push_back(item);
CustomGCode::Info info;
info.mode = CustomGCode::Mode::SingleExtruder;
info.mode = CustomGCode::Mode::SingleExtruder;
info.gcodes = gcode_items;
model.plates_custom_gcodes[model.curr_plate_index] = info;
}
void CalibPressureAdvancePattern::refresh_setup(
const DynamicPrintConfig& config,
bool is_bbl_machine,
const Model& model,
const Vec3d& origin
)
void CalibPressureAdvancePattern::refresh_setup(const DynamicPrintConfig &config, bool is_bbl_machine, const Model &model, const Vec3d &origin)
{
m_config = config;
m_config.apply(model.objects.front()->config.get(), true);
@ -558,15 +441,10 @@ void CalibPressureAdvancePattern::refresh_setup(
_refresh_writer(is_bbl_machine, model, origin);
}
void CalibPressureAdvancePattern::_refresh_starting_point(const Model& model)
void CalibPressureAdvancePattern::_refresh_starting_point(const Model &model)
{
ModelObject* obj = model.objects.front();
BoundingBoxf3 bbox =
obj->instance_bounding_box(
*obj->instances.front(),
false
)
;
ModelObject * obj = model.objects.front();
BoundingBoxf3 bbox = obj->instance_bounding_box(*obj->instances.front(), false);
m_starting_point = Vec3d(bbox.min.x(), bbox.max.y(), 0);
m_starting_point.y() += m_handle_spacing;
@ -577,39 +455,28 @@ void CalibPressureAdvancePattern::_refresh_starting_point(const Model& model)
}
}
void CalibPressureAdvancePattern::_refresh_writer(
bool is_bbl_machine,
const Model& model,
const Vec3d& origin
)
void CalibPressureAdvancePattern::_refresh_writer(bool is_bbl_machine, const Model &model, const Vec3d &origin)
{
PrintConfig print_config;
print_config.apply(m_config, true);
m_writer.apply_print_config(print_config);
m_writer.set_xy_offset(origin(0), origin(1));
m_writer.set_is_bbl_machine(is_bbl_machine);
//m_writer.set_is_bbl_machine(is_bbl_machine);
const unsigned int extruder_id = model.objects.front()->volumes.front()->extruder_id();
m_writer.set_extruders({ extruder_id });
m_writer.set_extruders({extruder_id});
m_writer.set_extruder(extruder_id);
}
std::string CalibPressureAdvancePattern::draw_line(
Vec2d to_pt,
DrawLineOptArgs opt_args
)
std::string CalibPressureAdvancePattern::draw_line(Vec2d to_pt, DrawLineOptArgs opt_args)
{
const double e_per_mm = CalibPressureAdvance::e_per_mm(
opt_args.line_width,
opt_args.height,
m_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_flow_ratio")->get_at(0)
);
const double e_per_mm = CalibPressureAdvance::e_per_mm(opt_args.line_width, opt_args.height, m_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_diameter")->get_at(0),
m_config.option<ConfigOptionFloats>("filament_flow_ratio")->get_at(0));
const double length = get_distance(Vec2d(m_last_pos.x(), m_last_pos.y()), to_pt);
auto dE = e_per_mm * length;
auto dE = e_per_mm * length;
std::stringstream gcode;
@ -621,40 +488,31 @@ std::string CalibPressureAdvancePattern::draw_line(
return gcode.str();
}
std::string CalibPressureAdvancePattern::draw_box(
double min_x,
double min_y,
double size_x,
double size_y,
DrawBoxOptArgs opt_args
)
std::string CalibPressureAdvancePattern::draw_box(double min_x, double min_y, double size_x, double size_y, DrawBoxOptArgs opt_args)
{
std::stringstream gcode;
double x = min_x;
double y = min_y;
double x = min_x;
double y = min_y;
const double max_x = min_x + size_x;
const double max_y = min_y + size_y;
const double spacing = opt_args.line_width - opt_args.height * (1 - M_PI / 4);
// if number of perims exceeds size of box, reduce it to max
const int max_perimeters =
std::min(
// this is the equivalent of number of perims for concentric fill
std::floor(size_x * std::sin(to_radians(45))) / (spacing / std::sin(to_radians(45))),
std::floor(size_y * std::sin(to_radians(45))) / (spacing / std::sin(to_radians(45)))
)
;
const int max_perimeters = std::min(
// this is the equivalent of number of perims for concentric fill
std::floor(size_x * std::sin(to_radians(45))) / (spacing / std::sin(to_radians(45))),
std::floor(size_y * std::sin(to_radians(45))) / (spacing / std::sin(to_radians(45))));
opt_args.num_perimeters = std::min(opt_args.num_perimeters, max_perimeters);
gcode << move_to(Vec2d(min_x, min_y), m_writer, "Move to box start");
DrawLineOptArgs line_opt_args(*this);
line_opt_args.height = opt_args.height;
line_opt_args.height = opt_args.height;
line_opt_args.line_width = opt_args.line_width;
line_opt_args.speed = opt_args.speed;
line_opt_args.speed = opt_args.speed;
for (int i = 0; i < opt_args.num_perimeters; ++i) {
if (i != 0) { // after first perimeter, step inwards to start next perimeter
@ -680,23 +538,18 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << draw_line(Vec2d(x, y), line_opt_args);
}
if (!opt_args.is_filled) {
return gcode.str();
}
if (!opt_args.is_filled) { return gcode.str(); }
// create box infill
const double spacing_45 = spacing / std::sin(to_radians(45));
const double bound_modifier =
(spacing * (opt_args.num_perimeters - 1)) +
(opt_args.line_width * (1 - m_encroachment))
;
const double x_min_bound = min_x + bound_modifier;
const double x_max_bound = max_x - bound_modifier;
const double y_min_bound = min_y + bound_modifier;
const double y_max_bound = max_y - bound_modifier;
const int x_count = std::floor((x_max_bound - x_min_bound) / spacing_45);
const int y_count = std::floor((y_max_bound - y_min_bound) / spacing_45);
const double bound_modifier = (spacing * (opt_args.num_perimeters - 1)) + (opt_args.line_width * (1 - m_encroachment));
const double x_min_bound = min_x + bound_modifier;
const double x_max_bound = max_x - bound_modifier;
const double y_min_bound = min_y + bound_modifier;
const double y_max_bound = max_y - bound_modifier;
const int x_count = std::floor((x_max_bound - x_min_bound) / spacing_45);
const int y_count = std::floor((y_max_bound - y_min_bound) / spacing_45);
double x_remainder = std::fmod((x_max_bound - x_min_bound), spacing_45);
double y_remainder = std::fmod((y_max_bound - y_min_bound), spacing_45);
@ -706,7 +559,8 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Move to fill start");
for (int i = 0; i < x_count + y_count + (x_remainder + y_remainder >= spacing_45 ? 1 : 0); ++i) { // this isn't the most robust way, but less expensive than finding line intersections
for (int i = 0; i < x_count + y_count + (x_remainder + y_remainder >= spacing_45 ? 1 : 0);
++i) { // this isn't the most robust way, but less expensive than finding line intersections
if (i < std::min(x_count, y_count)) {
if (i % 2 == 0) {
x += spacing_45;
@ -714,7 +568,7 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step right");
y += x - x_min_bound;
x = x_min_bound;
x = x_min_bound;
line_opt_args.comment = "Fill: Print up/left";
gcode << draw_line(Vec2d(x, y), line_opt_args);
} else {
@ -723,7 +577,7 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step up");
x += y - y_min_bound;
y = y_min_bound;
y = y_min_bound;
line_opt_args.comment = "Fill: Print down/right";
gcode << draw_line(Vec2d(x, y), line_opt_args);
}
@ -736,7 +590,7 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step right");
x -= y_max_bound - y_min_bound;
y = y_max_bound;
y = y_max_bound;
line_opt_args.comment = "Fill: Print up/left";
gcode << draw_line(Vec2d(x, y), line_opt_args);
} else {
@ -748,9 +602,9 @@ std::string CalibPressureAdvancePattern::draw_box(
}
y = y_max_bound;
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step right");
x += y_max_bound - y_min_bound;
y = y_min_bound;
y = y_min_bound;
line_opt_args.comment = "Fill: Print down/right";
gcode << draw_line(Vec2d(x, y), line_opt_args);
}
@ -792,7 +646,7 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step up");
x -= y_max_bound - y;
y = y_max_bound;
y = y_max_bound;
line_opt_args.comment = "Fill: Print up/left";
gcode << draw_line(Vec2d(x, y), line_opt_args);
} else {
@ -805,7 +659,7 @@ std::string CalibPressureAdvancePattern::draw_box(
gcode << move_to(Vec2d(x, y), m_writer, "Fill: Step right");
y -= x_max_bound - x;
x = x_max_bound;
x = x_max_bound;
line_opt_args.comment = "Fill: Print down/right";
gcode << draw_line(Vec2d(x, y), line_opt_args);
}
@ -815,26 +669,17 @@ std::string CalibPressureAdvancePattern::draw_box(
return gcode.str();
}
double CalibPressureAdvancePattern::get_distance(Vec2d from, Vec2d to) const
{
return std::hypot((to.x() - from.x()), (to.y() - from.y()));
}
double CalibPressureAdvancePattern::get_distance(Vec2d from, Vec2d to) const { return std::hypot((to.x() - from.x()), (to.y() - from.y())); }
double CalibPressureAdvancePattern::object_size_x() const
{
return get_num_patterns() * ((wall_count() - 1) * line_spacing_angle()) +
(get_num_patterns() - 1) * (m_pattern_spacing + line_width()) +
std::cos(to_radians(m_corner_angle) / 2) * m_wall_side_length +
line_spacing_first_layer() * wall_count()
;
return get_num_patterns() * ((wall_count() - 1) * line_spacing_angle()) + (get_num_patterns() - 1) * (m_pattern_spacing + line_width()) +
std::cos(to_radians(m_corner_angle) / 2) * m_wall_side_length + line_spacing_first_layer() * wall_count();
}
double CalibPressureAdvancePattern::object_size_y() const
{
return 2 * (std::sin(to_radians(m_corner_angle) / 2) * m_wall_side_length) +
max_numbering_height() +
m_glyph_padding_vertical * 2 +
line_width_first_layer();
return 2 * (std::sin(to_radians(m_corner_angle) / 2) * m_wall_side_length) + max_numbering_height() + m_glyph_padding_vertical * 2 + line_width_first_layer();
}
double CalibPressureAdvancePattern::glyph_start_x(int pattern_i) const
@ -843,16 +688,14 @@ double CalibPressureAdvancePattern::glyph_start_x(int pattern_i) const
// align glyph's start with first perimeter of specified pattern
double x =
// starting offset
m_starting_point.x() +
pattern_shift() +
m_starting_point.x() + pattern_shift() +
// width of pattern extrusions
pattern_i * (wall_count() - 1) * line_spacing_angle() + // center to center distance of extrusions
pattern_i * line_width() + // endcaps. center to end on either side = 1 line width
pattern_i * line_width() + // endcaps. center to end on either side = 1 line width
// space between each pattern
pattern_i * m_pattern_spacing
;
pattern_i * m_pattern_spacing;
// align to middle of pattern walls
x += wall_count() * line_spacing_angle() / 2;
@ -873,35 +716,26 @@ double CalibPressureAdvancePattern::glyph_length_x() const
double CalibPressureAdvancePattern::glyph_tab_max_x() const
{
// only every other glyph is shown, starting with 1
int num = get_num_patterns();
int max_num =
(num % 2 == 0)
? num - 1
: num
;
int num = get_num_patterns();
int max_num = (num % 2 == 0) ? num - 1 : num;
// padding at end should be same as padding at start
double padding = glyph_start_x(0) - m_starting_point.x();
return
glyph_start_x(max_num - 1) + // glyph_start_x is zero-based
(glyph_length_x() - line_width() / 2) +
padding
;
return glyph_start_x(max_num - 1) + // glyph_start_x is zero-based
(glyph_length_x() - line_width() / 2) + padding;
}
double CalibPressureAdvancePattern::max_numbering_height() const
{
std::string::size_type most_characters = 0;
const int num_patterns = get_num_patterns();
const int num_patterns = get_num_patterns();
// note: only every other number is printed
for (std::string::size_type i = 0; i < num_patterns; i += 2) {
std::string sNumber = convert_number_to_string(m_params.start + (i * m_params.step));
if (sNumber.length() > most_characters) {
most_characters = sNumber.length();
}
if (sNumber.length() > most_characters) { most_characters = sNumber.length(); }
}
most_characters = std::min(most_characters, m_max_number_len);
@ -909,12 +743,6 @@ double CalibPressureAdvancePattern::max_numbering_height() const
return (most_characters * m_digit_segment_len) + ((most_characters - 1) * m_digit_gap_len);
}
double CalibPressureAdvancePattern::pattern_shift() const
{
return
(wall_count() - 1) * line_spacing_first_layer() +
line_width_first_layer() +
m_glyph_padding_horizontal
;
}
double CalibPressureAdvancePattern::pattern_shift() const { return (wall_count() - 1) * line_spacing_first_layer() + line_width_first_layer() + m_glyph_padding_horizontal; }
} // namespace Slic3r