mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-19 04:05:58 +08:00
Fixed conflicts after merge with master
This commit is contained in:
commit
2c3ad03cd4
65
.github/ISSUE_TEMPLATE/bug_report_form.yml
vendored
Normal file
65
.github/ISSUE_TEMPLATE/bug_report_form.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Description of the bug
|
||||
description: What happened? Please, enclose a screenshot whenever possible (even when you think the description is clear). What did you expect to happen? In case of 3D rendering issues, please attach the content of menu Help -> System Info dialog.
|
||||
placeholder: |
|
||||
What is the problem?
|
||||
What did you expect?
|
||||
You paste or drop screenshots here
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: to_reproduce
|
||||
attributes:
|
||||
label: Project file & How to reproduce
|
||||
description: "*Please* upload a ZIP archive containing the project file used when the problem arise. Please export it just before the problem occurs. Even if you did nothing and/or there is no object, export it! (it contains your current configuration)."
|
||||
placeholder: |
|
||||
`File`->`Export project as...` then zip it & drop it here
|
||||
Also, if needed include the steps to reproduce the bug:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist of files included above
|
||||
options:
|
||||
- label: Project file
|
||||
- label: Screenshot
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version of PrusaSlicer
|
||||
description: What version of PrusaSlicer are you running? You can see the full version in `Help` -> `About PrusaSlicer`.
|
||||
placeholder: e.g. 2.4.1-alpha2-win64 / 2.3.3-linux / 2.4.1-alpha0+61-win64-gcd2459455 ...
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: with the version if possible
|
||||
placeholder: e.g. Windows 7/8/10/11 ... , Ubuntu 22.04/Debian ... , macOS 10.15/11.1 ...
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: printer
|
||||
attributes:
|
||||
label: Printer model
|
||||
description: Please, fill this in even when it seems irrelevant.
|
||||
placeholder: voron 2.4 with afterburner
|
||||
validations:
|
||||
required: true
|
||||
|
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
contact_links:
|
||||
- name: PrusaSlicer Manual and Support
|
||||
url: https://help.prusa3d.com/en/article/customer-support_2287/
|
||||
about: If you are not sure that what you are reporting is really a bug, please, consult the manual first.
|
||||
- name: PrusaPrinters Forum
|
||||
url: https://forum.prusaprinters.org/forum/prusaslicer/
|
||||
about: Please get in touch on our PrusaPrinters Community Forum! (Not an official support channel.)
|
||||
|
||||
blank_issues_enabled: false
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe how it would work**
|
||||
Be as descriptive as your skill level allows you.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or paint drawing about the feature request here.
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ local-lib
|
||||
build-linux/*
|
||||
deps/build-linux/*
|
||||
**/.DS_Store
|
||||
/.idea/
|
||||
|
@ -164,6 +164,9 @@ IF NOT EXIST "%MSVC_DIR%" (
|
||||
@ECHO ERROR: Compatible Visual Studio installation not found. 1>&2
|
||||
GOTO :HELP
|
||||
)
|
||||
REM Cmake always defaults to latest supported MSVC generator. Let's make sure it uses what we select.
|
||||
FOR /F "tokens=* USEBACKQ" %%I IN (`^""%VSWHERE%" %MSVC_FILTER% -nologo -property catalog_productLineVersion^"`) DO SET PS_PRODUCT_VERSION=%%I
|
||||
|
||||
REM Give the user a chance to cancel if we found something odd.
|
||||
IF "%PS_ASK_TO_CONTINUE%" EQU "" GOTO :BUILD_ENV
|
||||
@ECHO.
|
||||
@ -183,6 +186,7 @@ SET PS_CURRENT_STEP=environment
|
||||
@ECHO ** Deps path: %PS_DESTDIR%
|
||||
@ECHO ** Using Microsoft Visual Studio installation found at:
|
||||
@ECHO ** %MSVC_DIR%
|
||||
SET CMAKE_GENERATOR=Visual Studio %PS_VERSION% %PS_PRODUCT_VERSION%
|
||||
CALL "%MSVC_DIR%\Common7\Tools\vsdevcmd.bat" -arch=%PS_ARCH% -host_arch=%PS_ARCH_HOST% -app_platform=Desktop
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO :END
|
||||
REM Need to reset the echo state after vsdevcmd.bat clobbers it.
|
||||
|
22
resources/icons/toolbar_arrow_2.svg
Normal file
22
resources/icons/toolbar_arrow_2.svg
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="50 0 228 330" style="enable-background:new 50 0 228 330;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{display:none;}
|
||||
.st1{fill:none;stroke:#ED6B21;stroke-width:17.0079;stroke-linecap:round;stroke-miterlimit:10;}
|
||||
</style>
|
||||
<path id="XMLID_28_" class="st0" d="M180,315V51.2l49.4,49.4c5.9,5.9,15.4,5.9,21.2,0c5.9-5.9,5.9-15.4,0-21.2l-75-75
|
||||
c-5.9-5.9-15.4-5.9-21.2,0l-75,75C76.5,82.3,75,86.2,75,90s1.5,7.7,4.4,10.6c5.9,5.9,15.4,5.9,21.2,0L150,51.2V315
|
||||
c0,8.3,6.7,15,15,15S180,323.3,180,315z"
|
||||
style="fill:#ed6b21;"/>
|
||||
<g id="XMLID_1_">
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st1" points="113.3,84.5 164,18.3 164,18.3 "/>
|
||||
<polyline class="st1" points="216.1,84.5 164,18.3 164,18.3 "/>
|
||||
</g>
|
||||
</g>
|
||||
<line class="st1" x1="164" y1="263.3" x2="164" y2="18.3"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-02-09 09:04+0100\n"
|
||||
"PO-Revision-Date: 2021-12-16 18:50+0100\n"
|
||||
"PO-Revision-Date: 2022-03-04 17:01+0100\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: ca\n"
|
||||
@ -90,7 +90,7 @@ msgstr ""
|
||||
#: src/slic3r/GUI/BackgroundSlicingProcess.cpp:84
|
||||
#, boost-format
|
||||
msgid "PrusaSlicer has encountered a fatal error: \"%1%\""
|
||||
msgstr ""
|
||||
msgstr "PrusaSlicer ha trobat un error crític: \"%1%\""
|
||||
|
||||
#: src/slic3r/GUI/BackgroundSlicingProcess.cpp:85
|
||||
msgid ""
|
||||
@ -1887,7 +1887,7 @@ msgstr "Imatge del firmware:"
|
||||
|
||||
#: src/slic3r/GUI/FirmwareDialog.cpp:813
|
||||
msgid "Select a file"
|
||||
msgstr ""
|
||||
msgstr "Seleccioneu un fitxer"
|
||||
|
||||
#: src/slic3r/GUI/FirmwareDialog.cpp:815
|
||||
#: src/slic3r/GUI/PhysicalPrinterDialog.cpp:297
|
||||
@ -3495,11 +3495,11 @@ msgstr "Preparant pestanyes de configuració"
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1334 src/slic3r/GUI/Preferences.cpp:287
|
||||
msgid "Restore window position on start"
|
||||
msgstr ""
|
||||
msgstr "Restaura la posició de la finestra a l'inici"
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1336
|
||||
msgid "PrusaSlicer started after a crash"
|
||||
msgstr ""
|
||||
msgstr "PrusaSlicer s'ha reiniciat després d'una fallada"
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1337
|
||||
#, boost-format
|
||||
@ -3513,16 +3513,27 @@ msgid ""
|
||||
"To avoid this problem, consider disabling \"%4%\" in \"Preferences\". "
|
||||
"Otherwise, the application will most likely crash again next time."
|
||||
msgstr ""
|
||||
"PrusaSlicer va crashejar la darrera vegada en intentar establir la posició "
|
||||
"de la finestra.\n"
|
||||
"Lamentem les molèsties, malauradament passa amb certes configuracions de "
|
||||
"monitor múltiple.\n"
|
||||
"El motiu més precís de l'accident: \"%1%\".\n"
|
||||
"Per obtenir més informació, consulteu el nostre rastrejador d'incidències de "
|
||||
"GitHub: \"%2%\" i \"%3%\"\n"
|
||||
"\n"
|
||||
"Per evitar aquest problema, considereu desactivar \"%4%\" a \"Preferències"
|
||||
"\". En cas contrari, és probable que l'aplicació es torni a crashejar la "
|
||||
"propera vegada."
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1349
|
||||
#, boost-format
|
||||
msgid "Disable \"%1%\""
|
||||
msgstr ""
|
||||
msgstr "Deshabilitar \"%1%\""
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1350
|
||||
#, boost-format
|
||||
msgid "Leave \"%1%\" enabled"
|
||||
msgstr ""
|
||||
msgstr "Deixa \"%1%\" habilitat"
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:1677
|
||||
msgid ""
|
||||
@ -3805,6 +3816,7 @@ msgstr "PrusaSlicer recordarà la vostra elecció."
|
||||
#: src/slic3r/GUI/GUI_App.cpp:3101
|
||||
msgid "You will not be asked about it again on hyperlinks hovering."
|
||||
msgstr ""
|
||||
"No se us tornarà a preguntar al respecte quan passis per sobre de l'enllaç."
|
||||
|
||||
#: src/slic3r/GUI/GUI_App.cpp:3102 src/slic3r/GUI/Plater.cpp:1738
|
||||
#, boost-format
|
||||
@ -5008,15 +5020,16 @@ msgstr "S'ha produït un error inesperat"
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:21
|
||||
msgid "Best surface quality"
|
||||
msgstr ""
|
||||
msgstr "Màxima qualitat de superfície"
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:23
|
||||
msgid "Optimize object rotation for best surface quality."
|
||||
msgstr ""
|
||||
"Optimitzar la rotació de l'objecte per a la màxima qualitat de superfície."
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:24
|
||||
msgid "Reduced overhang slopes"
|
||||
msgstr ""
|
||||
msgstr "Pendents de voladís reduïts"
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:26
|
||||
msgid ""
|
||||
@ -5025,14 +5038,20 @@ msgid ""
|
||||
"Note that this method will try to find the best surface of the object for "
|
||||
"touching the print bed if no elevation is set."
|
||||
msgstr ""
|
||||
"Optimitza la rotació d'objectes per tenir una quantitat mínima de voladissos "
|
||||
"que necessiten estructures de suport.\n"
|
||||
"Tingueu en compte que aquest mètode intentarà trobar la millor superfície de "
|
||||
"l'objecte per tocar el llit d'impressió si no s'estableix cap elevació."
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:30
|
||||
msgid "Lowest Z height"
|
||||
msgstr ""
|
||||
msgstr "Mínima alçada Z"
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.hpp:32
|
||||
msgid "Rotate the model to have the lowest z height for faster print time."
|
||||
msgstr ""
|
||||
"Rota el model per tenir l'alçada z més baixa i un temps d'impressió més "
|
||||
"ràpid."
|
||||
|
||||
#: src/slic3r/GUI/Jobs/RotoptimizeJob.cpp:59
|
||||
msgid "Searching for optimal orientation"
|
||||
@ -6985,7 +7004,7 @@ msgstr "Voleu desar els canvis a \"%1%\"?"
|
||||
|
||||
#: src/slic3r/GUI/Plater.cpp:1732 src/slic3r/GUI/Preferences.cpp:222
|
||||
msgid "Ask for unsaved changes in project"
|
||||
msgstr ""
|
||||
msgstr "Preguntar pels canvis no desats al projecte"
|
||||
|
||||
#: src/slic3r/GUI/Plater.cpp:1735
|
||||
msgid ""
|
||||
@ -6993,6 +7012,9 @@ msgid ""
|
||||
"- Closing PrusaSlicer,\n"
|
||||
"- Loading or creating a new project"
|
||||
msgstr ""
|
||||
"No et preguntarà pels canvis no guardats la propera vegada que: \n"
|
||||
"- Tanquis PrusaSlicer,\n"
|
||||
"- Carreguis o creis un nou projecte"
|
||||
|
||||
#: src/slic3r/GUI/Plater.cpp:2197
|
||||
#, c-format, boost-format
|
||||
@ -7622,6 +7644,9 @@ msgid ""
|
||||
"- Closing PrusaSlicer,\n"
|
||||
"- Loading or creating a new project"
|
||||
msgstr ""
|
||||
"Sol·licita sempre canvis no desats en el projecte, quan: \n"
|
||||
"- Tancament PrusaSlicer,\n"
|
||||
"- Càrrega o creació d'un nou projecte"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:233
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:897
|
||||
@ -7629,6 +7654,8 @@ msgid ""
|
||||
"Ask to save unsaved changes in presets when closing the application or when "
|
||||
"loading a new project"
|
||||
msgstr ""
|
||||
"Demana desar els canvis no desats en els predefinits en tancar l'aplicació o "
|
||||
"en carregar un projecte nou"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:235
|
||||
msgid ""
|
||||
@ -7636,6 +7663,9 @@ msgid ""
|
||||
"- Closing PrusaSlicer while some presets are modified,\n"
|
||||
"- Loading a new project while some presets are modified"
|
||||
msgstr ""
|
||||
"Preguntar sempre pels canvis no guardats en els predefinits, quan:\n"
|
||||
"- En tancar PrusaSlicer mentre es modifiquen alguns ajustaments,\n"
|
||||
"- En carregar un nou projecte mentre es modifiquen alguns ajustaments"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:242
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:896
|
||||
@ -7647,15 +7677,20 @@ msgid ""
|
||||
"Always ask for unsaved changes in presets when selecting new preset or "
|
||||
"resetting a preset"
|
||||
msgstr ""
|
||||
"Preguntar sempre pels canvis no guardats en predefinits en seleccionar un "
|
||||
"nou ajustament o en restablir un ajustament"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:249
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:895
|
||||
msgid "Ask for unsaved changes in presets when creating new project"
|
||||
msgstr ""
|
||||
"Preguntar pels canvis no desats en predefinits en crear un nou projecte"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:251
|
||||
msgid "Always ask for unsaved changes in presets when creating new project"
|
||||
msgstr ""
|
||||
"Preguntar sempre pels canvis no guardats en predefinits en crear un nou "
|
||||
"projecte"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:258
|
||||
msgid "Associate .gcode files to PrusaSlicer G-code Viewer"
|
||||
@ -7688,6 +7723,7 @@ msgstr "Mostra la pantalla de presentació"
|
||||
#: src/slic3r/GUI/Preferences.cpp:289
|
||||
msgid "If enabled, PrusaSlicer will be open at the position it was closed"
|
||||
msgstr ""
|
||||
"Si està habilitat, PrusaSlicer s'obrirà en la posició en què s'ha tancat"
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:295
|
||||
msgid "Clear Undo / Redo stack on new project"
|
||||
@ -7779,7 +7815,7 @@ msgstr ""
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:384
|
||||
msgid "If enabled, PrusaSlicer will not open hyperlinks in your browser."
|
||||
msgstr ""
|
||||
msgstr "Si està habilitat, PrusaSlicer no obrirà hipervincles al navegador."
|
||||
|
||||
#: src/slic3r/GUI/Preferences.cpp:391
|
||||
msgid "Use colors for axes values in Manipulation panel"
|
||||
@ -9224,19 +9260,19 @@ msgstr "Ajust"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:3938
|
||||
msgid "Find"
|
||||
msgstr "Cerca"
|
||||
msgstr "Cercar"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:3939
|
||||
msgid "Replace with"
|
||||
msgstr ""
|
||||
msgstr "Substitueix-ho per"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4028
|
||||
msgid "Regular expression"
|
||||
msgstr ""
|
||||
msgstr "Expressió normal"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4032
|
||||
msgid "Case insensitive"
|
||||
msgstr ""
|
||||
msgstr "No distingeix minúscules/majúscules"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4036
|
||||
msgid "Whole word"
|
||||
@ -9244,11 +9280,11 @@ msgstr "Paraula sencera"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4040
|
||||
msgid "Match single line"
|
||||
msgstr ""
|
||||
msgstr "Coincideix amb una sola línia"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4143
|
||||
msgid "Are you sure you want to delete all substitutions?"
|
||||
msgstr ""
|
||||
msgstr "Esteu segur que voleu suprimir totes les substitucions?"
|
||||
|
||||
#: src/slic3r/GUI/Tab.cpp:4275
|
||||
msgid ""
|
||||
@ -9512,12 +9548,16 @@ msgid ""
|
||||
"You will not be asked about the unsaved changes in presets the next time you "
|
||||
"create new project"
|
||||
msgstr ""
|
||||
"No et preguntarà pels canvis no guardats en predefinits la propera vegada "
|
||||
"que creis un nou projecte"
|
||||
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:899
|
||||
msgid ""
|
||||
"You will not be asked about the unsaved changes in presets the next time you "
|
||||
"switch a preset"
|
||||
msgstr ""
|
||||
"No et preguntarà pels canvis no guardats en predefinits la propera vegada "
|
||||
"que canvíis d'ajust"
|
||||
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:900
|
||||
msgid ""
|
||||
@ -9526,6 +9566,10 @@ msgid ""
|
||||
"- Closing PrusaSlicer while some presets are modified,\n"
|
||||
"- Loading a new project while some presets are modified"
|
||||
msgstr ""
|
||||
"Preguntar sempre pels canvis no guardats en predefinits la propera vegada "
|
||||
"que::\n"
|
||||
"- Tanquis PrusaSlicer mentre es modifiquen alguns ajustaments,\n"
|
||||
"- Carreguis un nou projecte mentre es modifiquen alguns ajustaments"
|
||||
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:903
|
||||
msgid "PrusaSlicer will remember your action."
|
||||
@ -9617,7 +9661,7 @@ msgstr "Comptador d'extrusors"
|
||||
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:1454
|
||||
msgid "Select presets to compare"
|
||||
msgstr ""
|
||||
msgstr "Seleccioneu els predefinits per comparar"
|
||||
|
||||
#: src/slic3r/GUI/UnsavedChangesDialog.cpp:1503
|
||||
msgid "Show all presets (including incompatible)"
|
||||
@ -10245,24 +10289,26 @@ msgstr ""
|
||||
|
||||
#: src/slic3r/Config/Snapshot.cpp:584
|
||||
msgid "Taking a configuration snapshot failed."
|
||||
msgstr ""
|
||||
msgstr "No s'ha pogut prendre una instantània de configuració."
|
||||
|
||||
#: src/slic3r/Config/Snapshot.cpp:598
|
||||
msgid ""
|
||||
"PrusaSlicer has encountered an error while taking a configuration snapshot."
|
||||
msgstr ""
|
||||
"El PrusaSlicer ha trobat un error mentre feia una instantània de "
|
||||
"configuració."
|
||||
|
||||
#: src/slic3r/Config/Snapshot.cpp:599
|
||||
msgid "PrusaSlicer error"
|
||||
msgstr ""
|
||||
msgstr "Error de PrusaSlicer"
|
||||
|
||||
#: src/slic3r/Config/Snapshot.cpp:601
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
msgstr "Continuar"
|
||||
|
||||
#: src/slic3r/Config/Snapshot.cpp:601
|
||||
msgid "Abort"
|
||||
msgstr ""
|
||||
msgstr "Avortar"
|
||||
|
||||
#: src/libslic3r/GCode.cpp:539
|
||||
msgid "There is an object with no extrusions in the first layer."
|
||||
@ -10313,7 +10359,7 @@ msgstr ""
|
||||
|
||||
#: src/libslic3r/GCode.cpp:1236 src/libslic3r/GCode.cpp:1247
|
||||
msgid "No extrusions were generated for objects."
|
||||
msgstr ""
|
||||
msgstr "No s'han generat extrusions per als objectes."
|
||||
|
||||
#: src/libslic3r/GCode.cpp:1445
|
||||
msgid ""
|
||||
@ -10706,18 +10752,25 @@ msgid ""
|
||||
"each layer to prevent loss of floating point accuracy. Add \"G92 E0\" to "
|
||||
"layer_gcode."
|
||||
msgstr ""
|
||||
"L'adreçament relatiu de l'extrusor requereix restablir la posició de "
|
||||
"l'extrusor a cada capa per evitar la pèrdua de precisió de coma flotant. "
|
||||
"Afegiu \"G92 E0\" a layer_gcode."
|
||||
|
||||
#: src/libslic3r/Print.cpp:665
|
||||
msgid ""
|
||||
"\"G92 E0\" was found in before_layer_gcode, which is incompatible with "
|
||||
"absolute extruder addressing."
|
||||
msgstr ""
|
||||
"\"G92 E0\" s'ha trobat a before_layer_gcode, el qual és incompatible amb "
|
||||
"l'adreçament absolut d'extrusor."
|
||||
|
||||
#: src/libslic3r/Print.cpp:667
|
||||
msgid ""
|
||||
"\"G92 E0\" was found in layer_gcode, which is incompatible with absolute "
|
||||
"extruder addressing."
|
||||
msgstr ""
|
||||
"\"G92 E0\" s'ha trobat a layer_gcode, el qual és incompatible amb "
|
||||
"l'adreçament absolut d'extrusor."
|
||||
|
||||
#: src/libslic3r/Print.cpp:809
|
||||
msgid "Infilling layers"
|
||||
@ -12309,11 +12362,11 @@ msgstr ""
|
||||
|
||||
#: src/libslic3r/PrintConfig.cpp:1361
|
||||
msgid "G-code substitutions"
|
||||
msgstr ""
|
||||
msgstr "Substitucions de codi G"
|
||||
|
||||
#: src/libslic3r/PrintConfig.cpp:1362
|
||||
msgid "Find / replace patterns in G-code lines and substitute them."
|
||||
msgstr ""
|
||||
msgstr "Cerca / substitueix patrons en línies de codi G i els substitueix."
|
||||
|
||||
#: src/libslic3r/PrintConfig.cpp:1367
|
||||
msgid "High extruder current on filament swap"
|
||||
@ -15587,7 +15640,7 @@ msgid ""
|
||||
"the<a>Variable layer height tool</a>. (Not available for SLA printers.)"
|
||||
msgstr ""
|
||||
"Alçada de capa variable\n"
|
||||
"Sabies que pot imprimir diferents regions del teu model amb una alçada de "
|
||||
"Sabies que pots imprimir diferents regions del teu model amb una alçada de "
|
||||
"capa diferent i suavitzar les transicions entre elles? Proveu "
|
||||
"l'eina<a>Alçada de capa variable</a>. (No disponible per a impressores SLA.)"
|
||||
|
||||
@ -15624,7 +15677,7 @@ msgid ""
|
||||
"threshold area</a>. (Expert mode only.)"
|
||||
msgstr ""
|
||||
"Àrea llindar de farciment sòlid\n"
|
||||
"Sabies que pot fer que les parts del seu model amb una secció transversal "
|
||||
"Sabies que pots fer que les parts del teu model amb una secció transversal "
|
||||
"petita s'emplenin amb farciment sòlid automàticament? Ajusta el<a>Àrea "
|
||||
"llindar de farciment sòlid</a>. (Només en mode Expert.)"
|
||||
|
||||
@ -15837,13 +15890,44 @@ msgstr ""
|
||||
"Sabies que pots posar el PrusaSlicer en mode de pantalla completa? Utilitzeu "
|
||||
"la tecla d'accés ràpid <b>F11</b>."
|
||||
|
||||
#: ../src/common/debugrpt.cpp:586
|
||||
msgid ""
|
||||
"\n"
|
||||
"Please send this report to the program maintainer, thank you!\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Envieu aquest informe al mantenidor del programa. Gràcies!\n"
|
||||
#~ msgid ""
|
||||
#~ "If enabled, the descriptions of configuration parameters in settings tabs "
|
||||
#~ "wouldn't work as hyperlinks. If disabled, the descriptions of "
|
||||
#~ "configuration parameters in settings tabs will work as hyperlinks."
|
||||
#~ msgstr ""
|
||||
#~ "Si està habilitat, les descripcions dels paràmetres de configuració a les "
|
||||
#~ "pestanyes de configuració no funcionaran com a hiperenllaços. Si està "
|
||||
#~ "deshabilitat, les descripcions dels paràmetres de configuració a les "
|
||||
#~ "pestanyes de configuració funcionaran com a hiperenllaços."
|
||||
|
||||
#, c-format, boost-format
|
||||
#~ msgid ""
|
||||
#~ "PrusaSlicer detected another configuration folder at %s.\n"
|
||||
#~ "Its version is %s.\n"
|
||||
#~ "Last version you used in current configuration folder is %s.\n"
|
||||
#~ "Please note that PrusaSlicer uses different folders to save configuration "
|
||||
#~ "of alpha, beta and full release versions.\n"
|
||||
#~ "Would you like to copy found configuration to your current configuration "
|
||||
#~ "folder?\n"
|
||||
#~ "\n"
|
||||
#~ "If you select yes, PrusaSlicer will copy all profiles and other files "
|
||||
#~ "from found folder to the current one. Overwriting any existing file with "
|
||||
#~ "matching name.\n"
|
||||
#~ "If you select no, you will continue with current configuration."
|
||||
#~ msgstr ""
|
||||
#~ "PrusaSlicer ha detectat una altra carpeta de configuració a %s.\n"
|
||||
#~ "La vostra versió és %s.\n"
|
||||
#~ "La darrera versió que heu utilitzat a la carpeta de configuració actual "
|
||||
#~ "és %s.\n"
|
||||
#~ "Si us plau, tingueu en compte que PrusaSlicer utilitza diferents carpetes "
|
||||
#~ "per desar la configuració de les versions alfa, beta i final.\n"
|
||||
#~ "Voleu copiar la configuració trobada a la vostra carpeta de configuració "
|
||||
#~ "actual?\n"
|
||||
#~ "\n"
|
||||
#~ "Si seleccioneu sí, PrusaSlicer copiarà tots els perfils i altres fitxers "
|
||||
#~ "de la carpeta trobada a l'actual, sobreescrivint qualsevol fitxer "
|
||||
#~ "existent amb el mateix nom.\n"
|
||||
#~ "Si seleccioneu no, continuareu amb la configuració actual."
|
||||
|
||||
#: ../src/richtext/richtextstyledlg.cpp:210
|
||||
#: ../src/richtext/richtextstyledlg.cpp:222
|
||||
|
@ -1,3 +1,6 @@
|
||||
min_slic3r_version = 2.4.1-rc1
|
||||
0.1.1 Fixed before layer change g-code for Mega Zero.
|
||||
0.1.0 Added Anycubic 4Max Pro 2.0
|
||||
min_slic3r_version = 2.3.2-alpha0
|
||||
0.0.12 Updated Anycubic i3 MEGA(S) profiles.
|
||||
0.0.11 Added bed model and texture for i3 Mega, i3 Mega S.
|
||||
|
File diff suppressed because one or more lines are too long
BIN
resources/profiles/Anycubic/4MAXPRO20_bed.stl
Normal file
BIN
resources/profiles/Anycubic/4MAXPRO20_bed.stl
Normal file
Binary file not shown.
259
resources/profiles/Anycubic/4MAXPRO20_texture.svg
Normal file
259
resources/profiles/Anycubic/4MAXPRO20_texture.svg
Normal file
@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="270mm"
|
||||
height="210mm"
|
||||
viewBox="0 0 270 210"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"
|
||||
sodipodi:docname="4MAXPRO20_texture.svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="246.42197"
|
||||
inkscape:cy="156.15646"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="true"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1377"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid1404" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-34.773811,-90.714287)">
|
||||
<rect
|
||||
style="fill:none;stroke-width:0.264583"
|
||||
id="rect1402"
|
||||
width="270"
|
||||
height="210"
|
||||
x="34.773811"
|
||||
y="90.714287" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773811,100.71429 H 304.7738 v 0"
|
||||
id="path1410" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="m 304.7738,100.71429 v 0"
|
||||
id="path1412" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,110.71429 H 304.77381 v 0"
|
||||
id="path1410-7" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,120.71429 H 304.77381 v 0"
|
||||
id="path1410-4" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,130.71429 H 304.77381 v 0"
|
||||
id="path1410-9" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,140.71429 H 304.77381 v 0"
|
||||
id="path1410-1" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,150.71429 H 304.77381 v 0"
|
||||
id="path1410-5" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,160.71429 H 304.77381 v 0"
|
||||
id="path1410-8" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,170.71429 H 304.77381 v 0"
|
||||
id="path1410-56" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,180.71429 H 304.77381 v 0"
|
||||
id="path1410-569" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,190.71429 H 304.77381 v 0"
|
||||
id="path1410-85" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,200.71429 H 304.77381 v 0"
|
||||
id="path1410-0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,210.71429 H 304.77381 v 0"
|
||||
id="path1410-43" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,220.71429 H 304.77381 v 0"
|
||||
id="path1410-55" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,230.71429 H 304.77381 v 0"
|
||||
id="path1410-45" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,240.71429 H 304.77381 v 0"
|
||||
id="path1410-58" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,250.71429 H 304.77381 v 0"
|
||||
id="path1410-3" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,260.71429 H 304.77381 v 0"
|
||||
id="path1410-53" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,270.71429 H 304.77381 v 0"
|
||||
id="path1410-97" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,280.71429 H 304.77381 v 0"
|
||||
id="path1410-38" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 34.773822,290.71429 H 304.77381 v 0"
|
||||
id="path1410-75" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 44.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 44.773811,270.71428 v 0"
|
||||
id="path1620" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 54.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-5" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 64.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-2" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 74.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-3" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 84.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-6" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 94.773811,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-9" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 104.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 114.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-95" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 124.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-1" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 134.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-57" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 144.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-54" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 154.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-958" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 164.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-4" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 174.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-17" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 184.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-27" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 194.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-8" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 204.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-88" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 214.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-98" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 224.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-16" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 234.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-7" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 244.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-175" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 254.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-00" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 264.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-28" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 274.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-39" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 284.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-70" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 294.77381,90.714287 V 300.71429 270.71428"
|
||||
id="path1618-33" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 12 KiB |
BIN
resources/profiles/Anycubic/4MAXPRO20_thumbnail.png
Normal file
BIN
resources/profiles/Anycubic/4MAXPRO20_thumbnail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
@ -1,3 +1,5 @@
|
||||
min_slic3r_version = 2.4.1
|
||||
0.1.4 Added Ender-3 Pro. Added M25 support for some printers.
|
||||
min_slic3r_version = 2.4.0-rc
|
||||
0.1.3 Ender-3 S1 improvements.
|
||||
0.1.2 Added alpha Ender 3 S1 profiles.
|
||||
|
@ -5,7 +5,7 @@
|
||||
name = Creality
|
||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||
config_version = 0.1.3
|
||||
config_version = 0.1.4
|
||||
# Where to get the updates from?
|
||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Creality/
|
||||
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
||||
@ -32,6 +32,15 @@ bed_model = ender3_bed.stl
|
||||
bed_texture = ender3.svg
|
||||
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY
|
||||
|
||||
[printer_model:ENDER3PRO]
|
||||
name = Creality Ender-3 Pro
|
||||
variants = 0.4
|
||||
technology = FFF
|
||||
family = ENDER
|
||||
bed_model = ender3_bed.stl
|
||||
bed_texture = ender3.svg
|
||||
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY
|
||||
|
||||
[printer_model:ENDER3V2]
|
||||
name = Creality Ender-3 V2
|
||||
variants = 0.4
|
||||
@ -960,8 +969,16 @@ inherits = Creality Ender-3; *fastabl*
|
||||
renamed_from = "Creality ENDER-3 BLTouch"
|
||||
printer_model = ENDER3BLTOUCH
|
||||
|
||||
[printer:Creality Ender-3 Pro]
|
||||
inherits = *common*; *pauseprint*
|
||||
renamed_from = "Creality Ender-3 Pro"
|
||||
bed_shape = 5x0,215x0,215x220,5x220
|
||||
max_print_height = 250
|
||||
printer_model = ENDER3PRO
|
||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3PRO\nPRINTER_HAS_BOWDEN
|
||||
|
||||
[printer:Creality Ender-3 V2]
|
||||
inherits = *common*
|
||||
inherits = *common*; *pauseprint*
|
||||
renamed_from = "Creality Ender-3V2"
|
||||
bed_shape = 5x0,215x0,215x220,5x220
|
||||
max_print_height = 250
|
||||
@ -969,14 +986,14 @@ printer_model = ENDER3V2
|
||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3V2\nPRINTER_HAS_BOWDEN
|
||||
|
||||
[printer:Creality Ender-3 S1]
|
||||
inherits = *common*; *spriteextruder*
|
||||
inherits = *common*; *pauseprint*; *spriteextruder*
|
||||
bed_shape = 5x0,215x0,215x220,5x220
|
||||
max_print_height = 270
|
||||
printer_model = ENDER3S1
|
||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3S1
|
||||
|
||||
[printer:Creality Ender-3 Max]
|
||||
inherits = *common*
|
||||
inherits = *common*; *pauseprint*
|
||||
retract_length = 6
|
||||
bed_shape = 5x5,295x5,295x295,5x295
|
||||
max_print_height = 340
|
||||
|
BIN
resources/profiles/Creality/ENDER3PRO_thumbnail.png
Normal file
BIN
resources/profiles/Creality/ENDER3PRO_thumbnail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
@ -1,4 +1,5 @@
|
||||
min_slic3r_version = 2.4.0-rc
|
||||
1.4.3 Added new filament profiles and SLA materials.
|
||||
1.4.2 Added SLA material profiles.
|
||||
1.4.1 Updated firmware version.
|
||||
1.4.0 Updated for the PrusaSlicer 2.4.0-rc release. Updated SLA material colors.
|
||||
|
@ -5,7 +5,7 @@
|
||||
name = Prusa Research
|
||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||
config_version = 1.4.2
|
||||
config_version = 1.4.3
|
||||
# Where to get the updates from?
|
||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaResearch/
|
||||
changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
||||
@ -477,7 +477,7 @@ perimeter_acceleration = 800
|
||||
perimeter_speed = 50
|
||||
solid_infill_speed = 50
|
||||
top_infill_extrusion_width = 0.4
|
||||
top_solid_layers = 7
|
||||
top_solid_layers = 8
|
||||
bridge_flow_ratio = 1
|
||||
bridge_speed = 25
|
||||
|
||||
@ -1543,6 +1543,7 @@ filament_max_volumetric_speed = 13
|
||||
[filament:*ABSMINI*]
|
||||
# inherits = *ABS*
|
||||
bed_temperature = 100
|
||||
first_layer_bed_temperature = 100
|
||||
filament_retract_length = 2.7
|
||||
filament_retract_speed = nil
|
||||
filament_deretract_speed = nil
|
||||
@ -2914,6 +2915,7 @@ inherits = *PET*
|
||||
filament_vendor = BASF
|
||||
filament_cost =
|
||||
filament_density = 1.33
|
||||
filament_colour = #F7F7F7
|
||||
first_layer_temperature = 220
|
||||
first_layer_bed_temperature = 70
|
||||
temperature = 215
|
||||
@ -2925,7 +2927,7 @@ bridge_fan_speed = 100
|
||||
filament_type = PET
|
||||
disable_fan_first_layers = 1
|
||||
full_fan_speed_layer = 3
|
||||
filament_notes = "BASF Forward AM Ultrafuse PET\nMaterial profile version 1.0\n\nMaterial Description\nUltrafuse PET is made from a premium PET and prints as easy as PLA, but is much stronger. The filament has a large operating window for printing (temperature vs. speed), so it can be used on every 3D-printer. PET will give you outstanding printing results: a good layer adhesion, a high resolution and it is easy to handle. Ultrafuse PET can be 100% recycled, is watertight and has great colors and finish.\n\nPrinting Recommendations:\nUltrafuse PET can be printed directly onto a clean build plate. For challenging prints, use 3dLac to improve adhesion.\n"
|
||||
filament_notes = "Material Description\nUltrafuse PET is made from a premium PET and prints as easy as PLA, but is much stronger. The filament has a large operating window for printing (temperature vs. speed), so it can be used on every 3D-printer. PET will give you outstanding printing results: a good layer adhesion, a high resolution and it is easy to handle. Ultrafuse PET can be 100% recycled, is watertight and has great colors and finish.\n\nPrinting Recommendations:\nUltrafuse PET can be printed directly onto a clean build plate. For challenging prints, use 3dLac to improve adhesion."
|
||||
filament_retract_length = 2
|
||||
filament_retract_speed = 40
|
||||
filament_retract_before_travel = 2
|
||||
@ -2943,7 +2945,7 @@ filament_cost =
|
||||
filament_density = 1.25
|
||||
filament_spool_weight = 0
|
||||
filament_colour = #FFFFFF
|
||||
filament_notes = "BASF Forward AM Ultrafuse PLA PRO1\nMaterial profile version 1.0\n\nMaterial Description\nPLA PRO1 is an extremely versatile tough PLA filament made for professionals. It reduces your printing time by 30% – 80%, (subject to printer and object limitations) and the strength exceeds overall mechanical properties of printed ABS parts. Printer settings can be tuned to achieve blazing fast speeds or an unrivaled surface finish. The excellent quality control ensures the highest levels of consistency between colors and batches, it will perform as expected, every time.\n\nPrinting Recommendations:\nUltrafuse PLA PRO1 can be printed directly onto a clean build plate.\n"
|
||||
filament_notes = "Material Description\nPLA PRO1 is an extremely versatile tough PLA filament made for professionals. It reduces your printing time by 30% – 80%, (subject to printer and object limitations) and the strength exceeds overall mechanical properties of printed ABS parts. Printer settings can be tuned to achieve blazing fast speeds or an unrivaled surface finish. The excellent quality control ensures the highest levels of consistency between colors and batches, it will perform as expected, every time.\n\nPrinting Recommendations:\nUltrafuse PLA PRO1 can be printed directly onto a clean build plate."
|
||||
filament_retract_length = 2
|
||||
filament_retract_lift = 0
|
||||
filament_retract_speed = 40
|
||||
@ -2969,15 +2971,303 @@ max_fan_speed = 20
|
||||
bed_temperature = 100
|
||||
disable_fan_first_layers = 3
|
||||
filament_colour = #FFFFFF
|
||||
filament_notes = "BASF Forward AM Ultrafuse ABS\nMaterial profile version 1.0\n\nMaterial Description\nABS is the second most used 3D printing material. It is strong, flexible and has a high heat resistance. ABS is a preferred plastic for engineers and professional applications. ABS can be smoothened with acetone. To make a proper 3D print with ABS you will need a heated print bed. The filament is available in 9 colors.\n\nPrinting Recommendations:\n\nApply Tape, adhesion spray or glue to a clean build plate to improve adhesion.\n"
|
||||
filament_retract_length = 2
|
||||
filament_retract_speed = 40
|
||||
filament_notes = "Material Description\nABS is the second most used 3D printing material. It is strong, flexible and has a high heat resistance. ABS is a preferred plastic for engineers and professional applications. ABS can be smoothened with acetone. To make a proper 3D print with ABS you will need a heated print bed. The filament is available in 9 colors.\n\nPrinting Recommendations:\n\nApply Tape, adhesion spray or glue to a clean build plate to improve adhesion."
|
||||
filament_retract_before_travel = 2
|
||||
filament_wipe = 0
|
||||
filament_retract_layer_change = 0
|
||||
|
||||
[filament:Ultrafuse ABS @MINI]
|
||||
inherits = Ultrafuse ABS; *ABSMINI*
|
||||
filament_retract_layer_change = nil
|
||||
|
||||
[filament:Ultrafuse ABS Fusion+]
|
||||
inherits = Ultrafuse ABS
|
||||
filament_density = 1.08
|
||||
first_layer_bed_temperature = 105
|
||||
temperature = 250
|
||||
filament_colour = #FFF8D9
|
||||
filament_notes = "Material Description\nABS Fusion+ made with Polyscope XILOY™ 3D is an engineering filament which has been optimized for 3D-printing. This special grade has been developed in collaboration with Polyscope Polymers - renowned for its material solutions in the automotive industry. ABS is a thermoplastic which is used in many applications. Although ABS has been classified as a standard material in 3D-printing it is known to be quite challenging to process. ABS Fusion+ combines the properties of ABS with an improved processability. The filament is based on an ABS grade which can be directly printed on glass without any adhesives or tape and has a higher success rate of prints due to extreme low warping."
|
||||
filament_retract_before_travel = 2
|
||||
filament_wipe = nil
|
||||
filament_retract_layer_change = 0
|
||||
filament_retract_lift = 0
|
||||
|
||||
[filament:Ultrafuse ABS Fusion+ @MINI]
|
||||
inherits = Ultrafuse ABS Fusion+; *ABSMINI*
|
||||
first_layer_bed_temperature = 100
|
||||
filament_retract_layer_change = nil
|
||||
|
||||
[filament:Ultrafuse ASA]
|
||||
inherits = Ultrafuse ABS Fusion+
|
||||
filament_density = 1.07
|
||||
filament_colour = #FFF4CA
|
||||
first_layer_temperature = 275
|
||||
temperature = 275
|
||||
first_layer_bed_temperature = 110
|
||||
bed_temperature = 105
|
||||
filament_type = ASA
|
||||
min_fan_speed = 25
|
||||
max_fan_speed = 50
|
||||
bridge_fan_speed = 100
|
||||
disable_fan_first_layers = 4
|
||||
filament_max_volumetric_speed = 5
|
||||
filament_notes = "Material Description\nUltrafuse ASA is a high-performance thermoplastic with similar mechanical properties as ABS. ASA offers additional benefits such as high outdoor weather resistance. The UV resistance, toughness, and rigidity make it an ideal material to 3D-print outdoor fixtures and appliances without losing its properties or color. When also taking into account the high heat resistance and high chemical resistance, this filament is a good choice for many types of applications.\n\nPrinting Recommendations:\nApply Magigoo PC, 3D lac or Dimafix to a clean build plate to improve adhesion."
|
||||
|
||||
[filament:Ultrafuse ASA @MINI]
|
||||
inherits = Ultrafuse ASA; *ABSMINI*
|
||||
filament_type = ASA
|
||||
|
||||
[filament:Ultrafuse HIPS]
|
||||
inherits = Ultrafuse ABS
|
||||
temperature = 250
|
||||
filament_density = 1.02
|
||||
filament_type = HIPS
|
||||
min_fan_speed = 20
|
||||
max_fan_speed = 20
|
||||
filament_soluble = 1
|
||||
filament_notes = "Material Description\nUltrafuse HIPS is a high-quality engineering thermoplastic, which is well known in the 3D-printing industry as a support material for ABS. But this material has additional properties to offer like good impact resistance, good dimensional stability, and easy post-processing. HiPS is a great material to use as a support for ABS because there is a good compatibility between the two materials, and HIPS is an easy breakaway support. Now you have the opportunity to create ABS models with complex geometry. HIPS is easy to post process with glue or with sanding paper."
|
||||
|
||||
[filament:Ultrafuse HIPS @MINI]
|
||||
inherits = Ultrafuse HIPS; *ABSMINI*
|
||||
filament_type = HIPS
|
||||
min_fan_speed = 20
|
||||
max_fan_speed = 20
|
||||
|
||||
[filament:Ultrafuse PA]
|
||||
inherits = Fillamentum Nylon FX256
|
||||
filament_vendor = BASF
|
||||
filament_density = 1.12
|
||||
filament_colour = #ECFAFF
|
||||
first_layer_temperature = 240
|
||||
temperature = 240
|
||||
first_layer_bed_temperature = 80
|
||||
bed_temperature = 70
|
||||
min_fan_speed = 0
|
||||
max_fan_speed = 0
|
||||
bridge_fan_speed = 0
|
||||
fan_below_layer_time = 30
|
||||
slowdown_below_layer_time = 20
|
||||
min_print_speed = 15
|
||||
filament_max_volumetric_speed = 11
|
||||
filament_retract_length = 1
|
||||
filament_retract_lift = 0
|
||||
filament_retract_before_travel = 2
|
||||
filament_retract_layer_change = 0
|
||||
filament_cost = 0
|
||||
filament_spool_weight = 0
|
||||
compatible_printers_condition = printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.01{elsif nozzle_diameter[0]==0.6}0.02{else}0.04{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K12{elsif nozzle_diameter[0]==0.8};{else}M900 K20{endif} ; Filament gcode LA 1.0"
|
||||
filament_notes = "Material Description\nThe key features of Ultrafuse PA are the high strength and high modulus. Furthermore, Ultrafuse PA shows a good thermal distortion stability.\n\nPrinting Recommendations:\nApply PVA glue, Kapton tape or PA adhesive to a clean buildplate to improve adhesion."
|
||||
|
||||
[filament:Ultrafuse PA6 GF30]
|
||||
inherits = Ultrafuse PA
|
||||
filament_density = 1.17
|
||||
first_layer_temperature = 270
|
||||
temperature = 270
|
||||
first_layer_bed_temperature = 100
|
||||
bed_temperature = 100
|
||||
filament_colour = #404040
|
||||
fan_always_on = 1
|
||||
min_fan_speed = 0
|
||||
max_fan_speed = 50
|
||||
bridge_fan_speed = 100
|
||||
disable_fan_first_layers = 1
|
||||
full_fan_speed_layer = 3
|
||||
slowdown_below_layer_time = 15
|
||||
filament_max_volumetric_speed = 10
|
||||
filament_retract_length = 1.2
|
||||
filament_retract_speed = 40
|
||||
filament_deretract_speed = 30
|
||||
filament_retract_lift = nil
|
||||
filament_wipe = 0
|
||||
filament_notes = "Material Description\nUltrafuse® PA6 GF30 is a unique compound specifically developed for FFF printing. Due to the glass fiber content of 30%, parts tend to warp less. In addition the excellent layer adhesion and its compatibility with the water soluble support Ultrafuse® BVOH make this material the perfect solution to develop industrial applications on an FFF printer.\n\nWith its high wear and chemical resistance, high stiffness and strength, Ultrafuse® PA6 GF30 is perfect for a wide variety of applications in automotive, electronics or transportation.\n\nUltrafuse PA6 GF30 is designed for functional prototyping and demanding applications such as industrial tooling, transportation, electronics, small appliances, sports & leisure\n\nPrinting Recommendations:\nThis material contains fibers that have an abrasive effect on printer components. Use a hardened or Ruby nozzle with a diameter of 0.6 or larger for optimal performance and avoid damage to the nozzle.\n\nUltrafuse PA6 GF30 can be printed directly onto a clean build plate. For challenging prints, use Magigoo PA gluestick to improve adhesion."
|
||||
compatible_printers_condition = nozzle_diameter[0]>=0.6 and printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Ultrafuse PAHT-CF15]
|
||||
inherits = Ultrafuse PA6 GF30
|
||||
filament_density = 1.23
|
||||
filament_notes = "Material Description\nPAHT CF15 is a high-performance 3D printing filament that opens new application fields in FFF printing. In parallel to its advanced mechanical properties, dimensional stability, and chemical resistance, it has very good processability. It works in any FFF printer with a hardened nozzle. In addition to that, it is compatible with water-soluble support material and HiPS, which allow printing complex geometries that work in challenging environments. PAHT CF15 has high heat resistance up to 130 °C and low moisture absorption.\n\nPrinting Recommendations:\nThis material contains fibers that have an abrasive effect on printer components. Use a hardened or Ruby nozzle with a diameter of 0.6 or larger for optimal performance and avoid damage to the nozzle.\n\nUltrafuse PAHT-CF can be printed directly onto a clean build plate. For challenging prints, use 3dLac to improve adhesion."
|
||||
|
||||
[filament:Ultrafuse PC-ABS-FR]
|
||||
inherits = Ultrafuse ABS
|
||||
filament_colour = #505050
|
||||
filament_density = 1.17
|
||||
first_layer_temperature = 275
|
||||
temperature = 275
|
||||
first_layer_bed_temperature = 110
|
||||
bed_temperature = 105
|
||||
filament_type = PC
|
||||
filament_max_volumetric_speed = 8
|
||||
filament_wipe = nil
|
||||
min_fan_speed = 20
|
||||
max_fan_speed = 20
|
||||
bridge_fan_speed = 30
|
||||
disable_fan_first_layers = 4
|
||||
compatible_printers_condition = printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
filament_notes = "Material Description\nUltrafuse® PC/ABS FR Black is a V-0 flame retardant blend of Polycarbonate and ABS – two of the most used thermoplastics for engineering & electrical applications. The combination of these two materials results in a premium material with a mix of the excellent mechanical properties of PC and the comparably low printing temperature of ABS. Combined with a halogen free flame retardant, parts printed with Ultrafuse® PC/ABS FR Black feature great tensile and impact strength, higher thermal resistance than ABS and can fulfill the requirements of the UL94 V-0 standard.\n\nPrinting Recommendations:\nApply Magigoo PC to a clean build plate to improve adhesion."
|
||||
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.07{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K24{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0"
|
||||
|
||||
[filament:Ultrafuse PET-CF15]
|
||||
inherits = Ultrafuse PET
|
||||
filament_density = 1.36
|
||||
filament_colour = #404040
|
||||
first_layer_temperature = 270
|
||||
temperature = 270
|
||||
first_layer_bed_temperature = 75
|
||||
bed_temperature = 75
|
||||
min_fan_speed = 60
|
||||
max_fan_speed = 100
|
||||
bridge_fan_speed = 100
|
||||
disable_fan_first_layers = 1
|
||||
full_fan_speed_layer = 3
|
||||
slowdown_below_layer_time = 15
|
||||
fan_below_layer_time = 30
|
||||
filament_max_volumetric_speed = 10
|
||||
filament_retract_length = 1.2
|
||||
filament_retract_speed = 40
|
||||
filament_deretract_speed = 30
|
||||
filament_retract_lift = nil
|
||||
filament_wipe = 0
|
||||
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.01{elsif nozzle_diameter[0]==0.6}0.04{else}0.05{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K18{elsif nozzle_diameter[0]==0.8};{else}M900 K30{endif} ; Filament gcode LA 1.0"
|
||||
filament_notes = "Material Description\nPET CF15 is a Carbon Fiber reinforced PET which has precisely tuned material properties, for a wide range of technical applications. The filament is very strong and stiff and has high heat resistance. With its high dimensional stability and low abrasiveness, the filament offers an easy to print experience which allows direct printing on glass or a PEI sheet. It is compatible with HiPS for breakaway support and water soluble support and has an excellent surface finish.\n\nPrinting Recommendations:\nThis material contains fibers that have an abrasive effect on printer components. Use a hardened or Ruby nozzle with a diameter of 0.6 or larger for optimal performance and avoid damage to the nozzle.\n\nUltrafuse PET-CF15 can be printed directly onto a clean build plate. For challenging prints, use 3dLac to improve adhesion."
|
||||
compatible_printers_condition = nozzle_diameter[0]>=0.6 and printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Ultrafuse PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = BASF
|
||||
filament_density = 1.25
|
||||
full_fan_speed_layer = 3
|
||||
filament_notes = "Material Description\nPLA is one of the most used materials for 3D printing. Ultrafuse PLA is available in a wide range of colors. The glossy feel often attracts those who print display models or items for household use. Many appreciate the plant-based origin of this material. When properly cooled, PLA has a high maximum printing speed and sharp printed corners. Combining this with low warping of the print makes it a popular plastic for home printers, hobbyists, prototyping and schools.\n\nPrinting Recommendations:\nUltrafuse PLA can be printed directly onto a clean build plate."
|
||||
|
||||
[filament:Ultrafuse PP]
|
||||
inherits = Ultrafuse ABS
|
||||
filament_density = 0.91
|
||||
filament_colour = #F0F0F0
|
||||
first_layer_temperature = 240
|
||||
temperature = 240
|
||||
first_layer_bed_temperature = 80
|
||||
bed_temperature = 70
|
||||
min_fan_speed = 100
|
||||
max_fan_speed = 100
|
||||
bridge_fan_speed = 100
|
||||
disable_fan_first_layers = 1
|
||||
full_fan_speed_layer = 3
|
||||
fan_below_layer_time = 60
|
||||
slowdown_below_layer_time = 20
|
||||
min_print_speed = 10
|
||||
filament_type = PP
|
||||
filament_max_volumetric_speed = 2.5
|
||||
filament_retract_speed = 25
|
||||
filament_deretract_speed = 25
|
||||
filament_retract_layer_change = 0
|
||||
filament_wipe = nil
|
||||
filament_notes = "Material Description\nUltrafuse PP is high-performance thermoplastic with low density, high elasticity and high resistance to fatigue. The mechanical properties make it an ideal material for 3D-printing applications which have to endure high stress or strain. The filament has high chemical resistance and a high isolation value. PP is one of the most used materials in the world, due to its versatility and ability to engineer lightweight tough parts.\n\nPrinting Recommendations:\nApply PP tape or Magigoo PP adhesive to the buildplate for optimal adhesion."
|
||||
compatible_printers_condition = printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Ultrafuse PP-GF30]
|
||||
inherits = Ultrafuse PP
|
||||
filament_density = 1.07
|
||||
filament_colour = #404040
|
||||
first_layer_temperature = 260
|
||||
temperature = 250
|
||||
first_layer_bed_temperature = 90
|
||||
bed_temperature = 40
|
||||
min_fan_speed = 40
|
||||
max_fan_speed = 75
|
||||
fan_always_on = 1
|
||||
fan_below_layer_time = 30
|
||||
slowdown_below_layer_time = 15
|
||||
min_print_speed = 15
|
||||
filament_retract_length = 1.2
|
||||
filament_retract_speed = 40
|
||||
filament_deretract_speed = 30
|
||||
filament_retract_lift = nil
|
||||
filament_wipe = 0
|
||||
filament_notes = "Ultrafuse PP GF30 is polypropylene, reinforced with 30% glass fiber content. The fibers in this compound are specially designed for 3D-printing filaments and are compatible with a wide range of standard FFF 3D-printers. The extreme stiffness makes this material highly suitable for demanding applications. Other key properties of PPGF30 are high heat resistance and improved UV-resistance. All these excellent properties make this filament highly suitable in an industrial environment.\n\nPrinting Recommendations:\nThis material contains fibers that have an abrasive effect on printer components. Use a hardened or Ruby nozzle with a diameter of 0.6 or larger for optimal performance and avoid damage to the nozzle.\n\nApply PP strapping tape or PPGF adhesive to a clean build plate for optimal adhesion."
|
||||
compatible_printers_condition = nozzle_diameter[0]>=0.6 and printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Ultrafuse TPC-45D]
|
||||
inherits = *FLEX*
|
||||
filament_vendor = BASF
|
||||
extrusion_multiplier = 1
|
||||
filament_density = 1.15
|
||||
filament_colour = #0035EC
|
||||
first_layer_temperature = 235
|
||||
temperature = 235
|
||||
first_layer_bed_temperature = 60
|
||||
bed_temperature = 60
|
||||
min_fan_speed = 10
|
||||
max_fan_speed = 50
|
||||
bridge_fan_speed = 80
|
||||
fan_below_layer_time = 30
|
||||
slowdown_below_layer_time = 15
|
||||
min_print_speed = 15
|
||||
fan_always_on = 1
|
||||
cooling = 1
|
||||
filament_max_volumetric_speed = 1.2
|
||||
filament_retract_length = 1.2
|
||||
filament_retract_speed = 25
|
||||
filament_deretract_speed = 25
|
||||
filament_retract_lift = 0
|
||||
filament_wipe = nil
|
||||
filament_retract_before_wipe = nil
|
||||
filament_retract_before_travel = 2
|
||||
filament_retract_layer_change = 0
|
||||
filament_notes = "Material Description\nTPC 45D is a flexible, shore 45D, rubber-like Thermoplastic Copolyester Elastomer (TPE-C), which is derived from rapeseed oil and combines the best properties of elastomers (rubbers) and polyesters. The material delivers excellent adhesion in the Z-direction, meaning that the printed layers do not detach - even with extreme deformation.\n\nPrinting Recommendations:\nApply Magigoo Flex to a clean build plate to improve adhesion."
|
||||
|
||||
## [filament:Ultrafuse TPS-90A]
|
||||
## inherits = Ultrafuse TPC-45D
|
||||
## filament_density = 1.04
|
||||
## extrusion_multiplier = 1.02
|
||||
## filament_colour = #FFFFFF
|
||||
## first_layer_temperature = 270
|
||||
## temperature = 265
|
||||
## first_layer_bed_temperature = 30
|
||||
## bed_temperature = 30
|
||||
## min_fan_speed = 20
|
||||
## max_fan_speed = 75
|
||||
## filament_notes = "Material Description\nUltrafuse® TPS 90A is an elastomer based on the raw material SEBS. The combination of durable and flexible building blocks leads to a very versatile material. Compared to other flexible 3D printing materials it shows more rubber-like soft touch haptics and better non-slip properties. Furthermore, the material shows a reduced moisture uptake, which allows for printing without pre-drying. Parts printed with Ultrafuse® TPS 90A show almost no visible layers or warpage, which makes it an excellent material choice for end-use parts. Producing multi-material parts is possible by printing it together with ABS.\n\nPrinting Recommendations:\nApply Tape, adhesion spray or glue to a clean build plate to improve adhesion."
|
||||
|
||||
[filament:Ultrafuse TPU-64D]
|
||||
inherits = Ultrafuse TPC-45D
|
||||
filament_density = 1.16
|
||||
first_layer_temperature = 230
|
||||
temperature = 225
|
||||
first_layer_bed_temperature = 40
|
||||
bed_temperature = 40
|
||||
min_fan_speed = 20
|
||||
max_fan_speed = 100
|
||||
filament_notes = "Material Description\nUltrafuse® TPU 64D is the hardest elastomer in BASF Forward AM’s flexible productline. The material shows a relatively high rigidity while maintaining a certain flexibility. This filament is the perfect match for industrial applications requiring rigid parts being resistant to impact, wear and tear. Due to its property profile, the material can be used as an alternative for parts made from ABS and rubbers. Ultrafuse® TPU 64D is easy to print on direct drive and bowden style printers and is compatible with soluble BVOH support to realize the most complex geometries.\n\nPrinting Recommendations:\nUltrafuse TPU can be printed directly onto a clean build plate. A small amount of 3Dlac can make removal easier after printing."
|
||||
|
||||
[filament:Ultrafuse TPU-85A]
|
||||
inherits = Ultrafuse TPU-64D
|
||||
filament_density = 1.11
|
||||
first_layer_temperature = 225
|
||||
temperature = 220
|
||||
filament_notes = "Material Description\nUltrafuse® TPU 85A comes in its natural white color. Chemical properties (e.g. resistance against particular substances) and tolerance for solvents can be made available, if these factors are relevant for a specific application. Generally, these properties correspond to publicly available data on polyether based TPUs. This material is not FDA conform. Good flexibility at low temperature, good wear performance and good damping behavior are the key features of Ultrafuse® TPU 85A.\n\nPrinting Recommendations:\nUltrafuse TPU can be printed directly onto a clean build plate. A small amount of 3Dlac can make removal easier after printing."
|
||||
|
||||
[filament:Ultrafuse TPU-95A]
|
||||
inherits = Ultrafuse TPU-85A
|
||||
filament_density = 1.14
|
||||
first_layer_temperature = 230
|
||||
temperature = 225
|
||||
filament_notes = "Material Description\nUltrafuse® TPU 95A comes with a well-balanced profile of flexibility and durability. On top of that, it allows for easier and faster printing then softer TPU grades. Parts printed with Ultrafuse® TPU 95A show a high elongation, good impact resistance, excellent layer adhesion and a good resistance to oils and common industrially used chemicals. Due to its good printing behavior, Ultrafuse® TPU 95A is a good choice for starting printing flexible materials on both direct drive and bowden style printers.\n\nPrinting Recommendations:\nUltrafuse TPU can be printed directly onto a clean build plate. A small amount of 3Dlac can make removal easier after printing."
|
||||
|
||||
[filament:Ultrafuse rPET]
|
||||
inherits = Ultrafuse PET
|
||||
filament_density = 1.27
|
||||
filament_colour = #9DC5FF
|
||||
first_layer_temperature = 235
|
||||
temperature = 235
|
||||
first_layer_bed_temperature = 80
|
||||
bed_temperature = 75
|
||||
min_fan_speed = 50
|
||||
max_fan_speed = 100
|
||||
fan_below_layer_time = 15
|
||||
filament_notes = "Material Description\nPET is mainly known by the well-known PET bottle material. This recycled has a natural transparent blueish look. It has excellent 3D printing properties and good mechanical characteristics."
|
||||
filament_retract_length = 1.2
|
||||
filament_retract_lift = 0.6
|
||||
filament_wipe = nil
|
||||
|
||||
[filament:Ultrafuse Metal]
|
||||
inherits = *ABSC*
|
||||
@ -4629,7 +4919,7 @@ material_colour = #FF8040
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 12
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_type = Casting
|
||||
material_vendor = 3DM
|
||||
material_colour = #B0B000
|
||||
|
||||
@ -5084,6 +5374,38 @@ material_type = Tough
|
||||
material_vendor = Ameralabs
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:PrimaCreator Tough Light Grey @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:PrimaCreator Tough Clear @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:PrimaCreator Tough White @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:PrimaCreator Flex Clear @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 4.5
|
||||
initial_exposure_time = 30
|
||||
material_type = Flexible
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Siraya Tech Simple Clear @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 8
|
||||
@ -5371,7 +5693,7 @@ inherits = *common 0.05*
|
||||
exposure_time = 12
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_vendor = 3DM
|
||||
material_colour = #EC0000
|
||||
|
||||
[sla_material:Esun Bio-Photopolymer Resin White @0.05]
|
||||
@ -5550,6 +5872,38 @@ material_type = Tough
|
||||
material_vendor = Photocentric
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:PrimaCreator Tough Light Grey @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 8.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:PrimaCreator Tough Clear @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:PrimaCreator Tough White @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:PrimaCreator Flex Clear @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6.5
|
||||
initial_exposure_time = 30
|
||||
material_type = Flexible
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Siraya Tech Simple Clear @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 10
|
||||
@ -6270,6 +6624,38 @@ material_type = Tough
|
||||
material_vendor = Made for Prusa
|
||||
material_colour = #FF8040
|
||||
|
||||
[sla_material:PrimaCreator Tough Light Grey @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 14
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:PrimaCreator Tough Clear @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:PrimaCreator Tough White @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:PrimaCreator Flex Clear @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 12
|
||||
initial_exposure_time = 35
|
||||
material_type = Flexible
|
||||
material_vendor = PrimaCreator
|
||||
material_colour = #F8F8F8
|
||||
|
||||
## SL1S materials ##
|
||||
|
||||
## 0.025 SL1S
|
||||
@ -6916,6 +7302,310 @@ material_type = Tough
|
||||
material_vendor = Peopoly
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:3DM-ABS @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.6
|
||||
initial_exposure_time = 25
|
||||
material_type = Tough
|
||||
material_vendor = 3DM
|
||||
material_colour = #FF8040
|
||||
|
||||
[sla_material:3DM-DENT @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.3
|
||||
initial_exposure_time = 36
|
||||
material_type = Dental
|
||||
material_vendor = 3DM
|
||||
material_colour = #FFEEE6
|
||||
|
||||
[sla_material:3DM-HR Green @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = 3DM
|
||||
material_colour = #00B900
|
||||
|
||||
[sla_material:3DM-HR Red Wine @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 32
|
||||
material_type = Tough
|
||||
material_vendor = 3DM
|
||||
material_colour = #EC0000
|
||||
|
||||
[sla_material:3DM-Vulcan Gold @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 24
|
||||
material_type = Casting
|
||||
material_vendor = 3DM
|
||||
material_colour = #B0B000
|
||||
|
||||
[sla_material:3DM-XPRO White @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = 3DM
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:Asiga Denta Model @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 24
|
||||
material_type = Dental
|
||||
material_vendor = Asiga
|
||||
material_colour = #FFEEE6
|
||||
|
||||
[sla_material:Asiga PlasGRAY @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 9.7
|
||||
initial_exposure_time = 48
|
||||
material_type = Tough
|
||||
material_vendor = Asiga
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:BlueCast EcoGray @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = BlueCast
|
||||
material_colour = #808080
|
||||
|
||||
[sla_material:BlueCast Phrozen Wax @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5.3
|
||||
initial_exposure_time = 40
|
||||
material_type = Tough
|
||||
material_vendor = BlueCast
|
||||
material_colour = #007EFD
|
||||
|
||||
[sla_material:NextDent Model 2.0 Grey @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 4
|
||||
initial_exposure_time = 28
|
||||
material_type = Dental
|
||||
material_vendor = NextDent
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:NextDent Cast Purple @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3
|
||||
initial_exposure_time = 16
|
||||
material_type = Casting
|
||||
material_vendor = NextDent
|
||||
material_colour = #E800E8
|
||||
|
||||
[sla_material:Siraya Tech Tenacious @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.7
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Siraya Tech Blu Clear V2 @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Siraya Tech Blu Blue @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 4
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #007EFD
|
||||
|
||||
[sla_material:Siraya Tech Fast Black @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #595959
|
||||
|
||||
[sla_material:Siraya Tech Fast Grey @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:Siraya Tech Simple Clear @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Siraya Tech Sculpt @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.7
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Siraya Tech
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:Harz Labs Model Resin Cherry @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 4.3
|
||||
initial_exposure_time = 16
|
||||
material_type = Tough
|
||||
material_vendor = Harz Labs
|
||||
material_colour = #EC0000
|
||||
|
||||
[sla_material:Harz Labs Model Resin Black @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 4.3
|
||||
initial_exposure_time = 16
|
||||
material_type = Tough
|
||||
material_vendor = Harz Labs
|
||||
material_colour = #595959
|
||||
|
||||
[sla_material:Harz Labs Basic Resin Red @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 4.3
|
||||
initial_exposure_time = 16
|
||||
material_type = Tough
|
||||
material_vendor = Harz Labs
|
||||
material_colour = #EC0000
|
||||
|
||||
[sla_material:Resinworks 3D Violet @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5.7
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Resinworks 3D
|
||||
material_colour = #E800E8
|
||||
|
||||
[sla_material:FunToDo Industrial Blend Unpigmented @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 1.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = FunToDo
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:FunToDo Snow White @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = FunToDo
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:FunToDo Ash Grey @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3
|
||||
initial_exposure_time = 32
|
||||
material_type = Tough
|
||||
material_vendor = FunToDo
|
||||
material_colour = #808080
|
||||
|
||||
[sla_material:Ameralabs AMD 3 LED @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 1.7
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Ameralabs
|
||||
material_colour = #808080
|
||||
|
||||
[sla_material:Dragon Resin Metalshine Metal Grey @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 10
|
||||
initial_exposure_time = 40
|
||||
material_type = Tough
|
||||
material_vendor = Dragon Resin
|
||||
material_colour = #808080
|
||||
|
||||
[sla_material:Dragon Resin Metalshine Dark Brass @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 10
|
||||
initial_exposure_time = 40
|
||||
material_type = Tough
|
||||
material_vendor = Dragon Resin
|
||||
material_colour = #B0B000
|
||||
|
||||
[sla_material:Dragon Resin Metalshine Brass @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 10
|
||||
initial_exposure_time = 40
|
||||
material_type = Tough
|
||||
material_vendor = Dragon Resin
|
||||
material_colour = #B0B000
|
||||
|
||||
[sla_material:Esun Bio-Photopolymer Resin White @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.7
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Esun
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:Esun Standard Resin Black @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.3
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Esun
|
||||
material_colour = #595959
|
||||
|
||||
[sla_material:Monocure 3D Black Rapid Resin @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_colour = #595959
|
||||
|
||||
[sla_material:Monocure 3D Blue Rapid Resin @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_colour = #007EFD
|
||||
|
||||
[sla_material:Monocure 3D Clear Rapid Resin @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 2.7
|
||||
initial_exposure_time = 32
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_colour = #F8F8F8
|
||||
|
||||
[sla_material:Monocure 3D Grey Rapid Resin @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 25
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_colour = #C0C0C0
|
||||
|
||||
[sla_material:Monocure 3D White Rapid Resin @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 3.3
|
||||
initial_exposure_time = 28
|
||||
material_type = Tough
|
||||
material_vendor = Monocure
|
||||
material_colour = #FFFFFF
|
||||
|
||||
[sla_material:Photocentric Hard Grey @0.05 SL1S]
|
||||
inherits = *0.05_sl1s*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 24
|
||||
material_type = Tough
|
||||
material_vendor = Photocentric
|
||||
material_colour = #808080
|
||||
|
||||
## 0.1 SL1S
|
||||
|
||||
## Prusa Polymers 0.1
|
||||
|
@ -1,2 +1,4 @@
|
||||
min_slic3r_version = 2.4.0-beta0
|
||||
1.0.2 Fixed start g-code.
|
||||
1.0.1 Updated start g-code.
|
||||
1.0.0 Initial version
|
||||
|
@ -9,7 +9,7 @@ name = Ultimaker
|
||||
|
||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||
config_version = 1.0.0
|
||||
config_version = 1.0.2
|
||||
|
||||
# Where to get the updates from?
|
||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Ultimaker/
|
||||
@ -396,5 +396,5 @@ printer_notes = Dont remove the following keywords! These keywords are used in t
|
||||
nozzle_diameter = 0.4
|
||||
default_print_profile = 0.20mm NORMAL @ULTIMAKER2
|
||||
default_filament_profile = Generic PLA @ULTIMAKER2
|
||||
start_gcode = ; Printer_Settings_ID: [printer_settings_id]\n\n; # # # # # # START Header\nG21 ; metric values\nG90 ; absolute positioning\nM82 ; set extruder to absolute mode\nM107 ; start with the fan off\n\nG28 X0 Y0 Z0 ; move X/Y/Z to endstops\nG1 X1 Y6 F15000 ; move X/Y to start position\nG1 Z35 F9000 ; move Z to start position\n\n; Heat up bed and nozzle\nM190 S{first_layer_bed_temperature[0] - 5} ; wait for bed temperature - 5\nM140 S[first_layer_bed_temperature] ; continue bed heating\nM109 S[first_layer_temperature] ; wait for nozzle temperature\n\nG92 E0 ; zero the extruded length\nG1 F150 E22 ; purge nozzle with filament\nG92 E0 ; zero the extruded length again\nG1 F75 E7 ; additional priming\nG92 E0 ; zero the extruded length again\n\n; # # # # # # END Header
|
||||
start_gcode = ; Printer_Settings_ID: [printer_settings_id]\n\n; # # # # # # START Header\nG21 ; metric values\nG90 ; absolute positioning\nM82 ; set extruder to absolute mode\nM107 ; start with the fan off\n\nM140 S[first_layer_bed_temperature] ; start bed heating\n\nG28 X0 Y0 Z0 ; move X/Y/Z to endstops\nG1 X1 Y6 F15000 ; move X/Y to start position\nG1 Z35 F9000 ; move Z to start position\n\n; Wait for bed and nozzle temperatures\nM190 S{first_layer_bed_temperature[0] - 5} ; wait for bed temperature - 5\nM140 S[first_layer_bed_temperature] ; continue bed heating\nM109 S[first_layer_temperature] ; wait for nozzle temperature\n\n; Purge and prime\nM83 ; set extruder to relative mode\nG92 E0 ; reset extrusion distance\nG0 X0 Y1 F10000\nG1 F150 E20 ; compress the bowden tube\nG1 E-8 F1200\nG0 X30 Y1 F5000 \nG0 F1200 Z{first_layer_height/2} ; Cut the connection to priming blob\nG0 X100 F10000 ; disconnect with the prime blob\nG0 X50 ; Avoid the metal clip holding the Ultimaker glass plate\nG0 Z0.2 F720\nG1 E8 F1200\nG1 X80 E3 F1000 ; intro line 1\nG1 X110 E4 F1000 ; intro line 2\nG1 X140 F600 ; drag filament to decompress bowden tube\nG1 X100 F3200 ; wipe backwards a bit\nG1 X150 F3200 ; back to where there is no plastic: avoid dragging\nG92 E0 ; reset extruder reference\nM82 ; set extruder to absolute mode\n\n; # # # # # # END Header
|
||||
end_gcode = ; # # # # # # START Footer\nG91 ; relative coordinates\n;G1 E-1 F1200 ; retract the filament\nG1 Z+15 X-10 Y-10 E-7 F6000 ; move Z a bit\n; G1 X-10 Y-10 F6000 ; move XY a bit\nG1 E-5.5 F300 ; retract the filament\nG28 X0 Y0 ; move X/Y to min endstops, so the head is out of the way\nM104 S0 ; extruder heater off\nM140 S0 ; heated bed heater off (if you have it)\nM84 ; disable motors\n; # # # # # # END Footer\n
|
||||
|
11
resources/shaders/110/background.fs
Normal file
11
resources/shaders/110/background.fs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 110
|
||||
|
||||
uniform vec4 top_color;
|
||||
uniform vec4 bottom_color;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = mix(bottom_color, top_color, tex_coord.y);
|
||||
}
|
12
resources/shaders/110/background.vs
Normal file
12
resources/shaders/110/background.vs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 110
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = vec4(v_position, 1.0);
|
||||
}
|
11
resources/shaders/110/flat.vs
Normal file
11
resources/shaders/110/flat.vs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
10
resources/shaders/110/flat_texture.fs
Normal file
10
resources/shaders/110/flat_texture.fs
Normal file
@ -0,0 +1,10 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D uniform_texture;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(uniform_texture, tex_coord);
|
||||
}
|
15
resources/shaders/110/flat_texture.vs
Normal file
15
resources/shaders/110/flat_texture.vs
Normal file
@ -0,0 +1,15 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
86
resources/shaders/110/gouraud.fs
Normal file
86
resources/shaders/110/gouraud.fs
Normal file
@ -0,0 +1,86 @@
|
||||
#version 110
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
struct PrintVolumeDetection
|
||||
{
|
||||
// 0 = rectangle, 1 = circle, 2 = custom, 3 = invalid
|
||||
int type;
|
||||
// type = 0 (rectangle):
|
||||
// x = min.x, y = min.y, z = max.x, w = max.y
|
||||
// type = 1 (circle):
|
||||
// x = center.x, y = center.y, z = radius
|
||||
vec4 xy_data;
|
||||
// x = min z, y = max z
|
||||
vec2 z_data;
|
||||
};
|
||||
|
||||
struct SlopeDetection
|
||||
{
|
||||
bool actived;
|
||||
float normal_z;
|
||||
mat3 volume_world_normal_matrix;
|
||||
};
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform SlopeDetection slope;
|
||||
|
||||
uniform bool offset_depth_buffer;
|
||||
|
||||
#ifdef ENABLE_ENVIRONMENT_MAP
|
||||
uniform sampler2D environment_tex;
|
||||
uniform bool use_environment_tex;
|
||||
#endif // ENABLE_ENVIRONMENT_MAP
|
||||
|
||||
uniform PrintVolumeDetection print_volume;
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
varying vec4 world_pos;
|
||||
varying float world_normal_z;
|
||||
varying vec3 eye_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (any(lessThan(clipping_planes_dots, ZERO)))
|
||||
discard;
|
||||
vec3 color = uniform_color.rgb;
|
||||
float alpha = uniform_color.a;
|
||||
|
||||
if (slope.actived && world_normal_z < slope.normal_z - EPSILON) {
|
||||
color = vec3(0.7, 0.7, 1.0);
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
// if the fragment is outside the print volume -> use darker color
|
||||
vec3 pv_check_min = ZERO;
|
||||
vec3 pv_check_max = ZERO;
|
||||
if (print_volume.type == 0) {
|
||||
// rectangle
|
||||
pv_check_min = world_pos.xyz - vec3(print_volume.xy_data.x, print_volume.xy_data.y, print_volume.z_data.x);
|
||||
pv_check_max = world_pos.xyz - vec3(print_volume.xy_data.z, print_volume.xy_data.w, print_volume.z_data.y);
|
||||
}
|
||||
else if (print_volume.type == 1) {
|
||||
// circle
|
||||
float delta_radius = print_volume.xy_data.z - distance(world_pos.xy, print_volume.xy_data.xy);
|
||||
pv_check_min = vec3(delta_radius, 0.0, world_pos.z - print_volume.z_data.x);
|
||||
pv_check_max = vec3(0.0, 0.0, world_pos.z - print_volume.z_data.y);
|
||||
}
|
||||
color = (any(lessThan(pv_check_min, ZERO)) || any(greaterThan(pv_check_max, ZERO))) ? mix(color, ZERO, 0.3333) : color;
|
||||
|
||||
#ifdef ENABLE_ENVIRONMENT_MAP
|
||||
if (use_environment_tex)
|
||||
gl_FragColor = vec4(0.45 * texture2D(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color * intensity.x, alpha);
|
||||
else
|
||||
#endif
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
|
||||
|
||||
// In the support painting gizmo and the seam painting gizmo are painted triangles rendered over the already
|
||||
// rendered object. To resolved z-fighting between previously rendered object and painted triangles, values
|
||||
// inside the depth buffer are offset by small epsilon for painted triangles inside those gizmos.
|
||||
gl_FragDepth = gl_FragCoord.z - (offset_depth_buffer ? EPSILON : 0.0);
|
||||
}
|
77
resources/shaders/110/gouraud.vs
Normal file
77
resources/shaders/110/gouraud.vs
Normal file
@ -0,0 +1,77 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SHININESS 5.0
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
struct SlopeDetection
|
||||
{
|
||||
bool actived;
|
||||
float normal_z;
|
||||
mat3 volume_world_normal_matrix;
|
||||
};
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 volume_world_matrix;
|
||||
uniform SlopeDetection slope;
|
||||
|
||||
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
|
||||
uniform vec2 z_range;
|
||||
// Clipping plane - general orientation. Used by the SLA gizmo.
|
||||
uniform vec4 clipping_plane;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal;
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
|
||||
varying vec4 world_pos;
|
||||
varying float world_normal_z;
|
||||
varying vec3 eye_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
eye_normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
// Point in homogenous coordinates.
|
||||
world_pos = volume_world_matrix * vec4(v_position, 1.0);
|
||||
|
||||
// z component of normal vector in world coordinate used for slope shading
|
||||
world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
|
||||
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
|
||||
}
|
12
resources/shaders/110/gouraud_light.fs
Normal file
12
resources/shaders/110/gouraud_light.fs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 110
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform float emission_factor;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
|
||||
}
|
45
resources/shaders/110/gouraud_light.vs
Normal file
45
resources/shaders/110/gouraud_light.vs
Normal file
@ -0,0 +1,45 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
12
resources/shaders/110/gouraud_light_instanced.fs
Normal file
12
resources/shaders/110/gouraud_light_instanced.fs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 110
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform float emission_factor;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
|
||||
}
|
50
resources/shaders/110/gouraud_light_instanced.vs
Normal file
50
resources/shaders/110/gouraud_light_instanced.vs
Normal file
@ -0,0 +1,50 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
// vertex attributes
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal;
|
||||
// instance attributes
|
||||
attribute vec3 i_offset;
|
||||
attribute vec2 i_scales;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 eye_normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 world_position = vec4(v_position * vec3(vec2(1.5 * i_scales.x), 1.5 * i_scales.y) + i_offset - vec3(0.0, 0.0, 0.5 * i_scales.y), 1.0);
|
||||
vec4 eye_position = view_model_matrix * world_position;
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(eye_position.xyz), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_Position = projection_matrix * eye_position;
|
||||
}
|
11
resources/shaders/110/imgui.fs
Normal file
11
resources/shaders/110/imgui.fs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
varying vec2 Frag_UV;
|
||||
varying vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);
|
||||
}
|
17
resources/shaders/110/imgui.vs
Normal file
17
resources/shaders/110/imgui.vs
Normal file
@ -0,0 +1,17 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 ProjMtx;
|
||||
|
||||
attribute vec2 Position;
|
||||
attribute vec2 UV;
|
||||
attribute vec4 Color;
|
||||
|
||||
varying vec2 Frag_UV;
|
||||
varying vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
Frag_UV = UV;
|
||||
Frag_Color = Color;
|
||||
gl_Position = ProjMtx * vec4(Position.xy, 0.0, 1.0);
|
||||
}
|
13
resources/shaders/110/mm_contour.fs
Normal file
13
resources/shaders/110/mm_contour.fs
Normal file
@ -0,0 +1,13 @@
|
||||
#version 110
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = uniform_color;
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
11
resources/shaders/110/mm_contour.vs
Normal file
11
resources/shaders/110/mm_contour.vs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
63
resources/shaders/110/mm_gouraud.fs
Normal file
63
resources/shaders/110/mm_gouraud.fs
Normal file
@ -0,0 +1,63 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
uniform bool volume_mirrored;
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
varying vec4 model_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (any(lessThan(clipping_planes_dots, ZERO)))
|
||||
discard;
|
||||
vec3 color = uniform_color.rgb;
|
||||
float alpha = uniform_color.a;
|
||||
|
||||
vec3 triangle_normal = normalize(cross(dFdx(model_pos.xyz), dFdy(model_pos.xyz)));
|
||||
#ifdef FLIP_TRIANGLE_NORMALS
|
||||
triangle_normal = -triangle_normal;
|
||||
#endif
|
||||
|
||||
if (volume_mirrored)
|
||||
triangle_normal = -triangle_normal;
|
||||
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 eye_normal = normalize(normal_matrix * triangle_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
vec2 intensity = vec2(0.0);
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec3 position = (view_model_matrix * model_pos).xyz;
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
|
||||
}
|
28
resources/shaders/110/mm_gouraud.vs
Normal file
28
resources/shaders/110/mm_gouraud.vs
Normal file
@ -0,0 +1,28 @@
|
||||
#version 110
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
uniform mat4 volume_world_matrix;
|
||||
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
|
||||
uniform vec2 z_range;
|
||||
// Clipping plane - general orientation. Used by the SLA gizmo.
|
||||
uniform vec4 clipping_plane;
|
||||
|
||||
attribute vec3 v_position;
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
varying vec4 model_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
model_pos = vec4(v_position, 1.0);
|
||||
// Point in homogenous coordinates.
|
||||
vec4 world_pos = volume_world_matrix * model_pos;
|
||||
|
||||
gl_Position = projection_matrix * view_model_matrix * model_pos;
|
||||
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
|
||||
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
|
||||
}
|
34
resources/shaders/110/printbed.fs
Normal file
34
resources/shaders/110/printbed.fs
Normal file
@ -0,0 +1,34 @@
|
||||
#version 110
|
||||
|
||||
const vec3 back_color_dark = vec3(0.235, 0.235, 0.235);
|
||||
const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
|
||||
|
||||
uniform sampler2D texture;
|
||||
uniform bool transparent_background;
|
||||
uniform bool svg_source;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
vec4 svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 fore_color = texture2D(texture, tex_coord);
|
||||
|
||||
// calculates radial gradient
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
|
||||
|
||||
// blends foreground with background
|
||||
return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
|
||||
}
|
||||
|
||||
vec4 non_svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 color = texture2D(texture, tex_coord);
|
||||
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = svg_source ? svg_color() : non_svg_color();
|
||||
}
|
15
resources/shaders/110/printbed.vs
Normal file
15
resources/shaders/110/printbed.vs
Normal file
@ -0,0 +1,15 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
19
resources/shaders/110/toolpaths_cog.fs
Normal file
19
resources/shaders/110/toolpaths_cog.fs
Normal file
@ -0,0 +1,19 @@
|
||||
#version 110
|
||||
|
||||
const vec4 BLACK = vec4(vec3(0.1), 1.0);
|
||||
const vec4 WHITE = vec4(vec3(1.0), 1.0);
|
||||
|
||||
const float emission_factor = 0.25;
|
||||
|
||||
uniform vec3 world_center;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
varying vec3 world_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 delta = world_position - world_center;
|
||||
vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
|
||||
}
|
47
resources/shaders/110/toolpaths_cog.vs
Normal file
47
resources/shaders/110/toolpaths_cog.vs
Normal file
@ -0,0 +1,47 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
varying vec3 world_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
world_position = v_position;
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
41
resources/shaders/110/variable_layer_height.fs
Normal file
41
resources/shaders/110/variable_layer_height.fs
Normal file
@ -0,0 +1,41 @@
|
||||
#version 110
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
// 2D texture (1D texture split by the rows) of color along the object Z axis.
|
||||
uniform sampler2D z_texture;
|
||||
// Scaling from the Z texture rows coordinate to the normalized texture row coordinate.
|
||||
uniform float z_to_texture_row;
|
||||
uniform float z_texture_row_to_normalized;
|
||||
uniform float z_cursor;
|
||||
uniform float z_cursor_band_width;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
varying float object_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
float object_z_row = z_to_texture_row * object_z;
|
||||
// Index of the row in the texture.
|
||||
float z_texture_row = floor(object_z_row);
|
||||
// Normalized coordinate from 0. to 1.
|
||||
float z_texture_col = object_z_row - z_texture_row;
|
||||
float z_blend = 0.25 * cos(min(M_PI, abs(M_PI * (object_z - z_cursor) * 1.8 / z_cursor_band_width))) + 0.25;
|
||||
// Calculate level of detail from the object Z coordinate.
|
||||
// This makes the slowly sloping surfaces to be shown with high detail (with stripes),
|
||||
// and the vertical surfaces to be shown with low detail (no stripes)
|
||||
float z_in_cells = object_z_row * 190.;
|
||||
// Gradient of Z projected on the screen.
|
||||
float dx_vtc = dFdx(z_in_cells);
|
||||
float dy_vtc = dFdy(z_in_cells);
|
||||
float lod = clamp(0.5 * log2(max(dx_vtc * dx_vtc, dy_vtc * dy_vtc)), 0., 1.);
|
||||
// Sample the Z texture. Texture coordinates are normalized to <0, 1>.
|
||||
vec4 color = vec4(0.25, 0.25, 0.25, 1.0);
|
||||
if (z_texture_row >= 0.0)
|
||||
color = mix(texture2D(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row + 0.5 )), -10000.),
|
||||
texture2D(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row * 2. + 1.)), 10000.), lod);
|
||||
// Mix the final color.
|
||||
gl_FragColor = vec4(vec3(intensity.y), 1.0) + intensity.x * mix(color, vec4(1.0, 1.0, 0.0, 1.0), z_blend);
|
||||
}
|
60
resources/shaders/110/variable_layer_height.vs
Normal file
60
resources/shaders/110/variable_layer_height.vs
Normal file
@ -0,0 +1,60 @@
|
||||
#version 110
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SHININESS 5.0
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 volume_world_matrix;
|
||||
uniform float object_max_z;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
varying vec2 intensity;
|
||||
|
||||
varying float object_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
// =====================================================
|
||||
// NOTE:
|
||||
// when object_max_z > 0.0 we are rendering the overlay
|
||||
// when object_max_z == 0.0 we are rendering the volumes
|
||||
// =====================================================
|
||||
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = (object_max_z > 0.0) ? vec3(0.0, 0.0, 1.0) : normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular)
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
// Scaled to widths of the Z texture.
|
||||
object_z = (object_max_z > 0.0) ? object_max_z * v_tex_coord.y : (volume_world_matrix * vec4(v_position, 1.0)).z;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
11
resources/shaders/140/background.fs
Normal file
11
resources/shaders/140/background.fs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 140
|
||||
|
||||
uniform vec4 top_color;
|
||||
uniform vec4 bottom_color;
|
||||
|
||||
in vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = mix(bottom_color, top_color, tex_coord.y);
|
||||
}
|
12
resources/shaders/140/background.vs
Normal file
12
resources/shaders/140/background.vs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 140
|
||||
|
||||
in vec3 v_position;
|
||||
in vec2 v_tex_coord;
|
||||
|
||||
out vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = vec4(v_position, 1.0);
|
||||
}
|
8
resources/shaders/140/flat.fs
Normal file
8
resources/shaders/140/flat.fs
Normal file
@ -0,0 +1,8 @@
|
||||
#version 140
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = uniform_color;
|
||||
}
|
11
resources/shaders/140/flat.vs
Normal file
11
resources/shaders/140/flat.vs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
10
resources/shaders/140/flat_texture.fs
Normal file
10
resources/shaders/140/flat_texture.fs
Normal file
@ -0,0 +1,10 @@
|
||||
#version 140
|
||||
|
||||
uniform sampler2D uniform_texture;
|
||||
|
||||
in vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture(uniform_texture, tex_coord);
|
||||
}
|
15
resources/shaders/140/flat_texture.vs
Normal file
15
resources/shaders/140/flat_texture.vs
Normal file
@ -0,0 +1,15 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec2 v_tex_coord;
|
||||
|
||||
out vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
86
resources/shaders/140/gouraud.fs
Normal file
86
resources/shaders/140/gouraud.fs
Normal file
@ -0,0 +1,86 @@
|
||||
#version 140
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
struct PrintVolumeDetection
|
||||
{
|
||||
// 0 = rectangle, 1 = circle, 2 = custom, 3 = invalid
|
||||
int type;
|
||||
// type = 0 (rectangle):
|
||||
// x = min.x, y = min.y, z = max.x, w = max.y
|
||||
// type = 1 (circle):
|
||||
// x = center.x, y = center.y, z = radius
|
||||
vec4 xy_data;
|
||||
// x = min z, y = max z
|
||||
vec2 z_data;
|
||||
};
|
||||
|
||||
struct SlopeDetection
|
||||
{
|
||||
bool actived;
|
||||
float normal_z;
|
||||
mat3 volume_world_normal_matrix;
|
||||
};
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform SlopeDetection slope;
|
||||
|
||||
uniform bool offset_depth_buffer;
|
||||
|
||||
#ifdef ENABLE_ENVIRONMENT_MAP
|
||||
uniform sampler2D environment_tex;
|
||||
uniform bool use_environment_tex;
|
||||
#endif // ENABLE_ENVIRONMENT_MAP
|
||||
|
||||
uniform PrintVolumeDetection print_volume;
|
||||
|
||||
in vec3 clipping_planes_dots;
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
in vec2 intensity;
|
||||
|
||||
in vec4 world_pos;
|
||||
in float world_normal_z;
|
||||
in vec3 eye_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (any(lessThan(clipping_planes_dots, ZERO)))
|
||||
discard;
|
||||
vec3 color = uniform_color.rgb;
|
||||
float alpha = uniform_color.a;
|
||||
|
||||
if (slope.actived && world_normal_z < slope.normal_z - EPSILON) {
|
||||
color = vec3(0.7, 0.7, 1.0);
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
// if the fragment is outside the print volume -> use darker color
|
||||
vec3 pv_check_min = ZERO;
|
||||
vec3 pv_check_max = ZERO;
|
||||
if (print_volume.type == 0) {
|
||||
// rectangle
|
||||
pv_check_min = world_pos.xyz - vec3(print_volume.xy_data.x, print_volume.xy_data.y, print_volume.z_data.x);
|
||||
pv_check_max = world_pos.xyz - vec3(print_volume.xy_data.z, print_volume.xy_data.w, print_volume.z_data.y);
|
||||
}
|
||||
else if (print_volume.type == 1) {
|
||||
// circle
|
||||
float delta_radius = print_volume.xy_data.z - distance(world_pos.xy, print_volume.xy_data.xy);
|
||||
pv_check_min = vec3(delta_radius, 0.0, world_pos.z - print_volume.z_data.x);
|
||||
pv_check_max = vec3(0.0, 0.0, world_pos.z - print_volume.z_data.y);
|
||||
}
|
||||
color = (any(lessThan(pv_check_min, ZERO)) || any(greaterThan(pv_check_max, ZERO))) ? mix(color, ZERO, 0.3333) : color;
|
||||
|
||||
#ifdef ENABLE_ENVIRONMENT_MAP
|
||||
if (use_environment_tex)
|
||||
gl_FragColor = vec4(0.45 * texture(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color * intensity.x, alpha);
|
||||
else
|
||||
#endif
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
|
||||
|
||||
// In the support painting gizmo and the seam painting gizmo are painted triangles rendered over the already
|
||||
// rendered object. To resolved z-fighting between previously rendered object and painted triangles, values
|
||||
// inside the depth buffer are offset by small epsilon for painted triangles inside those gizmos.
|
||||
gl_FragDepth = gl_FragCoord.z - (offset_depth_buffer ? EPSILON : 0.0);
|
||||
}
|
77
resources/shaders/140/gouraud.vs
Normal file
77
resources/shaders/140/gouraud.vs
Normal file
@ -0,0 +1,77 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SHININESS 5.0
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
struct SlopeDetection
|
||||
{
|
||||
bool actived;
|
||||
float normal_z;
|
||||
mat3 volume_world_normal_matrix;
|
||||
};
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 volume_world_matrix;
|
||||
uniform SlopeDetection slope;
|
||||
|
||||
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
|
||||
uniform vec2 z_range;
|
||||
// Clipping plane - general orientation. Used by the SLA gizmo.
|
||||
uniform vec4 clipping_plane;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec3 v_normal;
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
out vec2 intensity;
|
||||
|
||||
out vec3 clipping_planes_dots;
|
||||
|
||||
out vec4 world_pos;
|
||||
out float world_normal_z;
|
||||
out vec3 eye_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
eye_normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
// Point in homogenous coordinates.
|
||||
world_pos = volume_world_matrix * vec4(v_position, 1.0);
|
||||
|
||||
// z component of normal vector in world coordinate used for slope shading
|
||||
world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
|
||||
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
|
||||
}
|
12
resources/shaders/140/gouraud_light.fs
Normal file
12
resources/shaders/140/gouraud_light.fs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 140
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform float emission_factor;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
in vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
|
||||
}
|
45
resources/shaders/140/gouraud_light.vs
Normal file
45
resources/shaders/140/gouraud_light.vs
Normal file
@ -0,0 +1,45 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec3 v_normal;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
out vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
12
resources/shaders/140/gouraud_light_instanced.fs
Normal file
12
resources/shaders/140/gouraud_light_instanced.fs
Normal file
@ -0,0 +1,12 @@
|
||||
#version 140
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform float emission_factor;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
in vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
|
||||
}
|
50
resources/shaders/140/gouraud_light_instanced.vs
Normal file
50
resources/shaders/140/gouraud_light_instanced.vs
Normal file
@ -0,0 +1,50 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
// vertex attributes
|
||||
in vec3 v_position;
|
||||
in vec3 v_normal;
|
||||
// instance attributes
|
||||
in vec3 i_offset;
|
||||
in vec2 i_scales;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
out vec2 intensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 eye_normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 world_position = vec4(v_position * vec3(vec2(1.5 * i_scales.x), 1.5 * i_scales.y) + i_offset - vec3(0.0, 0.0, 0.5 * i_scales.y), 1.0);
|
||||
vec4 eye_position = view_model_matrix * world_position;
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(eye_position.xyz), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_Position = projection_matrix * eye_position;
|
||||
}
|
11
resources/shaders/140/imgui.fs
Normal file
11
resources/shaders/140/imgui.fs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 140
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
in vec2 Frag_UV;
|
||||
in vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = Frag_Color * texture(Texture, Frag_UV.st);
|
||||
}
|
17
resources/shaders/140/imgui.vs
Normal file
17
resources/shaders/140/imgui.vs
Normal file
@ -0,0 +1,17 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 ProjMtx;
|
||||
|
||||
in vec2 Position;
|
||||
in vec2 UV;
|
||||
in vec4 Color;
|
||||
|
||||
out vec2 Frag_UV;
|
||||
out vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
Frag_UV = UV;
|
||||
Frag_Color = Color;
|
||||
gl_Position = ProjMtx * vec4(Position.xy, 0.0, 1.0);
|
||||
}
|
13
resources/shaders/140/mm_contour.fs
Normal file
13
resources/shaders/140/mm_contour.fs
Normal file
@ -0,0 +1,13 @@
|
||||
#version 140
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = uniform_color;
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
11
resources/shaders/140/mm_contour.vs
Normal file
11
resources/shaders/140/mm_contour.vs
Normal file
@ -0,0 +1,11 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
63
resources/shaders/140/mm_gouraud.fs
Normal file
63
resources/shaders/140/mm_gouraud.fs
Normal file
@ -0,0 +1,63 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
uniform bool volume_mirrored;
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
in vec3 clipping_planes_dots;
|
||||
in vec4 model_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (any(lessThan(clipping_planes_dots, ZERO)))
|
||||
discard;
|
||||
vec3 color = uniform_color.rgb;
|
||||
float alpha = uniform_color.a;
|
||||
|
||||
vec3 triangle_normal = normalize(cross(dFdx(model_pos.xyz), dFdy(model_pos.xyz)));
|
||||
#ifdef FLIP_TRIANGLE_NORMALS
|
||||
triangle_normal = -triangle_normal;
|
||||
#endif
|
||||
|
||||
if (volume_mirrored)
|
||||
triangle_normal = -triangle_normal;
|
||||
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 eye_normal = normalize(normal_matrix * triangle_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
// x = diffuse, y = specular;
|
||||
vec2 intensity = vec2(0.0);
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec3 position = (view_model_matrix * model_pos).xyz;
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
|
||||
}
|
28
resources/shaders/140/mm_gouraud.vs
Normal file
28
resources/shaders/140/mm_gouraud.vs
Normal file
@ -0,0 +1,28 @@
|
||||
#version 140
|
||||
|
||||
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
uniform mat4 volume_world_matrix;
|
||||
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
|
||||
uniform vec2 z_range;
|
||||
// Clipping plane - general orientation. Used by the SLA gizmo.
|
||||
uniform vec4 clipping_plane;
|
||||
|
||||
in vec3 v_position;
|
||||
|
||||
out vec3 clipping_planes_dots;
|
||||
out vec4 model_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
model_pos = vec4(v_position, 1.0);
|
||||
// Point in homogenous coordinates.
|
||||
vec4 world_pos = volume_world_matrix * model_pos;
|
||||
|
||||
gl_Position = projection_matrix * view_model_matrix * model_pos;
|
||||
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
|
||||
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
|
||||
}
|
35
resources/shaders/140/printbed.fs
Normal file
35
resources/shaders/140/printbed.fs
Normal file
@ -0,0 +1,35 @@
|
||||
#version 140
|
||||
|
||||
const vec3 back_color_dark = vec3(0.235, 0.235, 0.235);
|
||||
const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
|
||||
|
||||
uniform sampler2D in_texture;
|
||||
uniform bool transparent_background;
|
||||
uniform bool svg_source;
|
||||
|
||||
in vec2 tex_coord;
|
||||
out vec4 frag_color;
|
||||
|
||||
vec4 svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 fore_color = texture(in_texture, tex_coord);
|
||||
|
||||
// calculates radial gradient
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
|
||||
|
||||
// blends foreground with background
|
||||
return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
|
||||
}
|
||||
|
||||
vec4 non_svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 color = texture(in_texture, tex_coord);
|
||||
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_color = svg_source ? svg_color() : non_svg_color();
|
||||
}
|
15
resources/shaders/140/printbed.vs
Normal file
15
resources/shaders/140/printbed.vs
Normal file
@ -0,0 +1,15 @@
|
||||
#version 140
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec2 v_tex_coord;
|
||||
|
||||
out vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
19
resources/shaders/140/toolpaths_cog.fs
Normal file
19
resources/shaders/140/toolpaths_cog.fs
Normal file
@ -0,0 +1,19 @@
|
||||
#version 140
|
||||
|
||||
const vec4 BLACK = vec4(vec3(0.1), 1.0);
|
||||
const vec4 WHITE = vec4(vec3(1.0), 1.0);
|
||||
|
||||
const float emission_factor = 0.25;
|
||||
|
||||
uniform vec3 world_center;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
in vec2 intensity;
|
||||
in vec3 world_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 delta = world_position - world_center;
|
||||
vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
|
||||
gl_FragColor = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
|
||||
}
|
47
resources/shaders/140/toolpaths_cog.vs
Normal file
47
resources/shaders/140/toolpaths_cog.vs
Normal file
@ -0,0 +1,47 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec3 v_normal;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
out vec2 intensity;
|
||||
out vec3 world_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular applied).
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
world_position = v_position;
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
41
resources/shaders/140/variable_layer_height.fs
Normal file
41
resources/shaders/140/variable_layer_height.fs
Normal file
@ -0,0 +1,41 @@
|
||||
#version 140
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
// 2D texture (1D texture split by the rows) of color along the object Z axis.
|
||||
uniform sampler2D z_texture;
|
||||
// Scaling from the Z texture rows coordinate to the normalized texture row coordinate.
|
||||
uniform float z_to_texture_row;
|
||||
uniform float z_texture_row_to_normalized;
|
||||
uniform float z_cursor;
|
||||
uniform float z_cursor_band_width;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
in vec2 intensity;
|
||||
|
||||
in float object_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
float object_z_row = z_to_texture_row * object_z;
|
||||
// Index of the row in the texture.
|
||||
float z_texture_row = floor(object_z_row);
|
||||
// Normalized coordinate from 0. to 1.
|
||||
float z_texture_col = object_z_row - z_texture_row;
|
||||
float z_blend = 0.25 * cos(min(M_PI, abs(M_PI * (object_z - z_cursor) * 1.8 / z_cursor_band_width))) + 0.25;
|
||||
// Calculate level of detail from the object Z coordinate.
|
||||
// This makes the slowly sloping surfaces to be shown with high detail (with stripes),
|
||||
// and the vertical surfaces to be shown with low detail (no stripes)
|
||||
float z_in_cells = object_z_row * 190.;
|
||||
// Gradient of Z projected on the screen.
|
||||
float dx_vtc = dFdx(z_in_cells);
|
||||
float dy_vtc = dFdy(z_in_cells);
|
||||
float lod = clamp(0.5 * log2(max(dx_vtc * dx_vtc, dy_vtc * dy_vtc)), 0., 1.);
|
||||
// Sample the Z texture. Texture coordinates are normalized to <0, 1>.
|
||||
vec4 color = vec4(0.25, 0.25, 0.25, 1.0);
|
||||
if (z_texture_row >= 0.0)
|
||||
color = mix(texture(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row + 0.5 )), -10000.),
|
||||
texture(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row * 2. + 1.)), 10000.), lod);
|
||||
// Mix the final color.
|
||||
gl_FragColor = vec4(vec3(intensity.y), 1.0) + intensity.x * mix(color, vec4(1.0, 1.0, 0.0, 1.0), z_blend);
|
||||
}
|
60
resources/shaders/140/variable_layer_height.vs
Normal file
60
resources/shaders/140/variable_layer_height.vs
Normal file
@ -0,0 +1,60 @@
|
||||
#version 140
|
||||
|
||||
#define INTENSITY_CORRECTION 0.6
|
||||
|
||||
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
|
||||
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
|
||||
#define LIGHT_TOP_SHININESS 20.0
|
||||
|
||||
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
|
||||
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
|
||||
//#define LIGHT_FRONT_SHININESS 5.0
|
||||
|
||||
#define INTENSITY_AMBIENT 0.3
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 volume_world_matrix;
|
||||
uniform float object_max_z;
|
||||
|
||||
in vec3 v_position;
|
||||
in vec3 v_normal;
|
||||
in vec2 v_tex_coord;
|
||||
|
||||
// x = tainted, y = specular;
|
||||
out vec2 intensity;
|
||||
|
||||
out float object_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
// =====================================================
|
||||
// NOTE:
|
||||
// when object_max_z > 0.0 we are rendering the overlay
|
||||
// when object_max_z == 0.0 we are rendering the volumes
|
||||
// =====================================================
|
||||
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
vec3 normal = (object_max_z > 0.0) ? vec3(0.0, 0.0, 1.0) : normalize(normal_matrix * v_normal);
|
||||
|
||||
// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
|
||||
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
|
||||
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
|
||||
|
||||
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
|
||||
vec4 position = view_model_matrix * vec4(v_position, 1.0);
|
||||
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
|
||||
|
||||
// Perform the same lighting calculation for the 2nd light source (no specular)
|
||||
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
|
||||
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
// Scaled to widths of the Z texture.
|
||||
object_z = (object_max_z > 0.0) ? object_max_z * v_tex_coord.y : (volume_world_matrix * vec4(v_position, 1.0)).z;
|
||||
|
||||
gl_Position = projection_matrix * position;
|
||||
}
|
@ -40,7 +40,6 @@ varying vec2 intensity;
|
||||
|
||||
uniform PrintVolumeDetection print_volume;
|
||||
|
||||
varying vec4 model_pos;
|
||||
varying vec4 world_pos;
|
||||
varying float world_normal_z;
|
||||
varying vec3 eye_normal;
|
||||
|
@ -38,7 +38,6 @@ varying vec2 intensity;
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
|
||||
varying vec4 model_pos;
|
||||
varying vec4 world_pos;
|
||||
varying float world_normal_z;
|
||||
varying vec3 eye_normal;
|
||||
@ -60,7 +59,6 @@ void main()
|
||||
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
|
||||
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
|
||||
|
||||
model_pos = gl_Vertex;
|
||||
// Point in homogenous coordinates.
|
||||
world_pos = volume_world_matrix * gl_Vertex;
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
#version 110
|
||||
|
||||
uniform bool use_fixed_screen_size;
|
||||
uniform float zoom;
|
||||
uniform float point_size;
|
||||
uniform float near_plane_height;
|
||||
|
||||
float fixed_screen_size()
|
||||
{
|
||||
return point_size;
|
||||
}
|
||||
|
||||
float fixed_world_size()
|
||||
{
|
||||
return (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
gl_PointSize = use_fixed_screen_size ? fixed_screen_size() : fixed_world_size();
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// version 120 is needed for gl_PointCoord
|
||||
#version 120
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
uniform float percent_outline_radius;
|
||||
uniform float percent_center_radius;
|
||||
|
||||
vec4 calc_color(float radius, vec4 color)
|
||||
{
|
||||
return ((radius < percent_center_radius) || (radius > 1.0 - percent_outline_radius)) ?
|
||||
vec4(0.5 * color.rgb, color.a) : color;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 pos = (gl_PointCoord - 0.5) * 2.0;
|
||||
float radius = length(pos);
|
||||
if (radius > 1.0)
|
||||
discard;
|
||||
|
||||
gl_FragColor = calc_color(radius, uniform_color);
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
#version 120
|
||||
|
||||
uniform bool use_fixed_screen_size;
|
||||
uniform float zoom;
|
||||
uniform float point_size;
|
||||
uniform float near_plane_height;
|
||||
|
||||
float fixed_screen_size()
|
||||
{
|
||||
return point_size;
|
||||
}
|
||||
|
||||
float fixed_world_size()
|
||||
{
|
||||
return (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
gl_PointSize = use_fixed_screen_size ? fixed_screen_size() : fixed_world_size();
|
||||
}
|
@ -7,15 +7,15 @@ uniform sampler2D texture;
|
||||
uniform bool transparent_background;
|
||||
uniform bool svg_source;
|
||||
|
||||
varying vec2 tex_coords;
|
||||
varying vec2 tex_coord;
|
||||
|
||||
vec4 svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 fore_color = texture2D(texture, tex_coords);
|
||||
vec4 fore_color = texture2D(texture, tex_coord);
|
||||
|
||||
// calculates radial gradient
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coords.xy) - vec2(0.5)))));
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
|
||||
|
||||
// blends foreground with background
|
||||
return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
|
||||
@ -24,7 +24,7 @@ vec4 svg_color()
|
||||
vec4 non_svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 color = texture2D(texture, tex_coords);
|
||||
vec4 color = texture2D(texture, tex_coord);
|
||||
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#version 110
|
||||
|
||||
varying vec2 tex_coords;
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
tex_coords = gl_MultiTexCoord0.xy;
|
||||
tex_coord = gl_MultiTexCoord0.xy;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ static std::vector<InnerBrimExPolygons> inner_brim_area(const Print
|
||||
// After 7ff76d07684858fd937ef2f5d863f105a10f798e offset and shrink don't work with CW polygons (holes), so let's make it CCW.
|
||||
Polygons ex_poly_holes_reversed = ex_poly.holes;
|
||||
polygons_reverse(ex_poly_holes_reversed);
|
||||
for (const PrintInstance &instance : object->instances()) {
|
||||
for ([[maybe_unused]] const PrintInstance &instance : object->instances()) {
|
||||
++polygon_idx; // Increase idx because of the contour of the ExPolygon.
|
||||
|
||||
if (brim_type == BrimType::btInnerOnly || brim_type == BrimType::btOuterAndInner)
|
||||
|
@ -95,10 +95,10 @@ public:
|
||||
bool all_paths_inside_vertices_and_normals_interleaved(const std::vector<float>& paths, const Eigen::AlignedBox<float, 3>& bbox, bool ignore_bottom = true) const;
|
||||
|
||||
|
||||
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
const std::pair<std::vector<Vec2d>, std::vector<Vec2d>>& top_bottom_convex_hull_decomposition_scene() const { return m_top_bottom_convex_hull_decomposition_scene; }
|
||||
const std::pair<std::vector<Vec2d>, std::vector<Vec2d>>& top_bottom_convex_hull_decomposition_bed() const { return m_top_bottom_convex_hull_decomposition_bed; }
|
||||
#endif // ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
|
||||
private:
|
||||
// Source definition of the print bed geometry (PrintConfig::bed_shape)
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "FillBase.hpp"
|
||||
#include "FillRectilinear.hpp"
|
||||
#include "FillLightning.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@ -318,7 +319,7 @@ void export_group_fills_to_svg(const char *path, const std::vector<SurfaceFill>
|
||||
#endif
|
||||
|
||||
// friend to Layer
|
||||
void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree)
|
||||
void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator)
|
||||
{
|
||||
for (LayerRegion *layerm : m_regions)
|
||||
layerm->fills.clear();
|
||||
@ -348,6 +349,9 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
|
||||
f->angle = surface_fill.params.angle;
|
||||
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
|
||||
|
||||
if (surface_fill.params.pattern == ipLightning)
|
||||
dynamic_cast<FillLightning::Filler*>(f.get())->generator = lightning_generator;
|
||||
|
||||
// calculate flow spacing for infill pattern generation
|
||||
bool using_internal_flow = ! surface_fill.surface.is_solid() && ! surface_fill.params.bridge;
|
||||
double link_max_length = 0.;
|
||||
|
@ -46,9 +46,7 @@ Fill* Fill::new_from_type(const InfillPattern type)
|
||||
case ipAdaptiveCubic: return new FillAdaptive::Filler();
|
||||
case ipSupportCubic: return new FillAdaptive::Filler();
|
||||
case ipSupportBase: return new FillSupportBase();
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
case ipLightning: return new FillLightning::Filler();
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
default: throw Slic3r::InvalidArgument("unknown type");
|
||||
}
|
||||
}
|
||||
|
@ -406,13 +406,15 @@ public:
|
||||
// for the infill pattern, don't cut the corners.
|
||||
// default miterLimt = 3
|
||||
//double miterLimit = 10.;
|
||||
assert(aoffset1 < 0);
|
||||
// FIXME: Resolve properly the cases when it is constructed with aoffset1 = 0 and aoffset2 = 0,
|
||||
// that is used in sample_grid_pattern() for Lightning infill.
|
||||
// assert(aoffset1 < 0);
|
||||
assert(aoffset2 <= 0);
|
||||
assert(aoffset2 == 0 || aoffset2 < aoffset1);
|
||||
// assert(aoffset2 == 0 || aoffset2 < aoffset1);
|
||||
// bool sticks_removed =
|
||||
remove_sticks(polygons_src);
|
||||
// if (sticks_removed) BOOST_LOG_TRIVIAL(error) << "Sticks removed!";
|
||||
polygons_outer = offset(polygons_src, float(aoffset1), ClipperLib::jtMiter, miterLimit);
|
||||
polygons_outer = aoffset1 == 0 ? polygons_src : offset(polygons_src, float(aoffset1), ClipperLib::jtMiter, miterLimit);
|
||||
if (aoffset2 < 0)
|
||||
polygons_inner = shrink(polygons_outer, float(aoffset1 - aoffset2), ClipperLib::jtMiter, miterLimit);
|
||||
// Filter out contours with zero area or small area, contours with 2 points only.
|
||||
|
@ -10,27 +10,29 @@ namespace Slic3r::FillLightning
|
||||
|
||||
constexpr coord_t radius_per_cell_size = 6; // The cell-size should be small compared to the radius, but not so small as to be inefficient.
|
||||
|
||||
DistanceField::DistanceField(const coord_t& radius, const Polygons& current_outline, const Polygons& current_overhang) :
|
||||
m_cell_size(radius / radius_per_cell_size),
|
||||
m_supporting_radius(radius)
|
||||
DistanceField::DistanceField(const coord_t& radius, const Polygons& current_outline, const BoundingBox& current_outlines_bbox, const Polygons& current_overhang) :
|
||||
m_cell_size(radius / radius_per_cell_size),
|
||||
m_supporting_radius(radius),
|
||||
m_unsupported_points_bbox(current_outlines_bbox)
|
||||
{
|
||||
m_supporting_radius2 = double(radius) * double(radius);
|
||||
m_supporting_radius2 = Slic3r::sqr(int64_t(radius));
|
||||
// Sample source polygons with a regular grid sampling pattern.
|
||||
for (const ExPolygon &expoly : union_ex(current_outline)) {
|
||||
for (const ExPolygon &expoly : union_ex(current_overhang)) {
|
||||
for (const Point &p : sample_grid_pattern(expoly, m_cell_size)) {
|
||||
// Find a squared distance to the source expolygon boundary.
|
||||
double d2 = std::numeric_limits<double>::max();
|
||||
for (size_t icontour = 0; icontour <= expoly.holes.size(); ++ icontour) {
|
||||
for (size_t icontour = 0; icontour <= expoly.holes.size(); ++icontour) {
|
||||
const Polygon &contour = icontour == 0 ? expoly.contour : expoly.holes[icontour - 1];
|
||||
if (contour.size() > 2) {
|
||||
Point prev = contour.points.back();
|
||||
for (const Point &p2 : contour.points) {
|
||||
d2 = std::min(d2, Line::distance_to_squared(p, prev, p2));
|
||||
d2 = std::min(d2, Line::distance_to_squared(p, prev, p2));
|
||||
prev = p2;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_unsupported_points.emplace_back(p, sqrt(d2));
|
||||
assert(m_unsupported_points_bbox.contains(p));
|
||||
}
|
||||
}
|
||||
m_unsupported_points.sort([&radius](const UnsupportedCell &a, const UnsupportedCell &b) {
|
||||
@ -41,8 +43,11 @@ DistanceField::DistanceField(const coord_t& radius, const Polygons& current_outl
|
||||
});
|
||||
for (auto it = m_unsupported_points.begin(); it != m_unsupported_points.end(); ++it) {
|
||||
UnsupportedCell& cell = *it;
|
||||
m_unsupported_points_grid.emplace(Point{ cell.loc.x() / m_cell_size, cell.loc.y() / m_cell_size }, it);
|
||||
m_unsupported_points_grid.emplace(this->to_grid_point(cell.loc), it);
|
||||
}
|
||||
// Because the distance between two points is at least one axis equal to m_cell_size, every cell
|
||||
// in m_unsupported_points_grid contains exactly one point.
|
||||
assert(m_unsupported_points.size() == m_unsupported_points_grid.size());
|
||||
}
|
||||
|
||||
void DistanceField::update(const Point& to_node, const Point& added_leaf)
|
||||
@ -60,17 +65,24 @@ void DistanceField::update(const Point& to_node, const Point& added_leaf)
|
||||
grid.merge(to_node + iextent);
|
||||
grid.merge(added_leaf - iextent);
|
||||
grid.merge(added_leaf + iextent);
|
||||
grid.min /= m_cell_size;
|
||||
grid.max /= m_cell_size;
|
||||
|
||||
// Clip grid by m_unsupported_points_bbox. Mainly to ensure that grid.min is a non-negative value.
|
||||
grid.min.x() = std::max(grid.min.x(), m_unsupported_points_bbox.min.x());
|
||||
grid.min.y() = std::max(grid.min.y(), m_unsupported_points_bbox.min.y());
|
||||
grid.max.x() = std::min(grid.max.x(), m_unsupported_points_bbox.max.x());
|
||||
grid.max.y() = std::min(grid.max.y(), m_unsupported_points_bbox.max.y());
|
||||
|
||||
grid.min = this->to_grid_point(grid.min);
|
||||
grid.max = this->to_grid_point(grid.max);
|
||||
}
|
||||
|
||||
Point grid_addr;
|
||||
Point grid_loc;
|
||||
for (coord_t row = grid.min.y(); row <= grid.max.y(); ++ row) {
|
||||
grid_loc.y() = row * m_cell_size;
|
||||
for (coord_t col = grid.min.x(); col <= grid.max.y(); ++ col) {
|
||||
grid_loc.x() = col * m_cell_size;
|
||||
for (grid_addr.y() = grid.min.y(); grid_addr.y() <= grid.max.y(); ++grid_addr.y()) {
|
||||
for (grid_addr.x() = grid.min.x(); grid_addr.x() <= grid.max.x(); ++grid_addr.x()) {
|
||||
grid_loc = this->from_grid_point(grid_addr);
|
||||
// Test inside a circle at the new leaf.
|
||||
if ((grid_loc - added_leaf).cast<double>().squaredNorm() > m_supporting_radius2) {
|
||||
if ((grid_loc - added_leaf).cast<int64_t>().squaredNorm() > m_supporting_radius2) {
|
||||
// Not inside a circle at the end of the new leaf.
|
||||
// Test inside a rotated rectangle.
|
||||
Vec2d vx = (grid_loc - to_node).cast<double>();
|
||||
@ -84,10 +96,10 @@ void DistanceField::update(const Point& to_node, const Point& added_leaf)
|
||||
}
|
||||
// Inside a circle at the end of the new leaf, or inside a rotated rectangle.
|
||||
// Remove unsupported leafs at this grid location.
|
||||
if (auto it = m_unsupported_points_grid.find(grid_loc); it != m_unsupported_points_grid.end()) {
|
||||
if (auto it = m_unsupported_points_grid.find(grid_addr); it != m_unsupported_points_grid.end()) {
|
||||
std::list<UnsupportedCell>::iterator& list_it = it->second;
|
||||
UnsupportedCell& cell = *list_it;
|
||||
if ((cell.loc - added_leaf).cast<double>().squaredNorm() <= m_supporting_radius2) {
|
||||
if ((cell.loc - added_leaf).cast<int64_t>().squaredNorm() <= m_supporting_radius2) {
|
||||
m_unsupported_points.erase(list_it);
|
||||
m_unsupported_points_grid.erase(it);
|
||||
}
|
||||
@ -96,4 +108,25 @@ void DistanceField::update(const Point& to_node, const Point& added_leaf)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void DistanceField::update(const Point &to_node, const Point &added_leaf)
|
||||
{
|
||||
const Point supporting_radius_point(m_supporting_radius, m_supporting_radius);
|
||||
const BoundingBox grid(this->to_grid_point(added_leaf - supporting_radius_point), this->to_grid_point(added_leaf + supporting_radius_point));
|
||||
|
||||
for (coord_t grid_y = grid.min.y(); grid_y <= grid.max.y(); ++grid_y) {
|
||||
for (coord_t grid_x = grid.min.x(); grid_x <= grid.max.x(); ++grid_x) {
|
||||
if (auto it = m_unsupported_points_grid.find({grid_x, grid_y}); it != m_unsupported_points_grid.end()) {
|
||||
std::list<UnsupportedCell>::iterator &list_it = it->second;
|
||||
UnsupportedCell &cell = *list_it;
|
||||
if ((cell.loc - added_leaf).cast<int64_t>().squaredNorm() <= m_supporting_radius2) {
|
||||
m_unsupported_points.erase(list_it);
|
||||
m_unsupported_points_grid.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Slic3r::FillLightning
|
||||
|
@ -4,6 +4,7 @@
|
||||
#ifndef LIGHTNING_DISTANCE_FIELD_H
|
||||
#define LIGHTNING_DISTANCE_FIELD_H
|
||||
|
||||
#include "../../BoundingBox.hpp"
|
||||
#include "../../Point.hpp"
|
||||
#include "../../Polygon.hpp"
|
||||
|
||||
@ -29,7 +30,7 @@ public:
|
||||
* \param current_overhang The overhang that needs to be supported on this
|
||||
* layer.
|
||||
*/
|
||||
DistanceField(const coord_t& radius, const Polygons& current_outline, const Polygons& current_overhang);
|
||||
DistanceField(const coord_t& radius, const Polygons& current_outline, const BoundingBox& current_outlines_bbox, const Polygons& current_overhang);
|
||||
|
||||
/*!
|
||||
* Gets the next unsupported location to be supported by a new branch.
|
||||
@ -69,14 +70,14 @@ protected:
|
||||
* branch of a tree.
|
||||
*/
|
||||
coord_t m_supporting_radius;
|
||||
double m_supporting_radius2;
|
||||
int64_t m_supporting_radius2;
|
||||
|
||||
/*!
|
||||
* Represents a small discrete area of infill that needs to be supported.
|
||||
*/
|
||||
struct UnsupportedCell
|
||||
{
|
||||
UnsupportedCell(Point loc, coord_t dist_to_boundary) : loc(loc), dist_to_boundary(dist_to_boundary) {}
|
||||
UnsupportedCell(const Point &loc, coord_t dist_to_boundary) : loc(loc), dist_to_boundary(dist_to_boundary) {}
|
||||
// The position of the center of this cell.
|
||||
Point loc;
|
||||
// How far this cell is removed from the ``current_outline`` polygon, the edge of the infill area.
|
||||
@ -88,11 +89,30 @@ protected:
|
||||
*/
|
||||
std::list<UnsupportedCell> m_unsupported_points;
|
||||
|
||||
/*!
|
||||
* BoundingBox of all points in m_unsupported_points. Used for mapping of sign integer numbers to positive integer numbers.
|
||||
*/
|
||||
const BoundingBox m_unsupported_points_bbox;
|
||||
|
||||
/*!
|
||||
* Links the unsupported points to a grid point, so that we can quickly look
|
||||
* up the cell belonging to a certain position in the grid.
|
||||
*/
|
||||
std::unordered_map<Point, std::list<UnsupportedCell>::iterator, PointHash> m_unsupported_points_grid;
|
||||
|
||||
/*!
|
||||
* Maps the point to the grid coordinates.
|
||||
*/
|
||||
Point to_grid_point(const Point &point) const {
|
||||
return (point - m_unsupported_points_bbox.min) / m_cell_size;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Maps the point to the grid coordinates.
|
||||
*/
|
||||
Point from_grid_point(const Point &point) const {
|
||||
return point * m_cell_size + m_unsupported_points_bbox.min;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Slic3r::FillLightning
|
||||
|
@ -35,17 +35,17 @@ Generator::Generator(const PrintObject &print_object)
|
||||
// const int infill_extruder = region_config.infill_extruder.value;
|
||||
const double default_infill_extrusion_width = Flow::auto_extrusion_width(FlowRole::frInfill, float(max_nozzle_diameter));
|
||||
// Note: There's not going to be a layer below the first one, so the 'initial layer height' doesn't have to be taken into account.
|
||||
const double layer_thickness = object_config.layer_height;
|
||||
const double layer_thickness = scaled<double>(object_config.layer_height.value);
|
||||
|
||||
m_infill_extrusion_width = scaled<float>(region_config.infill_extrusion_width.percent ? default_infill_extrusion_width * 0.01 * region_config.infill_extrusion_width : region_config.infill_extrusion_width);
|
||||
m_supporting_radius = scaled<coord_t>(m_infill_extrusion_width * 0.001 / region_config.fill_density);
|
||||
m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 / coord_t(region_config.fill_density.value);
|
||||
|
||||
const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees
|
||||
const double lightning_infill_prune_angle = M_PI / 4; // 45 degrees
|
||||
const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees
|
||||
const double lightning_infill_prune_angle = M_PI / 4; // 45 degrees
|
||||
const double lightning_infill_straightening_angle = M_PI / 4; // 45 degrees
|
||||
m_wall_supporting_radius = layer_thickness * std::tan(lightning_infill_overhang_angle);
|
||||
m_prune_length = layer_thickness * std::tan(lightning_infill_prune_angle);
|
||||
m_straightening_max_distance = layer_thickness * std::tan(lightning_infill_straightening_angle);
|
||||
m_wall_supporting_radius = coord_t(layer_thickness * std::tan(lightning_infill_overhang_angle));
|
||||
m_prune_length = coord_t(layer_thickness * std::tan(lightning_infill_prune_angle));
|
||||
m_straightening_max_distance = coord_t(layer_thickness * std::tan(lightning_infill_straightening_angle));
|
||||
|
||||
generateInitialInternalOverhangs(print_object);
|
||||
generateTrees(print_object);
|
||||
@ -54,19 +54,20 @@ Generator::Generator(const PrintObject &print_object)
|
||||
void Generator::generateInitialInternalOverhangs(const PrintObject &print_object)
|
||||
{
|
||||
m_overhang_per_layer.resize(print_object.layers().size());
|
||||
const float infill_wall_offset = - m_infill_extrusion_width;
|
||||
// FIXME: It can be adjusted to improve bonding between infill and perimeters.
|
||||
const float infill_wall_offset = 0;// m_infill_extrusion_width;
|
||||
|
||||
Polygons infill_area_above;
|
||||
//Iterate from top to bottom, to subtract the overhang areas above from the overhang areas on the layer below, to get only overhang in the top layer where it is overhanging.
|
||||
for (int layer_nr = print_object.layers().size() - 1; layer_nr >= 0; layer_nr--) {
|
||||
for (int layer_nr = int(print_object.layers().size()) - 1; layer_nr >= 0; layer_nr--) {
|
||||
Polygons infill_area_here;
|
||||
for (const LayerRegion* layerm : print_object.get_layer(layer_nr)->regions())
|
||||
for (const Surface& surface : layerm->fill_surfaces.surfaces)
|
||||
if (surface.surface_type == stInternal)
|
||||
append(infill_area_here, offset(surface.expolygon, infill_wall_offset));
|
||||
append(infill_area_here, infill_wall_offset == 0 ? surface.expolygon : offset(surface.expolygon, infill_wall_offset));
|
||||
|
||||
//Remove the part of the infill area that is already supported by the walls.
|
||||
Polygons overhang = diff(offset(infill_area_here, -m_wall_supporting_radius), infill_area_above);
|
||||
Polygons overhang = diff(offset(infill_area_here, -float(m_wall_supporting_radius)), infill_area_above);
|
||||
|
||||
m_overhang_per_layer[layer_nr] = overhang;
|
||||
infill_area_above = std::move(infill_area_here);
|
||||
@ -82,16 +83,17 @@ const Layer& Generator::getTreesForLayer(const size_t& layer_id) const
|
||||
void Generator::generateTrees(const PrintObject &print_object)
|
||||
{
|
||||
m_lightning_layers.resize(print_object.layers().size());
|
||||
const coord_t infill_wall_offset = - m_infill_extrusion_width;
|
||||
// FIXME: It can be adjusted to improve bonding between infill and perimeters.
|
||||
const coord_t infill_wall_offset = 0;// m_infill_extrusion_width;
|
||||
|
||||
std::vector<Polygons> infill_outlines(print_object.layers().size(), Polygons());
|
||||
|
||||
// For-each layer from top to bottom:
|
||||
for (int layer_id = print_object.layers().size() - 1; layer_id >= 0; layer_id--)
|
||||
for (int layer_id = int(print_object.layers().size()) - 1; layer_id >= 0; layer_id--)
|
||||
for (const LayerRegion *layerm : print_object.get_layer(layer_id)->regions())
|
||||
for (const Surface &surface : layerm->fill_surfaces.surfaces)
|
||||
if (surface.surface_type == stInternal)
|
||||
append(infill_outlines[layer_id], offset(surface.expolygon, infill_wall_offset));
|
||||
append(infill_outlines[layer_id], infill_wall_offset == 0 ? surface.expolygon : offset(surface.expolygon, infill_wall_offset));
|
||||
|
||||
// For various operations its beneficial to quickly locate nearby features on the polygon:
|
||||
const size_t top_layer_id = print_object.layers().size() - 1;
|
||||
@ -99,16 +101,16 @@ void Generator::generateTrees(const PrintObject &print_object)
|
||||
outlines_locator.create(infill_outlines[top_layer_id], locator_cell_size);
|
||||
|
||||
// For-each layer from top to bottom:
|
||||
for (int layer_id = top_layer_id; layer_id >= 0; layer_id--)
|
||||
{
|
||||
Layer& current_lightning_layer = m_lightning_layers[layer_id];
|
||||
Polygons& current_outlines = infill_outlines[layer_id];
|
||||
for (int layer_id = int(top_layer_id); layer_id >= 0; layer_id--) {
|
||||
Layer ¤t_lightning_layer = m_lightning_layers[layer_id];
|
||||
const Polygons ¤t_outlines = infill_outlines[layer_id];
|
||||
const BoundingBox ¤t_outlines_bbox = get_extents(current_outlines);
|
||||
|
||||
// register all trees propagated from the previous layer as to-be-reconnected
|
||||
std::vector<NodeSPtr> to_be_reconnected_tree_roots = current_lightning_layer.tree_roots;
|
||||
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
current_lightning_layer.reconnectRoots(to_be_reconnected_tree_roots, current_outlines, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
current_lightning_layer.generateNewTrees(m_overhang_per_layer[layer_id], current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
current_lightning_layer.reconnectRoots(to_be_reconnected_tree_roots, current_outlines, current_outlines_bbox, outlines_locator, m_supporting_radius, m_wall_supporting_radius);
|
||||
|
||||
// Initialize trees for next lower layer from the current one.
|
||||
if (layer_id == 0)
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
* already be calculated at this point.
|
||||
* \param mesh The mesh to generate infill for.
|
||||
*/
|
||||
Generator(const PrintObject &print_object);
|
||||
explicit Generator(const PrintObject &print_object);
|
||||
|
||||
/*!
|
||||
* Get a tree of paths generated for a certain layer of the mesh.
|
||||
|
@ -3,12 +3,11 @@
|
||||
|
||||
#include "Layer.hpp" //The class we're implementing.
|
||||
|
||||
#include <iterator> // advance
|
||||
|
||||
#include "DistanceField.hpp"
|
||||
#include "TreeNode.hpp"
|
||||
|
||||
#include "../../Geometry.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
namespace Slic3r::FillLightning {
|
||||
|
||||
@ -23,10 +22,15 @@ Point GroundingLocation::p() const
|
||||
return tree_node ? tree_node->getLocation() : *boundary_location;
|
||||
}
|
||||
|
||||
void Layer::fillLocator(SparseNodeGrid &tree_node_locator)
|
||||
inline static Point to_grid_point(const Point &point, const BoundingBox &bbox)
|
||||
{
|
||||
std::function<void(NodeSPtr)> add_node_to_locator_func = [&tree_node_locator](NodeSPtr node) {
|
||||
tree_node_locator.insert(std::make_pair(Point(node->getLocation().x() / locator_cell_size, node->getLocation().y() / locator_cell_size), node));
|
||||
return (point - bbox.min) / locator_cell_size;
|
||||
}
|
||||
|
||||
void Layer::fillLocator(SparseNodeGrid &tree_node_locator, const BoundingBox& current_outlines_bbox)
|
||||
{
|
||||
std::function<void(NodeSPtr)> add_node_to_locator_func = [&tree_node_locator, ¤t_outlines_bbox](const NodeSPtr &node) {
|
||||
tree_node_locator.insert(std::make_pair(to_grid_point(node->getLocation(), current_outlines_bbox), node));
|
||||
};
|
||||
for (auto& tree : tree_roots)
|
||||
tree->visitNodes(add_node_to_locator_func);
|
||||
@ -36,38 +40,46 @@ void Layer::generateNewTrees
|
||||
(
|
||||
const Polygons& current_overhang,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outlines_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius
|
||||
)
|
||||
{
|
||||
DistanceField distance_field(supporting_radius, current_outlines, current_overhang);
|
||||
DistanceField distance_field(supporting_radius, current_outlines, current_outlines_bbox, current_overhang);
|
||||
|
||||
SparseNodeGrid tree_node_locator;
|
||||
fillLocator(tree_node_locator);
|
||||
fillLocator(tree_node_locator, current_outlines_bbox);
|
||||
|
||||
// Until no more points need to be added to support all:
|
||||
// Determine next point from tree/outline areas via distance-field
|
||||
Point unsupported_location;
|
||||
while (distance_field.tryGetNextPoint(&unsupported_location)) {
|
||||
GroundingLocation grounding_loc = getBestGroundingLocation(
|
||||
unsupported_location, current_outlines, outlines_locator, supporting_radius, wall_supporting_radius, tree_node_locator);
|
||||
unsupported_location, current_outlines, current_outlines_bbox, outlines_locator, supporting_radius, wall_supporting_radius, tree_node_locator);
|
||||
|
||||
NodeSPtr new_parent;
|
||||
NodeSPtr new_child;
|
||||
this->attach(unsupported_location, grounding_loc, new_child, new_parent);
|
||||
tree_node_locator.insert(std::make_pair(Point(new_child->getLocation().x() / locator_cell_size, new_child->getLocation().y() / locator_cell_size), new_child));
|
||||
tree_node_locator.insert(std::make_pair(to_grid_point(new_child->getLocation(), current_outlines_bbox), new_child));
|
||||
if (new_parent)
|
||||
tree_node_locator.insert(std::make_pair(Point(new_parent->getLocation().x() / locator_cell_size, new_parent->getLocation().y() / locator_cell_size), new_parent));
|
||||
tree_node_locator.insert(std::make_pair(to_grid_point(new_parent->getLocation(), current_outlines_bbox), new_parent));
|
||||
// update distance field
|
||||
distance_field.update(grounding_loc.p(), unsupported_location);
|
||||
}
|
||||
|
||||
#ifdef LIGHTNING_TREE_NODE_DEBUG_OUTPUT
|
||||
{
|
||||
static int iRun = 0;
|
||||
export_to_svg(debug_out_path("FillLightning-TreeNodes-%d.svg", iRun++), current_outlines, this->tree_roots);
|
||||
}
|
||||
#endif /* LIGHTNING_TREE_NODE_DEBUG_OUTPUT */
|
||||
}
|
||||
|
||||
static bool polygonCollidesWithLineSegment(const Point from, const Point to, const EdgeGrid::Grid &loc_to_line)
|
||||
static bool polygonCollidesWithLineSegment(const Point &from, const Point &to, const EdgeGrid::Grid &loc_to_line)
|
||||
{
|
||||
struct Visitor {
|
||||
explicit Visitor(const EdgeGrid::Grid &grid) : grid(grid) {}
|
||||
explicit Visitor(const EdgeGrid::Grid &grid, const Line &line) : grid(grid), line(line) {}
|
||||
|
||||
bool operator()(coord_t iy, coord_t ix) {
|
||||
// Called with a row and colum of the grid cell, which is intersected by a line.
|
||||
@ -87,7 +99,7 @@ static bool polygonCollidesWithLineSegment(const Point from, const Point to, con
|
||||
const EdgeGrid::Grid& grid;
|
||||
Line line;
|
||||
bool intersect = false;
|
||||
} visitor(loc_to_line);
|
||||
} visitor(loc_to_line, {from, to});
|
||||
|
||||
loc_to_line.visit_cells_intersecting_line(from, to, visitor);
|
||||
return visitor.intersect;
|
||||
@ -97,6 +109,7 @@ GroundingLocation Layer::getBestGroundingLocation
|
||||
(
|
||||
const Point& unsupported_location,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius,
|
||||
@ -128,8 +141,8 @@ GroundingLocation Layer::getBestGroundingLocation
|
||||
if (current_dist >= wall_supporting_radius) { // Only reconnect tree roots to other trees if they are not already close to the outlines.
|
||||
const coord_t search_radius = std::min(current_dist, within_dist);
|
||||
BoundingBox region(unsupported_location - Point(search_radius, search_radius), unsupported_location + Point(search_radius + locator_cell_size, search_radius + locator_cell_size));
|
||||
region.min /= locator_cell_size;
|
||||
region.max /= locator_cell_size;
|
||||
region.min = to_grid_point(region.min, current_outlines_bbox);
|
||||
region.max = to_grid_point(region.max, current_outlines_bbox);
|
||||
Point grid_addr;
|
||||
for (grid_addr.y() = region.min.y(); grid_addr.y() < region.max.y(); ++ grid_addr.y())
|
||||
for (grid_addr.x() = region.min.x(); grid_addr.x() < region.max.x(); ++ grid_addr.x()) {
|
||||
@ -176,6 +189,7 @@ void Layer::reconnectRoots
|
||||
(
|
||||
std::vector<NodeSPtr>& to_be_reconnected_tree_roots,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius
|
||||
@ -184,10 +198,10 @@ void Layer::reconnectRoots
|
||||
constexpr coord_t tree_connecting_ignore_offset = 100;
|
||||
|
||||
SparseNodeGrid tree_node_locator;
|
||||
fillLocator(tree_node_locator);
|
||||
fillLocator(tree_node_locator, current_outlines_bbox);
|
||||
|
||||
const coord_t within_max_dist = outline_locator.resolution() * 2;
|
||||
for (auto root_ptr : to_be_reconnected_tree_roots)
|
||||
for (const auto &root_ptr : to_be_reconnected_tree_roots)
|
||||
{
|
||||
auto old_root_it = std::find(tree_roots.begin(), tree_roots.end(), root_ptr);
|
||||
|
||||
@ -203,7 +217,7 @@ void Layer::reconnectRoots
|
||||
root_ptr->addChild(new_root);
|
||||
new_root->reroot();
|
||||
|
||||
tree_node_locator.insert(std::make_pair(Point(new_root->getLocation().x() / locator_cell_size, new_root->getLocation().y() / locator_cell_size), new_root));
|
||||
tree_node_locator.insert(std::make_pair(to_grid_point(new_root->getLocation(), current_outlines_bbox), new_root));
|
||||
|
||||
*old_root_it = std::move(new_root); // replace old root with new root
|
||||
continue;
|
||||
@ -217,6 +231,7 @@ void Layer::reconnectRoots
|
||||
(
|
||||
root_ptr->getLocation(),
|
||||
current_outlines,
|
||||
current_outlines_bbox,
|
||||
outline_locator,
|
||||
supporting_radius,
|
||||
tree_connecting_ignore_width,
|
||||
@ -233,7 +248,7 @@ void Layer::reconnectRoots
|
||||
attach_ptr->reroot();
|
||||
|
||||
new_root->addChild(attach_ptr);
|
||||
tree_node_locator.insert(std::make_pair(new_root->getLocation(), new_root));
|
||||
tree_node_locator.insert(std::make_pair(to_grid_point(new_root->getLocation(), current_outlines_bbox), new_root));
|
||||
|
||||
*old_root_it = std::move(new_root); // replace old root with new root
|
||||
}
|
||||
@ -256,15 +271,25 @@ void Layer::reconnectRoots
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation assumes moving inside, but moving outside should just as well be possible.
|
||||
/*!
|
||||
* Moves the point \p from onto the nearest polygon or leaves the point as-is, when the comb boundary is not within the root of \p max_dist2 distance.
|
||||
* Given a \p distance more than zero, the point will end up inside, and conversely outside.
|
||||
* When the point is already in/outside by more than \p distance, \p from is unaltered, but the polygon is returned.
|
||||
* When the point is in/outside by less than \p distance, \p from is moved to the correct place.
|
||||
* Implementation assumes moving inside, but moving outside should just as well be possible.
|
||||
*
|
||||
* \param polygons The polygons onto which to move the point
|
||||
* \param from[in,out] The point to move.
|
||||
* \param distance The distance by which to move the point.
|
||||
* \param max_dist2 The squared maximal allowed distance from the point to the nearest polygon.
|
||||
* \return The index to the polygon onto which we have moved the point.
|
||||
*/
|
||||
static unsigned int moveInside(const Polygons& polygons, Point& from, int distance, int64_t maxDist2)
|
||||
{
|
||||
Point ret = from;
|
||||
int64_t bestDist2 = std::numeric_limits<int64_t>::max();
|
||||
unsigned int bestPoly = static_cast<unsigned int>(-1);
|
||||
bool is_already_on_correct_side_of_boundary = false; // whether [from] is already on the right side of the boundary
|
||||
Point ret = from;
|
||||
int64_t bestDist2 = std::numeric_limits<int64_t>::max();
|
||||
auto bestPoly = static_cast<unsigned int>(-1);
|
||||
bool is_already_on_correct_side_of_boundary = false; // whether [from] is already on the right side of the boundary
|
||||
for (unsigned int poly_idx = 0; poly_idx < polygons.size(); poly_idx++)
|
||||
{
|
||||
const Polygon &poly = polygons[poly_idx];
|
||||
@ -333,7 +358,7 @@ static unsigned int moveInside(const Polygons& polygons, Point& from, int distan
|
||||
else
|
||||
{ // x is projected to a point properly on the line segment (not onto a vertex). The case which looks like | .
|
||||
projected_p_beyond_prev_segment = false;
|
||||
Point x = a + ab * dot_prod / ab_length2;
|
||||
Point x = (a.cast<int64_t>() + ab.cast<int64_t>() * dot_prod / ab_length2).cast<coord_t>();
|
||||
|
||||
int64_t dist2 = (p - x).cast<int64_t>().squaredNorm();
|
||||
if (dist2 < bestDist2)
|
||||
|
@ -41,9 +41,10 @@ public:
|
||||
(
|
||||
const Polygons& current_overhang,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius
|
||||
coord_t supporting_radius,
|
||||
coord_t wall_supporting_radius
|
||||
);
|
||||
|
||||
/*! Determine & connect to connection point in tree/outline.
|
||||
@ -53,9 +54,10 @@ public:
|
||||
(
|
||||
const Point& unsupported_location,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius,
|
||||
coord_t supporting_radius,
|
||||
coord_t wall_supporting_radius,
|
||||
const SparseNodeGrid& tree_node_locator,
|
||||
const NodeSPtr& exclude_tree = nullptr
|
||||
);
|
||||
@ -71,16 +73,17 @@ public:
|
||||
(
|
||||
std::vector<NodeSPtr>& to_be_reconnected_tree_roots,
|
||||
const Polygons& current_outlines,
|
||||
const BoundingBox& current_outlines_bbox,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t supporting_radius,
|
||||
const coord_t wall_supporting_radius
|
||||
coord_t supporting_radius,
|
||||
coord_t wall_supporting_radius
|
||||
);
|
||||
|
||||
Polylines convertToLines(const Polygons& limit_to_outline, const coord_t line_width) const;
|
||||
Polylines convertToLines(const Polygons& limit_to_outline, coord_t line_width) const;
|
||||
|
||||
coord_t getWeightedDistance(const Point& boundary_loc, const Point& unsupported_location);
|
||||
|
||||
void fillLocator(SparseNodeGrid& tree_node_locator);
|
||||
void fillLocator(SparseNodeGrid& tree_node_locator, const BoundingBox& current_outlines_bbox);
|
||||
};
|
||||
|
||||
} // namespace Slic3r::FillLightning
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include "TreeNode.hpp"
|
||||
|
||||
#include "../../Geometry.hpp"
|
||||
#include "../../ClipperUtils.hpp"
|
||||
|
||||
namespace Slic3r::FillLightning {
|
||||
|
||||
@ -107,7 +106,7 @@ NodeSPtr Node::deepCopy() const
|
||||
return local_root;
|
||||
}
|
||||
|
||||
void Node::reroot(NodeSPtr new_parent /*= nullptr*/)
|
||||
void Node::reroot(const NodeSPtr &new_parent)
|
||||
{
|
||||
if (! m_is_root) {
|
||||
auto old_parent = m_parent.lock();
|
||||
@ -142,7 +141,7 @@ NodeSPtr Node::closestNode(const Point& loc)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool inside(const Polygons &polygons, const Point p)
|
||||
bool inside(const Polygons &polygons, const Point &p)
|
||||
{
|
||||
int poly_count_inside = 0;
|
||||
for (const Polygon &poly : polygons) {
|
||||
@ -181,7 +180,7 @@ bool lineSegmentPolygonsIntersection(const Point& a, const Point& b, const EdgeG
|
||||
} visitor { outline_locator, a.cast<double>(), b.cast<double>() };
|
||||
|
||||
outline_locator.visit_cells_intersecting_line(a, b, visitor);
|
||||
return visitor.d2min < within_max_dist * within_max_dist;
|
||||
return visitor.d2min < double(within_max_dist) * double(within_max_dist);
|
||||
}
|
||||
|
||||
bool Node::realign(const Polygons& outlines, const EdgeGrid::Grid& outline_locator, std::vector<NodeSPtr>& rerooted_parts)
|
||||
@ -226,14 +225,14 @@ bool Node::realign(const Polygons& outlines, const EdgeGrid::Grid& outline_locat
|
||||
|
||||
void Node::straighten(const coord_t magnitude, const coord_t max_remove_colinear_dist)
|
||||
{
|
||||
straighten(magnitude, m_p, 0, max_remove_colinear_dist * max_remove_colinear_dist);
|
||||
straighten(magnitude, m_p, 0, int64_t(max_remove_colinear_dist) * int64_t(max_remove_colinear_dist));
|
||||
}
|
||||
|
||||
Node::RectilinearJunction Node::straighten(
|
||||
const coord_t magnitude,
|
||||
const Point& junction_above,
|
||||
const coord_t accumulated_dist,
|
||||
const coord_t max_remove_colinear_dist2)
|
||||
const int64_t max_remove_colinear_dist2)
|
||||
{
|
||||
constexpr coord_t junction_magnitude_factor_numerator = 3;
|
||||
constexpr coord_t junction_magnitude_factor_denominator = 4;
|
||||
@ -245,13 +244,13 @@ Node::RectilinearJunction Node::straighten(
|
||||
auto child_dist = coord_t((m_p - child_p->m_p).cast<double>().norm());
|
||||
RectilinearJunction junction_below = child_p->straighten(magnitude, junction_above, accumulated_dist + child_dist, max_remove_colinear_dist2);
|
||||
coord_t total_dist_to_junction_below = junction_below.total_recti_dist;
|
||||
Point a = junction_above;
|
||||
Point b = junction_below.junction_loc;
|
||||
const Point& a = junction_above;
|
||||
Point b = junction_below.junction_loc;
|
||||
if (a != b) // should always be true!
|
||||
{
|
||||
Point ab = b - a;
|
||||
Point destination = a + ab * accumulated_dist / std::max(coord_t(1), total_dist_to_junction_below);
|
||||
if ((destination - m_p).cast<double>().squaredNorm() <= magnitude * magnitude)
|
||||
Point destination = (a.cast<int64_t>() + ab.cast<int64_t>() * int64_t(accumulated_dist) / std::max(int64_t(1), int64_t(total_dist_to_junction_below))).cast<coord_t>();
|
||||
if ((destination - m_p).cast<int64_t>().squaredNorm() <= int64_t(magnitude) * int64_t(magnitude))
|
||||
m_p = destination;
|
||||
else
|
||||
m_p += ((destination - m_p).cast<double>().normalized() * magnitude).cast<coord_t>();
|
||||
@ -262,7 +261,7 @@ Node::RectilinearJunction Node::straighten(
|
||||
child_p = m_children.front(); //recursive call to straighten might have removed the child
|
||||
const NodeSPtr& parent_node = m_parent.lock();
|
||||
if (parent_node &&
|
||||
(child_p->m_p - parent_node->m_p).cast<double>().squaredNorm() < max_remove_colinear_dist2 &&
|
||||
(child_p->m_p - parent_node->m_p).cast<int64_t>().squaredNorm() < max_remove_colinear_dist2 &&
|
||||
Line::distance_to_squared(m_p, parent_node->m_p, child_p->m_p) < close_enough * close_enough) {
|
||||
child_p->m_parent = m_parent;
|
||||
for (auto& sibling : parent_node->m_children)
|
||||
@ -347,7 +346,7 @@ coord_t Node::prune(const coord_t& pruning_distance)
|
||||
void Node::convertToPolylines(Polygons& output, const coord_t line_width) const
|
||||
{
|
||||
Polygons result;
|
||||
output.emplace_back();
|
||||
result.emplace_back();
|
||||
convertToPolylines(0, result);
|
||||
removeJunctionOverlap(result, line_width);
|
||||
append(output, std::move(result));
|
||||
@ -386,7 +385,7 @@ void Node::removeJunctionOverlap(Polygons& result_lines, const coord_t line_widt
|
||||
|
||||
coord_t to_be_reduced = reduction;
|
||||
Point a = polyline.back();
|
||||
for (int point_idx = polyline.size() - 2; point_idx >= 0; point_idx--) {
|
||||
for (int point_idx = int(polyline.size()) - 2; point_idx >= 0; point_idx--) {
|
||||
const Point b = polyline[point_idx];
|
||||
const Point ab = b - a;
|
||||
const auto ab_len = coord_t(ab.cast<double>().norm());
|
||||
@ -408,4 +407,29 @@ void Node::removeJunctionOverlap(Polygons& result_lines, const coord_t line_widt
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LIGHTNING_TREE_NODE_DEBUG_OUTPUT
|
||||
void export_to_svg(const NodeSPtr &root_node, SVG &svg)
|
||||
{
|
||||
for (const NodeSPtr &children : root_node->m_children) {
|
||||
svg.draw(Line(root_node->getLocation(), children->getLocation()), "red");
|
||||
export_to_svg(children, svg);
|
||||
}
|
||||
}
|
||||
|
||||
void export_to_svg(const std::string &path, const Polygons &contour, const std::vector<NodeSPtr> &root_nodes) {
|
||||
BoundingBox bbox = get_extents(contour);
|
||||
|
||||
bbox.offset(SCALED_EPSILON);
|
||||
SVG svg(path, bbox);
|
||||
svg.draw_outline(contour, "blue");
|
||||
|
||||
for (const NodeSPtr &root_node: root_nodes) {
|
||||
for (const NodeSPtr &children: root_node->m_children) {
|
||||
svg.draw(Line(root_node->getLocation(), children->getLocation()), "red");
|
||||
export_to_svg(children, svg);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* LIGHTNING_TREE_NODE_DEBUG_OUTPUT */
|
||||
|
||||
} // namespace Slic3r::FillLightning
|
||||
|
@ -11,6 +11,9 @@
|
||||
|
||||
#include "../../EdgeGrid.hpp"
|
||||
#include "../../Polygon.hpp"
|
||||
#include "SVG.hpp"
|
||||
|
||||
//#define LIGHTNING_TREE_NODE_DEBUG_OUTPUT
|
||||
|
||||
namespace Slic3r::FillLightning
|
||||
{
|
||||
@ -99,9 +102,9 @@ public:
|
||||
std::vector<NodeSPtr>& next_trees,
|
||||
const Polygons& next_outlines,
|
||||
const EdgeGrid::Grid& outline_locator,
|
||||
const coord_t prune_distance,
|
||||
const coord_t smooth_magnitude,
|
||||
const coord_t max_remove_colinear_dist
|
||||
coord_t prune_distance,
|
||||
coord_t smooth_magnitude,
|
||||
coord_t max_remove_colinear_dist
|
||||
) const;
|
||||
|
||||
/*!
|
||||
@ -156,7 +159,7 @@ public:
|
||||
* This is then recursively bubbled up until it reaches the (former) root, which then will become a leaf.
|
||||
* \param new_parent The (new) parent-node of the root, useful for recursing or immediately attaching the node to another tree.
|
||||
*/
|
||||
void reroot(NodeSPtr new_parent = nullptr);
|
||||
void reroot(const NodeSPtr &new_parent = nullptr);
|
||||
|
||||
/*!
|
||||
* Retrieves the closest node to the specified location.
|
||||
@ -211,7 +214,7 @@ protected:
|
||||
* \param magnitude The maximum allowed distance to move the node.
|
||||
* \param max_remove_colinear_dist Maximum distance of the (compound) line-segment from which a co-linear point may be removed.
|
||||
*/
|
||||
void straighten(const coord_t magnitude, const coord_t max_remove_colinear_dist);
|
||||
void straighten(coord_t magnitude, coord_t max_remove_colinear_dist);
|
||||
|
||||
/*! Recursive part of \ref straighten(.)
|
||||
* \param junction_above The last seen junction with multiple children above
|
||||
@ -219,7 +222,7 @@ protected:
|
||||
* \param max_remove_colinear_dist2 Maximum distance _squared_ of the (compound) line-segment from which a co-linear point may be removed.
|
||||
* \return the total distance along the tree from the last junction above to the first next junction below and the location of the next junction below
|
||||
*/
|
||||
RectilinearJunction straighten(const coord_t magnitude, const Point& junction_above, const coord_t accumulated_dist, const coord_t max_remove_colinear_dist2);
|
||||
RectilinearJunction straighten(coord_t magnitude, const Point& junction_above, coord_t accumulated_dist, int64_t max_remove_colinear_dist2);
|
||||
|
||||
/*! Prune the tree from the extremeties (leaf-nodes) until the pruning distance is reached.
|
||||
* \return The distance that has been pruned. If less than \p distance, then the whole tree was puned away.
|
||||
@ -236,7 +239,7 @@ public:
|
||||
*
|
||||
* \param output all branches in this tree connected into polylines
|
||||
*/
|
||||
void convertToPolylines(Polygons& output, const coord_t line_width) const;
|
||||
void convertToPolylines(Polygons& output, coord_t line_width) const;
|
||||
|
||||
/*! If this was ever a direct child of the root, it'll have a previous grounding location.
|
||||
*
|
||||
@ -257,7 +260,7 @@ protected:
|
||||
*/
|
||||
void convertToPolylines(size_t long_line_idx, Polygons& output) const;
|
||||
|
||||
void removeJunctionOverlap(Polygons& polylines, const coord_t line_width) const;
|
||||
void removeJunctionOverlap(Polygons& polylines, coord_t line_width) const;
|
||||
|
||||
bool m_is_root;
|
||||
Point m_p;
|
||||
@ -265,10 +268,20 @@ protected:
|
||||
std::vector<NodeSPtr> m_children;
|
||||
|
||||
std::optional<Point> m_last_grounding_location; //<! The last known grounding location, see 'getLastGroundingLocation()'.
|
||||
|
||||
#ifdef LIGHTNING_TREE_NODE_DEBUG_OUTPUT
|
||||
friend void export_to_svg(const NodeSPtr &root_node, Slic3r::SVG &svg);
|
||||
friend void export_to_svg(const std::string &path, const Polygons &contour, const std::vector<NodeSPtr> &root_nodes);
|
||||
#endif /* LIGHTNING_TREE_NODE_DEBUG_OUTPUT */
|
||||
};
|
||||
|
||||
bool inside(const Polygons &polygons, const Point p);
|
||||
bool lineSegmentPolygonsIntersection(const Point& a, const Point& b, const EdgeGrid::Grid& outline_locator, Point& result, const coord_t within_max_dist);
|
||||
bool inside(const Polygons &polygons, const Point &p);
|
||||
bool lineSegmentPolygonsIntersection(const Point& a, const Point& b, const EdgeGrid::Grid& outline_locator, Point& result, coord_t within_max_dist);
|
||||
|
||||
#ifdef LIGHTNING_TREE_NODE_DEBUG_OUTPUT
|
||||
void export_to_svg(const NodeSPtr &root_node, SVG &svg);
|
||||
void export_to_svg(const std::string &path, const Polygons &contour, const std::vector<NodeSPtr> &root_nodes);
|
||||
#endif /* LIGHTNING_TREE_NODE_DEBUG_OUTPUT */
|
||||
|
||||
} // namespace Slic3r::FillLightning
|
||||
|
||||
|
@ -1155,13 +1155,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
}
|
||||
print.throw_if_canceled();
|
||||
|
||||
// Starting now, the G-code find / replace post-processor will be enabled.
|
||||
file.find_replace_enable();
|
||||
|
||||
// adds tags for time estimators
|
||||
if (print.config().remaining_times.value)
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::First_Line_M73_Placeholder).c_str());
|
||||
|
||||
// Starting now, the G-code find / replace post-processor will be enabled.
|
||||
file.find_replace_enable();
|
||||
|
||||
// Prepare the helper object for replacing placeholders in custom G-code and output filename.
|
||||
m_placeholder_parser = print.placeholder_parser();
|
||||
m_placeholder_parser.update_timestamp();
|
||||
@ -1442,6 +1442,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100%
|
||||
file.write(m_writer.postamble());
|
||||
|
||||
// From now to the end of G-code, the G-code find / replace post-processor will be disabled.
|
||||
// Thus the PrusaSlicer generated config will NOT be processed by the G-code post-processor, see GH issue #7952.
|
||||
file.find_replace_supress();
|
||||
|
||||
// adds tags for time estimators
|
||||
if (print.config().remaining_times.value)
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str());
|
||||
@ -1464,10 +1468,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
file.write_format("; total toolchanges = %i\n", print.m_print_statistics.total_toolchanges);
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
|
||||
|
||||
// From now to the end of G-code, the G-code find / replace post-processor will be disabled.
|
||||
// Thus the PrusaSlicer generated config will NOT be processed by the G-code post-processor, see GH issue #7952.
|
||||
file.find_replace_supress();
|
||||
|
||||
// Append full config, delimited by two 'phony' configuration keys prusaslicer_config = begin and prusaslicer_config = end.
|
||||
// The delimiters are structured as configuration key / value pairs to be parsable by older versions of PrusaSlicer G-code viewer.
|
||||
{
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <unordered_set>
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
//#define AVOID_CROSSING_PERIMETERS_DEBUG_OUTPUT
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
struct TravelPoint
|
||||
@ -354,8 +356,6 @@ static Polyline to_polyline(const std::vector<TravelPoint> &travel)
|
||||
return result;
|
||||
}
|
||||
|
||||
// #define AVOID_CROSSING_PERIMETERS_DEBUG_OUTPUT
|
||||
|
||||
#ifdef AVOID_CROSSING_PERIMETERS_DEBUG_OUTPUT
|
||||
static void export_travel_to_svg(const Polygons &boundary,
|
||||
const Line &original_travel,
|
||||
@ -521,6 +521,25 @@ static float get_perimeter_spacing_external(const Layer &layer)
|
||||
return perimeter_spacing;
|
||||
}
|
||||
|
||||
// Returns average perimeter width calculated from all LayerRegion within the layer.
|
||||
static float get_external_perimeter_width(const Layer &layer)
|
||||
{
|
||||
size_t regions_count = 0;
|
||||
float perimeter_width = 0.f;
|
||||
for (const LayerRegion *layer_region : layer.regions())
|
||||
if (layer_region != nullptr && !layer_region->slices.empty()) {
|
||||
perimeter_width += float(layer_region->flow(frExternalPerimeter).scaled_width());
|
||||
++regions_count;
|
||||
}
|
||||
|
||||
assert(perimeter_width >= 0.f);
|
||||
if (regions_count != 0)
|
||||
perimeter_width /= float(regions_count);
|
||||
else
|
||||
perimeter_width = get_default_perimeter_spacing(*layer.object());
|
||||
return perimeter_width;
|
||||
}
|
||||
|
||||
// Called by avoid_perimeters() and by simplify_travel_heuristics().
|
||||
static size_t avoid_perimeters_inner(const AvoidCrossingPerimeters::Boundary &boundary,
|
||||
const Point &start,
|
||||
@ -659,22 +678,22 @@ static size_t avoid_perimeters(const AvoidCrossingPerimeters::Boundary &boundary
|
||||
// Check if anyone of ExPolygons contains whole travel.
|
||||
// called by need_wipe() and AvoidCrossingPerimeters::travel_to()
|
||||
// FIXME Lukas H.: Maybe similar approach could also be used for ExPolygon::contains()
|
||||
static bool any_expolygon_contains(const ExPolygons &ex_polygons,
|
||||
const std::vector<BoundingBox> &ex_polygons_bboxes,
|
||||
const EdgeGrid::Grid &grid_lslice,
|
||||
static bool any_expolygon_contains(const ExPolygons &lslices_offset,
|
||||
const std::vector<BoundingBox> &lslices_offset_bboxes,
|
||||
const EdgeGrid::Grid &grid_lslices_offset,
|
||||
const Line &travel)
|
||||
{
|
||||
assert(ex_polygons.size() == ex_polygons_bboxes.size());
|
||||
if(!grid_lslice.bbox().contains(travel.a) || !grid_lslice.bbox().contains(travel.b))
|
||||
assert(lslices_offset.size() == lslices_offset_bboxes.size());
|
||||
if(!grid_lslices_offset.bbox().contains(travel.a) || !grid_lslices_offset.bbox().contains(travel.b))
|
||||
return false;
|
||||
|
||||
FirstIntersectionVisitor visitor(grid_lslice);
|
||||
FirstIntersectionVisitor visitor(grid_lslices_offset);
|
||||
visitor.pt_current = &travel.a;
|
||||
visitor.pt_next = &travel.b;
|
||||
grid_lslice.visit_cells_intersecting_line(*visitor.pt_current, *visitor.pt_next, visitor);
|
||||
grid_lslices_offset.visit_cells_intersecting_line(*visitor.pt_current, *visitor.pt_next, visitor);
|
||||
if (!visitor.intersect) {
|
||||
for (const ExPolygon &ex_polygon : ex_polygons) {
|
||||
const BoundingBox &bbox = ex_polygons_bboxes[&ex_polygon - &ex_polygons.front()];
|
||||
for (const ExPolygon &ex_polygon : lslices_offset) {
|
||||
const BoundingBox &bbox = lslices_offset_bboxes[&ex_polygon - &lslices_offset.front()];
|
||||
if (bbox.contains(travel.a) && bbox.contains(travel.b) && ex_polygon.contains(travel.a))
|
||||
return true;
|
||||
}
|
||||
@ -684,18 +703,18 @@ static bool any_expolygon_contains(const ExPolygons &ex_polygons,
|
||||
|
||||
// Check if anyone of ExPolygons contains whole travel.
|
||||
// called by need_wipe()
|
||||
static bool any_expolygon_contains(const ExPolygons &ex_polygons, const std::vector<BoundingBox> &ex_polygons_bboxes, const EdgeGrid::Grid &grid_lslice, const Polyline &travel)
|
||||
static bool any_expolygon_contains(const ExPolygons &ex_polygons, const std::vector<BoundingBox> &ex_polygons_bboxes, const EdgeGrid::Grid &grid_lslice_offset, const Polyline &travel)
|
||||
{
|
||||
assert(ex_polygons.size() == ex_polygons_bboxes.size());
|
||||
if(std::any_of(travel.points.begin(), travel.points.end(), [&grid_lslice](const Point &point) { return !grid_lslice.bbox().contains(point); }))
|
||||
if(std::any_of(travel.points.begin(), travel.points.end(), [&grid_lslice_offset](const Point &point) { return !grid_lslice_offset.bbox().contains(point); }))
|
||||
return false;
|
||||
|
||||
FirstIntersectionVisitor visitor(grid_lslice);
|
||||
FirstIntersectionVisitor visitor(grid_lslice_offset);
|
||||
bool any_intersection = false;
|
||||
for (size_t line_idx = 1; line_idx < travel.size(); ++line_idx) {
|
||||
visitor.pt_current = &travel.points[line_idx - 1];
|
||||
visitor.pt_next = &travel.points[line_idx];
|
||||
grid_lslice.visit_cells_intersecting_line(*visitor.pt_current, *visitor.pt_next, visitor);
|
||||
grid_lslice_offset.visit_cells_intersecting_line(*visitor.pt_current, *visitor.pt_next, visitor);
|
||||
any_intersection = visitor.intersect;
|
||||
if (any_intersection) break;
|
||||
}
|
||||
@ -711,14 +730,14 @@ static bool any_expolygon_contains(const ExPolygons &ex_polygons, const std::vec
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool need_wipe(const GCode &gcodegen,
|
||||
const EdgeGrid::Grid &grid_lslice,
|
||||
const Line &original_travel,
|
||||
const Polyline &result_travel,
|
||||
const size_t intersection_count)
|
||||
static bool need_wipe(const GCode &gcodegen,
|
||||
const ExPolygons &lslices_offset,
|
||||
const std::vector<BoundingBox> &lslices_offset_bboxes,
|
||||
const EdgeGrid::Grid &grid_lslices_offset,
|
||||
const Line &original_travel,
|
||||
const Polyline &result_travel,
|
||||
const size_t intersection_count)
|
||||
{
|
||||
const ExPolygons &lslices = gcodegen.layer()->lslices;
|
||||
const std::vector<BoundingBox> &lslices_bboxes = gcodegen.layer()->lslices_bboxes;
|
||||
bool z_lift_enabled = gcodegen.config().retract_lift.get_at(gcodegen.writer().extruder()->id()) > 0.;
|
||||
bool wipe_needed = false;
|
||||
|
||||
@ -728,16 +747,16 @@ static bool need_wipe(const GCode &gcodegen,
|
||||
// The original layer is intersected with defined boundaries. Then it is necessary to make a detailed test.
|
||||
// If the z-lift is enabled, then a wipe is needed when the original travel leads above the holes.
|
||||
if (z_lift_enabled) {
|
||||
if (any_expolygon_contains(lslices, lslices_bboxes, grid_lslice, original_travel)) {
|
||||
if (any_expolygon_contains(lslices_offset, lslices_offset_bboxes, grid_lslices_offset, original_travel)) {
|
||||
// Check if original_travel and result_travel are not same.
|
||||
// If both are the same, then it is possible to skip testing of result_travel
|
||||
wipe_needed = !(result_travel.size() > 2 && result_travel.first_point() == original_travel.a && result_travel.last_point() == original_travel.b) &&
|
||||
!any_expolygon_contains(lslices, lslices_bboxes, grid_lslice, result_travel);
|
||||
!any_expolygon_contains(lslices_offset, lslices_offset_bboxes, grid_lslices_offset, result_travel);
|
||||
} else {
|
||||
wipe_needed = true;
|
||||
}
|
||||
} else {
|
||||
wipe_needed = !any_expolygon_contains(lslices, lslices_bboxes, grid_lslice, result_travel);
|
||||
wipe_needed = !any_expolygon_contains(lslices_offset, lslices_offset_bboxes, grid_lslices_offset, result_travel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1163,10 +1182,8 @@ Polyline AvoidCrossingPerimeters::travel_to(const GCode &gcodegen, const Point &
|
||||
Vec2d startf = start.cast<double>();
|
||||
Vec2d endf = end .cast<double>();
|
||||
|
||||
const ExPolygons &lslices = gcodegen.layer()->lslices;
|
||||
const std::vector<BoundingBox> &lslices_bboxes = gcodegen.layer()->lslices_bboxes;
|
||||
bool is_support_layer = dynamic_cast<const SupportLayer *>(gcodegen.layer()) != nullptr;
|
||||
if (!use_external && (is_support_layer || (!lslices.empty() && !any_expolygon_contains(lslices, lslices_bboxes, m_grid_lslice, travel)))) {
|
||||
bool is_support_layer = dynamic_cast<const SupportLayer *>(gcodegen.layer()) != nullptr;
|
||||
if (!use_external && (is_support_layer || (!m_lslices_offset.empty() && !any_expolygon_contains(m_lslices_offset, m_lslices_offset_bboxes, m_grid_lslices_offset, travel)))) {
|
||||
// Initialize m_internal only when it is necessary.
|
||||
if (m_internal.boundaries.empty())
|
||||
init_boundary(&m_internal, to_polygons(get_boundary(*gcodegen.layer())));
|
||||
@ -1216,7 +1233,7 @@ Polyline AvoidCrossingPerimeters::travel_to(const GCode &gcodegen, const Point &
|
||||
} else if (max_detour_length_exceeded) {
|
||||
*could_be_wipe_disabled = false;
|
||||
} else
|
||||
*could_be_wipe_disabled = !need_wipe(gcodegen, m_grid_lslice, travel, result_pl, travel_intersection_count);
|
||||
*could_be_wipe_disabled = !need_wipe(gcodegen, m_lslices_offset, m_lslices_offset_bboxes, m_grid_lslices_offset, travel, result_pl, travel_intersection_count);
|
||||
|
||||
return result_pl;
|
||||
}
|
||||
@ -1227,13 +1244,21 @@ void AvoidCrossingPerimeters::init_layer(const Layer &layer)
|
||||
{
|
||||
m_internal.clear();
|
||||
m_external.clear();
|
||||
m_lslices_offset.clear();
|
||||
m_lslices_offset_bboxes.clear();
|
||||
|
||||
float perimeter_offset = -get_external_perimeter_width(layer) / float(2.);
|
||||
m_lslices_offset = offset_ex(layer.lslices, perimeter_offset);
|
||||
|
||||
m_lslices_offset_bboxes.reserve(m_lslices_offset.size());
|
||||
for (const ExPolygon &ex_poly : m_lslices_offset)
|
||||
m_lslices_offset_bboxes.emplace_back(get_extents(ex_poly));
|
||||
|
||||
BoundingBox bbox_slice(get_extents(layer.lslices));
|
||||
bbox_slice.offset(SCALED_EPSILON);
|
||||
|
||||
m_grid_lslice.set_bbox(bbox_slice);
|
||||
//FIXME 1mm grid?
|
||||
m_grid_lslice.create(layer.lslices, coord_t(scale_(1.)));
|
||||
m_grid_lslices_offset.set_bbox(bbox_slice);
|
||||
m_grid_lslices_offset.create(m_lslices_offset, coord_t(scale_(1.)));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -58,8 +58,11 @@ private:
|
||||
// we enable it by default for the first travel move in print
|
||||
bool m_disabled_once { true };
|
||||
|
||||
// Lslices offseted by half an external perimeter width. Used for detection if line or polyline is inside of any polygon.
|
||||
ExPolygons m_lslices_offset;
|
||||
std::vector<BoundingBox> m_lslices_offset_bboxes;
|
||||
// Used for detection of line or polyline is inside of any polygon.
|
||||
EdgeGrid::Grid m_grid_lslice;
|
||||
EdgeGrid::Grid m_grid_lslices_offset;
|
||||
// Store all needed data for travels inside object
|
||||
Boundary m_internal;
|
||||
// Store all needed data for travels outside object
|
||||
|
@ -36,6 +36,10 @@ static const float DEFAULT_FILAMENT_DIAMETER = 1.75f;
|
||||
static const float DEFAULT_FILAMENT_DENSITY = 1.245f;
|
||||
static const Slic3r::Vec3f DEFAULT_EXTRUDER_OFFSET = Slic3r::Vec3f::Zero();
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
static const std::string INTERNAL_G2G3_TAG = "!#!#! internal only - from G2/G3 expansion !#!#!";
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
const std::vector<std::string> GCodeProcessor::Reserved_Tags = {
|
||||
@ -737,9 +741,7 @@ void GCodeProcessorResult::reset() {
|
||||
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
||||
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
||||
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
time = 0;
|
||||
}
|
||||
#else
|
||||
@ -755,9 +757,7 @@ void GCodeProcessorResult::reset() {
|
||||
filament_diameters = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DIAMETER);
|
||||
filament_densities = std::vector<float>(MIN_EXTRUDERS_COUNT, DEFAULT_FILAMENT_DENSITY);
|
||||
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
spiral_vase_layers = std::vector<std::pair<float, std::pair<size_t, size_t>>>();
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
}
|
||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||
|
||||
@ -905,17 +905,13 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||
|
||||
m_result.max_print_height = config.max_print_height;
|
||||
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
||||
if (spiral_vase != nullptr)
|
||||
m_spiral_vase_active = spiral_vase->value;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
||||
if (z_offset != nullptr)
|
||||
m_z_offset = z_offset->value;
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
}
|
||||
|
||||
void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||
@ -1160,17 +1156,13 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||
if (max_print_height != nullptr)
|
||||
m_result.max_print_height = max_print_height->value;
|
||||
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_vase");
|
||||
if (spiral_vase != nullptr)
|
||||
m_spiral_vase_active = spiral_vase->value;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
const ConfigOptionFloat* z_offset = config.option<ConfigOptionFloat>("z_offset");
|
||||
if (z_offset != nullptr)
|
||||
m_z_offset = z_offset->value;
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
}
|
||||
|
||||
void GCodeProcessor::enable_stealth_time_estimator(bool enabled)
|
||||
@ -1203,9 +1195,7 @@ void GCodeProcessor::reset()
|
||||
m_forced_height = 0.0f;
|
||||
m_mm3_per_mm = 0.0f;
|
||||
m_fan_speed = 0.0f;
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
m_z_offset = 0.0f;
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
|
||||
m_extrusion_role = erNone;
|
||||
m_extruder_id = 0;
|
||||
@ -1220,7 +1210,6 @@ void GCodeProcessor::reset()
|
||||
|
||||
m_extruded_last_z = 0.0f;
|
||||
m_first_layer_height = 0.0f;
|
||||
m_processing_start_custom_gcode = false;
|
||||
m_g1_line_id = 0;
|
||||
m_layer_id = 0;
|
||||
m_cp_color.reset();
|
||||
@ -1238,9 +1227,7 @@ void GCodeProcessor::reset()
|
||||
|
||||
m_options_z_corrector.reset();
|
||||
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
m_spiral_vase_active = false;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
|
||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||
m_mm3_per_mm_compare.reset();
|
||||
@ -1596,6 +1583,10 @@ void GCodeProcessor::process_gcode_line(const GCodeReader::GCodeLine& line, bool
|
||||
switch (cmd[1]) {
|
||||
case '0': { process_G0(line); break; } // Move
|
||||
case '1': { process_G1(line); break; } // Move
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
case '2': { process_G2_G3(line, true); break; } // CW Arc Move
|
||||
case '3': { process_G2_G3(line, false); break; } // CCW Arc Move
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
@ -1826,7 +1817,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
||||
set_extrusion_role(ExtrusionEntity::string_to_role(comment.substr(reserved_tag(ETags::Role).length())));
|
||||
if (m_extrusion_role == erExternalPerimeter)
|
||||
m_seams_detector.activate(true);
|
||||
m_processing_start_custom_gcode = (m_extrusion_role == erCustom && m_g1_line_id == 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1950,16 +1940,17 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
||||
// layer change tag
|
||||
if (comment == reserved_tag(ETags::Layer_Change)) {
|
||||
++m_layer_id;
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
if (m_spiral_vase_active) {
|
||||
assert(!m_result.moves.empty());
|
||||
size_t move_id = m_result.moves.size() - 1;
|
||||
if (!m_result.spiral_vase_layers.empty() && m_end_position[Z] == m_result.spiral_vase_layers.back().first)
|
||||
m_result.spiral_vase_layers.back().second.second = move_id;
|
||||
else
|
||||
m_result.spiral_vase_layers.push_back({ static_cast<float>(m_end_position[Z]), { move_id, move_id } });
|
||||
if (m_result.moves.empty())
|
||||
m_result.spiral_vase_layers.push_back({ m_first_layer_height, { 0, 0 } });
|
||||
else {
|
||||
const size_t move_id = m_result.moves.size() - 1;
|
||||
if (!m_result.spiral_vase_layers.empty() && m_end_position[Z] == m_result.spiral_vase_layers.back().first)
|
||||
m_result.spiral_vase_layers.back().second.second = move_id;
|
||||
else
|
||||
m_result.spiral_vase_layers.push_back({ static_cast<float>(m_end_position[Z]), { move_id, move_id } });
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2450,9 +2441,10 @@ void GCodeProcessor::process_G0(const GCodeReader::GCodeLine& line)
|
||||
|
||||
void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
{
|
||||
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_result.filament_diameters.size()) ? m_result.filament_diameters[m_extruder_id] : m_result.filament_diameters.back();
|
||||
float filament_radius = 0.5f * filament_diameter;
|
||||
float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
|
||||
const float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_result.filament_diameters.size()) ? m_result.filament_diameters[m_extruder_id] : m_result.filament_diameters.back();
|
||||
const float filament_radius = 0.5f * filament_diameter;
|
||||
const float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
|
||||
#if !ENABLE_PROCESS_G2_G3_LINES
|
||||
auto absolute_position = [this, area_filament_cross_section](Axis axis, const GCodeReader::GCodeLine& lineG1) {
|
||||
bool is_relative = (m_global_positioning_type == EPositioningType::Relative);
|
||||
if (axis == E)
|
||||
@ -2468,6 +2460,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
else
|
||||
return m_start_position[axis];
|
||||
};
|
||||
#endif // !ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
auto move_type = [this](const AxisCoords& delta_pos) {
|
||||
EMoveType type = EMoveType::Noop;
|
||||
@ -2495,7 +2488,11 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
|
||||
// updates axes positions from line
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
m_end_position[a] = extract_absolute_position_on_axis((Axis)a, line, double(area_filament_cross_section));
|
||||
#else
|
||||
m_end_position[a] = absolute_position((Axis)a, line);
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
}
|
||||
|
||||
// updates feedrate from line, if present
|
||||
@ -2514,11 +2511,11 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
if (max_abs_delta == 0.0f)
|
||||
return;
|
||||
|
||||
EMoveType type = move_type(delta_pos);
|
||||
const EMoveType type = move_type(delta_pos);
|
||||
if (type == EMoveType::Extrude) {
|
||||
float delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
|
||||
float volume_extruded_filament = area_filament_cross_section * delta_pos[E];
|
||||
float area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
|
||||
const float delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
|
||||
const float volume_extruded_filament = area_filament_cross_section * delta_pos[E];
|
||||
const float area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
|
||||
|
||||
// save extruded volume to the cache
|
||||
m_used_filaments.increase_caches(volume_extruded_filament);
|
||||
@ -2529,12 +2526,25 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
m_mm3_per_mm_compare.update(area_toolpath_cross_section, m_extrusion_role);
|
||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
if (m_forced_height > 0.0f)
|
||||
m_height = m_forced_height;
|
||||
else if (m_layer_id == 0)
|
||||
m_height = (m_end_position[Z] <= double(m_first_layer_height)) ? m_end_position[Z] : m_first_layer_height;
|
||||
else if (line.comment() != INTERNAL_G2G3_TAG){
|
||||
if (m_end_position[Z] > m_extruded_last_z + EPSILON && delta_pos[Z] == 0.0)
|
||||
m_height = m_end_position[Z] - m_extruded_last_z;
|
||||
}
|
||||
#else
|
||||
if (m_forced_height > 0.0f)
|
||||
m_height = m_forced_height;
|
||||
else if (m_layer_id == 0)
|
||||
m_height = (m_end_position[Z] <= double(m_first_layer_height)) ? m_end_position[Z] : m_first_layer_height;
|
||||
else {
|
||||
if (m_end_position[Z] > m_extruded_last_z + EPSILON)
|
||||
m_height = m_end_position[Z] - m_extruded_last_z;
|
||||
}
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
if (m_height == 0.0f)
|
||||
m_height = DEFAULT_TOOLPATH_HEIGHT;
|
||||
@ -2542,7 +2552,10 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
if (m_end_position[Z] == 0.0f)
|
||||
m_end_position[Z] = m_height;
|
||||
|
||||
m_extruded_last_z = m_end_position[Z];
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
if (line.comment() != INTERNAL_G2G3_TAG)
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
m_extruded_last_z = m_end_position[Z];
|
||||
m_options_z_corrector.update(m_height);
|
||||
|
||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||
@ -2582,9 +2595,9 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
return delta_pos[X] == 0.0f && delta_pos[Y] == 0.0f && delta_pos[Z] == 0.0f && delta_pos[E] != 0.0f;
|
||||
};
|
||||
|
||||
float distance = move_length(delta_pos);
|
||||
const float distance = move_length(delta_pos);
|
||||
assert(distance != 0.0f);
|
||||
float inv_distance = 1.0f / distance;
|
||||
const float inv_distance = 1.0f / distance;
|
||||
|
||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||
TimeMachine& machine = m_time_processor.machines[i];
|
||||
@ -2615,7 +2628,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
|
||||
curr.abs_axis_feedrate[a] = std::abs(curr.axis_feedrate[a]);
|
||||
if (curr.abs_axis_feedrate[a] != 0.0f) {
|
||||
float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
const float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
if (axis_max_feedrate != 0.0f)
|
||||
min_feedrate_factor = std::min<float>(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
|
||||
}
|
||||
@ -2638,7 +2651,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
get_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i)));
|
||||
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
float axis_max_acceleration = get_axis_max_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
const float axis_max_acceleration = get_axis_max_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
if (acceleration * std::abs(delta_pos[a]) * inv_distance > axis_max_acceleration)
|
||||
acceleration = axis_max_acceleration;
|
||||
}
|
||||
@ -2649,7 +2662,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
curr.safe_feedrate = block.feedrate_profile.cruise;
|
||||
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
const float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
if (curr.abs_axis_feedrate[a] > axis_max_jerk)
|
||||
curr.safe_feedrate = std::min(curr.safe_feedrate, axis_max_jerk);
|
||||
}
|
||||
@ -2683,7 +2696,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
}
|
||||
|
||||
// Calculate the jerk depending on whether the axis is coasting in the same direction or reversing a direction.
|
||||
float jerk =
|
||||
const float jerk =
|
||||
(v_exit > v_entry) ?
|
||||
((v_entry > 0.0f || v_exit < 0.0f) ?
|
||||
// coasting
|
||||
@ -2697,7 +2710,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
// axis reversal
|
||||
std::max(-v_exit, v_entry));
|
||||
|
||||
float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
const float axis_max_jerk = get_axis_max_jerk(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
|
||||
if (jerk > axis_max_jerk) {
|
||||
v_factor *= axis_max_jerk / jerk;
|
||||
limited = true;
|
||||
@ -2709,14 +2722,14 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
|
||||
// Now the transition velocity is known, which maximizes the shared exit / entry velocity while
|
||||
// respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints.
|
||||
float vmax_junction_threshold = vmax_junction * 0.99f;
|
||||
const float vmax_junction_threshold = vmax_junction * 0.99f;
|
||||
|
||||
// Not coasting. The machine will stop and start the movements anyway, better to start the segment from start.
|
||||
if (prev.safe_feedrate > vmax_junction_threshold && curr.safe_feedrate > vmax_junction_threshold)
|
||||
vmax_junction = curr.safe_feedrate;
|
||||
}
|
||||
|
||||
float v_allowable = max_allowable_speed(-acceleration, curr.safe_feedrate, block.distance);
|
||||
const float v_allowable = max_allowable_speed(-acceleration, curr.safe_feedrate, block.distance);
|
||||
block.feedrate_profile.entry = std::min(vmax_junction, v_allowable);
|
||||
|
||||
block.max_entry_speed = vmax_junction;
|
||||
@ -2752,11 +2765,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
// the threshold value = 0.0625f == 0.25 * 0.25 is arbitrary, we may find some smarter condition later
|
||||
|
||||
if ((new_pos - *first_vertex).squaredNorm() < 0.0625f) {
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
set_end_position(0.5f * (new_pos + *first_vertex) + m_z_offset * Vec3f::UnitZ());
|
||||
#else
|
||||
set_end_position(0.5f * (new_pos + *first_vertex));
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
store_move_vertex(EMoveType::Seam);
|
||||
set_end_position(curr_pos);
|
||||
}
|
||||
@ -2769,15 +2778,221 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||
m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id]);
|
||||
}
|
||||
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
if (m_spiral_vase_active && !m_result.spiral_vase_layers.empty() && !m_result.moves.empty())
|
||||
m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
|
||||
// store move
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
store_move_vertex(type, line.comment() == INTERNAL_G2G3_TAG);
|
||||
#else
|
||||
store_move_vertex(type);
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
}
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line, bool clockwise)
|
||||
{
|
||||
if (!line.has('X') || !line.has('Y') || !line.has('I') || !line.has('J'))
|
||||
return;
|
||||
|
||||
// relative center
|
||||
Vec3f rel_center = Vec3f::Zero();
|
||||
if (!line.has_value('I', rel_center.x()) || !line.has_value('J', rel_center.y()))
|
||||
return;
|
||||
|
||||
// scale center, if needed
|
||||
if (m_units == EUnits::Inches)
|
||||
rel_center *= INCHES_TO_MM;
|
||||
|
||||
struct Arc
|
||||
{
|
||||
Vec3d start{ Vec3d::Zero() };
|
||||
Vec3d end{ Vec3d::Zero() };
|
||||
Vec3d center{ Vec3d::Zero() };
|
||||
|
||||
double angle{ 0.0 };
|
||||
double delta_x() const { return end.x() - start.x(); }
|
||||
double delta_y() const { return end.y() - start.y(); }
|
||||
double delta_z() const { return end.z() - start.z(); }
|
||||
|
||||
double length() const { return angle * start_radius(); }
|
||||
double travel_length() const { return std::sqrt(sqr(length() + sqr(delta_z()))); }
|
||||
double start_radius() const { return (start - center).norm(); }
|
||||
double end_radius() const { return (end - center).norm(); }
|
||||
|
||||
Vec3d relative_start() const { return start - center; }
|
||||
Vec3d relative_end() const { return end - center; }
|
||||
|
||||
bool closed() const { return end.isApprox(start); }
|
||||
};
|
||||
|
||||
Arc arc;
|
||||
|
||||
// arc start endpoint
|
||||
arc.start = Vec3d(m_start_position[X], m_start_position[Y], m_start_position[Z]);
|
||||
|
||||
// arc center
|
||||
arc.center = arc.start + rel_center.cast<double>();
|
||||
|
||||
const float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_result.filament_diameters.size()) ? m_result.filament_diameters[m_extruder_id] : m_result.filament_diameters.back();
|
||||
const float filament_radius = 0.5f * filament_diameter;
|
||||
const float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
|
||||
|
||||
AxisCoords end_position = m_start_position;
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
end_position[a] = extract_absolute_position_on_axis((Axis)a, line, double(area_filament_cross_section));
|
||||
}
|
||||
|
||||
// arc end endpoint
|
||||
arc.end = Vec3d(end_position[X], end_position[Y], end_position[Z]);
|
||||
|
||||
// radii
|
||||
if (std::abs(arc.end_radius() - arc.start_radius()) > EPSILON) {
|
||||
// what to do ???
|
||||
}
|
||||
|
||||
// updates feedrate from line
|
||||
std::optional<float> feedrate;
|
||||
if (line.has_f())
|
||||
feedrate = m_feed_multiply.current * line.f() * MMMIN_TO_MMSEC;
|
||||
|
||||
// updates extrusion from line
|
||||
std::optional<float> extrusion;
|
||||
if (line.has_e())
|
||||
extrusion = end_position[E] - m_start_position[E];
|
||||
|
||||
// relative arc endpoints
|
||||
const Vec3d rel_arc_start = arc.relative_start();
|
||||
const Vec3d rel_arc_end = arc.relative_end();
|
||||
|
||||
// arc angle
|
||||
if (arc.closed())
|
||||
arc.angle = 2.0 * PI;
|
||||
else {
|
||||
arc.angle = std::atan2(rel_arc_start.x() * rel_arc_end.y() - rel_arc_start.y() * rel_arc_end.x(),
|
||||
rel_arc_start.x() * rel_arc_end.x() + rel_arc_start.y() * rel_arc_end.y());
|
||||
if (arc.angle < 0.0)
|
||||
arc.angle += 2.0 * PI;
|
||||
if (clockwise)
|
||||
arc.angle -= 2.0 * PI;
|
||||
}
|
||||
|
||||
const double travel_length = arc.travel_length();
|
||||
if (travel_length < 0.001)
|
||||
return;
|
||||
|
||||
auto adjust_target = [this, area_filament_cross_section](const AxisCoords& target, const AxisCoords& prev_position) {
|
||||
AxisCoords ret = target;
|
||||
if (m_global_positioning_type == EPositioningType::Relative) {
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
ret[a] -= prev_position[a];
|
||||
}
|
||||
}
|
||||
else if (m_e_local_positioning_type == EPositioningType::Relative)
|
||||
ret[E] -= prev_position[E];
|
||||
|
||||
if (m_use_volumetric_e)
|
||||
ret[E] *= area_filament_cross_section;
|
||||
|
||||
const double lengthsScaleFactor = (m_units == EUnits::Inches) ? double(INCHES_TO_MM) : 1.0;
|
||||
for (unsigned char a = X; a <= E; ++a) {
|
||||
ret[a] /= lengthsScaleFactor;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
auto internal_only_g1_line = [](const AxisCoords& target, bool has_z, const std::optional<float>& feedrate, const std::optional<float>& extrusion) {
|
||||
std::string ret = (boost::format("G1 X%1% Y%2%") % target[X] % target[Y]).str();
|
||||
if (has_z)
|
||||
ret += (boost::format(" Z%1%") % target[Z]).str();
|
||||
if (feedrate.has_value())
|
||||
ret += (boost::format(" F%1%") % *feedrate).str();
|
||||
if (extrusion.has_value())
|
||||
ret += (boost::format(" E%1%") % target[E]).str();
|
||||
|
||||
ret += (boost::format(" ;%1%\n") % INTERNAL_G2G3_TAG).str();
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
// calculate arc segments
|
||||
// reference:
|
||||
// Prusa-Firmware\Firmware\motion_control.cpp - mc_arc()
|
||||
|
||||
// segments count
|
||||
static const double MM_PER_ARC_SEGMENT = 1.0;
|
||||
const size_t segments = std::max<size_t>(std::floor(travel_length / MM_PER_ARC_SEGMENT), 1);
|
||||
|
||||
const double theta_per_segment = arc.angle / double(segments);
|
||||
const double z_per_segment = arc.delta_z() / double(segments);
|
||||
const double extruder_per_segment = (extrusion.has_value()) ? *extrusion / double(segments) : 0.0;
|
||||
|
||||
double cos_T = 1.0 - 0.5 * sqr(theta_per_segment); // Small angle approximation
|
||||
double sin_T = theta_per_segment;
|
||||
|
||||
AxisCoords prev_target = m_start_position;
|
||||
AxisCoords arc_target;
|
||||
double sin_Ti;
|
||||
double cos_Ti;
|
||||
double r_axisi;
|
||||
size_t count = 0;
|
||||
|
||||
// Initialize the linear axis
|
||||
arc_target[Z] = m_start_position[Z];
|
||||
|
||||
// Initialize the extruder axis
|
||||
arc_target[E] = m_start_position[E];
|
||||
|
||||
static const size_t N_ARC_CORRECTION = 25;
|
||||
|
||||
Vec3d curr_rel_arc_start = arc.relative_start();
|
||||
|
||||
std::string gcode;
|
||||
|
||||
for (size_t i = 1; i < segments; ++i) { // Increment (segments-1)
|
||||
if (count < N_ARC_CORRECTION) {
|
||||
// Apply vector rotation matrix
|
||||
r_axisi = curr_rel_arc_start.x() * sin_T + curr_rel_arc_start.y() * cos_T;
|
||||
curr_rel_arc_start.x() = curr_rel_arc_start.x() * cos_T - curr_rel_arc_start.y() * sin_T;
|
||||
curr_rel_arc_start.y() = r_axisi;
|
||||
count++;
|
||||
}
|
||||
else {
|
||||
// Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments.
|
||||
// Compute exact location by applying transformation matrix from initial radius vector(=-offset).
|
||||
cos_Ti = ::cos(double(i) * theta_per_segment);
|
||||
sin_Ti = ::sin(double(i) * theta_per_segment);
|
||||
curr_rel_arc_start.x() = -double(rel_center.x()) * cos_Ti + double(rel_center.y()) * sin_Ti;
|
||||
curr_rel_arc_start.y() = -double(rel_center.x()) * sin_Ti - double(rel_center.y()) * cos_Ti;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
// Update arc_target location
|
||||
arc_target[X] = arc.center.x() + curr_rel_arc_start.x();
|
||||
arc_target[Y] = arc.center.y() + curr_rel_arc_start.y();
|
||||
arc_target[Z] += z_per_segment;
|
||||
arc_target[E] += extruder_per_segment;
|
||||
|
||||
gcode += internal_only_g1_line(adjust_target(arc_target, prev_target), z_per_segment != 0.0, feedrate, extrusion);
|
||||
prev_target = arc_target;
|
||||
|
||||
// feedrate is constant, we do not need to repeat it
|
||||
feedrate.reset();
|
||||
}
|
||||
|
||||
// Ensure last segment arrives at target location.
|
||||
gcode += internal_only_g1_line(adjust_target(end_position, prev_target), arc.delta_z() != 0.0, feedrate, extrusion);
|
||||
|
||||
// process fake gcode lines
|
||||
GCodeReader parser;
|
||||
parser.parse_buffer(gcode, [this](GCodeReader&, const GCodeReader::GCodeLine& line) {
|
||||
// force all lines to share the same id
|
||||
--m_line_id;
|
||||
process_gcode_line(line, false);
|
||||
});
|
||||
}
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
void GCodeProcessor::process_G10(const GCodeReader::GCodeLine& line)
|
||||
{
|
||||
// stores retract move
|
||||
@ -3278,7 +3493,11 @@ void GCodeProcessor::process_T(const std::string_view command)
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
void GCodeProcessor::store_move_vertex(EMoveType type, bool internal_only)
|
||||
#else
|
||||
void GCodeProcessor::store_move_vertex(EMoveType type)
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
{
|
||||
m_last_line_id = (type == EMoveType::Color_change || type == EMoveType::Pause_Print || type == EMoveType::Custom_GCode) ?
|
||||
m_line_id + 1 :
|
||||
@ -3290,11 +3509,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type)
|
||||
m_extrusion_role,
|
||||
m_extruder_id,
|
||||
m_cp_color.current,
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z] - m_z_offset) + m_extruder_offsets[m_extruder_id],
|
||||
#else
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z]) + m_extruder_offsets[m_extruder_id],
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_end_position[Z] - m_z_offset) + m_extruder_offsets[m_extruder_id],
|
||||
static_cast<float>(m_end_position[E] - m_start_position[E]),
|
||||
m_feedrate,
|
||||
m_width,
|
||||
@ -3302,7 +3517,12 @@ void GCodeProcessor::store_move_vertex(EMoveType type)
|
||||
m_mm3_per_mm,
|
||||
m_fan_speed,
|
||||
m_extruder_temps[m_extruder_id],
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
static_cast<float>(m_result.moves.size()),
|
||||
internal_only
|
||||
#else
|
||||
static_cast<float>(m_result.moves.size())
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
});
|
||||
|
||||
// stores stop time placeholders for later use
|
||||
@ -3499,5 +3719,24 @@ void GCodeProcessor::update_estimated_times_stats()
|
||||
m_result.print_statistics.used_filaments_per_role = m_used_filaments.filaments_per_role;
|
||||
}
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
double GCodeProcessor::extract_absolute_position_on_axis(Axis axis, const GCodeReader::GCodeLine& line, double area_filament_cross_section)
|
||||
{
|
||||
if (line.has(Slic3r::Axis(axis))) {
|
||||
bool is_relative = (m_global_positioning_type == EPositioningType::Relative);
|
||||
if (axis == E)
|
||||
is_relative |= (m_e_local_positioning_type == EPositioningType::Relative);
|
||||
|
||||
const double lengthsScaleFactor = (m_units == EUnits::Inches) ? double(INCHES_TO_MM) : 1.0;
|
||||
double ret = line.value(Slic3r::Axis(axis)) * lengthsScaleFactor;
|
||||
if (axis == E && m_use_volumetric_e)
|
||||
ret /= area_filament_cross_section;
|
||||
return is_relative ? m_start_position[axis] + ret : m_origin[axis] + ret;
|
||||
}
|
||||
else
|
||||
return m_start_position[axis];
|
||||
}
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
} /* namespace Slic3r */
|
||||
|
||||
|
@ -113,6 +113,9 @@ namespace Slic3r {
|
||||
float fan_speed{ 0.0f }; // percentage
|
||||
float temperature{ 0.0f }; // Celsius degrees
|
||||
float time{ 0.0f }; // s
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
bool internal_only{ false };
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
float volumetric_rate() const { return feedrate * mm3_per_mm; }
|
||||
};
|
||||
@ -131,9 +134,7 @@ namespace Slic3r {
|
||||
std::vector<float> filament_densities;
|
||||
PrintEstimatedStatistics print_statistics;
|
||||
std::vector<CustomGCode::Item> custom_gcode_per_print_z;
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
|
||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||
int64_t time{ 0 };
|
||||
@ -542,16 +543,13 @@ namespace Slic3r {
|
||||
float m_forced_height; // mm
|
||||
float m_mm3_per_mm;
|
||||
float m_fan_speed; // percentage
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
float m_z_offset; // mm
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
ExtrusionRole m_extrusion_role;
|
||||
unsigned char m_extruder_id;
|
||||
ExtruderColors m_extruder_colors;
|
||||
ExtruderTemps m_extruder_temps;
|
||||
float m_extruded_last_z;
|
||||
float m_first_layer_height; // mm
|
||||
bool m_processing_start_custom_gcode;
|
||||
unsigned int m_g1_line_id;
|
||||
unsigned int m_layer_id;
|
||||
CpColor m_cp_color;
|
||||
@ -559,9 +557,7 @@ namespace Slic3r {
|
||||
SeamsDetector m_seams_detector;
|
||||
OptionsZCorrector m_options_z_corrector;
|
||||
size_t m_last_default_color_id;
|
||||
#if ENABLE_SPIRAL_VASE_LAYERS
|
||||
bool m_spiral_vase_active;
|
||||
#endif // ENABLE_SPIRAL_VASE_LAYERS
|
||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time;
|
||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||
@ -652,6 +648,11 @@ namespace Slic3r {
|
||||
void process_G0(const GCodeReader::GCodeLine& line);
|
||||
void process_G1(const GCodeReader::GCodeLine& line);
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
// Arc Move
|
||||
void process_G2_G3(const GCodeReader::GCodeLine& line, bool clockwise);
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
// Retract
|
||||
void process_G10(const GCodeReader::GCodeLine& line);
|
||||
|
||||
@ -752,7 +753,11 @@ namespace Slic3r {
|
||||
void process_T(const GCodeReader::GCodeLine& line);
|
||||
void process_T(const std::string_view command);
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
void store_move_vertex(EMoveType type, bool internal_only = false);
|
||||
#else
|
||||
void store_move_vertex(EMoveType type);
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
|
||||
void set_extrusion_role(ExtrusionRole role);
|
||||
|
||||
@ -777,6 +782,10 @@ namespace Slic3r {
|
||||
void simulate_st_synchronize(float additional_time = 0.0f);
|
||||
|
||||
void update_estimated_times_stats();
|
||||
|
||||
#if ENABLE_PROCESS_G2_G3_LINES
|
||||
double extract_absolute_position_on_axis(Axis axis, const GCodeReader::GCodeLine& line, double area_filament_cross_section);
|
||||
#endif // ENABLE_PROCESS_G2_G3_LINES
|
||||
};
|
||||
|
||||
} /* namespace Slic3r */
|
||||
|
@ -20,6 +20,10 @@ namespace FillAdaptive {
|
||||
struct Octree;
|
||||
};
|
||||
|
||||
namespace FillLightning {
|
||||
class Generator;
|
||||
};
|
||||
|
||||
class LayerRegion
|
||||
{
|
||||
public:
|
||||
@ -151,8 +155,8 @@ public:
|
||||
}
|
||||
void make_perimeters();
|
||||
// Phony version of make_fills() without parameters for Perl integration only.
|
||||
void make_fills() { this->make_fills(nullptr, nullptr); }
|
||||
void make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree);
|
||||
void make_fills() { this->make_fills(nullptr, nullptr, nullptr); }
|
||||
void make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator);
|
||||
void make_ironing();
|
||||
|
||||
void export_region_slices_to_svg(const char *path) const;
|
||||
|
@ -177,6 +177,11 @@ inline bool operator<(const Point &l, const Point &r)
|
||||
return l.x() < r.x() || (l.x() == r.x() && l.y() < r.y());
|
||||
}
|
||||
|
||||
inline Point operator* (const Point& l, const double &r)
|
||||
{
|
||||
return {coord_t(l.x() * r), coord_t(l.y() * r)};
|
||||
}
|
||||
|
||||
inline bool is_approx(const Point &p1, const Point &p2, coord_t epsilon = coord_t(SCALED_EPSILON))
|
||||
{
|
||||
Point d = (p2 - p1).cwiseAbs();
|
||||
|
@ -35,7 +35,13 @@ namespace FillAdaptive {
|
||||
struct Octree;
|
||||
struct OctreeDeleter;
|
||||
using OctreePtr = std::unique_ptr<Octree, OctreeDeleter>;
|
||||
};
|
||||
}; // namespace FillAdaptive
|
||||
|
||||
namespace FillLightning {
|
||||
class Generator;
|
||||
struct GeneratorDeleter;
|
||||
using GeneratorPtr = std::unique_ptr<Generator, GeneratorDeleter>;
|
||||
}; // namespace FillLightning
|
||||
|
||||
// Print step IDs for keeping track of the print state.
|
||||
// The Print steps are applied in this order.
|
||||
@ -387,6 +393,7 @@ private:
|
||||
void combine_infill();
|
||||
void _generate_support_material();
|
||||
std::pair<FillAdaptive::OctreePtr, FillAdaptive::OctreePtr> prepare_adaptive_infill_data();
|
||||
FillLightning::GeneratorPtr prepare_lightning_infill_data();
|
||||
|
||||
// XYZ in scaled coordinates
|
||||
Vec3crd m_size;
|
||||
|
@ -108,9 +108,7 @@ static const t_config_enum_values s_keys_map_InfillPattern {
|
||||
{ "octagramspiral", ipOctagramSpiral },
|
||||
{ "adaptivecubic", ipAdaptiveCubic },
|
||||
{ "supportcubic", ipSupportCubic },
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
{ "lightning", ipLightning }
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InfillPattern)
|
||||
|
||||
@ -1155,9 +1153,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_values.push_back("octagramspiral");
|
||||
def->enum_values.push_back("adaptivecubic");
|
||||
def->enum_values.push_back("supportcubic");
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
def->enum_values.push_back("lightning");
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
def->enum_labels.push_back(L("Rectilinear"));
|
||||
def->enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
def->enum_labels.push_back(L("Grid"));
|
||||
@ -1174,9 +1170,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_labels.push_back(L("Octagram Spiral"));
|
||||
def->enum_labels.push_back(L("Adaptive Cubic"));
|
||||
def->enum_labels.push_back(L("Support Cubic"));
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
def->enum_labels.push_back(L("Lightning"));
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipStars));
|
||||
|
||||
def = this->add("first_layer_acceleration", coFloat);
|
||||
|
@ -57,14 +57,10 @@ enum class FuzzySkinType {
|
||||
All,
|
||||
};
|
||||
|
||||
#define HAS_LIGHTNING_INFILL 0
|
||||
|
||||
enum InfillPattern : int {
|
||||
ipRectilinear, ipMonotonic, ipAlignedRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
|
||||
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipAdaptiveCubic, ipSupportCubic, ipSupportBase,
|
||||
#if HAS_LIGHTNING_INFILL
|
||||
ipLightning,
|
||||
#endif // HAS_LIGHTNING_INFILL
|
||||
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipAdaptiveCubic, ipSupportCubic, ipSupportBase,
|
||||
ipLightning,
|
||||
ipCount,
|
||||
};
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "TriangleMeshSlicer.hpp"
|
||||
#include "Utils.hpp"
|
||||
#include "Fill/FillAdaptive.hpp"
|
||||
#include "Fill/FillLightning.hpp"
|
||||
#include "Format/STL.hpp"
|
||||
|
||||
#include <float.h>
|
||||
@ -353,14 +354,15 @@ void PrintObject::infill()
|
||||
|
||||
if (this->set_started(posInfill)) {
|
||||
auto [adaptive_fill_octree, support_fill_octree] = this->prepare_adaptive_infill_data();
|
||||
auto lightning_generator = this->prepare_lightning_infill_data();
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Filling layers in parallel - start";
|
||||
tbb::parallel_for(
|
||||
tbb::blocked_range<size_t>(0, m_layers.size()),
|
||||
[this, &adaptive_fill_octree = adaptive_fill_octree, &support_fill_octree = support_fill_octree](const tbb::blocked_range<size_t>& range) {
|
||||
[this, &adaptive_fill_octree = adaptive_fill_octree, &support_fill_octree = support_fill_octree, &lightning_generator](const tbb::blocked_range<size_t>& range) {
|
||||
for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++ layer_idx) {
|
||||
m_print->throw_if_canceled();
|
||||
m_layers[layer_idx]->make_fills(adaptive_fill_octree.get(), support_fill_octree.get());
|
||||
m_layers[layer_idx]->make_fills(adaptive_fill_octree.get(), support_fill_octree.get(), lightning_generator.get());
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -453,6 +455,18 @@ std::pair<FillAdaptive::OctreePtr, FillAdaptive::OctreePtr> PrintObject::prepare
|
||||
support_line_spacing ? build_octree(mesh, overhangs.front(), support_line_spacing, true) : OctreePtr());
|
||||
}
|
||||
|
||||
FillLightning::GeneratorPtr PrintObject::prepare_lightning_infill_data()
|
||||
{
|
||||
bool has_lightning_infill = false;
|
||||
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++region_id)
|
||||
if (const PrintRegionConfig &config = this->printing_region(region_id).config(); config.fill_density > 0 && config.fill_pattern == ipLightning) {
|
||||
has_lightning_infill = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return has_lightning_infill ? FillLightning::build_generator(std::as_const(*this)) : FillLightning::GeneratorPtr();
|
||||
}
|
||||
|
||||
void PrintObject::clear_layers()
|
||||
{
|
||||
for (Layer *l : m_layers)
|
||||
|
@ -1174,7 +1174,8 @@ sla::SupportPoints SLAPrintObject::transformed_support_points() const
|
||||
{
|
||||
assert(m_model_object != nullptr);
|
||||
auto spts = m_model_object->sla_support_points;
|
||||
auto tr = trafo().cast<float>();
|
||||
const Transform3d& vol_trafo = m_model_object->volumes.front()->get_transformation().get_matrix();
|
||||
const Transform3f& tr = (trafo() * vol_trafo).cast<float>();
|
||||
for (sla::SupportPoint& suppt : spts) {
|
||||
suppt.pos = tr * suppt.pos;
|
||||
}
|
||||
@ -1186,8 +1187,10 @@ sla::DrainHoles SLAPrintObject::transformed_drainhole_points() const
|
||||
{
|
||||
assert(m_model_object != nullptr);
|
||||
auto pts = m_model_object->sla_drain_holes;
|
||||
auto tr = trafo().cast<float>();
|
||||
auto sc = m_model_object->instances.front()->get_scaling_factor().cast<float>();
|
||||
const Transform3d& vol_trafo = m_model_object->volumes.front()->get_transformation().get_matrix();
|
||||
const Geometry::Transformation trans(trafo() * vol_trafo);
|
||||
const Transform3f& tr = trans.get_matrix().cast<float>();
|
||||
const Vec3f sc = trans.get_scaling_factor().cast<float>();
|
||||
for (sla::DrainHole &hl : pts) {
|
||||
hl.pos = tr * hl.pos;
|
||||
hl.normal = tr * hl.normal - tr.translation();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user