Compare commits

...

96 Commits

Author SHA1 Message Date
Dario Sassi 7c7fa77608 3dPrinting 3.1c1 :
- ora MinStrandHFactor e MaxStrandHFactor sono letti dalla sezione [3dPrinting] dell'ini di macchina.
2026-03-04 09:18:03 +01:00
SaraP 5ad54c18f1 3dPrinting:
- sistemato spiral vase completo nel caso multiplanare
- sistemata correzione in z per caso multiplanare
- migliorie varie nei solidi
- gestione multicolore per solidi con strand semplificato.
2026-03-02 09:29:44 +01:00
SaraP 07b9a60a25 3dPrinting :
- correzione spiral vase multiplanare.
2026-02-20 14:30:59 +01:00
SaraP 6f625c46ae 3dPrinting :
- tolleranze per lo slicing legate alla tolleranza impostata nel programma
- corretti solidi multiplanari.
2026-02-20 12:34:46 +01:00
SaraP 33048785f9 3dPrinting :
- sistemato spiral vase con transizione nel caso multiplanare
- calcolo solidi nel caso multiplanare ( standard e spiral vase con transizione)
- sistemato esportatore icrx per multiplanar.
2026-02-20 11:35:00 +01:00
SaraP cad4045171 3dPrinting :
- in multiplanar aggiunto controllo strand max > strand min
- migliorata segnalazione errori.
2026-02-19 08:22:37 +01:00
SaraP b19415b030 3dPrinting :
- piccola correzione.
2026-02-18 12:32:43 +01:00
SaraP dd2e8f357a 3dPrinting :
- nel caso multiplanare aggiunto controllo su strand massimo e minimo ( dati letti dal file ini programma).
2026-02-18 11:14:42 +01:00
SaraP 415eb4d32a 3dPrinting :
- migliorata gestione spina per caso multiplanare
- eliminati eventuali slices senza curve.
2026-02-18 09:44:27 +01:00
SaraP 752d307cde 3dPrinting :
- piccola correzione progress bar per slicing multiplanare.
2026-02-17 10:16:58 +01:00
Dario Sassi 7b14c98461 3dPrinting :
- piccola miglioria per progressbar in multiplanare.
2026-02-17 09:53:59 +01:00
Dario Sassi a0314f3222 3dPrinting 3.1b2 :
- SpiralVaseLen ora è un parametro della lavorazione.
2026-02-16 11:38:14 +01:00
SaraP 6a60cd2b5e 3dPrinting :
- riorganizzato CalcSlices per MultiPlanar
- nello spiral vase MultiPlanar aggiunto layer extra finale a quota costante.
2026-02-13 16:23:09 +01:00
Dario Sassi 9df7f78665 3dPrinting :
- altra piccola correzione per multiplanare.
2026-02-13 16:16:45 +01:00
Dario Sassi 6211c6d873 3dPrinting :
- cambiate costanti KEY_SLICING_DIR e KEY_SLICING_POS in KEY_SLICE_DIR e KEY_SLICE_POS.
2026-02-13 10:34:52 +01:00
Dario Sassi 4b97a5b949 3dPrinting :
- piccole modifiche per MultiPlanar.
2026-02-12 16:44:30 +01:00
Dario Sassi eed869c997 3dPrinting 3.1b1 :
- prime modifiche per slicing Multi Planare.
2026-02-11 18:16:46 +01:00
SaraP bb1ba2b66f 3dPrinting :
- correzione solidi spiral vase.
2026-01-30 11:27:01 +01:00
SaraP 462a173729 3dPrinting :
- aggiunta nuova modalità di spiral vase ( con parametro SpiralVaseLen) per distribuire la differenza in altezza solo lungo il tratto finale del percorso.
2026-01-28 08:06:53 +01:00
SaraP 548a192315 3dPrinting :
- eliminati gruppi inutili nel calcolo solidi con spiral vase
- migliorie nella preparazione del 3dm per export icrx.
2026-01-27 14:36:39 +01:00
SaraP ac9fa89de1 3dPrinting 3.1a1 :
- correzione ordinamento setti con shortest path per evitare cambi nei collegamenti tra layers.
2026-01-26 12:08:41 +01:00
SaraP 4162dfd7b4 3dPrinting 2.7l1 :
- correzione errore ribs-merged shells.
2025-12-12 14:52:14 +01:00
SaraP da1c2c6424 3dPrinting 2.7j1 :
- in spiral vase introdotta lunghezza di interpolazione letta da file ini del programma
- migliorie varie nello spiral vase.
2025-10-30 14:57:44 +01:00
Dario Sassi 328ef638e8 3dPrinting 2.7i2 :
- corretto calcolo sezione dello strand quando altezza maggiore di larghezza.
2025-09-12 19:13:15 +02:00
SaraP f9caff1cc0 3dPrinting 2.7i1 :
- corretto errore nella gestione dei setti unbounded con più percorsi.
2025-09-04 12:27:52 +02:00
SaraP e1c375aa5a 3dPrinting 2.7h1 :
- aggiunto parametro RibsStrandOverlap per impostare una sovrapposizione tra le passate di uno stesso setto
- aggiunto numero massimo di layer da realizzare.
2025-08-19 14:32:17 +02:00
SaraP c718593585 3dPrinting 2.7f1 :
- aggiunta possibilità da file ini della macchina di forzare approssimazione lineare dei percorsi con tolleranza a scelta.
2025-06-20 13:16:56 +02:00
SaraP 29f1243c91 3dPrinting :
- in spiral vase corretto errore su punti di inizio non coincidenti tra layer consecutivi.
2025-04-29 11:54:32 +02:00
SaraP ad44ff7c5a 3dPrinting :
- in spiral vase spostata approssimazione delle curve per farla sempre su curva piana.
2025-04-28 15:07:36 +02:00
SaraP bcaf1c56a4 3dPrinting 2.7d1 :
- modifiche per nuova modalità di stampa dei primi layers nel caso a spirale.
2025-04-22 15:10:18 +02:00
SaraP 000bd0091f 3dPrinting 2.7a1 :
- modificati i controlli per il valore di ritorno di EgtGetNameInGroup.
2025-01-31 11:05:57 +01:00
SaraP b0ebb4a871 3dPrinting 2.6l1 :
- sistemata segnalazione errore slicing.
2024-12-13 09:15:38 +01:00
SaraP 3d6f9f2b85 3dPrinting 2.6k1 :
- correzioni spiral vase per transizione tra layers.
2024-11-28 12:44:03 +01:00
SaraP 898d065fe1 3dPrinting :
- nel caso spiral vase corretta la gestione dei punti iniziali delle curve.
2024-07-31 14:23:36 +02:00
SaraP 54d809508d 3dPrinting 2.6g2 :
- correzione lead out invertiti.
2024-07-29 15:18:13 +02:00
SaraP 1596869230 3dPrinting 2.6f1 :
- correzione nell'unione delle curve per esportazione 3dm.
2024-06-10 17:37:26 +02:00
SaraP 68caeb21b2 3dPrinting :
- correzioni spiral vase.
2024-05-16 15:38:34 +02:00
SaraP eb955244b3 3dPrinting :
- corretto errore nel calcolo dei solidi.
2024-05-10 16:34:09 +02:00
SaraP 2215fc2240 3dPrinting :
- possibilità di realizzare i solidi con sezione semplificata ( rettangolare) da parametro nel file ini.
2024-05-10 09:34:23 +02:00
SaraP 78b722b236 3dPrinting :
- migliorata chiusura solidi nel caso spiral vase.
2024-05-08 11:09:12 +02:00
SaraP 4d342b56c2 3dPrinting :
- corretto errore nel calcolo solidi con spiral vase
- nel calcolo solidi migliorata gestione caso problematico con split ricorsivo della curva guida.
2024-05-06 17:05:37 +02:00
Dario Sassi f12d8b56c8 3dPrinting :
- unite le modifiche.
2024-05-06 08:57:59 +02:00
Dario Sassi c7cbe66299 3dPrinting 2.6e1 :
- correzione a AddRetraction per autointersezioni strane.
2024-05-06 08:46:58 +02:00
SaraP baaf137cb4 3dPrinting 2.6d1 :
- sistemati fillet per setti anche nel caso di ribs-merged shells
- correzioni varie.
2024-04-16 09:58:54 +02:00
Dario Sassi cfe7de8123 3dPrinting :
- in compilazione ora vengono tolte le informazioni di debug.
2024-03-27 16:59:29 +01:00
SaraP f5c9890924 3dPrinting 2.6c1 :
- aggiunti fillet per setti
- correzioni varie.
2024-03-27 09:51:18 +01:00
SaraP cdef58712f 3dPrinting :
- aggiunta altezza minima di sicurezza per wipe.
2024-02-14 15:29:47 +01:00
Dario Sassi 94b02be20a 3dPrinting 2.6b1 :
- aggiornata versione.
2024-02-13 14:53:06 +01:00
SaraP a15593303f 3dPrinting :
- corretto errore.
2024-02-12 12:06:46 +01:00
SaraP 011f049c43 3dPrinting :
- migliorie in PrepareExport con utilizzo della fat curve di Voronoi.
2024-02-12 12:05:04 +01:00
SaraP e214e5a766 3dPrinting :
- corretta approssimazione toolpath in spiral vase.
2024-01-31 10:11:08 +01:00
Dario Sassi e4c696c498 3dPrinting :
- correzioni a calcolo TFS per layer vuoti (tipicamente primi e ultimi con estrusione a 45 gradi).
2024-01-31 09:08:18 +01:00
SaraP e37a2f8e85 3dPrinting :
- modifiche per utilizzare la nuova funzione per il calcolo degli offset di flat regions ( per Voronoi).
2024-01-29 14:43:43 +01:00
Dario Sassi 5619072e46 3dPrinting 2.6a1 :
- cambio versione.
2024-01-26 16:06:34 +01:00
SaraP ff59ee3e5b 3dPrinting :
- sistemate le tolleranze nel calcolo delle superfici per gestire errore con extra shell spezzata.
2024-01-18 10:39:46 +01:00
SaraP af03fe39d8 3dPrinting :
- nel calcolo dei toopath riassegnato punto di inizio dopo approssimazione delle curve.
2024-01-15 15:34:06 +01:00
SaraP 775d0c9329 3dPrinting :
- modificato parametro tolleranza offset.
2024-01-10 10:26:53 +01:00
SaraP 6669803e53 3dPrinting :
- aggiunto parametro per tolleranza nel calcolo offset.
2024-01-10 10:14:38 +01:00
SaraP 2827ba9ac0 3dPrinting 2.5l1 :
- unione dei setti alla shell interna
- migliorie nel riordino extra shells.
2023-12-19 14:40:29 +01:00
SaraP 30368edd88 3dPrinting :
- modificato valore di correzione offset in CalcPath.
2023-12-12 11:20:23 +01:00
SaraP b420905b7a 3dPrinting :
- sistemata approssimazione dei toolpath nel caso spiral vase
- corretto errore calcolo solidi spiral vase.
2023-12-11 17:13:10 +01:00
SaraP 36a867ef4a 3dPrinting :
- aggiunta approssimazione delle curve nel toolpath per eliminare piccoli tratti.
2023-12-04 14:50:14 +01:00
SaraP 7cebcd4b0e 3dPrinting :
- modifiche in RunPrepareExport per gestire assenza dello strand sulle singole curve.
2023-11-23 10:17:01 +01:00
SaraP fa7f51d02e 3dPrinting :
- gestita la generazione dei solidi nel caso in cui lo strand non sia definito sulle singole curve.
2023-11-23 10:02:03 +01:00
SaraP eac6b2da77 3dPrinting :
- migliorie gestione extra shells.
2023-11-16 15:21:35 +01:00
SaraP 995ed10a0a 3dPrinting :
- corretto errore extra shell spezzata.
2023-11-14 15:07:19 +01:00
SaraP 6c2e16a13e 3dPrinting :
- modifica della lunghezza dei wipe che entrano nella tavola mantenendo la direzione scelta.
2023-11-06 09:43:57 +01:00
SaraP 3cdb99f795 3dPrinting :
- aggiunto PrepareExport e RunPrepareExport alla compilazione.
2023-10-24 15:34:09 +02:00
SaraP 973eba6379 3dPrinting :
- aggiunto PrepareExport per creare le geometrie necessarie all'esportazione in 3dm.
2023-10-24 15:21:07 +02:00
SaraP c2163ebf3f 3dPrinting :
- modifiche in CalcSolids per esportazione in 3MF.
2023-10-20 14:15:32 +02:00
SaraP 3f9628121c 3dPrinting 2.5j2 :
- aggiunta possibilità di unire i setti alla shell interna
- migliorie varie.
2023-10-17 14:38:52 +02:00
SaraP d97543fbf9 3dPrinting :
- corretto errore collegamento ribs.
2023-10-06 17:16:09 +02:00
SaraP 85bbeb8523 3dPrinting :
- corretta la gestione dei setti esterni in caso di solidi con più gruppi di curve
- migliorie varie.
2023-10-06 12:33:41 +02:00
Dario Sassi 9f6dda3079 3dPrinting :
- ripristinata scrittura feed in toolpath.
2023-10-02 18:06:22 +02:00
SaraP f3b3704f3b 3dPrinting :
- aggunta info di strand anche sulle curve di wipe.
2023-10-02 17:28:31 +02:00
Dario Sassi 1b67ca3559 3dPrinting 2.5j1 :
- aggiornamento versione.
2023-10-02 16:14:48 +02:00
Dario Sassi 86d4000455 Merge commit 'd343e36e77aa38c73c98d75d79b715861b30797b' 2023-10-02 16:12:29 +02:00
Dario Sassi 3d5b7522bd Merge remote-tracking branch 'origin/Feature/CalcTFSDifferentW' 2023-10-02 16:12:15 +02:00
SaraP d343e36e77 3dPrinting :
- corretto errore ingressi e uscite setti.
2023-10-02 14:20:42 +02:00
Emmanuele Sassi 87d2641ab1 - gestito calcolo F e S con strand di differente larghezza 2023-09-25 15:48:10 +02:00
SaraP b610f1f5e1 3dPrinting 2.5i1 :
- sistemata gestione degli strand variabili con valore nullo.
2023-09-20 15:59:58 +02:00
SaraP d83b571883 3dPrinting :
- correzioni nel collegamento tra ribs che terminano esattamente sul pezzo
- migliorie varie nei ribs.
2023-09-01 17:03:25 +02:00
SaraP a595fcdb98 3dPrinting :
- corretto collegamento fra ribs esterni che passa sotto il solido.
2023-08-30 09:52:28 +02:00
Dario Sassi 43949d7f13 3dPrinting 2.5h1 :
- aggiunta direzione su estrusioni a 45deg in X e Y (X+/- e Y+/-).
2023-08-28 19:52:40 +02:00
SaraP 00700f3194 3dPrinting :
- lettura di HMax per slicing dai parametri
- correzione slicing filled solids.
2023-08-25 09:25:14 +02:00
SaraP 28686fe6b6 3dPrinting :
- introdotta info con numero totale di layers.
2023-08-09 17:34:16 +02:00
SaraP 4a4a7d648b 3dPrinting :
- aggiunta chiusura dei percorsi di extra shell
- aggiunto clamp sui valori di strand width.
2023-07-20 12:44:32 +02:00
SaraP 03c1768afe 3dPrinting 2.5g1 :
- aggiunto numero di passate per Filled Solids.
2023-07-03 10:23:37 +02:00
SaraP ba9470ee88 3dPrinting :
- aggiunto collegamento infill.
2023-06-30 12:52:39 +02:00
SaraP e629f1b12d 3dPrinting 2.5f2 :
- gestione strand variabili per entità.
2023-06-21 09:21:17 +02:00
SaraP 451f3a2939 3dPrinting 2.5f1 :
- correzioni infill
- aggiornamento versione.
2023-06-15 10:17:29 +02:00
SaraP bc3cf3b3a9 3dPrinting :
- corretto errore reduced shell number di area nulla.
2023-06-08 10:34:42 +02:00
SaraP 4225985a61 3dPrinting :
- aggiunta approssimazione delle curve dopo slicing ( per evitare caso di fallimento offset)
- migliorata segnalazione errori.
2023-06-06 17:11:09 +02:00
SaraP fcd61efd53 3dPrinting :
- piccole correzioni nei setti per evitare interruzione calcolo.
2023-06-01 17:31:43 +02:00
SaraP 01711d2925 3dPrinting 2.5e3 :
- infill prima versione ( lineari, griglia, zigzag, nido d'ape)
- aggiunto riempimento ad infill anche nei solidi ausiliari
- migliorie varie nella gestione dei riempimenti pieni
- migliorie nei link e in StartPointOffsetOnLayer.
2023-05-26 15:20:27 +02:00
SaraP e015136592 3dPrinting 2.5e2 ;
- corretto errore nel lead in/lead out dei setti quando terminano su altro setto
- migliorie varie per lead in, lead out e link dei setti.
2023-05-24 08:26:27 +02:00
14 changed files with 6985 additions and 2007 deletions
+4 -4
View File
@@ -16,14 +16,14 @@ variables:
$FileList = Get-ChildItem("*.lua")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua54 -o bin\$FileName $FileName
echo "lua54 -o bin\$FileName $FileName"
lua54 -o bin\$FileName -s $FileName
echo "lua54 -o bin\$FileName -s $FileName"
}
$FileList = Get-ChildItem("LuaLibs\*.lua")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
}
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI
+34
View File
@@ -0,0 +1,34 @@
{
"Lua.diagnostics.globals": [
"MATERIAL",
"EgtGetFirstNameInGroup",
"GDB_ID",
"EgtGroup",
"EgtSetLevel",
"EgtSetName",
"GDB_LV",
"EgtGetCurrMachineDir",
"EgtGetCurrMachineName",
"EgtGetStringFromIni",
"EgtGetFirstPart",
"EgtGetInfo",
"EgtGetNextPart",
"EgtGetLastNameInGroup",
"EgtRemoveInfo",
"EgtGetFirstInGroup",
"EgtGetName",
"EgtCurveLength",
"EgtGetNext",
"EgtCurveArea",
"EgtGetNextName",
"EgtSetInfo",
"floor",
"pi",
"pow",
"EgtProcessEvents",
"EgtEmptyGroup",
"EgtOutLog",
"EgtIf",
"EgtProtectGlobal"
]
}
+16 -14
View File
@@ -1,19 +1,21 @@
REM Compilazione degli script 3dPrinting Egaltech 2023.01.11
REM Compilazione degli script 3dPrinting Egaltech 2024.03.27
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
REM Compilazione 32 e 64 bit
\EgtProg\Dll32\luac54 -o bin\LuaLibs\AddManData.lua LuaLibs\AddManData.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcPaths.lua LuaLibs\CalcPaths.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcSlices.lua LuaLibs\CalcSlices.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcToolPath.lua LuaLibs\CalcToolPath.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunCalcSolids.lua LuaLibs\RunCalcSolids.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunGcodeGenerate.lua LuaLibs\RunGcodeGenerate.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunMachParamFromSWCalc.lua LuaLibs\RunMachParamFromSWCalc.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunSlicing.lua LuaLibs\RunSlicing.lua
\EgtProg\Dll32\luac54 -o bin\CalcMachParamFromSW.lua CalcMachParamFromSW.lua
\EgtProg\Dll32\luac54 -o bin\CalcSolids.lua CalcSolids.lua
\EgtProg\Dll32\luac54 -o bin\GcodeGenerate.lua GcodeGenerate.lua
\EgtProg\Dll32\luac54 -o bin\Slicing.lua Slicing.lua
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\AddManData.lua -s LuaLibs\AddManData.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcPaths.lua -s LuaLibs\CalcPaths.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcSlices.lua -s LuaLibs\CalcSlices.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\CalcToolPath.lua -s LuaLibs\CalcToolPath.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunCalcSolids.lua -s LuaLibs\RunCalcSolids.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunGcodeGenerate.lua -s LuaLibs\RunGcodeGenerate.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunMachParamFromSWCalc.lua -s LuaLibs\RunMachParamFromSWCalc.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunPrepareExport.lua -s LuaLibs\RunPrepareExport.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\RunSlicing.lua -s LuaLibs\RunSlicing.lua
\EgtProg\Dll32\luac54 -o bin\CalcMachParamFromSW.lua -s CalcMachParamFromSW.lua
\EgtProg\Dll32\luac54 -o bin\CalcSolids.lua -s CalcSolids.lua
\EgtProg\Dll32\luac54 -o bin\GcodeGenerate.lua -s GcodeGenerate.lua
\EgtProg\Dll32\luac54 -o bin\PrepareExport.lua -s PrepareExport.lua
\EgtProg\Dll32\luac54 -o bin\Slicing.lua -s Slicing.lua
\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua
+96 -17
View File
@@ -28,23 +28,30 @@ LINK_CRV = "Link"
FRAME_PART = "FramePart"
START_GEOM = "Start"
TOT_SHELL_TRIM_SURF = "TotalShellSurfForTrim"
SHELL_SURF = "ShellSurf"
COARSE_TRIM_SURF = "CoarseTrimSurf"
TRIM_SURF_LOOP = "TrimSurfLoop"
SURF_LOOP = "SurfLoop"
LOOP_GRP = "LoopGrp"
DIR_ARROW = "Arrow"
MIN_LEN = 0.1
MIN_AREA = 0.01
MIN_RIBS_LEN = 2
MIN_INFILL_LEN = 2
-- Parametri di lavorazione
SEC_DEFAULT = "Default"
KEY_PARAMS = "Params"
KEY_CALC_SOLIDS = "CalcSolids"
KEY_SPIRAL_VASE = "SpiralVase"
KEY_SPIRAL_VASE_LEN = 'SpiralVaseLen'
KEY_SPIRAL_VASE_INTERP_LEN = 'SpiralVaseInterpLen'
KEY_SLICING_TYPE = "SlicingType"
KEY_SLICING_DIR = "SlicingDir"
KEY_SLICE_STEP = "StrandH"
KEY_SHELLS_NBR = "StrandCount"
KEY_STRAND = "StrandW"
KEY_INNER_STRAND = "InnerStrandW"
KEY_STRAND_OVERLAP = "StrandOverlap"
KEY_OFFSET_SLICE = "Offset"
KEY_SP_OFFSET_ON_SLICE = "StartPointOffsetOnSlice"
@@ -55,10 +62,6 @@ KEY_TYPE = "Type"
KEY_LINK_TYPE = "LinkType"
KEY_LINK_PARAM = "LinkParam"
KEY_LINK_ZUP = "LinkZup"
KEY_FLOOR_NBR = "FloorCount"
KEY_FLOOR_TYPE = "FloorType"
KEY_CEIL_NBR = "CeilCount"
KEY_CEIL_TYPE = "CeilType"
KEY_SPEED = "Speed"
KEY_FEED = "Feed"
KEY_EXT_FEED = "ExtFeed"
@@ -81,12 +84,37 @@ KEY_COASTING_FEED = "CoastingFeed"
KEY_WIPE_LEN = "WipeLen"
KEY_WIPE_DIR = "WipeDir"
KEY_WIPE_FEEDPU = "WipeFeedPu"
KEY_TOOL_DIAM = "ToolDiam"
KEY_TOOL_DIAM = "ToolDiam"
KEY_MAX_STRANDH_FACTOR = 'MaxStrandHFactor'
KEY_MIN_STRANDH_FACTOR = 'MinStrandHFactor'
-- Solid Fill
KEY_FLOOR_NBR = "FloorCount"
KEY_FLOOR_TYPE = "FloorType"
KEY_CEIL_NBR = "CeilCount"
KEY_CEIL_TYPE = "CeilType"
KEY_FILL_TYPE = "FillType"
-- Infill
KEY_INFILL_STRAND = "InfillStrandW"
KEY_INFILL_TYPE = "InfillType"
KEY_INFILL_DENSITY = "InfillDensity"
KEY_INFILL_LINK = "InfillLink"
KEY_INFILL_OVERLAP = "InfillOverlap"
KEY_INFILL_GRID_OVERLAP = "InfillGridOverlap"
KEY_INFILL_DIR = "InfillDirection"
KEY_INFILL_OFFSET_X = "InfillOffsetX"
KEY_INFILL_OFFSET_Y = "InfillOffsetY"
KEY_INFILL_COASTING = "InfillCoasting"
KEY_INFILL_WIPE = "InfillWipe"
KEY_INFILL_WIPE_DIR = "InfillWipeDir"
-- Ribs
KEY_RIBS_STRAND = "RibsStrandW"
KEY_RIBS_TYPE = "RibsType"
KEY_LIMIT_UNBDD_RIBS = "LimitUnboundedRibsWithSolid"
KEY_RIBS_OVERLAP = "RibsOverlap"
KEY_RIBS_STRAND_OVERLAP = 'RibsStrandOverlap'
KEY_RIBS_SHELLS_NBR = "RibsStrandCount"
KEY_RIBS_LINK = "RibsLink"
KEY_RIBS_INVERT_DIR = "RibsInvertDirection"
@@ -114,6 +142,10 @@ KEY_RIBS_USER_LINK_CCW = "RibUserLinkCCW"
KEY_RIBS_USER_LINK_ORDER = "RibUserLinkOrder"
KEY_RIBS_USER_LINK_TOT = "RibsUserLinkParts"
KEY_RIBS_INVERT_STRAND_ORDER = "RibsInvertStrandOrder"
KEY_RIBS_MERGE_WITH_SHELLS = "RibsMergeWithShell"
KEY_INVERT_RIBS_MERGED_SHELL_LINK = "InvertRibsMergedShellMainLink"
KEY_RIBS_LEAD_FILLET = "RibsLeadFillet"
KEY_RIBS_LINK_FILLET = "RibsLinkFillet"
-- Regioni con diverso numero di passate
KEY_SHELL_NBR_DIFF = "ShellNbrDifference"
@@ -125,12 +157,21 @@ KEY_EXTRA_SHELL_WIPE = "ExtraShellWipe"
KEY_EXTRA_SHELL_WIPE_DIR = "ExtraShellWipeDir"
-- Solidi ausiliari
KEY_AUX_SOLIDS_STRAND = "AuxSolidsStrandW"
KEY_AUX_SOLIDS_SHELLS_NBR = "AuxSolidsStrandCount"
KEY_AUX_SOLIDS_OVERLAP = "AuxSolidsOverlap"
KEY_AUX_SOLIDS_INFILL = "AuxSolidsInfill"
KEY_AUX_SOLIDS_PRINT_ORDER = "AuxSolidsStrandOrder"
KEY_AUX_SOLIDS_OVERLAP = "AuxSolidsOverlap"
KEY_AUX_SOLIDS_LINK_TYPE = "AuxSolidsLinkType"
KEY_AUX_SOLIDS_SP_OFFSET = "AuxSolidsStartPointOffsetOnSlice"
KEY_AUX_SOLIDS_LINK_PARAM = "AuxSolidsLinkParam"
KEY_AUX_SOLIDS_SP_OFFSET = "AuxSolidsStartPointOffsetOnSlice"
KEY_AUX_SOLIDS_LP_OFFSET = "AuxSolidsOffsetLeadPoint"
KEY_AUX_SOLIDS_INFILL_LINK = "AuxSolidsInfillLink"
KEY_AUX_SOLIDS_DENSITY = "AuxSolidsDensity"
KEY_AUX_SOLIDS_DIR = "AuxSolidsDirection"
KEY_AUX_SOLIDS_OFFSET_X = "AuxSolidsOffsetX"
KEY_AUX_SOLIDS_OFFSET_Y = "AuxSolidsOffsetY"
KEY_AUX_SOLIDS_GRID_OVERLAP = "AuxSolidsGridOverlap"
KEY_AUX_SOLIDS_COASTING_LEN = "AuxSolidsCoastingLen"
KEY_AUX_SOLIDS_WIPE_LEN = "AuxSolidsWipeLen"
KEY_AUX_SOLIDS_WIPE_DIR = "AuxSolidsWipeDir"
@@ -141,12 +182,17 @@ KEY_COEFF_X = "CoeffX"
KEY_COEFF_Y = "CoeffY"
KEY_SPEED_MIN = "SpeedMin"
KEY_SPEED_MAX = "SpeedMax"
KEY_FEED_MAX = 'FeedMax'
KEY_LINEAR_APPROX = 'LinearApprox'
KEY_LINEAR_TOL = 'LinearTol'
-- Altre chiavi
KEY_MAX_H = "SlicingHeight"
KEY_MAX_SLICES_NBR = "MaxSlicesNumber"
KEY_SLICE_NBR = "SliceNbr"
KEY_SLICE_Z = "SliceZ"
KEY_SLICE_DIR = "SliceDir"
KEY_SLICE_POS = "SlicePos"
KEY_SLICE_DELTAZ = "DeltaZ"
KEY_SLICE_REAL_Z = "SliceRealZ"
KEY_ZIG_ZAG_INFILL = "ZigZagInfill"
KEY_ZIG_ZAG_DIR = "ZigZagDir"
KEY_INVERTED_CRV = "InvertedCrv"
@@ -156,13 +202,28 @@ KEY_ASSOCIATED_CRVS = "AssociatedCrvs"
KEY_ORIGINAL_SURF = "OriginalSurf"
KEY_HAS_SOLIDS = "Solids"
KEY_BOX_MIN_Z = "PartBoxMinZ"
KEY_START_POINT = "StartPoint"
KEY_ORIGINAL_START_POINT = "OriginalStartPoint"
KEY_FIRST_SOLID_LAY = "FirstSolidLay"
KEY_LAST_SOLID_LAY = "LastSolidLay"
KEY_ASSOCIATED_TP_CRV = "AssociatedToolPathCrv"
KEY_ASSOCIATED_P_CRV = "AssociatedPathCrv"
KEY_INTERNAL_SRF_LOOP = "InternalSrfLoop"
KEY_PREV_CRV = "PrevCrv"
KEY_NEXT_CRVS = "NextCrvs"
KEY_CRV_STRAND = "CurveStrand"
KEY_LAYER_CNT = "LayerCnt"
KEY_CRV_OFFSET = "CurveOffset"
KEY_ORIG_REF = "Orig"
KEY_WIPE_ON_CRV = "WipeOnCrv"
KEY_FEED_COEFF = 'FeedCoeff'
KEY_ENTITY_NAME = 'EntityName'
SLICING_TYPE = {
SLICING_TYPE = {
VERTICAL = 1,
DEG45_X = 2,
DEG45_Y = 3,
HORIZONTAL = 4,
MULTIPLANAR = 5,
}
TYPE = {
@@ -202,7 +263,7 @@ PRINT_DIRECTION = {
LINK_TYPE = {
NONE = 1,
LINEAR = 2,
BIARC = 3,
BIARC = 3,
}
LEAD_TYPE = {
@@ -211,10 +272,21 @@ LEAD_TYPE = {
ARC = 3,
}
INFILL_TYPE = {
NONE = 1,
OFFSET = 2,
ZIGZAG = 3,
FILL_CATEGORY = {
NONE = 0,
SOLID_FILL = 16,
INFILL = 32,
}
FILL_TYPE = {
NONE = 0,
OFFSET = 16,
ZIGZAG = 17,
LINES = 32,
GRID = 33,
ZIG_ZAG_GRID = 34,
HONEYCOMB = 35,
HONEYCOMB_GRID = 36,
}
RIB_TYPE = {
@@ -234,10 +306,12 @@ LAY_RIBS = "Ribs"
LAY_AUX_SOLIDS = "AuxSolids"
LAY_SHELL_NBR = "ShellNumber"
LAY_AUX = "Aux"
SPINE_CURVE = "Spine"
LAY_FRAME = "Frame"
VIEWPARAMS = 'ViewParams'
IMPORTED_SOLID = 'ImportedSolid'
RESULT_READ_PROG = 'ResultReadProg'
LAY_EXPORT = "ExportLayer"
KEY_PART_ON_TABLE = 'PartOnTable'
KEY_RESULT = 'Result'
@@ -293,9 +367,14 @@ SHELL_NBR_CRV = "ShellNbrRegion"
SHELL_NBR_SURF = "ShellNbrSurf"
AUX_SOLIDS_GRP = "AuxSolids"
AUX_SOLIDS_INFILL_GRP = "InfillAuxSolids"
AUX_SOLIDS_CRV = "AuxSolid"
AUX_SOLIDS_INFILL_CRV = "InfillAuxSolid"
AUX_SOLIDS_SRF = "SrfAuxSolid"
INFILL_GRP = "Infill"
INFILL_CRV = "InfillCrv"
---------------------------------------------------------------------
-- parametri calcolo tempi, F ed S
LAY_TFSCALC = "TFSCalc"
+2483 -827
View File
File diff suppressed because it is too large Load Diff
+1009 -351
View File
File diff suppressed because it is too large Load Diff
+2277 -608
View File
File diff suppressed because it is too large Load Diff
+746 -156
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -36,7 +36,7 @@ function RunGcodeGenerate.Exec()
-- Recupero i layer da processare
local vLayIds = EgtGetNameInGroup( nPartId, SLICE_LAYER.."*")
if not vLayIds then
if not vLayIds or #vLayIds == 0 then
EgtOutBox( 'Error missing slices', 'GcodeGenerate')
return
end
+74 -22
View File
@@ -1,4 +1,4 @@
-- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2022/12/28
-- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2024/01/30
-- Calcolo dei parametri di stampa
-- Tabella per definizione modulo
@@ -53,6 +53,8 @@ function RunMachParamFromSWCalc.Exec()
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local dSMin = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_SPEED_MIN, 0, sMachIni))
local dSMax = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_SPEED_MAX, 50000, sMachIni))
-- recupero Feed massima dalla macchina
local dFLimit = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_FEED_MAX, 10000, sMachIni))
-- massa materiale utilizzato
local dPrintMass = 0
-- massimo indice di layer calcolato
@@ -62,7 +64,7 @@ function RunMachParamFromSWCalc.Exec()
while nPartId do
if not EgtGetInfo( nPartId, KEY_PART_ON_TABLE, 'b') then
nPartId = EgtGetNextPart( nPartId)
goto continue
goto continue
end
-- recupero i parametri di lavorazione del pezzo
local dSliceStep = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
@@ -77,6 +79,8 @@ function RunMachParamFromSWCalc.Exec()
while nLayerId do
-- rimuovo eventuale info precedente del tempo di attesa
EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- divido curve in base alla larghezza strand
local LengthCrvList = {}
-- calcolo lunghezza totale del layer
local dTotLayerLength = 0
local dTotLayerLengthForMass = 0
@@ -84,14 +88,29 @@ function RunMachParamFromSWCalc.Exec()
local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- sommo lunghezze percorsi
-- recupero lunghezze percorsi
local dTotCrvLength = 0
local dTotCrvLengthForMass = 0
nShellId = EgtGetFirstInGroup( nToolPathId)
local nShellId = EgtGetFirstInGroup( nToolPathId)
while nShellId do
dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
local dShellWidth = EgtGetInfo( nShellId, KEY_CRV_STRAND, "d")
local dShellLength = EgtCurveLength( nShellId)
local bFound = false
for LengthIndex = 1, #LengthCrvList do
if LengthCrvList[LengthIndex].Width == dShellWidth then
table.insert( LengthCrvList[LengthIndex].IdList, nShellId)
LengthCrvList[LengthIndex].Length = LengthCrvList[LengthIndex].Length + dShellLength
bFound = true
break
end
end
if not bFound then
table.insert( LengthCrvList, { Width = dShellWidth, IdList = { nShellId}, Length = dShellLength})
end
-- sommo per lunghezza totale
dTotCrvLength = dTotCrvLength + dShellLength
if EgtGetName( nShellId) ~= WIPE_CRV then
dTotCrvLengthForMass = dTotCrvLengthForMass + EgtCurveLength( nShellId)
dTotCrvLengthForMass = dTotCrvLengthForMass + dShellLength
end
nShellId = EgtGetNext( nShellId)
end
@@ -132,11 +151,17 @@ function RunMachParamFromSWCalc.Exec()
table.insert( nOrigLayers, nLayerId)
end
EgtSetInfo( nLayerResultId, KEY_SLICEID, nOrigLayers)
-- calcolo strand medio (media ponderata sulla lunghezza)
local dStrandMean = 0
for nMeanIndex = 1, #LengthCrvList do
dStrandMean = dStrandMean + LengthCrvList[nMeanIndex].Width * LengthCrvList[nMeanIndex].Length
end
dStrandMean = dStrandMean / EgtIf( dTotLayerLength > 0.1, dTotLayerLength, 1)
-- calcolo costante MF
local dMF = 1
local dSC = 1
if dTotLayerArea > 1 then
dMF = dTotLayerLength * dStrand / dTotLayerArea * 100
dMF = dTotLayerLength * dStrandMean / dTotLayerArea * 100
dSC = dStrandCount
else
dMF = 100
@@ -151,12 +176,12 @@ function RunMachParamFromSWCalc.Exec()
end
end
-- calcolo tempi stimati del layer
local dTMin = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTTrg = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMax = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dFMin = dTotLayerLength / dTMax * 60
local dFTrg = dTotLayerLength / dTTrg * 60
local dFMax = dTotLayerLength / dTMin * 60
local dTMin = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTTrg = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMax = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dFMin = dTotLayerLength / EgtIf( dTMax > 0.1, dTMax, 1) * 60
local dFTrg = dTotLayerLength / EgtIf( dTTrg > 0.1, dTTrg, 1) * 60
local dFMax = dTotLayerLength / EgtIf( dTMin > 0.1, dTMin, 1) * 60
local dLayerTime = dTTrg
if dLayerFeed == 0 then
dLayerFeed = dFTrg
@@ -164,8 +189,10 @@ function RunMachParamFromSWCalc.Exec()
dLayerTime = dTotLayerLength / dLayerFeed * 60
end
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
-- sezione dello strand
local dSect = max( ( dStrandMean - dSliceStep) * dSliceStep, 0) + pi * dSliceStep * dSliceStep / 4
-- calcolo la portata
local Vf = dLayerFeed * ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000
local Vf = dLayerFeed * dSect / 1000
-- calcolo speed
local dSpeed = ( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0) * pow( Vf / MATERIAL.C1, 1 / MATERIAL.C2)
-- verifico se speed esce da minimo e massimo della macchina
@@ -179,16 +206,42 @@ function RunMachParamFromSWCalc.Exec()
dSpeed = dSMax
end
if not bSpeedOk then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerTime = dTotLayerLength / dLayerFeed * 60
if dTotLayerLength > 0.1 then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / dSect
dLayerTime = dTotLayerLength / dLayerFeed * 60
end
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
end
-- calcolo massa dello strato
local dLayerMass = dTotLayerLengthForMass * dSliceStep * dStrand * MATERIAL.Density * 1e-6
local dLayerMass = dTotLayerLengthForMass * dSliceStep * dStrandMean * MATERIAL.Density * 1e-6
if dLayerMass and dLayerMass > 0 then
dPrintMass = dPrintMass + dLayerMass
end
-- scrivo info feed e speed in group toolpath
-- scrivo info feed su tutti i tratti
local dFeedMax = 0
for nWidthIndex = 1, #LengthCrvList do
local CurrWidth = LengthCrvList[nWidthIndex]
local CurrFeed = EgtIf( CurrWidth.Width > 0, dLayerFeed * dStrandMean / CurrWidth.Width, dLayerFeed)
for nCurveIdIndex = 1, #CurrWidth.IdList do
local dNewFeed = CurrFeed
-- verifico se coefficiente moltiplicativo per feed
local dCoeff = EgtGetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_FEED_COEFF, 'd')
if dCoeff then
dNewFeed = dCoeff * CurrFeed
if dNewFeed > dFLimit then
local dNewSpeed = dSpeed * dFLimit / dNewFeed
dNewSpeed = EgtClamp( dNewSpeed, dSMin, dSMax)
dNewFeed = dFLimit
EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_SPEED, dNewSpeed)
end
end
EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_FEED, dNewFeed)
if dNewFeed > dFeedMax then
dFeedMax = dNewFeed
end
end
end
-- scrivo info speed in group toolpath
nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP) or GDB_ID.NULL
@@ -202,13 +255,11 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nLayerResultId, KEY_WAITING_TIME, dLayerWait)
end
-- scrivo valori in struttura dati
--local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex)
EgtSetInfo( nLayerResultId, KEY_TMIN, dTMin)
EgtSetInfo( nLayerResultId, KEY_TTRG, dTTrg)
EgtSetInfo( nLayerResultId, KEY_TMAX, dTMax)
EgtSetInfo( nLayerResultId, KEY_FMIN, dFMin)
EgtSetInfo( nLayerResultId, KEY_FTRG, dFTrg)
EgtSetInfo( nLayerResultId, KEY_FMAX, dFMax)
EgtSetInfo( nLayerResultId, KEY_FMAX, dFeedMax)
EgtSetInfo( nLayerResultId, KEY_TCUR, dLayerTime)
EgtSetInfo( nLayerResultId, KEY_FCUR, dLayerFeed)
EgtSetInfo( nLayerResultId, KEY_LENGTH, dTotLayerLength)
@@ -220,11 +271,12 @@ function RunMachParamFromSWCalc.Exec()
EgtEmptyGroup( nResultLayerId)
return
end
-- passo al layer successivo
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end
if nMaxIndex < nLayerIndex then nMaxIndex = nLayerIndex end
-- passo al pezzo successivo
nPartId = EgtGetNextPart( nPartId)
::continue::
end
+211
View File
@@ -0,0 +1,211 @@
-- RunPrepareExport.lua by Egaltech s.r.l. 2023/10/19
-- Creo le geometrie da esportare con 3dm
-- Tabella per definizione modulo
local RunPrepareExport = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunPreprareExport started', 1)
-- Dati
local AMD = require( 'AddManData')
------------------------------------------------------------------
local function CalcCurves( nSliceId, nDestGrp, vtSlicing, dStrandBase)
-- scorro tutti i gruppi di curve
local vCrvs = EgtGetNameInGroup( nSliceId, CONTOUR_GRP .. '*')
for j = 1, #vCrvs do
-- cerco il gruppo del toolpath
local nTPath = EgtGetFirstNameInGroup( vCrvs[j], TOOLPATH_GRP)
if nTPath then
local nId = EgtGetFirstInGroup( nTPath)
while nId do
-- se non è wipe creo la fat curve da estrudere per creare il solido
local nType = EgtGetInfo( nId, KEY_TYPE, 'i')
if nType ~= TYPE.WIPE then
local dStrand = EgtGetInfo( nId, KEY_CRV_STRAND, 'd') or dStrandBase
-- calcolo fat region a partire da una copia della curva ( in questo modo nel DB geometrico non restano
-- salvati i diagrammi di Voronoi che non servono per conti futuri)
local nCopy = EgtCopyGlob( nId, nDestGrp)
local nSurf = EgtSurfFrFatCurve( nDestGrp, nCopy, 0.5 * dStrand, false)
-- se fallisce ritento con valore leggermente diverso
if not nSurf or nSurf == GDB_ID.NULL then
nSurf = EgtSurfFrFatCurve( nDestGrp, nCopy, 0.5 * dStrand - 0.05, false)
end
EgtErase( nCopy)
if nSurf then
local nChunks = EgtSurfFrChunkCount( nSurf)
for k = 0, nChunks - 1 do
-- estraggo i loop associati
local nCrv, nCnt = EgtExtractSurfFrChunkLoops( nSurf, k, nDestGrp)
-- eventuali aggiustamenti per creare un percorso unico
if nCnt > 1 then
for nLoopId = nCrv + 1, nCrv + nCnt - 1 do
local dLen = EgtCurveLength( nLoopId)
local dPar1 = EgtCurveParamAtLength( nLoopId, dLen * 0.5)
local dPar2 = EgtCurveParamAtLength( nLoopId, dLen * 0.5 + 2 * GEO.EPS_SMALL)
local ptM = EgtUP( nLoopId, dPar1)
local ptM2 = EgtUP( nLoopId, dPar2)
local _, _, dParRef1 = EgtPointCurveDist( ptM2, nCrv)
local _, _, dParRef2 = EgtPointCurveDist( ptM, nCrv)
EgtTrimCurveStartEndAtParam( nCrv, dParRef2, dParRef1)
EgtTrimCurveStartEndAtParam( nLoopId, dPar2, dPar1)
EgtAddCurveCompoLine( nCrv, EgtSP( nLoopId))
EgtAddCurveCompoCurve( nCrv, nLoopId)
EgtCloseCurveCompo( nCrv)
end
end
if nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'TEAL'))
elseif nType == TYPE.INNER_SHELL or nType == TYPE.EXTRA_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'ORANGE'))
elseif nType == TYPE.LINK then
EgtSetColor( nCrv, EgtStdColor( 'GRAY'))
elseif nType == TYPE.INFILL then
EgtSetColor( nCrv, EgtStdColor( 'YELLOW'))
elseif nType == TYPE.COASTING then
EgtSetColor( nCrv, EgtStdColor( 'BLUE'))
elseif nType == TYPE.RIB then
EgtSetColor( nCrv, EgtStdColor( 'OLIVE'))
elseif nType == TYPE.AUX_SOLID then
EgtSetColor( nCrv, EgtStdColor( 'AQUA'))
end
end
EgtErase( nSurf)
end
end
nId = EgtGetNext( nId)
end
end
-- copio le frecce direzione dal gruppo dei solidi
local nSolidGrp = EgtGetFirstNameInGroup( vCrvs[j], SOLID_GRP)
if nSolidGrp then
local nId = EgtGetFirstNameInGroup( nSolidGrp, DIR_ARROW)
while nId do
local nCopy = EgtCopyGlob( nId, nDestGrp)
EgtSetMode( nCopy, GDB_MD.STD)
EgtSetStatus( nCopy, GDB_ST.ON)
nId = EgtGetNextName( nId, DIR_ARROW)
end
end
end
end
------------------------------------------------------------------
local function GetSolids( nSliceId, nDestGrp)
-- scorro tutti i gruppi di curve
local vCrvs = EgtGetNameInGroup( nSliceId, CONTOUR_GRP .. '*')
for j = 1, #vCrvs do
-- recupero il solido dal gruppo
local nSolidGrp = EgtGetFirstNameInGroup( vCrvs[j], SOLID_GRP)
if nSolidGrp then
-- copio solo la prima freccia direzionale
local nArrow = EgtGetFirstNameInGroup( nSolidGrp, DIR_ARROW) or GDB_ID.NULL
EgtCopyGlob( nArrow, nDestGrp)
local vSolids = EgtGetAllInGroup( nSolidGrp)
for i = 1, #vSolids do
if EgtGetName( vSolids[i]) ~= DIR_ARROW then
EgtCopyGlob( vSolids[i], nDestGrp)
end
end
end
end
end
------------------------------------------------------------------
function RunPrepareExport.Exec()
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. '*')
if not nPartId then
EgtOutBox( 'Error : no part', 'Export')
return GDB_ID.NULL
end
-- creo o recupero il gruppo per l'esportazione
local nGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, LAY_EXPORT)
if not nGrp then
-- se non esiste creo il gruppo
nGrp = EgtGroup( GDB_ID.ROOT)
EgtSetName( nGrp, LAY_EXPORT)
EgtSetStatus( nGrp, GDB_ST.OFF)
EgtSetLevel( nGrp, GDB_LV.TEMP)
else
-- se il gruppo esiste già non devo fare nulla
return nGrp
end
-- creo il punto di origine del riferimento
local ptRef = EgtGetInfo( nPartId, KEY_ORIG_REF, 'p')
if not ptRef then
local nFrameId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, LAY_FRAME), FRAME_PART)
ptRef = EgtSP( nFrameId or GDB_ID.NULL, GDB_ID.ROOT)
end
local nPnt = EgtPoint( nGrp, ptRef, GDB_RT.GLOB)
EgtSetName( nPnt, KEY_ORIG_REF)
EgtSetStatus( nPnt, GDB_ST.OFF)
-- recupero alcune info utili e le assegno al punto per poterle leggere da ThreeJS
local dH = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
EgtSetInfo( nPnt, KEY_SLICE_STEP, dH)
local vtSlicing = EgtGetInfo( nPartId, KEY_SLICE_DIR, 'v')
EgtSetInfo( nPnt, "SlicingDir", vtSlicing)
local bSpiralVase = EgtGetInfo( nPartId, KEY_SPIRAL_VASE, 'b') or false
EgtSetInfo( nPnt, KEY_SPIRAL_VASE, bSpiralVase)
local nSlicingType = EgtGetInfo( nPartId, KEY_SLICING_TYPE, 'i')
-- recupero lo strand dai parametri generale nel caso non fosse definito sulle singole curve
local dStrandBase = EgtGetInfo( nPartId, KEY_STRAND, 'd') or 0
-- recupero gli slices
local vSlices = EgtGetNameInGroup( nPartId, SLICE_LAYER .. '*') or {}
if #vSlices == 0 then
EgtOutBox( 'Error : no slices', 'Export')
return GDB_ID.NULL
end
-- verifico che nel primo slice siano presenti sia i toolpath sia i solidi
local nCrvGrp = EgtGetFirstNameInGroup( vSlices[1], CONTOUR_GRP .. '*')
if not nCrvGrp then
EgtOutBox( 'Error : no toolpaths', 'Export')
return GDB_ID.NULL
end
local nTPath = EgtGetFirstNameInGroup( nCrvGrp, TOOLPATH_GRP)
if not nTPath then
EgtOutBox( 'Error : no toolpaths', 'Export')
return GDB_ID.NULL
end
local nSolid = EgtGetFirstNameInGroup( nCrvGrp, SOLID_GRP)
if not nSolid then
EgtOutBox( 'Error : no solids', 'Export')
return GDB_ID.NULL
end
for i = 1, #vSlices do
-- creo il gruppo corrispondente
local nDestGrp = EgtGroup( nGrp)
EgtSetName( nDestGrp, EgtGetName( vSlices[i]))
EgtSetStatus( nDestGrp, GDB_ST.OFF)
-- se multiplanare o spiral vase esporto direttamente i solidi altrimenti esporto le curve che verranno estruse nel visualizzatore
if nSlicingType == SLICING_TYPE.MULTIPLANAR or bSpiralVase then
GetSolids( vSlices[i], nDestGrp)
else
CalcCurves( vSlices[i], nDestGrp, vtSlicing, dStrandBase)
end
end
return nGrp
end
---------------------------------------------------------------------
return RunPrepareExport
+15 -5
View File
@@ -72,6 +72,20 @@ local function RemoveOldSlices( nPartId)
if nRibsLoopsGrp then
EgtErase( nRibsLoopsGrp)
end
-- rimuovo eventuali gruppi di infill (anche per aux solids)
local nInfillId = EgtGetFirstNameInGroup( nPartId, INFILL_GRP .. '*')
while nInfillId do
EgtErase( nInfillId)
nInfillId = EgtGetFirstNameInGroup( nPartId, INFILL_GRP .. '*')
end
-- rimuovo gruppo per export
local nExportGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, LAY_EXPORT)
if nExportGrpId then
EgtErase( nExportGrpId)
end
end
---------------------------------------------------------------------
@@ -150,10 +164,6 @@ function RunSlicing.Exec()
EgtRemoveAllOperations()
EgtResetCurrMachGroup()
-- Lettura dati macchina
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local HMax = tonumber( EgtGetStringFromIni( '3dPrinting', 'HMax', 500, sMachIni))
-- Eventuale ripristino posizione originaria
RestoreOriginalPosition( nPartId)
@@ -164,7 +174,7 @@ function RunSlicing.Exec()
RemoveOldTFS()
-- Calcolo delle fette
local bOk = CSLICES.Exec( nPartId, nStmId, HMax)
local bOk = CSLICES.Exec( nPartId, nStmId)
EgtDraw()
-- Calcolo dei percorsi sul centro strand in basso
+17
View File
@@ -0,0 +1,17 @@
-- PrepareExport.lua by Egaltech s.r.l. 2023/10/19
-- Creo le geometrie da esportare con 3dm
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
EgtAddToPackagePath( PRINT.BASEDIR .. '\\LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunPrepareExport = nil
local RPE = require( 'RunPrepareExport')
-- Calcolo
PRINT.EXPORTLAYER = RPE.Exec()
+2 -2
View File
@@ -1,4 +1,4 @@
-- Version.lua by Egaltech s.r.l. 2023/02/28
-- Version.lua by Egaltech s.r.l. 2026/03/04
-- Gestione della versione di 3dPrinting
VERSION = '2.5d5'
VERSION = '3.1c1'