Compare commits

...

82 Commits

Author SHA1 Message Date
Samuele Locatelli 90a8b558b9 fix script netuse 2023-03-20 12:45:43 +01:00
Samuele Locatelli eca66a82bf typo 2023-03-20 12:44:41 +01:00
Samuele Locatelli 82f61af2a3 sintassi alternativa x net share 2023-03-20 12:43:48 +01:00
Samuele Locatelli 2914862a15 aggiunto escape nel path 2023-03-20 12:41:23 +01:00
Samuele Locatelli 7d026726d6 test develop compile 2023-03-20 12:30:31 +01:00
Samuele Locatelli 439d48b380 update yaml gestione interfacce di rete 2023-03-20 12:29:56 +01:00
Samuele Locatelli e45cbf1f3d Merge branch 'main' into develop 2023-03-20 12:16:10 +01:00
SaraP 046431a2a9 3dPrinting :
- corretta la gestione delle uscite per setti chiusi con link disegnato dall'utente.
2023-03-20 11:49:15 +01:00
SaraP 3745705b3d 3dPrinting :
- corretto errore nel trim dei ribs.
2023-03-16 14:54:56 +01:00
SaraP 1da71888e7 3dPrinting :
- corretto il calcolo della correzione in z per appoggiare sulla tavola/bancaletto.
2023-03-13 10:56:56 +01:00
SaraP 862216b84f 3dPrinting 2.5c2 :
- aggiunto taglio dei ribs unbounded con solido se richiesto.
2023-03-06 14:54:19 +01:00
Emmanuele Sassi 25fb2b6b37 - gestito conto separato lunghezza percorso per calcolo massa totale oggetto 2023-03-03 13:13:08 +01:00
SaraP 921b8e2ef2 3dPrinting 2.5c1 :
- aggiunto flag per decidere se limitare ribs unbounded con solido.
2023-03-01 15:04:03 +01:00
SaraP 9e1588b386 3dPrinting 2.5b3 :
- aggiunto Version.lua.
2023-02-28 08:31:08 +01:00
SaraP 3a1dcbb822 3dPrinting :
- gestita interruzione degli script.
2023-02-16 10:27:46 +01:00
SaraP 31f27d66c1 3dPrinting :
- aggiunte le diverse tipologie di ribs nell'ordinamento degli elementi di stampa.
2023-02-15 14:39:47 +01:00
SaraP df0cb0dfa3 3dPrinting :
- aggiunte le costanti per le tipologie di setti in PRINT_ELEMENT.
2023-02-14 09:42:43 +01:00
SaraP 4916da48f9 3dPrinting :
- modificato calcolo della correzione in z per appoggiare correttamente sulla tavola
- correzione quote di slicing per includere setti esterni e unbounded.
2023-02-10 10:36:20 +01:00
DarioS 26acf572fc Merge branch 'main' of https://gitlab.steamware.net/egalware/3dPrinting 2023-02-02 11:55:06 +01:00
DarioS 412d1b15b5 3dPrinting :
- in generazione CN aggiunta restituzione stringa di errore (PRINT.MSG).
2023-02-02 11:54:43 +01:00
SaraP 4e85ebda3d 3dPrinting :
- piccole migliorie nei setti.
2023-02-02 11:16:10 +01:00
DarioS b020c855e3 3dPrinting :
- correzione errore nei setti.
2023-02-02 09:21:22 +01:00
SaraP 6117583a79 3dPrinting :
- aggiunto offset lead point anche per shell interne quando non ci sono collegamenti.
2023-02-01 11:03:24 +01:00
SaraP 9f5c2523e0 3dPrinting :
- modifiche per nuova definizione di EgtCurveCurveInters.
2023-02-01 09:36:43 +01:00
SaraP ee59b4ac74 3dPrinting :
- modifiche nei setti per conservare i link disegnati dall'utente ( prima versione)
- aggiunti ingressi/uscite per setti che non iniziano/terminano su shell.
2023-01-31 15:35:08 +01:00
SaraP 303bc59ddd 3dPrinting :
- aggiunto controllo sulla direzione della normale delle superfici ottenute dallo slicing.
2023-01-27 16:14:59 +01:00
DarioS 0a08957c55 Merge branch 'main' of https://gitlab.steamware.net/egalware/3dPrinting 2023-01-26 11:04:32 +01:00
DarioS ba1c7b7657 3dPrinting :
- corretta direzione estrusione dei Link nei setti.
2023-01-26 11:03:12 +01:00
SaraP 550365322a 3dPrinting :
- aggiunto StartPointOffsetOnLayer per setti chiusi.
2023-01-12 17:43:06 +01:00
DarioS 98e69f098d 3dPrinting :
- altra correzione a compilazione su git Push.
2023-01-12 09:33:13 +01:00
DarioS 7ff7e6e2e3 3dPrinting :
- correzione a compilazione su git Push.
2023-01-12 09:31:11 +01:00
DarioS 3a8f94f027 3dPrinting :
- eliminati tutti i file non per Icarus (lua e immagini)
- eliminata cartella Images
- compilazione 32 e 64 bit unificata con direttorio destinazione bin.
2023-01-12 09:25:56 +01:00
DarioS 30677a89a4 3dPrinting :
- modifiche per compilazione lua5.4.
2023-01-11 19:50:51 +01:00
DarioS ab39b407e4 Merge branch 'main' of https://gitlab.steamware.net/egalware/3dPrinting 2023-01-11 18:32:01 +01:00
DarioS 7f6ddd699c 3dPrinting :
- nuova compilazione per lua 5.4.
2023-01-11 18:31:35 +01:00
SaraP f050f49b66 3dPrinting :
- ordinamento elementi di stampa
- oridinamento per tipologia di setti.
2023-01-10 08:54:09 +01:00
SaraP 1225625a9a 3dPrinting :
- aggiunta nuova tipologia per setti ( setti di supporto)
- correzioni per setti chiusi nel caso di intersezioni con 2 passate.
2023-01-05 15:16:45 +01:00
SaraP 89a8002205 3dPrinting :
- gestione di offset lead point con valori negativi.
2023-01-04 11:50:04 +01:00
SaraP d576203a97 3dPrinting :
- gestione setti chiusi
- correzioni varie nelle regioni con diverse passate.
2023-01-03 16:36:47 +01:00
DarioS b2cba54453 3dPrinting :
- modifiche per assegnare valori di defualt a nuovi parametri.
2022-12-28 08:49:13 +01:00
Emmanuele Sassi 96a6f32458 - aggiornamento con nuove costanti materiale 2022-12-27 16:34:44 +01:00
Emmanuele Sassi a6a98f7a11 Merge branch 'main' of https://gitlab.steamware.net/egalware/3dprinting 2022-12-27 14:48:12 +01:00
Emmanuele Sassi f9d774a7eb - migliorata gestione wait time 2022-12-27 14:48:09 +01:00
SaraP d7b5d7d16d 3dPrinting :
- corretto rilevamento dell'intersezione fra setti.
2022-12-27 12:21:30 +01:00
DarioS 5e3def88fa 3dPrinting :
- piccola correzione a AddRetraction per evitare crash.
2022-12-20 11:05:16 +01:00
SaraP ef49a211ab 3dPrinting :
- migliorie nel calcolo solidi per spiral vase.
2022-12-16 16:55:40 +01:00
SaraP a7617c2761 3dPrinting :
- corretto errore nel calcolo dei solidi per spiral vase.
2022-12-12 12:34:50 +01:00
DarioS 1f8881a4c3 3dPrinting :
- modifiche a determinazione parametri calcolo MF e SC per Ribs Unbounded.
2022-12-07 12:19:47 +01:00
SaraP 6d03a8e898 3dPrinting :
- corretto errore nelle intersezioni di setti con overlap diversi.
2022-12-06 09:36:48 +01:00
SaraP 313e837f41 3dPrinting :
- modificato ordine di default per realizzazione setti ( unbounded fatti per primi).
2022-12-06 08:43:34 +01:00
DarioS 076e2382ab 3dPrinting :
- piccole modifiche per stampa 45deg su Y e gestione movimento solido conseguente.
2022-12-05 08:22:16 +01:00
SaraP fb9ecc811d 3dPrinting :
- migliorata organizzazione calcolo toolpath.
2022-12-02 11:36:09 +01:00
SaraP 298b0a4506 3dPrinting :
- correzione calcolo toolpath in spiral vase quando sezione varia tra layer.
2022-12-01 11:31:18 +01:00
SaraP 693746d6e3 3dPrinting :
- aggiunto slicing a 45° lungo Y.
2022-11-29 10:21:14 +01:00
SaraP 8622fc8919 3dPrinting :
- migliorata intersezione setti
- aggiunto ordine di realizzazione per tipologie setti.
2022-11-24 16:09:16 +01:00
DarioS 0a78833f61 3dPrinting :
- corretto calcolo TFS quando si estrudono solo i Ribs e non il Pezzo.
2022-11-22 20:01:58 +01:00
DarioS c0230eccf7 3dPrinting :
- tolleranza di approssimazione curve di slicing portata a 0.1 (MID_TOLER).
2022-11-14 09:27:42 +01:00
SaraP 5494e92e9d 3dPrinting :
- aggiunta la possibilità di collegare solo alcuni setti ( prima versione)
- correzioni varie.
2022-11-11 09:57:04 +01:00
SaraP f834d006f6 3dPrinting :
- gestione uscite differenziate per regioni con diverse passate.
2022-11-07 10:09:12 +01:00
SaraP 4d74134671 3dPrinting :
- correzione lead out setti.
2022-11-03 11:11:23 +01:00
SaraP 549f388227 3dPrinting :
- in spiral vase corrette info dell'ultimo layer.
2022-11-03 09:30:00 +01:00
SaraP 15c6563157 3dPrinting :
- in spiral vase corretta gestione primo layer.
2022-11-02 15:46:27 +01:00
DarioS e18e57e7c2 3dPrinting :
- modifiche e migliorie per calcolo solidi con uso della nuova funzione lua EgtSurfTmRectSwept.
2022-11-02 15:19:09 +01:00
SaraP 8e75cf21da 3dPrinting :
- correzione errori nel caso di pezzo ruotato.
2022-10-28 11:50:19 +02:00
DarioS 9c438d11b6 3dPrinting :
- cambiato valore delle costanti SLICING_TYPE.DEG45 = 2 e SLICING_TYPE.HORIZONTAL = 3.
2022-10-28 11:46:56 +02:00
DarioS 781e2d5274 3dPrinting :
- piccole modifiche estetiche
- salvataggio in TFS di MF e TotalArea.
2022-10-27 22:24:37 +02:00
SaraP 213e6ac6ed 3dPrinting :
- aggiunte tipologie per ribs ( interni, esterni, illimitati)
- migliorie per ordinamento ribs.
2022-10-26 16:12:25 +02:00
Emmanuele Sassi aa750ff933 - Cambio formule per costante k passata da unitaria in aggiunta a percentuale totale 2022-10-26 12:28:36 +02:00
Emmanuele Sassi 7ced9ec2f4 - modifiche per assegnazione nome iso da programma 2022-10-24 12:58:26 +02:00
SaraP d875e31491 3dPrinting :
- slicing a 90°.
2022-10-20 17:23:48 +02:00
SaraP 217bb4f26e 3dPrinting :
- aggiunti coasting e wipe sui setti che non arrivano al bordo.
2022-10-14 10:55:20 +02:00
DarioS f05f9c11ae 3dPrinting :
- aggiustamento tolleranze per slicing.
2022-10-12 19:08:11 +02:00
SaraP 7792f22242 3dPrinting :
- spiral vase (prima versione)
- aggiunto controllo sui wipe dei setti.
2022-10-11 16:06:30 +02:00
DarioS 2288078e49 3dPrinting :
- corretta verifica necessità ricalcolo solidi.
2022-10-11 09:46:47 +02:00
Emmanuele Sassi d502770114 - Aggiunta gestione attesa su layer 2022-10-10 16:28:01 +02:00
SaraP a94474869c 3dPrinting :
- modifiche progress bar.
2022-10-03 16:08:25 +02:00
SaraP 5e65055e86 3dPrinting :
- correzioni varie.
2022-10-03 12:07:43 +02:00
DarioS 6b2c1834d2 3dPrinting :
- correzioni per Extra Shell (estrusione su link e visualizzazione toolpath).
2022-10-02 00:39:42 +02:00
SaraP 00c504c58b 3dPrinting :
- correzione errori per regioni con diverse passate.
2022-09-30 15:44:52 +02:00
DarioS 276f8de4f8 3dPrinting :
- correzione a calcolo TFS per layer con errori (nome preceduto da __).
2022-09-30 01:10:52 +02:00
DarioS d1fb754cda 3dPrinting :
- tolleranza di slicing portata a 0.5.
2022-09-29 23:03:32 +02:00
Emmanuele Sassi 6fa13da092 Merge branch 'Feature/Icarus' 2022-09-29 21:25:12 +02:00
48 changed files with 2665 additions and 2769 deletions
+4 -4
View File
@@ -13,9 +13,9 @@
/Debug64 /Debug64
/Release64 /Release64
/ipch /ipch
/bin
/obj /obj
/.vs /.vs
/Machinings /bin/*.lua
/Materials /bin/*.ini
/bin/LuaLibs/*.lua
/bin/Images/*.png
+26 -65
View File
@@ -2,96 +2,58 @@ variables:
VERS_MAIN: '1.0' VERS_MAIN: '1.0'
APP_NAME: '3dPrinting' APP_NAME: '3dPrinting'
NEW_REL: '' NEW_REL: ''
NET_SHARE_R: '\\10.74.82.201\EgwTech' NET_SHARE_X: '\\10.74.82.201\EgwTech'
NET_SHARE_Z: '\\10.74.82.201\Artifacts' NET_SHARE_Z: '\\10.74.82.201\Artifacts'
NET_USERQ: 'steamw\egalware' NET_USERQ: 'steamw\egalware'
#Note compilazione LUA: #Note compilazione LUA:
# lua53 -o 32\$FileName -s $FileName: -o = output, -s = NON include i debug symbols # lua54 -o bin\$FileName -s $FileName: -o = output, -s = NON include i debug symbols
# helper compilazione LUA a 32 bit # helper compilazione LUA a 32 e 64 bit
.LuaCompile32: &LuaCompile32 .LuaCompile: &LuaCompile
- | - |
Set-Alias lua53 C:\Tools\Lua32\luac53 Set-Alias lua54 C:\Tools\Lua32\luac54
echo "Copia file *.ini"
$FileList = Get-ChildItem("*.ini")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
Copy-Item -Path $FileName -Destination 32\$FileName
echo "Copy-Item -Path $FileName -Destination 32\$FileName"
}
echo "Copia file *.lua"
$FileList = Get-ChildItem("*.lua") $FileList = Get-ChildItem("*.lua")
ForEach ($File in $FileList) { ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf $FileName = Split-Path $File -leaf
Copy-Item -Path $FileName -Destination 32\$FileName lua54 -o bin\$FileName $FileName
echo "Copy-Item -Path $FileName -Destination 32\$FileName" echo "lua54 -o bin\$FileName $FileName"
} }
$FileList = Get-ChildItem("LuaLibs\*.lua") $FileList = Get-ChildItem("LuaLibs\*.lua")
ForEach ($File in $FileList) { ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf $FileName = Split-Path $File -leaf
lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
echo "lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName" echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
} }
# helper compilazione LUA a 64 bit
.LuaCompile64: &LuaCompile64
- |
Set-Alias lua53 C:\Tools\Lua64\luac53
echo "Copia file *.ini"
$FileList = Get-ChildItem("*.ini")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
Copy-Item -Path $FileName -Destination 64\$FileName
echo "Copy-Item -Path $FileName -Destination 64\$FileName"
}
echo "Copia file *.lua"
$FileList = Get-ChildItem("*.lua")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
Copy-Item -Path $FileName -Destination 64\$FileName
echo "Copy-Item -Path $FileName -Destination 64\$FileName"
}
$FileList = Get-ChildItem("LuaLibs\*.lua")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua53 -o 64\LuaLibs\$FileName LuaLibs\$FileName
echo "lua53 -o 64\LuaLibs\$FileName LuaLibs\$FileName"
}
# Copy-Item -Path $FileName -Destination 64\$FileName
# echo "Copy-Item -Path $FileName -Destination 64\$FileName"
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI # helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI
.CodeReplicaR: &CodeReplicaR .CodeReplicaR: &CodeReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . X:\EgtData\$env:APP_NAME\ /MIR /XF .git* /XD .git
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64 # helper copia script verso cartella di rete R:\ delle cartelle bin
.ReplicaR: &ReplicaR .ReplicaR: &ReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR 32 R:\EgtData\$env:APP_NAME\32
ROBOCOPY /MIR 64 R:\EgtData\$env:APP_NAME\64
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\32\Images
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\64\Images
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64 # helper copia script verso cartella di rete Z:\ delle cartelle bin
.ReplicaZ: &ReplicaZ .ReplicaZ: &ReplicaZ
- | - |
net use Z: /delete net use Z: /delete
SLEEP 2
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR 32 Z:\EgtData\$env:APP_NAME\32 ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR 64 Z:\EgtData\$env:APP_NAME\64
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\32\Images
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\64\Images
SLEEP 2 SLEEP 2
net use Z: /delete net use Z: /delete
@@ -103,12 +65,11 @@ LuaCompile:build:
only: only:
- main - main
- master - master
- develop
tags: tags:
- win - win
script: script:
- *LuaCompile32 - *LuaCompile
- *LuaCompile64
- *CodeReplicaR - *CodeReplicaR
- *ReplicaR - *ReplicaR
- *ReplicaZ # - *ReplicaZ
View File
-16
View File
@@ -1,16 +0,0 @@
[3dPrinting]
Enable=1
BaseDir=C:\EgtData\3dPrinting
Button1=PartPositioning.lua,Images\PartPositioning.png,Disponi pezzo sulla tavola macchina
Button2=Slicing.lua,Images\Slicing.png,Calcola lo slicing, i solidi e i percorsi utensile
Button3=MachiningParamCalc.lua,Images\MachiningParamCalc.png,Calcola parametri di lavorazione (Tempo layer, F, S)
Button4=GcodeGenerate.lua,Images\GcodeGenerate.png,Genera codice CN
Button5=ShowManager.lua,Images\ShowManager.png,Gestore visualizzazione
Button6=ViewManager.lua,Images\ViewManager.png,Nascondi Visualizza strato
Button7=SliceAdvancement.lua,Images\SliceAdvancement.png,Mostra avanzamento strato
Button8=SlicePalette.lua,Images\SlicePalette.png,Gestore colori strato
Button9=MachiningParamEdit.lua,Images\MachiningParamEdit.png,Edita i parametri di stampa
Button10=MaterialParamEdit.lua,Images\MaterialParamEdit.png,Edita i parametri del materiale
ParamFile=C:\EgtData\3dPrinting\Machinings\Params.ini
ResultReadProg="C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"
MachiningEditProg="C:\Windows\System32\notepad.exe"
View File
View File
+2 -3
View File
@@ -1,4 +1,4 @@
-- CalcMachParamFromSW.lua by Egaltech s.r.l. 2022/09/15 -- CalcMachParamFromSW.lua by Egaltech s.r.l. 2023/01/11
-- Calcolo dei parametri di stampa -- Calcolo dei parametri di stampa
-- Intestazioni -- Intestazioni
@@ -7,8 +7,7 @@ _ENV = EgtProtectGlobal()
EgtEnableDebug( false) EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d -- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir() EgtAddToPackagePath( PRINT.BASEDIR .. '\\LuaLibs\\?.lua')
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie -- Librerie
_G.package.loaded.RunMachParamFromSWCalc = nil _G.package.loaded.RunMachParamFromSWCalc = nil
+2 -3
View File
@@ -1,4 +1,4 @@
-- CalcSolids.lua by Egaltech s.r.l. 2022/09/26 -- CalcSolids.lua by Egaltech s.r.l. 2023/01/11
-- Calcola i solidi a partire dallo slicing -- Calcola i solidi a partire dallo slicing
-- Intestazioni -- Intestazioni
@@ -7,8 +7,7 @@ _ENV = EgtProtectGlobal()
EgtEnableDebug( false) EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d -- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir() EgtAddToPackagePath( PRINT.BASEDIR .. '\\LuaLibs\\?.lua')
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie -- Librerie
_G.package.loaded.RunCalcSolids = nil _G.package.loaded.RunCalcSolids = nil
+18
View File
@@ -0,0 +1,18 @@
REM Compilazione degli script 3dPrinting Egaltech 2023.01.11
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
+2 -3
View File
@@ -1,4 +1,4 @@
-- GcodeGenerate.lua by Egaltech s.r.l. 2022/04/11 -- GcodeGenerate.lua by Egaltech s.r.l. 2023/01/11
-- Calcoli prima fase per Stampa 3d -- Calcoli prima fase per Stampa 3d
-- Intestazioni -- Intestazioni
@@ -7,8 +7,7 @@ _ENV = EgtProtectGlobal()
EgtEnableDebug( false) EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d -- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir() EgtAddToPackagePath( PRINT.BASEDIR .. '\\LuaLibs\\?.lua')
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie -- Librerie
_G.package.loaded.RunGcodeGenerate = nil _G.package.loaded.RunGcodeGenerate = nil
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

+62 -8
View File
@@ -24,9 +24,12 @@ COASTING_CRV = "Coasting"
WIPE_CRV = "Wipe" WIPE_CRV = "Wipe"
LEAD_IN_CRV = "LeadIn" LEAD_IN_CRV = "LeadIn"
LEAD_OUT_CRV = "LeadOut" LEAD_OUT_CRV = "LeadOut"
LINK_CRV = "Link"
FRAME_PART = "FramePart" FRAME_PART = "FramePart"
START_GEOM = "Start" START_GEOM = "Start"
TOT_SHELL_TRIM_SURF = "TotalShellSurfForTrim" TOT_SHELL_TRIM_SURF = "TotalShellSurfForTrim"
TRIM_SURF_LOOP = "TrimSurfLoop"
SURF_LOOP = "SurfLoop"
MIN_LEN = 0.1 MIN_LEN = 0.1
MIN_AREA = 0.01 MIN_AREA = 0.01
@@ -36,15 +39,17 @@ MIN_RIBS_LEN = 2
SEC_DEFAULT = "Default" SEC_DEFAULT = "Default"
KEY_PARAMS = "Params" KEY_PARAMS = "Params"
KEY_CALC_SOLIDS = "CalcSolids" KEY_CALC_SOLIDS = "CalcSolids"
KEY_SLICING_45 = "Slicing45" KEY_SPIRAL_VASE = "SpiralVase"
KEY_SLICING_DIR="SlicingDir" KEY_SLICING_TYPE = "SlicingType"
KEY_SLICING_DIR = "SlicingDir"
KEY_SLICE_STEP = "StrandH" KEY_SLICE_STEP = "StrandH"
KEY_SHELLS_NBR = "StrandCount" KEY_SHELLS_NBR = "StrandCount"
KEY_STRAND = "StrandW" KEY_STRAND = "StrandW"
KEY_STRAND_OVERLAP = "StrandOverlap" KEY_STRAND_OVERLAP = "StrandOverlap"
KEY_OFFSET_SLICE ="Offset" KEY_OFFSET_SLICE = "Offset"
KEY_SP_OFFSET_ON_SLICE = "StartPointOffsetOnSlice" KEY_SP_OFFSET_ON_SLICE = "StartPointOffsetOnSlice"
KEY_PRINT_ORDER = "StrandOrder" KEY_STRAND_ORDER = "StrandOrder"
KEY_PRINT_ORDER = "PrintOrder"
KEY_PRINT_DIRECTION = "Direction" KEY_PRINT_DIRECTION = "Direction"
KEY_TYPE = "Type" KEY_TYPE = "Type"
KEY_LINK_TYPE = "LinkType" KEY_LINK_TYPE = "LinkType"
@@ -74,10 +79,13 @@ KEY_OFFSET_LEAD_POINT = "OffsetLeadPoint"
KEY_COASTING_LEN = "CoastingLen" KEY_COASTING_LEN = "CoastingLen"
KEY_COASTING_FEED = "CoastingFeed" KEY_COASTING_FEED = "CoastingFeed"
KEY_WIPE_LEN = "WipeLen" KEY_WIPE_LEN = "WipeLen"
KEY_WIPE_DIR = "WipeDir"
KEY_WIPE_FEEDPU = "WipeFeedPu" KEY_WIPE_FEEDPU = "WipeFeedPu"
KEY_TOOL_DIAM = "ToolDiam" KEY_TOOL_DIAM = "ToolDiam"
-- Ribs -- Ribs
KEY_RIBS_TYPE = "RibsType"
KEY_LIMIT_UNBDD_RIBS = "LimitUnboundedRibsWithSolid"
KEY_RIBS_OVERLAP = "RibsOverlap" KEY_RIBS_OVERLAP = "RibsOverlap"
KEY_RIBS_SHELLS_NBR = "RibsStrandCount" KEY_RIBS_SHELLS_NBR = "RibsStrandCount"
KEY_RIBS_LINK = "RibsLink" KEY_RIBS_LINK = "RibsLink"
@@ -91,14 +99,29 @@ KEY_RIBS_LEAD_OUT_COASTING = "RibsLeadOutCoasting"
KEY_RIBS_LEAD_OUT_WIPE = "RibsLeadOutWipe" KEY_RIBS_LEAD_OUT_WIPE = "RibsLeadOutWipe"
KEY_RIBS_LEAD_OUT_WIPE_DIR = "RibsLeadOutWipeDir" KEY_RIBS_LEAD_OUT_WIPE_DIR = "RibsLeadOutWipeDir"
KEY_RIBS_INTERS = "RibsHaveIntersections" KEY_RIBS_INTERS = "RibsHaveIntersections"
KEY_SPLIT_RIB = "SplitRib" KEY_RIBS_SPECIAL_CASE = "RibsSpecialCase"
KEY_RIBS_TWO_STRANDS = "RibsHaveAll2Strands" KEY_SPLIT_ORDER = "SplitOrder"
KEY_SPLIT_AFTER_TRIM = "RibsSplitAfterTrim"
KEY_SPLIT_AFTER_TRIM_ORDER = "RibsSplitAfterTrimOrder"
KEY_SPLIT_AFTER_TRIM_TOT = "RibsSplitAfterTrimTot"
KEY_SPLIT_ID = "SplitId"
KEY_START_RIB = "StartRib"
KEY_ORIGINAL_RIB = "OriginalRib"
KEY_LOOP_RIB = "LoopRib"
KEY_RIBS_USER_LINK = "RibWithUserLink"
KEY_RIBS_USER_LINK_CCW = "RibUserLinkCCW"
KEY_RIBS_USER_LINK_ORDER = "RibUserLinkOrder"
KEY_RIBS_USER_LINK_TOT = "RibsUserLinkParts"
KEY_RIBS_INVERT_STRAND_ORDER = "RibsInvertStrandOrder"
-- Regioni con diverso numero di passate -- Regioni con diverso numero di passate
KEY_SHELL_NBR_DIFF = "ShellNbrDifference" KEY_SHELL_NBR_DIFF = "ShellNbrDifference"
KEY_SHELL_NBR_COASTING = "ShellNbrCoasting" KEY_SHELL_NBR_COASTING = "ShellNbrCoasting"
KEY_SHELL_NBR_WIPE = "ShellNbrWipe" KEY_SHELL_NBR_WIPE = "ShellNbrWipe"
KEY_SHELL_NBR_WIPE_DIR = "ShellNbrWipeDir" KEY_SHELL_NBR_WIPE_DIR = "ShellNbrWipeDir"
KEY_EXTRA_SHELL_COASTING = "ExtraShellCoasting"
KEY_EXTRA_SHELL_WIPE = "ExtraShellWipe"
KEY_EXTRA_SHELL_WIPE_DIR = "ExtraShellWipeDir"
-- Solidi ausiliari -- Solidi ausiliari
KEY_AUX_SOLIDS_INFILL = "AuxSolidsInfill" KEY_AUX_SOLIDS_INFILL = "AuxSolidsInfill"
@@ -128,7 +151,17 @@ KEY_ZIG_ZAG_DIR = "ZigZagDir"
KEY_INVERTED_CRV = "InvertedCrv" KEY_INVERTED_CRV = "InvertedCrv"
KEY_CLOSED_CRV = "ClosedCrv" KEY_CLOSED_CRV = "ClosedCrv"
KEY_ASSOCIATED_SURF = "AssociatedSurf" KEY_ASSOCIATED_SURF = "AssociatedSurf"
KEY_ASSOCIATED_CRVS = "AssociatedCrvs"
KEY_HAS_SOLIDS = "Solids" KEY_HAS_SOLIDS = "Solids"
KEY_BOX_MIN_Z = "PartBoxMinZ"
KEY_START_POINT = "StartPoint"
SLICING_TYPE = {
VERTICAL = 1,
DEG45_X = 2,
DEG45_Y = 3,
HORIZONTAL = 4,
}
TYPE = { TYPE = {
OUTER_SHELL = 1, OUTER_SHELL = 1,
@@ -143,9 +176,20 @@ TYPE = {
AUX_SOLID = 10, AUX_SOLID = 10,
} }
PRINT_ELEMENT = {
SHELL = 1,
EXTRA_SHELL = 2,
INFILL = 3,
AUX_SOLID = 4,
RIB_UNBOUNDED = 5,
RIB_EXTERNAL = 6,
RIB_INTERNAL = 7,
RIB_SUPPORT = 8,
}
PRINT_ORDER = { PRINT_ORDER = {
EXT_INT_INF = 1, EXT_INT = 1,
INF_INT_EXT = 2, INT_EXT = 2,
} }
PRINT_DIRECTION = { PRINT_DIRECTION = {
@@ -171,6 +215,13 @@ INFILL_TYPE = {
ZIGZAG = 3, ZIGZAG = 3,
} }
RIB_TYPE = {
INTERNAL = 1,
EXTERNAL = 2,
UNBOUNDED = 3,
SUPPORT = 4,
}
--------------------------------------------------------------------- ---------------------------------------------------------------------
TABLE = "Table" TABLE = "Table"
PART = "Part" PART = "Part"
@@ -198,6 +249,7 @@ KEY_SLICE_ADV_MODE = 'SliceAdvMode'
KEY_SLICE_ADV_PERC = 'SliceAdvPerc' KEY_SLICE_ADV_PERC = 'SliceAdvPerc'
KEY_MOVED_PART ='MovedPart' KEY_MOVED_PART ='MovedPart'
KEY_MOVED_PART2 ='MovedPart2'
RESULT = { RESULT = {
OK = 1, OK = 1,
@@ -255,6 +307,8 @@ KEY_FCUR = "FCur"
KEY_LENGTH = "Length" KEY_LENGTH = "Length"
KEY_SLICEID = "SliceId" KEY_SLICEID = "SliceId"
KEY_MASS = "PrintMass" KEY_MASS = "PrintMass"
KEY_MF = "MF"
KEY_TOTAREA = "TotArea"
--------------------------------------------------------------------- ---------------------------------------------------------------------
return AddManData return AddManData
-75
View File
@@ -1,75 +0,0 @@
-- CalcPaths.lua by Egaltech s.r.l. 2022/03/30
-- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo
local CSVManager = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' CSVManager started', 1)
-- Dati
local AMD = require( 'AddManData')
---------------------------------------------------------------------
function toCSV (t)
local s = ""
for _,p in pairs(t) do
s = s .. "," .. escapeCSV(p)
end
return string.sub(s, 2) -- remove first comma
end
---------------------------------------------------------------------
function escapeCSV (s)
if string.find(s, '[,"]') then
ns = '"' .. string.gsub(s, '"', '""') .. '"'
end
return s
end
---------------------------------------------------------------------
local function fromCSV(s)
s = s .. ';' -- ending comma
local t = {} -- table to collect fields
local fieldstart = 1
repeat
-- next field is quoted? (start with `"'?)
if string.find(s, '^"', fieldstart) then
local a, c
local i = fieldstart
repeat
-- find closing quote
a, i, c = string.find(s, '"("?)', i+1)
until c ~= '"' -- quote not followed by quote?
if not i then error('unmatched "') end
local f = string.sub(s, fieldstart+1, i-1)
table.insert(t, (string.gsub(f, '""', '"')))
fieldstart = string.find(s, ';', i) + 1
else -- unquoted; find next comma
local nexti = string.find(s, ';', fieldstart)
table.insert(t, string.sub(s, fieldstart, nexti-1))
fieldstart = nexti + 1
end
until fieldstart > string.len(s)
return t
end
---------------------------------------------------------------------
function read_file( path)
local file = io.open( path, "r") -- r read mode and b binary mode
if not file then return nil end
local CSVTable = {}
for line in io.lines( path) do
CSVTable[#CSVTable + 1] = fromCSV( line)
end
file:close()
return CSVTable
end
---------------------------------------------------------------------
return CSVManager
+1113 -354
View File
File diff suppressed because it is too large Load Diff
+296 -164
View File
@@ -1,4 +1,4 @@
-- CalcSlices.lua by Egaltech s.r.l. 2022/09/18 -- CalcSlices.lua by Egaltech s.r.l. 2022/10/12
-- Calcolo percorsi di lavoro per Stampa 3d -- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -16,8 +16,8 @@ local AMD = require( 'AddManData')
local s_nPartId local s_nPartId
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function ComputeZSlices( dZmin, dDeltaZ, dZmax) local function ComputeZSlices( dSliceStep, dZmin, dDeltaZ, dZmax)
local dSliceStep = EgtGetInfo( s_nPartId, KEY_SLICE_STEP, 'd') or 10000
local ptSlices = { dZmin + dDeltaZ} local ptSlices = { dZmin + dDeltaZ}
local dPosZ = dZmin + dSliceStep local dPosZ = dZmin + dSliceStep
while dPosZ < dZmax do while dPosZ < dZmax do
@@ -28,9 +28,16 @@ local function ComputeZSlices( dZmin, dDeltaZ, dZmax)
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
local function ComputeMaxH( nStmId, frSlicing, HMax) local function ComputeMaxH( vIds, frSlicing, HMax, dSliceStep)
-- calcolo il box globale
local b3BoxGlob = BBox3d()
for i = 1, #vIds do
local b3Box = EgtGetBBoxGlob( vIds[i], GDB_BB.STANDARD)
b3BoxGlob:Add( b3Box)
end
EgtSetInfo( s_nPartId, KEY_BOX_MIN_Z, b3BoxGlob:getMin():getZ())
local b3BoxGlob = EgtGetBBoxGlob( nStmId, GDB_BB.STANDARD)
if b3BoxGlob:getMax():getZ() < b3BoxGlob:getMin():getZ() + HMax + GEO.EPS_SMALL then if b3BoxGlob:getMax():getZ() < b3BoxGlob:getMin():getZ() + HMax + GEO.EPS_SMALL then
return GEO.INFINITO return GEO.INFINITO
end end
@@ -39,17 +46,27 @@ local function ComputeMaxH( nStmId, frSlicing, HMax)
return HMax return HMax
else else
-- se slicing inclinato -- se slicing inclinato
local nGrpTmp = EgtGroup( EgtGetParent( nStmId)) local nGrpTmp = EgtGroup( s_nPartId)
local nNewId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( Point3d( 0, 0, HMax), Z_AX(), nStmId, nGrpTmp) for i = 1, #vIds do
if not nNewId then EgtPlaneSurfTmInters( Point3d( 0, 0, HMax), Z_AX(), vIds[i], nGrpTmp, GDB_RT.GLOB)
return GEO.INFINITO
end end
local b3Box = EgtGetBBoxGlob( nGrpTmp, GDB_BB.STANDARD) local b3Box = EgtGetBBoxGlob( nGrpTmp, GDB_BB.STANDARD)
EgtErase( nGrpTmp) EgtErase( nGrpTmp)
if not b3Box then
return GEO.INFINITO
end
local ptMin = b3Box:getMin() local ptMin = b3Box:getMin()
local ptMax = b3Box:getMax()
-- la quota dell'ultimo slice è più bassa di dSliceStep rispetto alla quota dell'ultimo toolpath
-- ( andrebbe anche considerata dCorrZ)
ptMin = ptMin - dSliceStep * frSlicing:getVersZ()
ptMax = ptMax - dSliceStep * frSlicing:getVersZ()
ptMin:toLoc( frSlicing) ptMin:toLoc( frSlicing)
return ptMin:getZ() ptMax:toLoc( frSlicing)
return min( ptMin:getZ(), ptMax:getZ())
end end
return GEO.INFINITO return GEO.INFINITO
end end
@@ -68,7 +85,7 @@ local function AdjustAuxSolids( nSolidsLay)
while bInters do while bInters do
bInters = false bInters = false
local nNext = EgtGetNext( nCurr) local nNext = EgtGetNext( nCurr)
while nNext do while nNext do
if EgtGetType( nNext) == GDB_TY.SRF_MESH then if EgtGetType( nNext) == GDB_TY.SRF_MESH then
-- verifico se le due superfici si intersecano -- verifico se le due superfici si intersecano
local nFirst = EgtSurfTmSurfTmInters( nCurr, nNext, nGrpTmp) local nFirst = EgtSurfTmSurfTmInters( nCurr, nNext, nGrpTmp)
@@ -85,100 +102,76 @@ local function AdjustAuxSolids( nSolidsLay)
end end
nCurr = EgtGetNext( nCurr) nCurr = EgtGetNext( nCurr)
end end
EgtErase( nGrpTmp) EgtErase( nGrpTmp)
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
local function ReadParam( nId, sKey, sType, table) local function ReadParam( nId, sKey, sType, defVal, table)
-- verifico se info nell'oggetto specifico
local info = EgtGetInfo( nId, sKey, sType) local info = EgtGetInfo( nId, sKey, sType)
-- altrimenti recupero info dai parametri generali
if info == nil then info = EgtGetInfo( s_nPartId, sKey, sType) end if info == nil then info = EgtGetInfo( s_nPartId, sKey, sType) end
table[sKey] = info -- o assegno valore di default
if info == nil then info = defVal end
-- se presente, inserisco l'info nella tabella
if table then table[sKey] = info end
return info
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
local function GetRibParams( nId) local function GetRibParams( nId)
local RibParam = {} local RibParam = {}
ReadParam( nId, KEY_RIBS_SHELLS_NBR, 'i', RibParam) ReadParam( nId, KEY_RIBS_SHELLS_NBR, 'i', 0, RibParam)
ReadParam( nId, KEY_RIBS_INVERT_DIR, 'b', RibParam) ReadParam( nId, KEY_RIBS_INVERT_DIR, 'b', false, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_IN_INVERT, 'b', RibParam) ReadParam( nId, KEY_RIBS_LEAD_IN_INVERT, 'b', false, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_IN_LEN, 'd', RibParam) ReadParam( nId, KEY_RIBS_LEAD_IN_LEN, 'd', 0, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_OUT_INVERT, 'b', RibParam) ReadParam( nId, KEY_RIBS_LEAD_OUT_INVERT, 'b', false, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_OUT_LEN, 'd', RibParam) ReadParam( nId, KEY_RIBS_LEAD_OUT_LEN, 'd', 0, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_OUT_COASTING, 'd', RibParam) ReadParam( nId, KEY_RIBS_LEAD_OUT_COASTING, 'd', 0, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_OUT_WIPE, 'd', RibParam) ReadParam( nId, KEY_RIBS_LEAD_OUT_WIPE, 'd', 0, RibParam)
ReadParam( nId, KEY_RIBS_LEAD_OUT_WIPE_DIR, 'd', RibParam) ReadParam( nId, KEY_RIBS_LEAD_OUT_WIPE_DIR, 'd', 0, RibParam)
ReadParam( nId, KEY_RIBS_OVERLAP, 'i', 0, RibParam)
-- overlap può essere diverso tra le varie costolature solo se non sono collegate ReadParam( nId, KEY_RIBS_LINK, 'b', false, RibParam)
local bLink = EgtGetInfo( s_nPartId, KEY_RIBS_LINK, 'b') or false ReadParam( nId, KEY_RIBS_TYPE, 'i', RIB_TYPE.INTERNAL, RibParam)
if bLink then ReadParam( nId, KEY_RIBS_INVERT_STRAND_ORDER, 'b', false, RibParam)
RibParam[ KEY_RIBS_OVERLAP] = EgtGetInfo( s_nPartId, KEY_RIBS_OVERLAP, 'i') -- parametro generico
else
ReadParam( nId, KEY_RIBS_OVERLAP, 'i', RibParam) -- parametro specifico della costolatura
end
return RibParam return RibParam
end end
-------------------------------------------------------------------
local function GetShellNumberParams( nId)
local ShellNumberParam = {}
ReadParam( nId, KEY_SHELL_NBR_DIFF, 'i', 0, ShellNumberParam)
ReadParam( nId, KEY_SHELL_NBR_COASTING, 'd', 0, ShellNumberParam)
ReadParam( nId, KEY_SHELL_NBR_WIPE, 'd', 0, ShellNumberParam)
ReadParam( nId, KEY_SHELL_NBR_WIPE_DIR, 'd', 0, ShellNumberParam)
return ShellNumberParam
end
-------------------------------------------------------------------- --------------------------------------------------------------------
local function GetAuxSolidsParams( nId) local function GetAuxSolidsParams( nId)
local AuxSolidsParam = {} local AuxSolidsParam = {}
ReadParam( nId, KEY_AUX_SOLIDS_OVERLAP, 'i', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_OVERLAP, 'i', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_LINK_PARAM, 'd', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_LINK_PARAM, 'd', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_SP_OFFSET, 'd', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_SP_OFFSET, 'd', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_COASTING_LEN, 'd', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_COASTING_LEN, 'd', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_WIPE_LEN, 'd', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_WIPE_LEN, 'd', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_WIPE_DIR, 'd', AuxSolidsParam) ReadParam( nId, KEY_AUX_SOLIDS_WIPE_DIR, 'd', 0, AuxSolidsParam)
ReadParam( nId, KEY_AUX_SOLIDS_INFILL, 'i', INFILL_TYPE.NONE, AuxSolidsParam)
local sInfill = EgtGetInfo( nId, KEY_AUX_SOLIDS_INFILL, 's') ReadParam( nId, KEY_AUX_SOLIDS_PRINT_ORDER, 'i', PRINT_ORDER.EXT_INT, AuxSolidsParam)
if sInfill then ReadParam( nId, KEY_AUX_SOLIDS_LINK_TYPE, 'i', LINK_TYPE.NONE, AuxSolidsParam)
-- se parametro specifico per il solido
if sInfill == 'ZigZag' then
AuxSolidsParam[KEY_AUX_SOLIDS_INFILL] = INFILL_TYPE.ZIGZAG
elseif sInfill == 'Offset' then
AuxSolidsParam[KEY_AUX_SOLIDS_INFILL] = INFILL_TYPE.OFFSET
else
AuxSolidsParam[KEY_AUX_SOLIDS_INFILL] = INFILL_TYPE.NONE
end
else
-- altrimenti recupero il parametro generale dal pezzo
AuxSolidsParam[KEY_AUX_SOLIDS_INFILL] = EgtGetInfo( s_nPartId, KEY_AUX_SOLIDS_INFILL, 'i')
end
local sPrintOrder = EgtGetInfo( nId, KEY_AUX_SOLIDS_PRINT_ORDER, 's')
if sPrintOrder then
-- se parametro specifico per il solido
if sPrintOrder == 'OutToIn' then
AuxSolidsParam[KEY_AUX_SOLIDS_PRINT_ORDER] = PRINT_ORDER.EXT_INT_INF
else
AuxSolidsParam[KEY_AUX_SOLIDS_PRINT_ORDER] = PRINT_ORDER.INF_INT_EXT
end
else
-- altrimenti recupero il parametro generale dal pezzo
AuxSolidsParam[KEY_AUX_SOLIDS_PRINT_ORDER] = EgtGetInfo( s_nPartId, KEY_AUX_SOLIDS_PRINT_ORDER, 'i')
end
local sLinkType = EgtGetInfo( nId, KEY_AUX_SOLIDS_LINK_TYPE, 's')
if sLinkType then
-- se parametro specifico per il solido
if sLinkType == 'None' then
AuxSolidsParam[KEY_AUX_SOLIDS_LINK_TYPE] = LINK_TYPE.NONE
elseif sLinkType == 'BiArc' then
AuxSolidsParam[KEY_AUX_SOLIDS_LINK_TYPE] = LINK_TYPE.BIARC
else
AuxSolidsParam[KEY_AUX_SOLIDS_LINK_TYPE] = LINK_TYPE.LINEAR
end
else
-- altrimenti recupero il parametro generale dal pezzo
AuxSolidsParam[KEY_AUX_SOLIDS_LINK_TYPE] = EgtGetInfo( s_nPartId, KEY_AUX_SOLIDS_LINK_TYPE, 'i')
end
return AuxSolidsParam return AuxSolidsParam
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
local function SlicingExtraObjects( vtSlicing, nLay, nType, sNameGrp, sName) local function SlicingExtraObjects( vtSlicing, nLay, nType, sNameGrp, sName, nStmId)
-- recupero gli oggeti di cui fare slicing -- recupero gli oggeti di cui fare slicing
local vIds = EgtGetAllInGroup( nLay) local vIds = EgtGetAllInGroup( nLay)
@@ -206,7 +199,7 @@ local function SlicingExtraObjects( vtSlicing, nLay, nType, sNameGrp, sName)
vParams = GetRibParams( vIds[i]) vParams = GetRibParams( vIds[i])
if vParams[ KEY_RIBS_SHELLS_NBR] == 0 then bToBeDone = false end if vParams[ KEY_RIBS_SHELLS_NBR] == 0 then bToBeDone = false end
elseif nType == TYPE.EXTRA_SHELL then elseif nType == TYPE.EXTRA_SHELL then
vParams[KEY_SHELL_NBR_DIFF] = EgtGetInfo( vIds[i], KEY_SHELL_NBR_DIFF, 'i') or EgtGetInfo( s_nPartId, KEY_SHELL_NBR_DIFF, 'i') vParams = GetShellNumberParams( vIds[i])
if vParams[KEY_SHELL_NBR_DIFF] == 0 then bToBeDone = false end if vParams[KEY_SHELL_NBR_DIFF] == 0 then bToBeDone = false end
elseif nType == TYPE.AUX_SOLID then elseif nType == TYPE.AUX_SOLID then
vParams = GetAuxSolidsParams( vIds[i]) vParams = GetAuxSolidsParams( vIds[i])
@@ -215,7 +208,27 @@ local function SlicingExtraObjects( vtSlicing, nLay, nType, sNameGrp, sName)
table.insert( tabParams, vParams) table.insert( tabParams, vParams)
table.insert( vToBeDone, bToBeDone) table.insert( vToBeDone, bToBeDone)
end end
-- taglio i setti unbounded e limitati con il solido
local vEraseIds = {}
if nType == TYPE.RIB then
local bLimitUnbddRibs = EgtGetInfo( s_nPartId, KEY_LIMIT_UNBDD_RIBS, 'b') or false
if bLimitUnbddRibs then
for i = 1, #vIds do
if vToBeDone[i] then
if tabParams[i][KEY_RIBS_TYPE] == RIB_TYPE.UNBOUNDED then
-- creo copia e la taglio con solido
local nCopy = EgtCopyGlob( vIds[i], EgtGetParent( vIds[i]))
EgtSurfTmCut( nCopy, nStmId, true, true)
-- lo slicing viene fatto sulla copia
vIds[i] = nCopy
table.insert( vEraseIds, nCopy)
end
end
end
end
end
local nLayId = EgtGetFirstNameInGroup( s_nPartId, SLICE_LAYER .. '*') local nLayId = EgtGetFirstNameInGroup( s_nPartId, SLICE_LAYER .. '*')
while nLayId do while nLayId do
-- recupero quota per slicing -- recupero quota per slicing
@@ -280,6 +293,11 @@ local function SlicingExtraObjects( vtSlicing, nLay, nType, sNameGrp, sName)
nLayId = EgtGetNextName( nLayId, SLICE_LAYER .. '*') nLayId = EgtGetNextName( nLayId, SLICE_LAYER .. '*')
end end
-- rimuovo eventuali copie create per lo slicing
for i = 1, #vEraseIds do
EgtErase( vEraseIds[i])
end
return true return true
end end
@@ -294,79 +312,86 @@ local function ValueInArray( vArr, nValue)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function CalcSlices.Exec( nPartId, nStmId, HMax) local function SlicingNoSolid( nRibsLay, vZSlices, dDeltaZStart, dZmin, frSlicing, vErr)
local vtSlicing = frSlicing:getVersZ()
-- contatore per il calcolo delle intersezioni
if EgtProcessEvents( 100, 0) == 1 then return false end
-- creo i layer dello slicing
for i = 1, #vZSlices do
local nLayGrp = EgtGroup( s_nPartId)
EgtSetName( nLayGrp, SLICE_LAYER .. tostring( i))
local dDeltaZ = EgtIf( i == 1, dDeltaZStart, 0)
local dPosZ = vZSlices[i]- dDeltaZ
EgtSetInfo( nLayGrp, KEY_SLICE_Z, dPosZ - dZmin)
EgtSetInfo( nLayGrp, KEY_SLICE_REAL_Z, dPosZ)
EgtSetInfo( nLayGrp, KEY_SLICE_DELTAZ, dDeltaZ)
EgtSetInfo( nLayGrp, KEY_SLICE_NBR, i)
local nGrpCrv = EgtGroup( nLayGrp)
EgtSetName( nGrpCrv, CONTOUR_GRP .. EgtNumToString( 0))
end
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + 20, 0) == 1 then return false end
-- slicing dei setti
SlicingExtraObjects( vtSlicing, nRibsLay, TYPE.RIB, RIBS_GRP, RIBS_CRV)
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + 100, 0) == 1 then return false end
return true
end
---------------------------------------------------------------------
local function SlicingWithSolid( nStmId, vZSlices, dDeltaZStart, dZmin, frSlicing, vErr)
-- costanti -- costanti
local TOLER = 0.2 local TOLER = 0.05
local SMALL_TOLER = 0.02 -- da portare a 0.5 local MID_TOLER = 0.1
local BIG_TOLER = 2.0 local BIG_TOLER = 2.0
local MIN_LEN = 20.0 local MIN_LEN = 20.0
local MIN_AREA = 25.0 local MIN_AREA = 25.0
s_nPartId = nPartId local vtSlicing = frSlicing:getVersZ()
-- recupero la direzione dello slicing -- calcolo delle intersezioni
local vtSlicing = Z_AX() if EgtProcessEvents( 1, 0) == 1 then return false end
local bSlicing45 = EgtGetInfo( s_nPartId, KEY_SLICING_45, 'b') local nLayId = EgtParPlanesSurfTmInters( ORIG(), vtSlicing, vZSlices, nStmId, s_nPartId, GDB_RT.GLOB, TOLER)
if bSlicing45 then if EgtProcessEvents( 100, 0) == 1 then return false end
vtSlicing = VectorFromSpherical( 1, 45, 0)
end
EgtSetInfo( s_nPartId, KEY_SLICING_DIR, vtSlicing)
local frSlicing = Frame3d( ORIG(), vtSlicing)
-- recupero il box della superficie
local b3Box = EgtGetBBoxRef( nStmId, GDB_BB.STANDARD, frSlicing)
if not b3Box or b3Box:isEmpty() then
EgtOutText( 'La superficie selezionata è vuota')
EgtPause( 1000)
return
end
-- Parametri di slicing
local dZmin = b3Box:getMin():getZ()
local dZmax = b3Box:getMax():getZ()
local dMaxH = ComputeMaxH( nStmId, frSlicing, HMax)
dZmax = min( dZmax, dMaxH)
-- dZmin = 20
-- dZmax = 230
-- Eseguo slicing
local nLayCnt = 1
local nRecalc = 0
local dDeltaZStart = 0.2
--dDeltaZStart = 0
local vZSlices = ComputeZSlices( dZmin, dDeltaZStart, dZmax)
local nLayId = EgtParPlanesSurfTmInters( ORIG(), vtSlicing, vZSlices, nStmId, nPartId, GDB_RT.GLOB, TOLER)
local vErr = {}
local vPrevCen = {} local vPrevCen = {}
local nLayCnt = 1
-- scorro i risultati dello slicing -- scorro i risultati dello slicing
while nLayId do while nLayId do
local dDeltaZ = EgtIf( nLayCnt == 1, dDeltaZStart, 0) local dDeltaZ = EgtIf( nLayCnt == 1, dDeltaZStart, 0)
local dPosZ = vZSlices[nLayCnt]- dDeltaZ local dPosZ = vZSlices[nLayCnt]- dDeltaZ
EgtSetInfo( nLayId, KEY_SLICE_Z, dPosZ - dZmin) EgtSetInfo( nLayId, KEY_SLICE_Z, dPosZ - dZmin)
EgtSetInfo( nLayId, KEY_SLICE_REAL_Z, dPosZ) EgtSetInfo( nLayId, KEY_SLICE_REAL_Z, dPosZ)
EgtSetInfo( nLayId, KEY_SLICE_NBR, nLayCnt) EgtSetInfo( nLayId, KEY_SLICE_NBR, nLayCnt)
-- verifico se necessario ricalcolo -- verifico se necessario ricalcolo
local nId = EgtGetLastInGroup( nLayId) local nId = EgtGetLastInGroup( nLayId)
local bRecalc = not nId local bRecalc = not nId
local vtRecalc local vtRecalc
local nRecalc = 0
while nId and not bRecalc do while nId and not bRecalc do
local nType = EgtGetType( nId) local nType = EgtGetType( nId)
if nType == GDB_TY.SRF_MESH then if nType == GDB_TY.SRF_MESH then
bRecalc = true bRecalc = true
vtRecalc = EgtSurfTmFacetNormVersor( nId, 0) vtRecalc = EgtSurfTmFacetNormVersor( nId, 0)
elseif nType == GDB_TY.GEO_POINT then elseif nType == GDB_TY.GEO_POINT then
bRecalc = true bRecalc = true
end end
nId = EgtGetPrev( nId) nId = EgtGetPrev( nId)
end end
-- eseguo eventuale ricalcolo -- eseguo eventuale ricalcolo
::RECALC:: ::RECALC::
if bRecalc then if bRecalc then
nRecalc = nRecalc + 1 nRecalc = nRecalc + 1
EgtEmptyGroup( nLayId) EgtEmptyGroup( nLayId)
dDeltaZ = dDeltaZ + EgtIf( vtRecalc and vtRecalc:getZ() > 0, -0.01, 0.01) dDeltaZ = dDeltaZ + EgtIf( vtRecalc and vtRecalc:getZ() > 0, -0.01, 0.01)
-- eseguo il ricalcolo solo a quella quota -- eseguo il ricalcolo solo a quella quota
EgtPlaneSurfTmInters( ORIG() + ( dPosZ + dDeltaZ) * vtSlicing, vtSlicing, nStmId, nLayId, GDB_RT.GLOB, TOLER) EgtPlaneSurfTmInters( ORIG() + ( dPosZ + dDeltaZ) * vtSlicing, vtSlicing, nStmId, nLayId, GDB_RT.GLOB, TOLER)
@@ -386,7 +411,7 @@ function CalcSlices.Exec( nPartId, nStmId, HMax)
-- correggo eventuali spostamenti in Z -- correggo eventuali spostamenti in Z
if abs( dDeltaZ) > GEO.EPS_SMALL then if abs( dDeltaZ) > GEO.EPS_SMALL then
EgtMove( nId, - dDeltaZ * vtSlicing) EgtMove( nId, - dDeltaZ * vtSlicing)
end end
-- verifico presenza contorni aperti -- verifico presenza contorni aperti
if EgtCurveIsClosed( nId) then if EgtCurveIsClosed( nId) then
table.insert( vClosedId, nId) table.insert( vClosedId, nId)
@@ -436,30 +461,35 @@ function CalcSlices.Exec( nPartId, nStmId, HMax)
table.remove( vClosedId, i) table.remove( vClosedId, i)
end end
end end
-- se necessario e possibile, torno a ricalcolo -- se necessario e possibile, torno a ricalcolo
if not bAllClosed and nRecalc < 2 then if not bAllClosed and nRecalc < 2 then
bRecalc = true bRecalc = true
goto RECALC goto RECALC
end end
-- imposto dati ausiliari -- imposto dati ausiliari
EgtSetName( nLayId, EgtIf( bAllClosed, '', '__') .. SLICE_LAYER .. EgtNumToString( nLayCnt)) EgtSetName( nLayId, EgtIf( bAllClosed, '', '__') .. SLICE_LAYER .. EgtNumToString( nLayCnt))
EgtSetInfo( nLayId, 'CrvCnt', #vClosedId + #vOpenId) EgtSetInfo( nLayId, 'CrvCnt', #vClosedId + #vOpenId)
EgtSetColor( vClosedId or {}, 'TEAL') EgtSetColor( vClosedId or {}, 'TEAL')
EgtSetColor( vOpenId or {}, 'RED') EgtSetColor( vOpenId or {}, 'RED')
-- creo flat region a partire dalle curve chiuse ottenute con lo slicing -- creo flat region a partire dalle curve chiuse ottenute con lo slicing
local nGrp = EgtGroup( nLayId, frSlicing) local nGrp = EgtGroup( nLayId, frSlicing, GDB_RT.GLOB)
for i = 1, #vClosedId do for i = 1, #vClosedId do
EgtRelocateGlob( vClosedId[i], nGrp) EgtRelocateGlob( vClosedId[i], nGrp)
EgtApproxCurve( vClosedId[i], GDB_CA.ARCS, SMALL_TOLER) EgtApproxCurve( vClosedId[i], GDB_CA.ARCS, MID_TOLER)
EgtRelocateGlob( vClosedId[i], nLayId) EgtRelocateGlob( vClosedId[i], nLayId)
end end
EgtErase( nGrp) EgtErase( nGrp)
local nSurfFR, nSrfNbr = EgtSurfFlatRegion( nLayId, vClosedId) local nSurfFR, nSrfNbr = EgtSurfFlatRegion( nLayId, vClosedId)
if nSurfFR then if nSurfFR then
-- verifico orientamento della normale
local vtN = EgtSurfFrNormVersor( nSurfFR, GDB_ID.ROOT)
if AreOppositeVectorApprox( vtN, vtSlicing) then
EgtInvertSurf( nSurfFR)
end
-- elimino le curve originali -- elimino le curve originali
for i = 1, #vClosedId do for i = 1, #vClosedId do
EgtErase( vClosedId[i]) EgtErase( vClosedId[i])
@@ -542,59 +572,161 @@ function CalcSlices.Exec( nPartId, nStmId, HMax)
end end
end end
else else
local bErr = true local bErr = true
-- se nessuna curva -- se nessuna curva
if #vClosedId == 0 then if #vClosedId == 0 and #vOpenId == 0 then
bErr = false bErr = false
-- se una sola curva, ne verifico larghezza media -- se una sola curva, ne verifico larghezza media
elseif #vClosedId == 1 then elseif #vClosedId == 1 then
local dLen = EgtCurveLength( vClosedId[1]) local dLen = EgtCurveLength( vClosedId[1])
local _, _, dArea = EgtCurveArea( vClosedId[1]) local _, _, dArea = EgtCurveArea( vClosedId[1])
if not dArea or dArea / dLen < SMALL_TOLER then bErr = false end if not dArea or dArea / dLen < MID_TOLER then bErr = false end
end end
-- cambio nome al layer
EgtSetName( nLayId, '__' .. SLICE_LAYER .. EgtNumToString( nLayCnt))
-- se vero errore lo segnalo -- se vero errore lo segnalo
if bErr then if bErr then
table.insert( vErr, nLayCnt) table.insert( vErr, nLayCnt)
-- cambio nome al layer
EgtSetName( nLayId, '__' .. SLICE_LAYER .. EgtNumToString( nLayCnt))
else
-- altrimenti creo il CrvGrp da utilizzare nel CalcPath
local nGrpCrv = EgtGroup( nLayId)
EgtSetName( nGrpCrv, CONTOUR_GRP .. EgtNumToString( 1))
end end
end
-- passo al layer successivo
if EgtProcessEvents( nLayCnt / ( #vZSlices + 3) * 100, 0) == 1 then
EgtDraw()
return
end end
nLayCnt = nLayCnt + 1
-- passo al layer successivo
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + nLayCnt / ( #vZSlices + 3) * 100, 0) == 1 then
-- elimino i layer non ancora analizzati
local nNext = EgtGetNext( nLayId)
while nNext do
local nCurr = nNext
nNext = EgtGetNext( nCurr)
EgtErase( nCurr)
end
return false
end
nLayCnt = nLayCnt + 1
nLayId = EgtGetNext( nLayId) nLayId = EgtGetNext( nLayId)
end end
local bSpiralVase = EgtGetInfo( s_nPartId, KEY_SPIRAL_VASE, 'b') or false
if not bSpiralVase then
-- costolature
local nRibsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_RIBS)
if nRibsLay then
SlicingExtraObjects( vtSlicing, nRibsLay, TYPE.RIB, RIBS_GRP, RIBS_CRV, nStmId)
end
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + ( #vZSlices + 1) / ( #vZSlices + 3) * 100, 0) == 1 then return false end
-- solidi per regioni con diverso numero di passate
local nShellNbrLay = EgtGetFirstNameInGroup( s_nPartId, LAY_SHELL_NBR)
if nShellNbrLay then
SlicingExtraObjects( vtSlicing, nShellNbrLay, TYPE.EXTRA_SHELL, SHELL_NBR_GRP, SHELL_NBR_CRV, nStmId)
end
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + ( #vZSlices + 2) / ( #vZSlices + 3) * 100, 0) == 1 then return false end
-- solidi ausiliari
local nAuxSolidsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_AUX_SOLIDS)
if nAuxSolidsLay then
AdjustAuxSolids( nAuxSolidsLay)
SlicingExtraObjects( vtSlicing, nAuxSolidsLay, TYPE.AUX_SOLID, AUX_SOLIDS_GRP, AUX_SOLIDS_CRV, nStmId)
end
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + ( #vZSlices + 3) / ( #vZSlices + 3) * 100, 0) == 1 then return false end
end
-- costolature return true
end
---------------------------------------------------------------------
function CalcSlices.Exec( nPartId, nStmId, HMax)
s_nPartId = nPartId
-- recupero la direzione dello slicing
local vtSlicing = Z_AX()
local nSlicingType = EgtGetInfo( s_nPartId, KEY_SLICING_TYPE, 'i')
if nSlicingType == SLICING_TYPE.DEG45_X then
vtSlicing = VectorFromSpherical( 1, 45, 0)
elseif nSlicingType == SLICING_TYPE.DEG45_Y then
vtSlicing = VectorFromSpherical( 1, 45, -90)
elseif nSlicingType == SLICING_TYPE.HORIZONTAL then
vtSlicing = X_AX()
end
EgtSetInfo( s_nPartId, KEY_SLICING_DIR, vtSlicing)
local frSlicing = Frame3d( ORIG(), vtSlicing)
-- recupero la superficie ed eventuali setti esterni/unbounded da usare come riferimenti per quote slicing
local vRefIds = {}
if nStmId then table.insert( vRefIds, nStmId) end
local nRibsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_RIBS) local nRibsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_RIBS)
if nRibsLay then local vRibsIds = EgtGetAllInGroup( nRibsLay)
SlicingExtraObjects( vtSlicing, nRibsLay, TYPE.RIB, RIBS_GRP, RIBS_CRV) local bLimitUnbddRibs = EgtGetInfo( s_nPartId, KEY_LIMIT_UNBDD_RIBS, 'b') or false
for i = 1, #vRibsIds do
if EgtGetType( vRibsIds[i]) == GDB_TY.SRF_MESH then
local nType = ReadParam( vRibsIds[i], KEY_RIBS_TYPE, 'i', RIB_TYPE.INTERNAL)
if nType == RIB_TYPE.EXTERNAL or ( nType == RIB_TYPE.UNBOUNDED and not bLimitUnbddRibs) then
table.insert( vRefIds, vRibsIds[i])
end
end
end end
if EgtProcessEvents( ( #vZSlices + 1) / ( #vZSlices + 3) * 100, 0) == 1 then return end
-- solidi per regioni con diverso numero di passate if bLimitUnbddRibs and not nStmId then
local nShellNbrLay = EgtGetFirstNameInGroup( s_nPartId, LAY_SHELL_NBR) EgtOutBox( "No solid to limit unbounded ribs!", 'Error', 'ERROR')
if nShellNbrLay then return
SlicingExtraObjects( vtSlicing, nShellNbrLay, TYPE.EXTRA_SHELL, SHELL_NBR_GRP, SHELL_NBR_CRV)
end end
if EgtProcessEvents( ( #vZSlices + 2) / ( #vZSlices + 3) * 100, 0) == 1 then return end
-- solidi ausiliari -- recupero il box
local nAuxSolidsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_AUX_SOLIDS) local b3Box = BBox3d()
if nAuxSolidsLay then for i = 1, #vRefIds do
AdjustAuxSolids( nAuxSolidsLay) local b3Tmp = EgtGetBBoxRef( vRefIds[i], GDB_BB.STANDARD, frSlicing)
SlicingExtraObjects( vtSlicing, nAuxSolidsLay, TYPE.AUX_SOLID, AUX_SOLIDS_GRP, AUX_SOLIDS_CRV) b3Box:Add( b3Tmp)
end
if not b3Box or b3Box:isEmpty() then
EgtOutBox( "No part to be sliced!", 'Error', 'ERROR')
return
end
-- Parametri di slicing
local dSliceStep = EgtGetInfo( s_nPartId, KEY_SLICE_STEP, 'd') or 10000
if dSliceStep < GEO.EPS_SMALL then
EgtOutLog( 'Warning : SliceStep is 0')
return
end
local dZmin = b3Box:getMin():getZ()
local dZmax = b3Box:getMax():getZ()
local dMaxH = ComputeMaxH( vRefIds, frSlicing, HMax, dSliceStep)
dZmax = min( dZmax, dMaxH)
--dZmin = 708
--dZmax = 712
-- Eseguo slicing
local nLayCnt = 1
local nRecalc = 0
local dDeltaZStart = 0.2
local vZSlices = ComputeZSlices( dSliceStep, dZmin, dDeltaZStart, dZmax)
local vErr = {}
local bOk = true
if not nStmId then
-- caso senza solido e solo setti
bOk = SlicingNoSolid( nRibsLay, vZSlices, dDeltaZStart, dZmin, frSlicing, vErr)
else
-- caso con solido
bOk = SlicingWithSolid( nStmId, vZSlices, dDeltaZStart, dZmin, frSlicing, vErr)
end end
if EgtProcessEvents( ( #vZSlices + 3) / ( #vZSlices + 3) * 100, 0) == 1 then return end
-- eventuale segnalazione errori -- eventuale segnalazione errori
if #vErr > 0 then if bOk and #vErr > 0 then
EgtOutBox( 'Slicing Error on layers :\n' .. table.concat( vErr, ','), 'SlicingCalc') EgtOutBox( 'Slicing Error on layers :\n' .. table.concat( vErr, ','), 'SlicingCalc')
end end
return bOk
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+762 -409
View File
File diff suppressed because it is too large Load Diff
+233 -129
View File
@@ -1,4 +1,4 @@
-- RunCalcSolids.lua by Egaltech s.r.l. 2022/07/01 -- RunCalcSolids.lua by Egaltech s.r.l. 2022/11/02
-- Calcolo percorsi di lavoro per Stampa 3d -- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -12,13 +12,15 @@ EgtOutLog( ' RunCalcSolids started', 1)
-- Dati -- Dati
local AMD = require( 'AddManData') local AMD = require( 'AddManData')
--------------------------------------------------------------------
local s_dTol = 0.1
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function GetLayerParamsForSolidCalc( nPartId) local function GetLayerParamsForSolidCalc( nPartId)
local LayerParams = {} local LayerParams = {}
LayerParams.bInvert = EgtGetInfo( nPartId, KEY_PRINT_DIRECTION, 'b') LayerParams.bSpiralVase = EgtGetInfo( nPartId, KEY_SPIRAL_VASE, 'b') or false
LayerParams.dLayHeight = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd') LayerParams.dLayHeight = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
LayerParams.dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd') LayerParams.dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
LayerParams.nOrder = EgtGetInfo( nPartId, KEY_PRINT_ORDER, 'i')
LayerParams.vtSlicing = EgtGetInfo( nPartId, KEY_SLICING_DIR, 'v') LayerParams.vtSlicing = EgtGetInfo( nPartId, KEY_SLICING_DIR, 'v')
return LayerParams return LayerParams
end end
@@ -28,22 +30,6 @@ local function CalcSectionParams( dStrand, dH)
local dL = dStrand local dL = dStrand
local dLm = dStrand / 10 local dLm = dStrand / 10
local dHm = dH / 6 local dHm = dH / 6
-- recupero offset
--local dOffs = EgtGetInfo( s_nPartId, KEY_OFFSET_SLICE, 'd')
dOffs = 0
if dOffs and dOffs > 0 then
-- calcolo area originale
local dArea = ( dL * dH) - ( dLm * dHm)
local dLM = ( dArea / dH) - ( dLm / 6)
if dOffs / 2 <= ( dL - dLM) then
dL = dL - dOffs / 2
dLm = dL / 10
dHm = (( dL * dH) - dArea) / dLm
else
EgtOutLog( 'Strand section not calculated on area. Too much overlap?')
end
end
local dD1 = 0.5 * dL - dLm local dD1 = 0.5 * dL - dLm
local dD2 = 0.5 * dL - dD1 local dD2 = 0.5 * dL - dD1
local dD3 = dHm local dD3 = dHm
@@ -63,8 +49,8 @@ local function CreateSection( ptS, vtDir, dStrand, dH, vtSlicing, nSolidGrp)
local ptF = ptC - 2 * ( dD1 + dD2) * vtDir local ptF = ptC - 2 * ( dD1 + dD2) * vtDir
local ptG = ptB - 2 * ( dD1 + dD2) * vtDir local ptG = ptB - 2 * ( dD1 + dD2) * vtDir
local ptH = ptA - 2 * dD1 * vtDir local ptH = ptA - 2 * dD1 * vtDir
local nId = EgtCurveCompoFromPoints( nSolidGrp, {ptA, ptB, ptC, ptD, ptE, ptF, ptG, ptH, ptA}) local nId = EgtCurveCompoFromPoints( nSolidGrp, {ptA, ptB, ptC, ptD, ptE, ptF, ptG, ptH, ptA}, GDB_RT.GLOB)
EgtInvertCurve( nId) EgtInvertCurve( nId)
return nId return nId
@@ -79,41 +65,129 @@ local function CreateHalfSection( ptS, vtDir, dStrand, dH, vtSlicing, nSolidGrp)
local ptC = ptB + dD4 * vtSlicing local ptC = ptB + dD4 * vtSlicing
local ptD = ptA + dH * vtSlicing local ptD = ptA + dH * vtSlicing
local nId = EgtCurveCompoFromPoints( nSolidGrp, { ptS - dH * vtSlicing, ptA, ptB, ptC, ptD, ptS}) local nId = EgtCurveCompoFromPoints( nSolidGrp, { ptS - dH * vtSlicing, ptA, ptB, ptC, ptD, ptS}, GDB_RT.GLOB)
return nId return nId
end end
-------------------------------------------------------------------- ------------------------------------------------------------------------------
local function CreateSolid( nCrvId, nSolidGrp, dStrand, dH, vtSlicing) local function CreateSpiralVaseCap( nSectId, vtDir, nSolidGrp)
-- punti e direzioni all'inizio e fine della curva guida
local ptS = EgtSP( nCrvId) local vPt = {}
local vtS = EgtSV( nCrvId) for i = 0, 7 do
vtS:rotate( vtSlicing, 90) vPt[i + 1] = EgtUP( nSectId, i, GDB_ID.ROOT)
local ptE = EgtEP( nCrvId) end
local vtE = EgtEV( nCrvId)
vtE:rotate( vtSlicing, -90) local vCrvs = {}
-- creazione del solido aperto (tubo) vCrvs[1] = EgtArc2PV( nSolidGrp, vPt[1], vPt[2], vtDir, GDB_RT.GLOB)
local nSectId = CreateSection( ptS, vtS, dStrand, dH, vtSlicing, nSolidGrp) vCrvs[2] = EgtArc2PV( nSolidGrp, vPt[8], vPt[3], vtDir, GDB_RT.GLOB)
local nSrfId = EgtSurfTmSwept( nSolidGrp, nSectId, nCrvId, false, 0.1) vCrvs[3] = EgtArc2PV( nSolidGrp, vPt[7], vPt[4], vtDir, GDB_RT.GLOB)
EgtErase( nSectId) vCrvs[4] = EgtArc2PV( nSolidGrp, vPt[6], vPt[5], vtDir, GDB_RT.GLOB)
if not nSrfId then return nil end vCrvs[5] = EgtCurveCompo( nSolidGrp, {vCrvs[1]}, false, GDB_RT.GLOB)
EgtCloseCurveCompo( vCrvs[5])
vCrvs[6] = EgtCurveCompo( nSolidGrp, {vCrvs[4]}, false, GDB_RT.GLOB)
EgtCloseCurveCompo( vCrvs[6])
local nSurf1 = EgtSurfTmRuled( nSolidGrp, vCrvs[1], vCrvs[2], GDB_RUL.ISOPAR, s_dTol)
local nSurf2 = EgtSurfTmRuled( nSolidGrp, vCrvs[2], vCrvs[3], GDB_RUL.ISOPAR, s_dTol)
local nSurf3 = EgtSurfTmRuled( nSolidGrp, vCrvs[3], vCrvs[4], GDB_RUL.ISOPAR, s_dTol)
local nSurf4 = EgtSurfTmByRegion( nSolidGrp, vCrvs[5], s_dTol)
local nSurf5 = EgtSurfTmByRegion( nSolidGrp, vCrvs[6], s_dTol)
local nCapSrf = EgtSurfTmBySewing( nSolidGrp, {nSurf1, nSurf2, nSurf3, nSurf4, nSurf5})
for i = 1, #vCrvs do
EgtErase( vCrvs[i])
end
return nCapSrf
end
-------------------------------------------------------------------------------
local function CreateSpiralVaseSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
-- gruppo temporaneo per conti
local nGrpTmp = EgtGroup( nSolidGrp)
local ptS = EgtSP( nCrvId, GDB_ID.ROOT)
local vtS = EgtSV( nCrvId, GDB_ID.ROOT)
local ptE = EgtEP( nCrvId, GDB_ID.ROOT)
local vtE = EgtEV( nCrvId, GDB_ID.ROOT)
-- appiattisco la curva
local nCrvCopy = EgtCopyGlob( nCrvId, nGrpTmp)
local dDelta = ( ptE - ptS) * LayerParams.vtSlicing
EgtSpiralizeCurveAlongExtrusion( nCrvCopy, - dDelta)
EgtMergeCurvesInCurveCompo( nCrvCopy)
EgtChangeClosedCurveStartPoint( nCrvCopy, ptS, GDB_RT.GLOB)
-- calcolo la sezione iniziale
local vtDir = EgtSV( nCrvCopy, GDB_ID.ROOT)
vtDir:rotate( LayerParams.vtSlicing, 90)
local nSectId = CreateSection( ptS, vtDir, dStrand, LayerParams.dLayHeight, LayerParams.vtSlicing, nGrpTmp)
-- creo la sezione finale
local vtDir2 = EgtEV( nCrvCopy, GDB_ID.ROOT)
vtDir2:rotate( LayerParams.vtSlicing, 90)
local nSectE = CreateSection( ptE, vtDir2, dStrand, LayerParams.dLayHeight, LayerParams.vtSlicing, nGrpTmp)
-- creo il solido aperto (tubo)
local vCrvs = {}
local _, dParE = EgtCurveDomain( nSectId)
for i = 0, dParE do
local ptRef = EgtUP( nSectId, i, GDB_ID.ROOT)
local dOffs = ( ptS - ptRef) * vtDir
vCrvs[i+1] = EgtOffsetCurveAdv( nCrvCopy, dOffs)
if not vCrvs[i+1] or vCrvs[i+1] == GDB_ID.NULL then
EgtErase( nGrpTmp)
return nil
end
local dMove = ( ptRef - ptS) * LayerParams.vtSlicing
EgtMove( vCrvs[i+1], LayerParams.vtSlicing * dMove, GDB_RT.GLOB)
EgtSpiralizeCurveAlongExtrusion( vCrvs[i+1], dDelta)
-- modifico la curva per congiungerla ai caps
EgtAddCurveCompoLine( vCrvs[i+1], ptRef, false, GDB_RT.GLOB)
local ptRefEnd = EgtUP( nSectE, i, GDB_ID.ROOT)
EgtAddCurveCompoLine( vCrvs[i+1], ptRefEnd, true, GDB_RT.GLOB)
end
local vSurfs = {}
for i = 1, #vCrvs - 1 do
vSurfs[i] = EgtSurfTmRuled( nGrpTmp, vCrvs[i], vCrvs[i+1], GDB_RUL.MINDIST, s_dTol)
if not vSurfs[i] or vSurfs[i] == GDB_ID.NULL then
EgtErase( nGrpTmp)
return nil
end
end
local nSrfId = EgtSurfTmBySewing( nSolidGrp, vSurfs)
-- creazione del mezzo disco iniziale -- creazione del mezzo disco iniziale
local nSectS = CreateHalfSection( ptS, vtS, dStrand, dH, vtSlicing, nSolidGrp) local nCap1 = CreateSpiralVaseCap( nSectId, - vtS, nSolidGrp)
local nSrfS = EgtSurfTmByScrewing( nSolidGrp, nSectS, ptS, vtSlicing, 180, 0, false, 0.1)
EgtErase( nSectS)
if not nSrfS then return nil end
-- creazione del mezzo disco finale -- creazione del mezzo disco finale
local nSectE = CreateHalfSection( ptE, vtE, dStrand, dH, vtSlicing, nSolidGrp) local nCap2 = CreateSpiralVaseCap( nSectE, vtE, nSolidGrp)
local nSrfE = EgtSurfTmByScrewing( nSolidGrp, nSectE, ptE, vtSlicing, 180, 0, false, 0.1) EgtInvertSurf( nCap2)
EgtErase( nSectE)
if not nSrfE then return nil end -- cancello le curve usate per la costruzione
-- unione delle tre superfici EgtErase( nGrpTmp)
return EgtSurfTmBySewing( nSolidGrp, { nSrfId, nSrfS, nSrfE})
return EgtSurfTmBySewing( nSolidGrp, { nSrfId, nCap1, nCap2})
end
----------------------------------------------------------------------
local function CreateStandardSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
local dD1, dD2, dD3, dD4 = CalcSectionParams( dStrand, LayerParams.dLayHeight)
local nSrfId = EgtSurfTmRectSwept( nSolidGrp, dStrand, LayerParams.dLayHeight, dD2, dD3, nCrvId, GDB_RSCT.BEVEL, s_dTol)
return nSrfId
end
--------------------------------------------------------------------------------------
local function CreateSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
if LayerParams.bSpiralVase then
return CreateSpiralVaseSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
else
return CreateStandardSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams) local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i') local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i')
if nType == TYPE.WIPE then return true end if nType == TYPE.WIPE then return true end
@@ -134,17 +208,17 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
elseif nType == TYPE.RIB then elseif nType == TYPE.RIB then
Color = EgtStdColor( 'OLIVE') Color = EgtStdColor( 'OLIVE')
elseif nType == TYPE.AUX_SOLID then elseif nType == TYPE.AUX_SOLID then
Color = EgtStdColor( 'AQUA') Color = EgtStdColor( 'AQUA')
end end
local nCopyId = EgtCopyGlob( nCrvId, nSolidGrp) local nCopyId = EgtCopyGlob( nCrvId, nSolidGrp)
local nId = GDB_ID.NULL local nId = GDB_ID.NULL
local nParts = 1 local nParts = 1
local LEN_REF = 100 local LEN_REF = 100
local bZigZagInfill = EgtGetInfo( nCopyId, KEY_ZIG_ZAG_INFILL, 'b') or false local bZigZagInfill = EgtGetInfo( nCopyId, KEY_ZIG_ZAG_INFILL, 'b') or false
if bZigZagInfill then if bZigZagInfill then
nId, nParts = EgtSplitCurveAtCorners( nCopyId, 80) nId, nParts = EgtSplitCurveAtCorners( nCopyId, 80)
else else
local dLen = EgtCurveLength( nCrvId) local dLen = EgtCurveLength( nCrvId)
if dLen > LEN_REF and nType ~= TYPE.LINK and nType ~= TYPE.COASTING then if dLen > LEN_REF and nType ~= TYPE.LINK and nType ~= TYPE.COASTING then
nParts = EgtClamp( floor( dLen / LEN_REF), 1, 10) nParts = EgtClamp( floor( dLen / LEN_REF), 1, 10)
@@ -155,44 +229,60 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
if nId == GDB_ID.NULL then return false end if nId == GDB_ID.NULL then return false end
local bOk = true local bOk = true
for nInd = 0, nParts - 1 do for nInd = 0, nParts - 1 do
local nGuideId = nId + nInd local nGuideId = nId + nInd
local nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams.dStrand - 2 * GEO.EPS_SMALL, LayerParams.dLayHeight, LayerParams.vtSlicing) local nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 5 * GEO.EPS_SMALL)
if not nSrfId then
if not nSrfId then EgtOutLog( 'Warning : CreateSolid failed '.. '(layer '..tostring( nLayer)..', curve '..tostring( nCrvId)..')')
-- ritento con sezione leggermente modificata -- se non ultima, provo a spostare l'estremità finale
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams.dStrand - 100 * GEO.EPS_SMALL, LayerParams.dLayHeight, LayerParams.vtSlicing) if nInd < nParts - 1 then
if not nSrfId then local nCopyId = EgtCopy( nGuideId + 1, nGuideId, GDB_IN.AFTER)
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams.dStrand + 100 * GEO.EPS_SMALL, LayerParams.dLayHeight, LayerParams.vtSlicing) if nCopyId then
if not nSrfId then local LEN_TRIM = 10
-- ritento spezzando la curva local bOk1 = EgtTrimCurveEndAtLen( nCopyId, LEN_TRIM)
local nGrp = EgtGroup( nSolidGrp, Frame3d( ORIG(), LayerParams.vtSlicing)) local bOk2 = EgtAddCurveCompoCurve( nGuideId, nCopyId)
EgtRelocateGlob( nGuideId, nGrp) local bOk3 = EgtTrimCurveStartAtLen( nGuideId + 1, LEN_TRIM)
EgtApproxCurve( nGuideId, GDB_CA.LINES, 100 * GEO.EPS_SMALL) nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 5 * GEO.EPS_SMALL)
EgtRelocateGlob( nGuideId, nSolidGrp) if not nSrfId then
local nFirstCrv, nCrvNbr = EgtSplitCurveAtCorners( nGuideId, 30) nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 50 * GEO.EPS_SMALL)
if nFirstCrv and nCrvNbr > 1 then
local nSrfIds = {}
for nInd2 = 0, nCrvNbr-1 do
local nSrfId2 = CreateSolid( nFirstCrv + nInd2, nSolidGrp, LayerParams.dStrand - 100 * GEO.EPS_SMALL, LayerParams.dLayHeight, LayerParams.vtSlicing)
EgtErase( nFirstCrv + nInd2)
if nSrfId2 then
table.insert( nSrfIds, nSrfId2)
end
end
if #nSrfIds == nCrvNbr then
nSrfId = EgtSurfTmBySewing( nSolidGrp, nSrfIds)
end
end end
end end
end end
-- ritento spezzando la curva
if not nSrfId then
EgtOutLog( 'Warning : CreateSolid_2 failed')
local nGrp = EgtGroup( nSolidGrp, Frame3d( ORIG(), LayerParams.vtSlicing), GDB_RT.GLOB)
EgtRelocateGlob( nGuideId, nGrp)
EgtApproxCurve( nGuideId, GDB_CA.LINES, 100 * GEO.EPS_SMALL)
EgtRelocateGlob( nGuideId, nSolidGrp)
local nFirstCrv, nCrvNbr = EgtSplitCurveAtCorners( nGuideId, 30)
if nFirstCrv and nCrvNbr > 1 then
local nSrfIds = {}
for nInd2 = 0, nCrvNbr-1 do
local nSrfId2 = CreateSolid( nFirstCrv + nInd2, nSolidGrp, LayerParams, LayerParams.dStrand - 50 * GEO.EPS_SMALL)
EgtErase( nFirstCrv + nInd2)
if nSrfId2 then
table.insert( nSrfIds, nSrfId2)
end
end
if #nSrfIds == nCrvNbr then
nSrfId = EgtSurfTmBySewing( nSolidGrp, nSrfIds)
else
EgtOutLog( 'Warning : CreateSolid_3 failed')
end
else
EgtErase( nFirstCrv)
end
EgtErase( nGrp)
end
end end
if nSrfId then if nSrfId then
EgtSetColor( nSrfId, Color) EgtSetColor( nSrfId, Color)
EgtSetInfo( nSrfId, KEY_TYPE, nType) EgtSetInfo( nSrfId, KEY_TYPE, nType)
else else
bOk = false bOk = false
end EgtOutLog( 'Warning : CreateSolid_Sewing failed')
end
EgtErase( nGuideId) EgtErase( nGuideId)
end end
@@ -201,90 +291,99 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function RunCalcSolids.Exec() function RunCalcSolids.Exec()
-- per determinare il tempo di calcolo
EgtStartCounter()
local nPartIndex = 1 local nPartIndex = 1
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) or EgtGetFirstNameInGroup( GDB_ID.ROOT, PART) local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) or EgtGetFirstNameInGroup( GDB_ID.ROOT, PART)
while nPartId do while nPartId do
if EgtGetInfo( nPartId, KEY_PART_ON_TABLE, 'b') then if EgtGetInfo( nPartId, KEY_PART_ON_TABLE, 'b') then
-- verifico se necessario calcolare il solido -- verifico se necessario calcolare il solido
local bCalcSolid = EgtGetInfo( nPartId, KEY_CALC_SOLIDS, 'b') or false local bCalcSolid = EgtGetInfo( nPartId, KEY_CALC_SOLIDS, 'b') or false
local bHasSolids = EgtGetInfo( nPartId, KEY_HAS_SOLIDS, 'b') or false
if bCalcSolid then
if bCalcSolid and not bHasSolids then
-- recupero i suoi slice -- recupero i suoi slice
local vLayIds = EgtGetNameInGroup( nPartId, SLICE_LAYER .. '*') local vLayIds = EgtGetNameInGroup( nPartId, SLICE_LAYER .. '*')
if not vLayIds then if not vLayIds then
EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR') EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR')
return return
end end
EgtSetInfo( nPartId, KEY_HAS_SOLIDS, 1) EgtSetInfo( nPartId, KEY_HAS_SOLIDS, 1)
local vErr = {}
-- recupero i parametri necessari al calcolo dei solidi -- recupero i parametri necessari al calcolo dei solidi
local LayerParams = GetLayerParamsForSolidCalc( nPartId) local LayerParams = GetLayerParamsForSolidCalc( nPartId)
for nIdx = 1, #vLayIds do for nIdx = 1, #vLayIds do
-- flag di interruzione perchè trovati solidi già ok
local bSolidsOk = false
-- indice layer (per log)
local nLayer = EgtGetInfo( vLayIds[ nIdx], KEY_SLICE_NBR, 'i')
-- scorro tutti i gruppi di contorni -- scorro tutti i gruppi di contorni
local nCrvGrpId = EgtGetFirstNameInGroup( vLayIds[ nIdx], CONTOUR_GRP.."*") or GDB_ID.NULL local nCrvGrpId = EgtGetFirstNameInGroup( vLayIds[ nIdx], CONTOUR_GRP.."*") or GDB_ID.NULL
while nCrvGrpId ~= GDB_ID.NULL do while nCrvGrpId ~= GDB_ID.NULL do
-- recupero il gruppo dei percorsi utensile -- recupero il gruppo dei percorsi utensile
local nTPathGrpId = EgtGetFirstNameInGroup( nCrvGrpId, TOOLPATH_GRP) or GDB_ID.NULL local nTPathGrpId = EgtGetFirstNameInGroup( nCrvGrpId, TOOLPATH_GRP) or GDB_ID.NULL
if nTPathGrpId == GDB_ID.NULL then if nTPathGrpId == GDB_ID.NULL then
EgtOutBox( 'Error no tool paths', 'SolidCalc') EgtOutBox( 'Error no tool paths', 'SolidCalc')
return return
end end
-- recupero il gruppo dei solidi -- recupero il gruppo dei solidi
local nSolidGrpId = EgtGetFirstNameInGroup( nCrvGrpId, SOLID_GRP) or GDB_ID.NULL local nSolidGrpId = EgtGetFirstNameInGroup( nCrvGrpId, SOLID_GRP) or GDB_ID.NULL
if nSolidGrpId == GDB_ID.NULL then if nSolidGrpId == GDB_ID.NULL then
nSolidGrpId = EgtGroup( nCrvGrpId) nSolidGrpId = EgtGroup( nCrvGrpId)
EgtSetName( nSolidGrpId, SOLID_GRP) EgtSetName( nSolidGrpId, SOLID_GRP)
EgtSetLevel( nSolidGrpId, GDB_LV.TEMP) EgtSetLevel( nSolidGrpId, GDB_LV.TEMP)
-- scorro le curve del percorso utensile
local nId = EgtGetFirstInGroup( nTPathGrpId)
while nId do
local bOk = CreateSolidFromCurve( nId, nSolidGrpId, LayerParams, nLayer)
nId = EgtGetNext( nId)
end
else else
EgtEmptyGroup( nSolidGrpId) bSolidsOk = true
break
end end
-- scorro le curve del percorso utensile
local nId = EgtGetFirstInGroup( nTPathGrpId)
while nId do
local bOk = CreateSolidFromCurve( nId, nSolidGrpId, LayerParams)
if not bOk then
table.insert( vErr, nIdx)
end
nId = EgtGetNext( nId)
end
-- processo gli eventi
if ( nIdx % 20) == 0 then
EgtDraw()
if EgtProcessEvents( nIdx / #vLayIds * 100, 0) == 1 then
return
end
end
--passo al gruppo di contorni successivo --passo al gruppo di contorni successivo
nCrvGrpId = EgtGetNextName( nCrvGrpId, CONTOUR_GRP.."*") or GDB_ID.NULL nCrvGrpId = EgtGetNextName( nCrvGrpId, CONTOUR_GRP.."*") or GDB_ID.NULL
end end
EgtDraw() if bSolidsOk then
if EgtProcessEvents( EgtIf( PRINT, 300, 0) + nIdx / #vLayIds * 100, 0) == 1 then break
return end
local nStep = 10
if nIdx > 400 then
nStep = 80
elseif nIdx > 200 then
nStep = 40
elseif nIdx > 100 then
nStep = 20
end
if ( nIdx % nStep) == 0 then
EgtDraw()
end
if EgtProcessEvents( EgtIf( PRINT, 400, 0) + nIdx / #vLayIds * 100, 0) == 1 then
-- se interrompo cancello i solidi realizzati
for i = 1, #vLayIds do
local vGrpId = EgtGetNameInGroup( vLayIds[i], CONTOUR_GRP .. '*') or {}
for j = 1, #vGrpId do
local nSolidId = EgtGetNameInGroup( vGrpId[j], SOLID_GRP .. '*') or GDB_ID.NULL
EgtErase( nSolidId)
end
end
-- rimuovo info della presenza solidi
EgtSetInfo( nPartId, KEY_HAS_SOLIDS, false)
EgtDraw()
return
end end
end end
-- eventuale segnalazione errori
-- if #vErr > 0 then
-- EgtOutBox( 'Error on layers :\n' .. table.concat( vErr, ','), 'SolidCalc')
-- end
for i = 1, #vErr do
EgtOutLog( 'Error on solid creation (layer ' .. vErr[i] .. ') - SolidCalc')
end
-- eventuale aggiornamento delle ViewInfo -- eventuale aggiornamento delle ViewInfo
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS) local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS)
if nViewId then if nViewId then
@@ -293,11 +392,16 @@ function RunCalcSolids.Exec()
end end
end end
nPartIndex = nPartIndex + 1 nPartIndex = nPartIndex + 1
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) or EgtGetNextName( nPartId, PART) nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) or EgtGetNextName( nPartId, PART)
end end
EgtDraw()
-- report tempo di calcolo in log
EgtOutLog( string.format( ' CalcSolidsTime = %.2f ms', EgtStopCounter()))
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+30 -15
View File
@@ -1,4 +1,4 @@
-- RunGcodeGenerate.lua by Egaltech s.r.l. 2022/06/14 -- RunGcodeGenerate.lua by Egaltech s.r.l. 2023/02/02
-- Calcoli prima fase per Stampa 3d -- Calcoli prima fase per Stampa 3d
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -24,7 +24,7 @@ end
function RunGcodeGenerate.Exec() function RunGcodeGenerate.Exec()
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 501, 0) EgtProcessEvents( 601, 0)
-- Recupero il pezzo (per ora primo e unico) -- Recupero il pezzo (per ora primo e unico)
local nPartIndex = 1 local nPartIndex = 1
@@ -45,7 +45,7 @@ function RunGcodeGenerate.Exec()
local LayerParams = GetLayerParamsForGcodeGenerate( nPartId) local LayerParams = GetLayerParamsForGcodeGenerate( nPartId)
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 505, 0) EgtProcessEvents( 605, 0)
-- Ciclo sui layer -- Ciclo sui layer
local vEntId = {} local vEntId = {}
@@ -75,7 +75,7 @@ function RunGcodeGenerate.Exec()
end end
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 510, 0) EgtProcessEvents( 610, 0)
-- Imposto gruppo di lavoro -- Imposto gruppo di lavoro
EgtSetCurrMachGroup() EgtSetCurrMachGroup()
@@ -97,7 +97,7 @@ function RunGcodeGenerate.Exec()
end end
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 520, 0) EgtProcessEvents( 620, 0)
EgtSetMachiningGeometry( vEntId) EgtSetMachiningGeometry( vEntId)
@@ -106,17 +106,28 @@ function RunGcodeGenerate.Exec()
if not EgtApplyMachining() then if not EgtApplyMachining() then
local nErr, sErr = EgtGetLastMachMgrError() local nErr, sErr = EgtGetLastMachMgrError()
local sMsg = 'Error applying Extrusion' local sMsg = ''
if nErr == 2803 and string.find( sErr, '(3)', 1, true) then if nErr == 2803 and string.find( sErr, '(3)', 1, true) then
sMsg = sMsg .. ' (missing Feed & Speed)' sMsg = ' Missing Feed & Speed.'
elseif nErr == 2804 then
sMsg = ' Axes Values not calculable.'
elseif nErr == 2805 then
sMsg = ' Outstroke Axes (see Log File).'
else
sMsg = ' See Log File.'
end end
EgtResetCurrMachGroup() EgtResetCurrMachGroup()
EgtOutBox( sMsg, 'GcodeGenerate') if PRINT and PRINT.PROGRAM == 1 then
PRINT.ERR = 1
PRINT.MSG = sMsg
else
EgtOutBox( 'Error in Machining :'..sMsg, 'GcodeGenerate')
end
return return
end end
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 550, 0) EgtProcessEvents( 650, 0)
-- Salvo il progetto -- Salvo il progetto
local sFilePath = EgtGetCurrFilePath() local sFilePath = EgtGetCurrFilePath()
@@ -125,17 +136,21 @@ function RunGcodeGenerate.Exec()
EgtSaveFile() EgtSaveFile()
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 580, 0) EgtProcessEvents( 680, 0)
-- Genero il programma CN -- Genero il programma CN
local sInfo = 'EgtCAM5 ver.' .. EgtGetExeVersion() .. ' - ' .. sPath local sInfo = 'Icarus ver.' .. EgtGetExeVersion() .. ' - ' .. sPath
local bGenOk = EgtGenerate( '', sInfo) local sISOFilePath = ''
if PRINT and PRINT.PROGRAM == 1 and PRINT.ISOFILEPATH then
sISOFilePath = PRINT.ISOFILEPATH
end
local bGenOk = EgtGenerate( sISOFilePath, sInfo)
if bGenOk then if bGenOk then
EgtEstimate('') EgtEstimate('')
end end
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 590, 0) EgtProcessEvents( 690, 0)
EgtResetCurrMachGroup() EgtResetCurrMachGroup()
@@ -143,7 +158,7 @@ function RunGcodeGenerate.Exec()
if bGenOk then if bGenOk then
PRINT.ERR = 0 PRINT.ERR = 0
else else
PRINT.ERR = 999 PRINT.ERR = 2
end end
else else
if bGenOk then if bGenOk then
@@ -154,7 +169,7 @@ function RunGcodeGenerate.Exec()
end end
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 600, 0) EgtProcessEvents( 700, 0)
end end
+70 -20
View File
@@ -1,4 +1,4 @@
-- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2022/09/15 -- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2022/12/28
-- Calcolo dei parametri di stampa -- Calcolo dei parametri di stampa
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -12,9 +12,12 @@ EgtOutLog( ' RunMachParamFromSWCalc started', 1)
-- Costanti generali -- Costanti generali
local AMD = require( 'AddManData') local AMD = require( 'AddManData')
--local MACHINING = {}
--MACHINING.K = 103
--local MATERIAL = {} --local MATERIAL = {}
--MATERIAL.Name = 'AKROMID® B3 ICF 40' --MATERIAL.Name = 'AKROMID® B3 ICF 40'
--MATERIAL.K = 0.1 --MATERIAL.K_EXTRUSION = 110
--MATERIAL.K_LAYERTIME = 105
--MATERIAL.C1 = 0.8742 --MATERIAL.C1 = 0.8742
--MATERIAL.C2 = 0.8964 --MATERIAL.C2 = 0.8964
--MATERIAL.Density = 1.31 --MATERIAL.Density = 1.31
@@ -31,6 +34,14 @@ local AMD = require( 'AddManData')
--------------------------------------------------------------------- ---------------------------------------------------------------------
function RunMachParamFromSWCalc.Exec() function RunMachParamFromSWCalc.Exec()
-- valori default per nuovi parametri
MATERIAL.K_LAYERTIME = MATERIAL.K_LAYERTIME or 100
MATERIAL.K_EXTRUSION = MATERIAL.K_EXTRUSION or 100
if not MACHINING then
MACHINING = {}
MACHINING.K = 100
end
-- layer dei risultati -- layer dei risultati
local nResultLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, LAY_TFSCALC) local nResultLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, LAY_TFSCALC)
if not nResultLayerId then if not nResultLayerId then
@@ -58,43 +69,53 @@ function RunMachParamFromSWCalc.Exec()
local dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd') local dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
local dStrandCount = EgtGetInfo( nPartId, KEY_SHELLS_NBR, 'd') local dStrandCount = EgtGetInfo( nPartId, KEY_SHELLS_NBR, 'd')
-- recupero numero di strati per progress -- recupero numero di strati per progress
local nLastLayerId = EgtGetLastNameInGroup( nPartId, SLICE_LAYER .. '*') local nLastLayerId = EgtGetLastNameInGroup( nPartId, SLICE_LAYER .. '*') or GDB_ID.NULL
local nLayerQty = EgtGetInfo( nLastLayerId, KEY_SLICE_NBR, 'i') local nLayerQty = EgtGetInfo( nLastLayerId, KEY_SLICE_NBR, 'i') or 0
-- ciclo sui layer -- ciclo sui layer
local nLayerIndex = 1 local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
while nLayerId do while nLayerId do
-- rimuovo eventuale info precedente del tempo di attesa -- rimuovo eventuale info precedente del tempo di attesa
EgtRemoveInfo( nLayerId, KEY_WAITING_TIME) EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- calcolo lunghezza totale del layer -- calcolo lunghezza totale del layer
local dTotLayerLength = 0 local dTotLayerLength = 0
local dTotLayerLengthForMass = 0
local dTotLayerArea = 0 local dTotLayerArea = 0
local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*') local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP) local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- sommo lunghezze percorsi -- sommo lunghezze percorsi
local dTotCrvLength = 0 local dTotCrvLength = 0
local dTotCrvLengthForMass = 0
nShellId = EgtGetFirstInGroup( nToolPathId) nShellId = EgtGetFirstInGroup( nToolPathId)
while nShellId do while nShellId do
dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId) dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
if EgtGetName( nShellId) ~= WIPE_CRV then
dTotCrvLengthForMass = dTotCrvLengthForMass + EgtCurveLength( nShellId)
end
nShellId = EgtGetNext( nShellId) nShellId = EgtGetNext( nShellId)
end end
dTotLayerLength = dTotLayerLength + dTotCrvLength dTotLayerLength = dTotLayerLength + dTotCrvLength
dTotLayerLengthForMass = dTotLayerLengthForMass + dTotCrvLengthForMass
-- recupero area -- recupero area
local nOuterCrvId = EgtGetFirstNameInGroup( nCrvId, OUTER_CRV) local nOuterCrvId = EgtGetFirstNameInGroup( nCrvId, OUTER_CRV)
local _, _, dTotCrvArea = EgtCurveArea( nOuterCrvId) if nOuterCrvId and dStrandCount > 0.5 then
local dOuterLength = EgtCurveLength( nOuterCrvId) local _, _, dTotCrvArea = EgtCurveArea( nOuterCrvId)
-- recupero offset del part per aggiungerlo all'area interna local dOuterLength = EgtCurveLength( nOuterCrvId)
local dOffset = EgtGetInfo( nPartId, KEY_OFFSET_SLICE, 'd') -- recupero offset del part per aggiungerlo all'area interna
dTotCrvArea = dTotCrvArea + ( dOffset * dOuterLength) local dOffset = EgtGetInfo( nPartId, KEY_OFFSET_SLICE, 'd')
dTotLayerArea = dTotLayerArea + dTotCrvArea dTotCrvArea = dTotCrvArea + ( dOffset * dOuterLength)
dTotLayerArea = dTotLayerArea + dTotCrvArea
end
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*') nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end end
-- recupero feed del layer -- recupero feed del layer
local dLayerFeed = 0 local dLayerFeed = 0
local dLayerWait = 0
local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex) local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex)
if nLayerResultId then if nLayerResultId then
dLayerFeed = EgtGetInfo( nLayerResultId, KEY_FCUR, 'd') or 0 dLayerFeed = EgtGetInfo( nLayerResultId, KEY_FCUR, 'd') or 0
dLayerWait = EgtGetInfo( nLayerResultId, KEY_WAITING_TIME, 'd') or 0
else else
nLayerResultId = EgtGroup( nResultLayerId) nLayerResultId = EgtGroup( nResultLayerId)
EgtSetName( nLayerResultId, nLayerIndex) EgtSetName( nLayerResultId, nLayerIndex)
@@ -112,11 +133,27 @@ function RunMachParamFromSWCalc.Exec()
end end
EgtSetInfo( nLayerResultId, KEY_SLICEID, nOrigLayers) EgtSetInfo( nLayerResultId, KEY_SLICEID, nOrigLayers)
-- calcolo costante MF -- calcolo costante MF
local dMF = dTotLayerLength * dStrand / dTotLayerArea * 100 local dMF = 1
local dSC = 1
if dTotLayerArea > 1 then
dMF = dTotLayerLength * dStrand / dTotLayerArea * 100
dSC = dStrandCount
else
dMF = 100
local nRibsLayId = EgtGetFirstNameInGroup( nLayerId, RIBS_GRP) or GDB_ID.NULL
local nCrvId = EgtGetFirstInGroup( nRibsLayId)
while nCrvId do
if EgtGetInfo( nCrvId, KEY_RIBS_TYPE, 'i') == RIB_TYPE.UNBOUNDED then
dSC = ( EgtGetInfo( nCrvId, KEY_RIBS_SHELLS_NBR, 'd') or dSC) / 2
break
end
nCrvId = EgtGetNext( nCrvId)
end
end
-- calcolo tempi stimati del layer -- calcolo tempi stimati del layer
local dTMin = ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dStrandCount, MATERIAL.KN) 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 = ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dStrandCount, 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 = ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dStrandCount, 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 dFMin = dTotLayerLength / dTMax * 60
local dFTrg = dTotLayerLength / dTTrg * 60 local dFTrg = dTotLayerLength / dTTrg * 60
local dFMax = dTotLayerLength / dTMin * 60 local dFMax = dTotLayerLength / dTMin * 60
@@ -126,10 +163,11 @@ function RunMachParamFromSWCalc.Exec()
else else
dLayerTime = dTotLayerLength / dLayerFeed * 60 dLayerTime = dTotLayerLength / dLayerFeed * 60
end end
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
-- calcolo la portata -- calcolo la portata
local Vf = dLayerFeed * ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000 local Vf = dLayerFeed * ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000
-- calcolo speed -- calcolo speed
local dSpeed = ( 1 + MATERIAL.K) * pow( Vf / MATERIAL.C1, 1 / MATERIAL.C2) 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 -- verifico se speed esce da minimo e massimo della macchina
local bSpeedOk = true local bSpeedOk = true
if dSpeed < dSMin then if dSpeed < dSMin then
@@ -141,11 +179,12 @@ function RunMachParamFromSWCalc.Exec()
dSpeed = dSMax dSpeed = dSMax
end end
if not bSpeedOk then if not bSpeedOk then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / ( 1 + MATERIAL.K)), MATERIAL.C2)) * 1000 / ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) 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 dLayerTime = dTotLayerLength / dLayerFeed * 60
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
end end
-- calcolo massa dello strato -- calcolo massa dello strato
local dLayerMass = dTotLayerLength * dSliceStep * dStrand * MATERIAL.Density * 1e-6 local dLayerMass = dTotLayerLengthForMass * dSliceStep * dStrand * MATERIAL.Density * 1e-6
if dLayerMass and dLayerMass > 0 then if dLayerMass and dLayerMass > 0 then
dPrintMass = dPrintMass + dLayerMass dPrintMass = dPrintMass + dLayerMass
end end
@@ -157,6 +196,11 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nToolPathId, KEY_SPEED, dSpeed) EgtSetInfo( nToolPathId, KEY_SPEED, dSpeed)
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*') nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end end
-- scrivo info attesa
if dLayerWait > 0 then
EgtSetInfo( nLayerId, KEY_WAITING_TIME, dLayerWait)
EgtSetInfo( nLayerResultId, KEY_WAITING_TIME, dLayerWait)
end
-- scrivo valori in struttura dati -- scrivo valori in struttura dati
--local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex) --local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex)
EgtSetInfo( nLayerResultId, KEY_TMIN, dTMin) EgtSetInfo( nLayerResultId, KEY_TMIN, dTMin)
@@ -169,10 +213,16 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nLayerResultId, KEY_FCUR, dLayerFeed) EgtSetInfo( nLayerResultId, KEY_FCUR, dLayerFeed)
EgtSetInfo( nLayerResultId, KEY_LENGTH, dTotLayerLength) EgtSetInfo( nLayerResultId, KEY_LENGTH, dTotLayerLength)
EgtSetInfo( nLayerResultId, KEY_SPEED, dSpeed) EgtSetInfo( nLayerResultId, KEY_SPEED, dSpeed)
EgtSetInfo( nLayerResultId, KEY_MF, dMF)
EgtSetInfo( nLayerResultId, KEY_TOTAREA, dTotLayerArea)
-- aggiorno interfaccia -- aggiorno interfaccia
EgtProcessEvents( 400 + ( nLayerIndex / nLayerQty * 100), 0) if EgtProcessEvents( 500 + ( nLayerIndex / nLayerQty * 100), 0) == 1 then
EgtEmptyGroup( nResultLayerId)
return
end
nLayerIndex = nLayerIndex + 1 nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end end
if nMaxIndex < nLayerIndex then nMaxIndex = nLayerIndex end if nMaxIndex < nLayerIndex then nMaxIndex = nLayerIndex end
nPartId = EgtGetNextPart( nPartId) nPartId = EgtGetNextPart( nPartId)
-198
View File
@@ -1,198 +0,0 @@
-- RunMachiningParamCalc.lua by Egaltech s.r.l. 2022/04/13
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunMachiningParamCalc = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunMachiningParamCalc started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
local CSV = require( 'CSVManager')
---------------------------------------------------------------------
function RunMachiningParamCalc.Exec()
-- Dati recuperati dalla macchina
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local dCoeffX = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_COEFF_X, 0, sMachIni))
local dCoeffY = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_COEFF_Y, 0, sMachIni))
-- File dei risultati
local sCalcBaseDir = EgtGetStringFromIni( '3dPrinting', 'BaseDir', 'C:\\ProgramData\\Egaltech\\EgtCam5\\3dPrinting', EgtGetIniFile())
local sCurrProjectPath = EgtGetCurrFilePath()
local sResultFile = EgtChangePathExtension( sCurrProjectPath, '.csv')
local bResultFile = EgtExistsFile( sResultFile)
-- carico eventuale file dei risultati
local CSVOldResult
if bResultFile then
CSVOldResult = read_file( sResultFile)
end
-- tabella del csv del risultato
local CSVNewResult = {}
-- ciclo sui pezzi
local nPartId = EgtGetFirstPart()
while nPartId do
if not EgtGetInfo( nPartId, KEY_PART_ON_TABLE, 'b') then
nPartId = EgtGetNextPart( nPartId)
goto continue
end
-- recupero i parametri di lavorazione del pezzo
local dMachiningFeed = EgtGetInfo( nPartId, KEY_FEED, 'd')
local dSliceStep = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
local dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
local sMaterial = EgtGetInfo( nPartId, KEY_MATERIAL)
-- verifico la definizione dei parametri
if not dMachiningFeed then
EgtOutBox( 'Impossible calculating before applying a machining.', 'Error', 'ERROR')
return
end
-- calcolo intervallo tempi consentito
local sMaterialPath = sCalcBaseDir .. '\\Materials\\' .. sMaterial .. '.csv'
local MaterialCSV = read_file( sMaterialPath)
local dMinTime = 0
local dMaxTime = 0
if not MaterialCSV then
EgtOutBox( 'Material csv file not found.', 'Error', 'ERROR')
return
end
local bSectionFound = false
for nSectionIndex = 1, #MaterialCSV do
local Section = MaterialCSV[nSectionIndex]
if tonumber( Section[1]) == dStrand and tonumber( Section[2]) == dSliceStep then
dMinTime = tonumber(Section[3])
dMaxTime = tonumber(Section[4])
bSectionFound = true
break
end
end
if not bSectionFound then
EgtOutBox( 'Section not found in Material csv file.', 'Error', 'ERROR')
return
end
-- ciclo sui layer
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex)
while nLayerId do
local sLayerName = EgtGetName( nLayerId)
local nLayerIndex = tonumber( sLayerName:sub( #SLICE_LAYER + 1))
-- rimuovo eventuale info precedente del tempo di attesa
EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- calcolo lunghezza totale del layer
local dTotLayerLength = 0
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- sommo lunghezze percorsi
local dTotCrvLength = 0
nShellId = EgtGetFirstInGroup( nToolPathId)
while nShellId do
--local nType = EgtGetInfo( nShellId, KEY_TYPE, 'i')
dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
nShellId = EgtGetNext( nShellId)
end
dTotLayerLength = dTotLayerLength + dTotCrvLength
nCrvId = EgtGetNext( nCrvId)
end
-- recupero feed del layer
local dLayerFeed = 0
if bResultFile then
-- leggo il valore dal file
local bResultFound = false
for nResultIndex = 1, #CSVOldResult do
local OldResult = CSVOldResult[nResultIndex]
if tonumber( OldResult[1]) == nLayerIndex then
dLayerFeed = tonumber( OldResult[5])
bResultFound = true
break
end
end
if not bResultFound then
-- uso valore di default
dLayerFeed = dMachiningFeed
end
else
-- uso valore di default
dLayerFeed = dMachiningFeed
end
-- calcolo tempo stimato del layer
local dEsteemedTime = dTotLayerLength / dLayerFeed * 60
-- calcolo speed
local dSpeed = ((( dLayerFeed * dSliceStep * dStrand ) / 60) - dCoeffX) / dCoeffY
-- scrivo info feed e speed in group toolpath
nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
EgtSetInfo( nToolPathId, KEY_FEED, dLayerFeed)
EgtSetInfo( nToolPathId, KEY_SPEED, dSpeed)
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end
-- salvo e riporto valori calcolati in tabella per csv
local sStatus = ''
if dEsteemedTime < dMinTime then
EgtSetInfo( nLayerId, KEY_RESULT, RESULT.KO_MINUS)
EgtSetInfo( nLayerId, KEY_WAITING_TIME, dMinTime - dEsteemedTime)
sStatus = 'KO(-)'
elseif dEsteemedTime > dMinTime and dEsteemedTime < dMaxTime then
EgtSetInfo( nLayerId, KEY_RESULT, RESULT.OK)
sStatus = 'OK'
elseif dEsteemedTime > dMaxTime then
EgtSetInfo( nLayerId, KEY_RESULT, RESULT.KO_PLUS)
sStatus = 'KO(+)'
end
--table.insert( CSVOutTable, { Index = nLayerIndex, EsteemedTime = dEsteemedTime, Feed = dLayerFeed, Speed = dSpeed})
table.insert( CSVNewResult, { nLayerIndex, dTotLayerLength, dEsteemedTime, sStatus, dLayerFeed, dSpeed})
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex)
end
nPartId = EgtGetNextPart( nPartId)
::continue::
end
-- aggiorno palette
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS)
local nPaletteType = EgtGetInfo( nViewId, KEY_PALETTE, 'i')
if nPaletteType == PALETTE_TYPE.RESULTS then
local RSP = require( 'RunSlicePalette')
RSP.UpdateColors( nPaletteType)
end
-- scrivo nuovo file csv di risultato
local file = io.open( sResultFile, "w")
if file then
file:write('LayerIndex; Len; Time; Status; Feed; Speed')
file:write('\n')
for NewResultIndex = 1, #CSVNewResult do
local CSVOutLine = CSVNewResult[NewResultIndex]
local sParams = ''
for ParamIndex = 1, #CSVOutLine do
if ParamIndex > 1 then
sParams = sParams .. ";"
end
if ParamIndex == 4 then
sParams = sParams .. CSVOutLine[ParamIndex]
else
sParams = sParams .. EgtNumToString( CSVOutLine[ParamIndex], 1)
end
end
file:write(sParams)
file:write('\n')
end
file:close()
local sReadProgPath = EgtGetStringFromIni( '3dPrinting', RESULT_READ_PROG, "", EgtGetIniFile())
if not sReadProgPath or not EgtWinExec( '"'..sReadProgPath..'" "'..sResultFile..'"') then
EgtOutBox( 'Impossible opening software to show results. You can find them in ' .. sResultFile, 'Error', 'ERROR')
end
else
EgtOutBox( 'Impossible writing results file in ' .. sResultFile, 'Error', 'ERROR')
end
end
---------------------------------------------------------------------
return RunMachiningParamCalc
-57
View File
@@ -1,57 +0,0 @@
-- RunMachiningParamEdit.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunMachiningParamEdit = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunMachiningParamEdit started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
---------------------------------------------------------------------
function RunMachiningParamEdit.Exec()
-- recupero cartella delle lavorazioni
local sCalcBaseDir = EgtGetStringFromIni( '3dPrinting', 'BaseDir', 'C:\\ProgramData\\Egaltech\\EgtCam5\\3dPrinting', EgtGetIniFile())
local sMachiningDirPath = sCalcBaseDir .. '\\Machinings\\'
-- recupero file delle lavorazioni
--local Machinings = {}
local sMachinings = ''
local f = io.popen("dir " .. sMachiningDirPath .. " /B", "r")
for entry in f:lines() do
--Machinings[#Machinings + 1] = entry
local sDir, sFile, sExt = EgtSplitPath(entry)
if sExt == '.ini' then
if sMachinings ~= "" then
sMachinings = sMachinings .. ','
end
sMachinings = sMachinings .. sFile
end
end
-- chiedo quale file aprire
MachiningValues = EgtDialogBox( 'Machinings edit', { 'Machining', 'CB:' .. sMachinings})
if not MachiningValues or #MachiningValues < 1 then return end
-- verifico esistenza file
local sSelMachiningPath = sMachiningDirPath .. MachiningValues[1] .. '.ini'
if not EgtExistsFile( sSelMachiningPath) then
EgtOutBox( 'Machining file not found', 'Error', 'ERROR')
return
end
-- apro programma di edit
local sEditProgPath = EgtGetStringFromIni( '3dPrinting', 'MachiningEditProg', "", EgtGetIniFile())
if not sEditProgPath or not EgtWinExec( '"'..sEditProgPath..'" "'.. sSelMachiningPath..'"') then
EgtOutBox( 'Impossible opening software to show Machining. You can find it in ' .. sSelMachiningPath, 'Error', 'ERROR')
end
end
---------------------------------------------------------------------
return RunMachiningParamEdit
-56
View File
@@ -1,56 +0,0 @@
-- RunMaterialParamEdit.lua by Egaltech s.r.l. 2022/04/09
-- Gestione edit parametri materiali per Stampa 3d
-- Tabella per definizione modulo
local RunMaterialParamEdit = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunMaterialParamEdit started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
---------------------------------------------------------------------
function RunMaterialParamEdit.Exec()
-- recupero cartella dei materiali
local sCalcBaseDir = EgtGetStringFromIni( '3dPrinting', 'BaseDir', 'C:\\ProgramData\\Egaltech\\EgtCam5\\3dPrinting', EgtGetIniFile())
local sMaterialDirPath = sCalcBaseDir .. '\\Materials\\'
-- recupero elenco file dei materiali
local Files = EgtFindAllFiles( sMaterialDirPath..'*.csv')
if not Files then
EgtOutBox( 'Material files not found', 'Error', 'ERROR')
return
end
local sMaterials = ''
for i = 1, #Files do
local sDir, sFile, sExt = EgtSplitPath( Files[i])
if sMaterials ~= "" then
sMaterials = sMaterials .. ','
end
sMaterials = sMaterials .. sFile
end
-- chiedo quale file aprire
MaterialValues = EgtDialogBox( 'Materials edit', { 'Material', 'CB:' .. sMaterials})
if not MaterialValues or #MaterialValues < 1 then return end
-- verifico esistenza file
local sSelMaterialPath = sMaterialDirPath .. MaterialValues[1] .. '.csv'
if not EgtExistsFile( sSelMaterialPath) then
EgtOutBox( 'Material file not found', 'Error', 'ERROR')
return
end
-- apro programma di edit
local sEditProgPath = EgtGetStringFromIni( '3dPrinting', RESULT_READ_PROG, "", EgtGetIniFile())
if not sEditProgPath or not EgtWinExec( '"'..sEditProgPath..'" "'..sSelMaterialPath..'"') then
EgtOutBox( 'Impossible opening software to show Material. You can find them it in ' .. sSelMaterialPath, 'Error', 'ERROR')
end
end
---------------------------------------------------------------------
return RunMaterialParamEdit
-209
View File
@@ -1,209 +0,0 @@
-- RunPartPositioning.lua by Egaltech s.r.l. 2022/08/29
-- Gestione calcolo disposizione e lavorazioni per stampa 3d
-- 2022/03/21 Creazione file
-- Tabella per definizione modulo
local RunPartPositioning = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunPartPositioning started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
---------------------------------------------------------------------
function RunPartPositioning.Exec()
-- Verifico che la macchina corrente sia adatta alla stampa 3d
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local sMachMaterial = EgtGetStringFromIni( 'General', 'Material', '', sMachIni)
if sMachMaterial ~= 'Additive' then
EgtOutBox( 'Current machine unsuitable for additive manufacturing', 'Warning', 'WARNING')
return
end
-- Recupero ultimo oggetto selezionato
local nSolidId = EgtGetLastSelectedObj()
local nLayerId = EgtGetParent( nSolidId)
local nPartId = EgtGetParent( nLayerId)
-- Verifico sia in un pezzo valido
if nPartId then
if EgtIsPart( nPartId) then
local sName = EgtGetName( nPartId)
if sName == TABLE then
EgtOutBox( 'No selected part. Please select a part before moving it on the table.', 'Warning', 'WARNING')
return
end
local sLayer = EgtGetName( nLayerId)
if sLayer == LAY_RIBS or sLayer == LAY_AUX_SOLIDS or sLayer == LAY_SHELL_NBR then
EgtOutBox( 'No selected solid. Please select a solid before moving it on the table.', 'Warning', 'WARNING')
return
end
else
EgtOutBox( 'No selected part. Please select a part before moving it on the table.', 'Warning', 'WARNING')
return
end
else
EgtOutBox( 'No selected part. Please select a part before moving it on the table.', 'Warning', 'WARNING')
return
end
-- Assegno nome pezzo e layer
if not EgtGetName( nPartId) then
local nPartIndex = 1
while EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) do
nPartIndex = nPartIndex + 1
end
EgtSetName( nPartId, PART .. nPartIndex)
EgtSetName( nLayerId, PRINT_SOLID)
end
-- Recupero o creo layer ausiliario
local nAuxId = EgtGetFirstNameInGroup( nPartId, LAY_AUX)
if not nAuxId then
nAuxId = EgtGroup( nPartId)
EgtSetName( nAuxId, LAY_AUX)
else
EgtEmptyGroup( nAuxId)
end
-- Rimuovo eventuale gruppo di lavoro
local nMchGrpId = EgtGetMachGroupId( '3dPrint')
EgtRemoveMachGroup( nMchGrpId or GDB_ID.NULL)
-- Recupero dati tavola (creando gruppo di lavoro temporaneo)
local nQqqId = EgtAddMachGroup( 'qqq')
EgtSetTable( 'Tab')
local b3Tab = EgtGetTableArea()
dTabX = b3Tab:getDimX()
dTabY = b3Tab:getDimY()
EgtRemoveMachGroup( nQqqId or GDB_ID.NULL)
-- Richiedo posizione origine e offset pezzo
local b3Solid = EgtGetBBoxGlob( nSolidId, GDB_BB.EXACT)
local b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.EXACT)
local nRefX = 1
local nRefY = 1
local dPosX = b3Tab:getDimX() / 2 - b3Solid:getDimX() / 2
local dPosY = b3Tab:getDimY() / 2 - b3Solid:getDimY() / 2
local Positions = EgtDialogBox( 'Part position on table:', { 'Reference', 'CB:Left,Center,Right'},
{ '', 'CB:Bottom,Middle,Top'},
{ 'X', EgtNumToString( EgtToUiUnits( dPosX), 1)},
{ 'Y', EgtNumToString( EgtToUiUnits( dPosY), 1)})
if not Positions then return end
dPosX = EgtFromUiUnits( tonumber( Positions[3]))
dPosY = EgtFromUiUnits( tonumber( Positions[4]))
if Positions[1] == 'Center' then
nRefX = 2
dPosX = dPosX - b3Solid:getDimX() / 2
elseif Positions[1] == 'Right' then
nRefX = 3
dPosX = dPosX - b3Solid:getDimX()
end
if Positions[2] == 'Middle' then
nRefY = 2
dPosY = dPosY - b3Solid:getDimY() / 2
elseif Positions[2] == 'Top' then
nRefY = 3
dPosY = dPosY - b3Solid:getDimY()
end
-- Creo disegno tavola
local nTabPart = EgtGetFirstNameInGroup( GDB_ID.ROOT, TABLE)
EgtErase( nTabPart)
-- Disegno tavola
nTabPart = EgtGroup( GDB_ID.ROOT)
EgtSetMode( nTabPart, GDB_MD.LOCKED)
EgtSetLevel( nTabPart, GDB_LV.SYSTEM)
EgtSetName( nTabPart, TABLE)
local nTabLayer = EgtGroup( nTabPart)
EgtSetName( nTabLayer, TABLE)
local nTabOutlineId = EgtRectangle2P( nTabLayer, Point3d( 0, 0, 0), Point3d( dTabX, dTabY, 0))
local nTabSurfId = EgtSurfFlatRegion( nTabLayer, nTabOutlineId)
EgtSetColor( nTabSurfId, 'GRAY')
EgtSetAlpha( nTabSurfId, 70)
-- Aggiungo il box del solido
local nBoxId = EgtSurfTmBBox( nAuxId, b3Solid, false, GDB_RT.GLOB)
-- Posiziono il pezzo e aggiorno il suo box
local vtMove = Point3d( dPosX, dPosY, 0) - b3Solid:getMin()
EgtMove( nPartId, vtMove)
b3Solid:move( vtMove)
b3Part:move( vtMove)
-- Creo il frame del pezzo
local ptOrig = b3Solid:getMin()
if nRefX == 2 then
ptOrig = ptOrig + b3Solid:getDimX() / 2 * X_AX()
elseif nRefX == 3 then
ptOrig = ptOrig + b3Solid:getDimX() * X_AX()
end
if nRefY == 2 then
ptOrig = ptOrig + b3Solid:getDimY() / 2 * Y_AX()
elseif nRefY == 3 then
ptOrig = ptOrig + b3Solid:getDimY() * Y_AX()
end
-- Svuoto o creo layer per il frame
local nFrameLay = EgtGetFirstNameInGroup( nPartId, LAY_FRAME)
if not nFrameLay then
nFrameLay = EgtGroup( nPartId)
EgtSetName( nFrameLay, LAY_FRAME)
else
EgtEmptyGroup( nFrameLay)
end
local frPart = Frame3d( ptOrig, Z_AX())
nFrameId = EgtFrame( nFrameLay, frPart, GDB_RT.GLOB)
if nFrameId then
EgtSetName( nFrameId, FRAME_PART)
EgtSetMode( nFrameId, GDB_MD.LOCKED)
end
-- Definisco e posiziono il grezzo sulla tavola
EgtAddMachGroup( '3dPrint')
EgtSetTable( 'Tab')
local nRawId = EgtAddRawPartWithPart( nPartId, nBoxId, 0, Color3d( 128, 128, 128, 30))
EgtMoveToCornerRawPart( nRawId, Point3d( dPosX, dPosY, 0), MCH_CR.BL)
EgtResetCurrMachGroup()
-- Recupero/creo gruppo per punti e curve di partenza
local nMachStartId = EgtGetFirstNameInGroup( nPartId, LAY_MACH_START)
if not nMachStartId then
nMachStartId = EgtGroup( nPartId)
EgtSetName( nMachStartId, LAY_MACH_START)
end
local vStartId = EgtGetNameInGroup( nLayerId, START_GEOM)
if vStartId then
for j = 1, #vStartId do
EgtRelocateGlob( vStartId[j], nMachStartId)
EgtSetColor( vStartId[j], EgtStdColor( "RED"))
end
else
-- se non ci sono punti/curve di inizio definiti e non ve ne sono nemmeno nel gruppo, creo un punto
local vOldStart = EgtGetNameInGroup( nMachStartId, START_GEOM)
if not vOldStart then
local ptStart = b3Solid:getCenter() - 0.6 * b3Solid:getDimY() * Y_AX() - 0.5 * b3Solid:getDimZ() * Z_AX()
nPtStartId = EgtPoint( nMachStartId, ptStart, GDB_RT.GLOB)
EgtSetName( nPtStartId, START_GEOM)
EgtSetColor( nPtStartId, EgtStdColor( "RED"))
end
end
-- Dichiaro pezzo posizionato
EgtSetInfo( nPartId, KEY_PART_ON_TABLE, 1)
-- Deseleziono tutto
EgtDeselectAll()
EgtSetView( SCE_VD.ISO_SW, false)
EgtZoom( SCE_ZM.ALL)
EgtOutLog( ' +++ RunPartPositioning completed')
end
---------------------------------------------------------------------
return RunPartPositioning
-138
View File
@@ -1,138 +0,0 @@
-- RunShowManager.lua by Egaltech s.r.l. 2022/09/15
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunShowManager = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunShowManager started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
-- Librerie
_G.package.loaded.RunCalcSolids = nil
local CSOLIDS = require( 'RunCalcSolids')
---------------------------------------------------------------------
local function ShowImportedSolid( nPartId, bShow)
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
EgtSetStatus( nSolidLayId or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS)
EgtSetStatus( nRibsLayId or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
local nShellNbrLay = EgtGetFirstNameInGroup( nPartId, LAY_SHELL_NBR)
EgtSetStatus( nShellNbrLay or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
local nAuxSolidsLay = EgtGetFirstNameInGroup( nPartId, LAY_AUX_SOLIDS)
EgtSetStatus( nAuxSolidsLay or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
end
---------------------------------------------------------------------
function RunShowManager.Exec()
-- Verifico esistenza gruppo stato visualizzazione progetto
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS)
local bImportedSolid = false
local bOuterCrv = false
local bPath = false
local bSolid = false
local bToolPath = false
if not nViewId then
nViewId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nViewId, VIEWPARAMS)
EgtSetLevel( nViewId, GDB_LV.SYSTEM)
else
bImportedSolid = EgtGetInfo( nViewId, IMPORTED_SOLID, 'b')
bOuterCrv = EgtGetInfo( nViewId, OUTER_CRV, 'b')
bPath = EgtGetInfo( nViewId, PATH_GRP, 'b')
bSolid = EgtGetInfo( nViewId, SOLID_GRP, 'b')
bToolPath = EgtGetInfo( nViewId, TOOLPATH_GRP, 'b')
end
local bCurrImportedSolid = bImportedSolid
local bCurrOuterCrv = bOuterCrv
local bCurrPath = bPath
local bCurrSolid = bSolid
local bCurrToolPath = bToolPath
if EgtGetUserLevel() == 1 then
local ViewValues = EgtDialogBox( 'Show Manager', { 'Imported Solid', 'CK:' .. EgtIf( bImportedSolid, '1', '0')},
{ 'Solid', 'CK:' .. EgtIf( bSolid, '1', '0')},
{ 'ToolPath', 'CK:' .. EgtIf( bToolPath, '1', '0')})
if not ViewValues or #ViewValues < 3 then return end
bCurrImportedSolid = ( ViewValues[1] == '1')
bCurrSolid = ( ViewValues[2] == '1')
bCurrToolPath = ( ViewValues[3] == '1')
else
local ViewValues = EgtDialogBox( 'Show Manager', { 'Imported Solid', 'CK:' .. EgtIf( bImportedSolid, '1', '0')},
{ 'OuterCrv', 'CK:' .. EgtIf( bOuterCrv, '1', '0')},
{ 'Path', 'CK:' .. EgtIf( bPath, '1', '0')},
{ 'Solid', 'CK:' .. EgtIf( bSolid, '1', '0')},
{ 'ToolPath', 'CK:' .. EgtIf( bToolPath, '1', '0')})
if not ViewValues or #ViewValues < 5 then return end
bCurrImportedSolid = ( ViewValues[1] == '1')
bCurrOuterCrv = ( ViewValues[2] == '1')
bCurrPath = ( ViewValues[3] == '1')
bCurrSolid = ( ViewValues[4] == '1')
bCurrToolPath = ( ViewValues[5] == '1')
end
-- ciclo sui pezzi
local nPartIndex = 1
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
while nPartId do
-- eventuale calcolo dei solidi
local bHasSolids = EgtGetInfo( nPartId, KEY_HAS_SOLIDS, 'b') or false
if not bHasSolids and bCurrSolid then
EgtSetInfo( nPartId, KEY_CALC_SOLIDS, true)
CSOLIDS.Exec()
end
if bImportedSolid ~= bCurrImportedSolid then
ShowImportedSolid( nPartId, bCurrImportedSolid)
end
-- ciclo sui layer per dis/attivare il resto
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
while nLayerId do
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
while nCrvId do
if bOuterCrv ~= bCurrOuterCrv then
local nOuterCrvId = EgtGetFirstNameInGroup( nCrvId, OUTER_CRV)
EgtSetStatus( nOuterCrvId or GDB_ID.NULL, EgtIf( bCurrOuterCrv, GDB_ST.ON, GDB_ST.OFF))
end
if bPath ~= bCurrPath then
local nPathId = EgtGetFirstNameInGroup( nCrvId, PATH_GRP)
EgtSetStatus( nPathId or GDB_ID.NULL, EgtIf( bCurrPath, GDB_ST.ON, GDB_ST.OFF))
end
if bSolid ~= bCurrSolid then
local nSolidId = EgtGetFirstNameInGroup( nCrvId, SOLID_GRP)
EgtSetStatus( nSolidId or GDB_ID.NULL, EgtIf( bCurrSolid, GDB_ST.ON, GDB_ST.OFF))
end
if bToolPath ~= bCurrToolPath then
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
EgtSetStatus( nToolPathId or GDB_ID.NULL, EgtIf( bCurrToolPath, GDB_ST.ON, GDB_ST.OFF))
end
nCrvId = EgtGetNext( nCrvId)
end
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end
nPartIndex = nPartIndex + 1
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
end
-- riporto impostazioni in gruppo apposito
EgtSetInfo( nViewId, IMPORTED_SOLID, bCurrImportedSolid)
EgtSetInfo( nViewId, OUTER_CRV, bCurrOuterCrv)
EgtSetInfo( nViewId, PATH_GRP, bCurrPath)
EgtSetInfo( nViewId, SOLID_GRP, bCurrSolid)
EgtSetInfo( nViewId, TOOLPATH_GRP, bCurrToolPath)
EgtDraw()
end
---------------------------------------------------------------------
return RunShowManager
-186
View File
@@ -1,186 +0,0 @@
-- RunSliceAdvancement.lua by Egaltech s.r.l. 2022/06/28
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunSliceAdvancement = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunSliceAdvancement started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
-- Librerie
_G.package.loaded.RunCalcSolids = nil
local CSOLIDS = require( 'RunCalcSolids')
---------------------------------------------------------------------
local function ManageSegmentVisibility( SegmentList, nLastActiveIndex, ToHideList)
for Index = 1, #SegmentList do
EgtSetStatus( SegmentList[Index], EgtIf( Index <= nLastActiveIndex, GDB_ST.ON, GDB_ST.OFF))
end
if ToHideList and #ToHideList > 0 then
for Index = 1, #ToHideList do
EgtSetStatus( ToHideList[Index], GDB_ST.OFF)
end
end
end
---------------------------------------------------------------------
local function CalcType( nEntId, nOldType)
local nType = EgtGetInfo( nEntId, KEY_TYPE, 'i')
if not nType or nType == TYPE.LINK or nType == TYPE.COASTING or nType == TYPE.WIPE then
nType = nOldType
end
if nType == TYPE.RIB or nType == TYPE.AUX_SOLID then
nType = TYPE.INFILL
end
if nType == TYPE.EXTRA_SHELL then
nType = TYPE.INNER_SHELL
end
return nType
end
---------------------------------------------------------------------
function RunSliceAdvancement.Exec()
-- verifico ci sia almeno uno slice
local nFirstPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. 1)
if not nFirstPartId then
EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR')
return
else
local nLayerId = EgtGetFirstNameInGroup( nFirstPartId, SLICE_LAYER .. 1) or EgtGetFirstNameInGroup( nFirstPartId, "__" .. SLICE_LAYER .. 1)
if not nLayerId then
EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR')
return
end
end
local nAdvancementType = 1 -- 1 = All, 2 = Only Outer, 3 = Only Inner, 4 = Only Infill
local nPercentage = 30
-- leggo ultimi valori
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS)
if nViewId then
nAdvancementType = EgtGetInfo( nViewId, KEY_SLICE_ADV_MODE, 'i') or SLICE_ADV_TYPE.ALL
nPercentage = EgtGetInfo( nViewId, KEY_SLICE_ADV_PERC, 'i') or 30
end
local sAdvTypeCombo = ''
if nAdvancementType == SLICE_ADV_TYPE.ALL then
sAdvTypeCombo = 'CB:*All,Only Outer,Only Inner,Only Infill'
elseif nAdvancementType == SLICE_ADV_TYPE.OUTER then
sAdvTypeCombo = 'CB:All,*Only Outer,Only Inner,Only Infill'
elseif nAdvancementType == SLICE_ADV_TYPE.INNER then
sAdvTypeCombo = 'CB:All,Only Outer,*Only Inner,Only Infill'
elseif nAdvancementType == SLICE_ADV_TYPE.INFILL then
sAdvTypeCombo = 'CB:All,Only Outer,Only Inner,*Only Infill'
end
ViewValues = EgtDialogBox( 'Slice advancement', { 'Type', sAdvTypeCombo},
{ 'Percentage (0-100)', tostring( nPercentage)})
if not ViewValues or #ViewValues < 1 then return end
if ViewValues[1] == 'All' then
nAdvancementType = SLICE_ADV_TYPE.ALL
elseif ViewValues[1] == 'Only Outer' then
nAdvancementType = SLICE_ADV_TYPE.OUTER
elseif ViewValues[1] == 'Only Inner' then
nAdvancementType = SLICE_ADV_TYPE.INNER
elseif ViewValues[1] == 'Only Infill' then
nAdvancementType = SLICE_ADV_TYPE.INFILL
end
nPercentage = tonumber( ViewValues[2])
-- ciclo sui pezzi
local nPartIndex = 1
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
while nPartId do
-- eventuale calcolo dei solidi
local bHasSolids = EgtGetInfo( nPartId, KEY_HAS_SOLIDS, 'b') or false
if not bHasSolids then
EgtSetInfo( nPartId, KEY_CALC_SOLIDS, true)
CSOLIDS.Exec()
end
local nPrintOrder = EgtGetInfo( nPartId, KEY_PRINT_ORDER, 'i')
-- ciclo sui layer per dis/attivare il resto
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
while nLayerId do
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
while nCrvId do
local nSolidId = EgtGetFirstNameInGroup( nCrvId, SOLID_GRP)
local ShellList = { {}, {}, {}}
local nSurfId = EgtGetFirstInGroup( nSolidId)
local nOldType = TYPE.OUTER_SHELL
while nSurfId do
local nType = CalcType( nSurfId, nOldType)
nOldType = nType
table.insert( ShellList[nType], nSurfId)
nSurfId = EgtGetNext( nSurfId)
end
local nSegmentQty = 1
local SegmentList
local ToHideList
if nAdvancementType == SLICE_ADV_TYPE.ALL then
nSegmentQty = #ShellList[1] + #ShellList[2] + #ShellList[3]
if nPrintOrder == PRINT_ORDER.EXT_INT_INF then
SegmentList = ShellList[1]
for i = 1, #ShellList[2] do
SegmentList[#SegmentList + 1] = ShellList[2][i]
end
for i = 1, #ShellList[3] do
SegmentList[#SegmentList + 1] = ShellList[3][i]
end
else
SegmentList = ShellList[3]
for i = 1, #ShellList[2] do
SegmentList[#SegmentList + 1] = ShellList[2][i]
end
for i = 1, #ShellList[1] do
SegmentList[#SegmentList + 1] = ShellList[1][i]
end
end
elseif nAdvancementType == SLICE_ADV_TYPE.OUTER then
nSegmentQty = #ShellList[1]
SegmentList = ShellList[1]
ToHideList = ShellList[2]
for i = 1, #ShellList[3] do
ToHideList[#ToHideList + 1] = ShellList[3][i]
end
elseif nAdvancementType == SLICE_ADV_TYPE.INNER then
nSegmentQty = #ShellList[2]
SegmentList = ShellList[2]
ToHideList = ShellList[1]
for i = 1, #ShellList[3] do
ToHideList[#ToHideList + 1] = ShellList[3][i]
end
elseif nAdvancementType == SLICE_ADV_TYPE.INFILL then
nSegmentQty = #ShellList[3]
SegmentList = ShellList[3]
ToHideList = ShellList[1]
for i = 1, #ShellList[2] do
ToHideList[#ToHideList + 1] = ShellList[2][i]
end
end
local nLastActiveIndex = ceil( nSegmentQty * nPercentage / 100)
ManageSegmentVisibility( SegmentList, nLastActiveIndex, ToHideList)
nCrvId = EgtGetNext( nCrvId)
end
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end
nPartIndex = nPartIndex + 1
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
end
-- riporto impostazioni in gruppo apposito
EgtSetInfo( nViewId, KEY_SLICE_ADV_MODE, nAdvancementType)
EgtSetInfo( nViewId, KEY_SLICE_ADV_PERC, nPercentage)
EgtDraw()
end
---------------------------------------------------------------------
return RunSliceAdvancement
-113
View File
@@ -1,113 +0,0 @@
-- RunSlicePalette.lua by Egaltech s.r.l. 2022/08/23
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunSlicePalette = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunSlicePalette started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
-- Librerie
_G.package.loaded.RunCalcSolids = nil
local CSOLIDS = require( 'RunCalcSolids')
---------------------------------------------------------------------
function RunSlicePalette.UpdateColors( nPaletteType)
-- ciclo sui pezzi
local nPartIndex = 1
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
while nPartId do
-- eventuale calcolo dei solidi
local bHasSolids = EgtGetInfo( nPartId, KEY_HAS_SOLIDS, 'b') or false
if not bHasSolids then
EgtSetInfo( nPartId, KEY_CALC_SOLIDS, true)
CSOLIDS.Exec()
end
-- ciclo sui layer per dis/attivare il resto
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex)
while nLayerId do
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
while nCrvId do
local nSolidId = EgtGetFirstNameInGroup( nCrvId, SOLID_GRP)
local nSurfId = EgtGetFirstInGroup( nSolidId)
local nOldType = 0
while nSurfId do
local Color = EgtStdColor( 'GRAY')
if nPaletteType == PALETTE_TYPE.IN_OUT then
local nType = EgtGetInfo( nSurfId, KEY_TYPE, 'i')
if not nType or nType < TYPE.OUTER_SHELL or nType > TYPE.AUX_SOLID then nType = nOldType end
nOldType = nType
-- scelta del colore
if nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL then
Color = EgtStdColor( 'TEAL')
elseif nType == TYPE.INNER_SHELL or nType == TYPE.EXTRA_SHELL then
Color = EgtStdColor( 'ORANGE')
elseif nType == TYPE.INFILL then
Color = EgtStdColor( 'YELLOW')
elseif nType == TYPE.LINK then
Color = EgtStdColor( 'GRAY')
elseif nType == TYPE.COASTING then
Color = EgtStdColor( 'BLUE')
elseif nType == TYPE.WIPE then
Color = EgtStdColor( 'LIME')
elseif nType == TYPE.RIB then
Color = EgtStdColor( 'OLIVE')
elseif nType == TYPE.AUX_SOLID then
Color = EgtStdColor( 'AQUA')
end
else
local nResult = EgtGetInfo( nLayerId, KEY_RESULT, 'i')
if nResult == RESULT.OK then
Color = EgtStdColor( 'GREEN')
elseif nResult == RESULT.KO_MINUS then
Color = EgtStdColor( 'ORANGE')
elseif nResult == RESULT.KO_PLUS then
Color = EgtStdColor( 'RED')
end
end
EgtSetColor( nSurfId, Color)
nSurfId = EgtGetNext( nSurfId)
end
nCrvId = EgtGetNext( nCrvId)
end
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex)
end
nPartIndex = nPartIndex + 1
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
end
EgtDraw()
end
---------------------------------------------------------------------
function RunSlicePalette.Exec()
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS) or GDB_ID.NULL
local nOldPaletteType = EgtGetInfo( nViewId, KEY_PALETTE, 'i')
local sCombo = EgtIf( not nOldPaletteType or nOldPaletteType == 1, 'CB:*In/Out,Results', 'CB:In/Out,*Results')
ViewValues = EgtDialogBox( 'Slice Palette', { 'Type', sCombo})
if not ViewValues or #ViewValues < 1 then return end
local nPaletteType = PALETTE_TYPE.IN_OUT -- 1 = In/Out, 2 = Results
if ViewValues[1] == 'In/Out' then
nPaletteType = PALETTE_TYPE.IN_OUT
elseif ViewValues[1] == 'Results' then
nPaletteType = PALETTE_TYPE.RESULTS
end
EgtSetInfo( nViewId, KEY_PALETTE, nPaletteType)
RunSlicePalette.UpdateColors( nPaletteType)
end
---------------------------------------------------------------------
return RunSlicePalette
+39 -200
View File
@@ -26,177 +26,33 @@ _G.package.loaded.CalcToolPath = nil
local CTP = require( 'CalcToolPath') local CTP = require( 'CalcToolPath')
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function SetParamInfo( sFile, nParamsGrp, sSection, sKey, sDefaultVal) local function RestoreOriginalPosition( nPartId)
local sVal = EgtGetStringFromIni( sSection, sKey, sDefaultVal, sFile)
EgtSetInfo( nParamsGrp, sKey, sVal)
end
---------------------------------------------------------------------
local function LoadParams( sFile, nPartId)
EgtSetInfo( nPartId, KEY_PARAMS, sFile)
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_CALC_SOLIDS, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SLICING_45, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SLICE_STEP, '1.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_STRAND, '6.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SHELLS_NBR, '3')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_STRAND_OVERLAP, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_OFFSET_SLICE, '0.0')
local sStrandOrder = EgtGetStringFromIni( SEC_DEFAULT, KEY_PRINT_ORDER, 'InToOut', sFile)
if sStrandOrder == 'OutToIn' then
EgtSetInfo( nPartId, KEY_PRINT_ORDER, PRINT_ORDER.EXT_INT_INF)
else -- 'InToOut'
EgtSetInfo( nPartId, KEY_PRINT_ORDER, PRINT_ORDER.INF_INT_EXT)
end
local sStrandDirection = EgtGetStringFromIni( SEC_DEFAULT, KEY_PRINT_DIRECTION, 'CCW', sFile)
if sStrandDirection == 'CW' then
EgtSetInfo( nPartId, KEY_PRINT_DIRECTION, PRINT_DIRECTION.CW)
else -- 'CCW'
EgtSetInfo( nPartId, KEY_PRINT_DIRECTION, PRINT_DIRECTION.CCW)
end
local sLinkType = EgtGetStringFromIni( SEC_DEFAULT, KEY_LINK_TYPE, 'None', sFile)
if sLinkType == 'None' then
EgtSetInfo( nPartId, KEY_LINK_TYPE, LINK_TYPE.NONE)
elseif sLinkType == 'BiArc' then
EgtSetInfo( nPartId, KEY_LINK_TYPE, LINK_TYPE.BIARC)
else -- 'Linear'
EgtSetInfo( nPartId, KEY_LINK_TYPE, LINK_TYPE.LINEAR)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SP_OFFSET_ON_SLICE, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LINK_PARAM, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LINK_ZUP, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_FLOOR_NBR, '0')
local sFloorInfill = EgtGetStringFromIni( SEC_DEFAULT, KEY_FLOOR_TYPE, 'Offset', sFile)
if sFloorInfill == 'ZigZag' then
EgtSetInfo( nPartId, KEY_FLOOR_TYPE, INFILL_TYPE.ZIGZAG)
else
EgtSetInfo( nPartId, KEY_FLOOR_TYPE, INFILL_TYPE.OFFSET)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_CEIL_NBR, '0')
local sCeilInfill = EgtGetStringFromIni( SEC_DEFAULT, KEY_CEIL_TYPE, 'Offset', sFile)
if sCeilInfill == 'ZigZag' then
EgtSetInfo( nPartId, KEY_CEIL_TYPE, INFILL_TYPE.ZIGZAG)
else
EgtSetInfo( nPartId, KEY_CEIL_TYPE, INFILL_TYPE.OFFSET)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SPEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_EXT_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_INT_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_INFILL_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_IN_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_OUT_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SUPPORT_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_G0_FEED, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_MATERIAL, '')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_TOOL_DIAM, '0.0')
local sLeadInType = EgtGetStringFromIni( SEC_DEFAULT, KEY_LEAD_IN_TYPE, 'None', sFile)
if sLeadInType == 'Linear' then
EgtSetInfo( nPartId, KEY_LEAD_IN_TYPE, LEAD_TYPE.LINEAR)
elseif sLeadInType == 'Arc' then
EgtSetInfo( nPartId, KEY_LEAD_IN_TYPE, LEAD_TYPE.ARC)
else -- 'None'
EgtSetInfo( nPartId, KEY_LEAD_IN_TYPE, LEAD_TYPE.NONE)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_IN_TANG_DIST, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_IN_ORTHO_DIST, '0.0')
local sLeadOutType = EgtGetStringFromIni( SEC_DEFAULT, KEY_LEAD_OUT_TYPE, 'None', sFile)
if sLeadOutType == 'Linear' then
EgtSetInfo( nPartId, KEY_LEAD_OUT_TYPE, LEAD_TYPE.LINEAR)
elseif sLeadOutType == 'Arc' then
EgtSetInfo( nPartId, KEY_LEAD_OUT_TYPE, LEAD_TYPE.ARC)
else -- 'None'
EgtSetInfo( nPartId, KEY_LEAD_OUT_TYPE, LEAD_TYPE.NONE)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_OUT_TANG_DIST, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_LEAD_OUT_ORTHO_DIST, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_OFFSET_LEAD_POINT, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_COASTING_LEN, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_COASTING_FEED, '20000.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_WIPE_LEN, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_WIPE_FEEDPU, '0.9')
-- parametri per costolature
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_OVERLAP, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_SHELLS_NBR, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_INVERT_DIR, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_INVERT_ORDER, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LINK, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_IN_INVERT, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_IN_LEN, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_OUT_INVERT, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_OUT_LEN, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_OUT_COASTING, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_OUT_WIPE, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_RIBS_LEAD_OUT_WIPE_DIR, '0.0')
-- parametri per regioni con diverso numero di passate
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SHELL_NBR_DIFF, '0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SHELL_NBR_COASTING, EgtGetInfo( nPartId, KEY_COASTING_LEN, 'd'))
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SHELL_NBR_WIPE, EgtGetInfo( nPartId, KEY_WIPE_LEN, 'd'))
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_SHELL_NBR_WIPE_DIR, '0.0')
-- parametri per solidi ausiliari
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_OVERLAP, '0')
local sAuxSolidsInfill = EgtGetStringFromIni( SEC_DEFAULT, KEY_AUX_SOLIDS_INFILL, 'None', sFile)
if sAuxSolidsInfill == 'ZigZag' then
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_INFILL, INFILL_TYPE.ZIGZAG)
elseif sAuxSolidsInfill == 'Offset' then
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_INFILL, INFILL_TYPE.OFFSET)
else
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_INFILL, INFILL_TYPE.NONE)
end
local sAuxSolidsStrandOrder = EgtGetStringFromIni( SEC_DEFAULT, KEY_AUX_SOLIDS_PRINT_ORDER, 'InToOut', sFile)
if sAuxSolidsStrandOrder == 'OutToIn' then
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_PRINT_ORDER, PRINT_ORDER.EXT_INT_INF)
else -- 'InToOut'
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_PRINT_ORDER, PRINT_ORDER.INF_INT_EXT)
end
local sAuxSolidsLinkType = EgtGetStringFromIni( SEC_DEFAULT, KEY_AUX_SOLIDS_LINK_TYPE, 'None', sFile)
if sAuxSolidsLinkType == 'None' then
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_LINK_TYPE, LINK_TYPE.NONE)
elseif sAuxSolidsLinkType == 'BiArc' then
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_LINK_TYPE, LINK_TYPE.BIARC)
else -- 'Linear'
EgtSetInfo( nPartId, KEY_AUX_SOLIDS_LINK_TYPE, LINK_TYPE.LINEAR)
end
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_LINK_PARAM, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_SP_OFFSET, '0.0')
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_COASTING_LEN, EgtGetInfo( nPartId, KEY_COASTING_LEN, 'd'))
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_WIPE_LEN, EgtGetInfo( nPartId, KEY_WIPE_LEN, 'd'))
SetParamInfo( sFile, nPartId, SEC_DEFAULT, KEY_AUX_SOLIDS_WIPE_DIR, '0.0')
end
---------------------------------------------------------------------
local function RestoreSolidPosition( nPartId)
if not nPartId then return end if not nPartId then return end
-- recupero vecchio movimento
local vtMove = EgtGetInfo( nPartId, KEY_MOVED_PART, 'v') -- correzione solo del solido ( progetti vecchi)
if vtMove then local vtMove1 = EgtGetInfo( nPartId, KEY_MOVED_PART, 'v')
vtMove = -vtMove if vtMove1 then
vtMove1 = - vtMove1
EgtRemoveInfo( nPartId, KEY_MOVED_PART) EgtRemoveInfo( nPartId, KEY_MOVED_PART)
local SolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID) local SolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
if SolidLayId then if SolidLayId then
local EntId = EgtGetFirstInGroup( SolidLayId) local EntId = EgtGetFirstInGroup( SolidLayId)
while EntId do while EntId do
EgtMove( EntId, vtMove) EgtMove( EntId, vtMove1, GDB_RT.GLOB)
EntId = EgtGetNext( EntId) EntId = EgtGetNext( EntId)
end end
end end
end end
-- correzione dell'intero pezzo
local vtMove = EgtGetInfo( nPartId, KEY_MOVED_PART2, 'v')
if vtMove then
EgtRemoveInfo( nPartId, KEY_MOVED_PART2)
EgtMove( nPartId, - vtMove, GDB_RT.GLOB)
-- sistemo il riferimento
local nFrameId = EgtGetFirstNameInGroup( nPartId, LAY_FRAME)
EgtMove( nFrameId, vtMove, GDB_RT.GLOB)
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -274,78 +130,60 @@ function RunSlicing.Exec()
end end
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID) local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
local nStmId = EgtGetFirstInGroup( nSolidLayId or GDB_ID.NULL) local nStmId = EgtGetFirstInGroup( nSolidLayId or GDB_ID.NULL)
if not nStmId or EgtGetType( nStmId) ~= GDB_TY.SRF_MESH then if nStmId and EgtGetType( nStmId) ~= GDB_TY.SRF_MESH then
EgtOutBox( "Part without surface!", 'Warning', 'WARNING') EgtOutBox( "Part without surface!", 'Warning', 'WARNING')
return return
end end
local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS) local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS)
local nShellNbrLay = EgtGetFirstNameInGroup( nPartId, LAY_SHELL_NBR) local nShellNbrLay = EgtGetFirstNameInGroup( nPartId, LAY_SHELL_NBR)
local nAuxSolidsLay = EgtGetFirstNameInGroup( nPartId, LAY_AUX_SOLIDS) local nAuxSolidsLay = EgtGetFirstNameInGroup( nPartId, LAY_AUX_SOLIDS)
local nStartLayId = EgtGetFirstNameInGroup( nPartId, LAY_MACH_START) local nStartLayId = EgtGetFirstNameInGroup( nPartId, LAY_MACH_START)
local sParamFile
if not PRINT or PRINT.PROGRAM ~= 1 then
--Scelta del file dei parametri
local sPrevParamFile = EgtGetInfo( nPartId, KEY_PARAMS)
if not sPrevParamFile or not EgtExistsFile( sPrevParamFile) then
local sLastParamFile = EgtGetStringFromIni( '3dPrinting', 'ParamFile', '', EgtGetIniFile())
local sDir = EgtSplitPath( sLastParamFile)
sPrevParamFile = sDir..'*.ini'
end
sParamFile = EgtFileDialog( true, sPrevParamFile, 'Param Files (*.ini)|*.ini||')
if not sParamFile then
EgtOutBox( 'No param file selected', 'Warning', 'WARNING')
return
end
EgtWriteStringToIni( '3dPrinting', 'ParamFile', sParamFile, EgtGetIniFile())
end
-- Elimino eventuale precedente file dei risultati
if not PRINT or PRINT.PROGRAM ~= 1 then
local sResultFile = EgtChangePathExtension( sCurrProjectPath, '.csv')
EgtEraseFile( sResultFile)
end
-- Elimino eventuale precedente lavorazione -- Elimino eventuale precedente lavorazione
EgtSetCurrMachGroup() EgtSetCurrMachGroup()
EgtRemoveAllOperations() EgtRemoveAllOperations()
EgtResetCurrMachGroup() EgtResetCurrMachGroup()
-- Lettura dei parametri
if not PRINT or PRINT.PROGRAM ~= 1 then
LoadParams( sParamFile, nPartId)
end
-- Lettura dati macchina -- Lettura dati macchina
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini' local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local HMax = tonumber( EgtGetStringFromIni( '3dPrinting', 'HMax', 500, sMachIni)) local HMax = tonumber( EgtGetStringFromIni( '3dPrinting', 'HMax', 500, sMachIni))
-- Eventuale ripristino posizione solido -- Eventuale ripristino posizione originaria
RestoreSolidPosition( nPartId) RestoreOriginalPosition( nPartId)
-- Rimozione vecchi conti -- Rimozione vecchi conti
RemoveOldSlices( nPartId) RemoveOldSlices( nPartId)
-- Rimozione vecchi TFS -- Rimozione vecchi TFS
RemoveOldTFS() RemoveOldTFS()
-- Calcolo delle fette -- Calcolo delle fette
CSLICES.Exec( nPartId, nStmId, HMax) local bOk = CSLICES.Exec( nPartId, nStmId, HMax)
EgtDraw() EgtDraw()
-- Calcolo dei percorsi sul centro strand in basso -- Calcolo dei percorsi sul centro strand in basso
CPATHS.Exec( nPartId, nStmId) bOk = bOk and CPATHS.Exec( nPartId)
EgtDraw() EgtDraw()
-- Calcolo dei percorsi di lavoro -- Calcolo dei percorsi di lavoro
CTP.Exec( nPartId) bOk = bOk and CTP.Exec( nPartId)
EgtDraw() EgtDraw()
-- Calcolo dei solidi degli strand a partire dai percorsi di lavoro -- Calcolo dei solidi degli strand a partire dai percorsi di lavoro
local bCalcSolids = EgtGetInfo( nPartId, KEY_CALC_SOLIDS, 'b') local bCalcSolids = EgtGetInfo( nPartId, KEY_CALC_SOLIDS, 'b')
EgtRemoveInfo( nPartId, KEY_HAS_SOLIDS) EgtRemoveInfo( nPartId, KEY_HAS_SOLIDS)
if bCalcSolids then if bCalcSolids and bOk then
CSOLIDS.Exec( nPartId) CSOLIDS.Exec( nPartId)
end end
if not bOk then
-- eventuale ripristino posizione originaria
RestoreOriginalPosition( nPartId)
-- rimozione vecchi conti
RemoveOldSlices( nPartId)
EgtDraw()
return false
end
EgtSetStatus( nSolidLayId, GDB_ST.OFF) EgtSetStatus( nSolidLayId, GDB_ST.OFF)
EgtSetStatus( nRibsLayId or GDB_ID.NULL, GDB_ST.OFF) EgtSetStatus( nRibsLayId or GDB_ID.NULL, GDB_ST.OFF)
@@ -356,7 +194,8 @@ function RunSlicing.Exec()
-- Aggiorno impostazioni di visibilita' per ShowManager -- Aggiorno impostazioni di visibilita' per ShowManager
SetViewInfo( bCalcSolids) SetViewInfo( bCalcSolids)
return true
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-195
View File
@@ -1,195 +0,0 @@
-- RunViewManager.lua by Egaltech s.r.l. 2022/07/03
-- Gestione visualizzazione per Stampa 3d
-- Tabella per definizione modulo
local RunViewManager = {}
-- Intestazioni
require( 'EgtBase')
EgtOutLog( ' RunViewManager started', 1)
-- Costanti generali
local AMD = require( 'AddManData')
---------------------------------------------------------------------
local function CalcShow( nShellView, nType)
if nShellView == SHELL_VIEW_TYPE.OUTER then
return ( nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL)
elseif nShellView == SHELL_VIEW_TYPE.INNER then
return ( nType == TYPE.INNER_SHELL)
elseif nShellView == SHELL_VIEW_TYPE.INFILL then
return ( nType == TYPE.INFILL)
else --nShellView == SHELL_VIEW_TYPE.ALL
return true
end
end
---------------------------------------------------------------------
local function CalcType( nEntId, nOldType)
local nType = EgtGetInfo( nEntId, KEY_TYPE, 'i')
if not nType or nType == TYPE.LINK or nType == TYPE.COASTING or nType == TYPE.WIPE then
nType = nOldType
end
if nType == TYPE.RIB or nType == TYPE.AUX_SOLID then
nType = TYPE.INFILL
end
if nType == TYPE.EXTRA_SHELL then
nType = TYPE.INNER_SHELL
end
return nType
end
---------------------------------------------------------------------
function RunViewManager.Exec()
local nVisibilityMode = LAYER_VIEW_TYPE.ALL -- 1 = All, 2 = Till Selected, 3 = Only Selected, 4 = From Selected
local nShellType = SHELL_VIEW_TYPE.ALL -- 1 = All, 2 = Outer, 3 = Inner, 4 = infill
local nOldSelLayerId = GDB_ID.NULL
-- leggo ultimi valori
local nViewId = EgtGetFirstNameInGroup( GDB_ID.ROOT, VIEWPARAMS)
if nViewId then
nVisibilityMode = EgtGetInfo( nViewId, KEY_LAYER_VIEW, 'i')
nShellType = EgtGetInfo( nViewId, KEY_SHELL_VIEW, 'i')
nOldSelLayerId = EgtGetInfo( nViewId, KEY_SEL_LAYER, 'i') or GDB_ID.NULL
end
local sLayerViewCombo = ''
if nVisibilityMode == LAYER_VIEW_TYPE.TILL_SEL then
sLayerViewCombo = 'CB:All,*Till Selected,Only Selected,From Selected'
elseif nVisibilityMode == LAYER_VIEW_TYPE.ONLY_SEL then
sLayerViewCombo = 'CB:All,Till Selected,*Only Selected,From Selected'
elseif nVisibilityMode == LAYER_VIEW_TYPE.FROM_SEL then
sLayerViewCombo = 'CB:All,Till Selected,Only Selected,*From Selected'
else
sLayerViewCombo = 'CB:*All,Till Selected,Only Selected,From Selected'
end
local sShellViewCombo = ''
if nShellType == SHELL_VIEW_TYPE.OUTER then
sShellViewCombo = 'CB:All,*Outer,Inner,Infill'
elseif nShellType == SHELL_VIEW_TYPE.INNER then
sShellViewCombo = 'CB:All,Outer,*Inner,Infill'
elseif nShellType == SHELL_VIEW_TYPE.INFILL then
sShellViewCombo = 'CB:All,Outer,Inner,*Infill'
else
sShellViewCombo = 'CB:*All,Outer,Inner,Infill'
end
ViewValues = EgtDialogBox( 'Slicing visibility manager', { 'Visibility Mode', sLayerViewCombo},
{ 'Shell type', sShellViewCombo})
if not ViewValues or #ViewValues < 2 then return end
if ViewValues[1] == 'All' then
nVisibilityMode = LAYER_VIEW_TYPE.ALL
elseif ViewValues[1] == 'Till Selected' then
nVisibilityMode = LAYER_VIEW_TYPE.TILL_SEL
elseif ViewValues[1] == 'Only Selected' then
nVisibilityMode = LAYER_VIEW_TYPE.ONLY_SEL
elseif ViewValues[1] == 'From Selected' then
nVisibilityMode = LAYER_VIEW_TYPE.FROM_SEL
end
if ViewValues[2] == 'All' then
nShellType = SHELL_VIEW_TYPE.ALL
elseif ViewValues[2] == 'Outer' then
nShellType = SHELL_VIEW_TYPE.OUTER
elseif ViewValues[2] == 'Inner' then
nShellType = SHELL_VIEW_TYPE.INNER
elseif ViewValues[2] == 'Infill' then
nShellType = SHELL_VIEW_TYPE.INFILL
end
-- Recupero ultimo layer selezionato
-- verifico sia un pezzo valido
local sSelLayerName = ''
local bFound = false
local nSelLayerId = EgtGetLastSelectedObj()
while nSelLayerId do
local sSelLayerName = EgtGetName( nSelLayerId)
if sSelLayerName and ( sSelLayerName:sub(1, 5) == SLICE_LAYER or sSelLayerName:sub(3, 7) == SLICE_LAYER) then
bFound = true
break
end
nSelLayerId = EgtGetParent( nSelLayerId)
end
if not bFound then
if nOldSelLayerId and nOldSelLayerId ~= GDB_ID.NULL then
nSelLayerId = nOldSelLayerId
else
if nVisibilityMode ~= LAYER_VIEW_TYPE.ALL then
EgtOutBox( 'No selected element!', 'Warning', 'WARNING')
return
else
nSelLayerId = GDB_ID.NULL
sSelLayerName = ''
end
end
end
-- ciclo sui pezzi
local nPartIndex = 1
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
while nPartId do
-- ciclo sui layer per dis/attivare il resto
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
while nLayerId do
if nVisibilityMode == LAYER_VIEW_TYPE.ALL then
EgtSetStatus( nLayerId, GDB_ST.ON)
elseif nVisibilityMode == LAYER_VIEW_TYPE.TILL_SEL then
EgtSetStatus( nLayerId, EgtIf( nLayerId <= nSelLayerId, GDB_ST.ON, GDB_ST.OFF))
elseif nVisibilityMode == LAYER_VIEW_TYPE.ONLY_SEL then
EgtSetStatus( nLayerId, EgtIf( nLayerId == nSelLayerId, GDB_ST.ON, GDB_ST.OFF))
elseif nVisibilityMode == LAYER_VIEW_TYPE.FROM_SEL then
EgtSetStatus( nLayerId, EgtIf( nLayerId >= nSelLayerId, GDB_ST.ON, GDB_ST.OFF))
end
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
while nCrvId do
----
local nOldType = TYPE.OUTER_SHELL
local nPathId = EgtGetFirstNameInGroup( nCrvId, PATH_GRP)
local nShellId = EgtGetFirstInGroup( nPathId)
while nShellId do
local nType = CalcType( nShellId, nOldType)
nOldType = nType
EgtSetStatus( nShellId, EgtIf( CalcShow( nShellType, nType), GDB_ST.ON, GDB_ST.OFF))
nShellId = EgtGetNext( nShellId)
end
----
nOldType = TYPE.OUTER_SHELL
local nSolidId = EgtGetFirstNameInGroup( nCrvId, SOLID_GRP)
local nSurfId = EgtGetFirstInGroup( nSolidId)
while nSurfId do
local nType = CalcType( nSurfId, nOldType)
nOldType = nType
EgtSetStatus( nSurfId, EgtIf( CalcShow( nShellType, nType), GDB_ST.ON, GDB_ST.OFF))
nSurfId = EgtGetNext( nSurfId)
end
----
nOldType = TYPE.OUTER_SHELL
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
nShellId = EgtGetFirstInGroup( nToolPathId)
while nShellId do
local nType = CalcType( nShellId, nOldType)
nOldType = nType
EgtSetStatus( nShellId, EgtIf( CalcShow( nShellType, nType), GDB_ST.ON, GDB_ST.OFF))
nShellId = EgtGetNext( nShellId)
end
nCrvId = EgtGetNext( nCrvId)
end
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end
nPartIndex = nPartIndex + 1
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)
end
-- riporto impostazioni in gruppo apposito
EgtSetInfo( nViewId, KEY_LAYER_VIEW, nVisibilityMode)
EgtSetInfo( nViewId, KEY_SHELL_VIEW, nShellType)
EgtSetInfo( nViewId, KEY_SEL_LAYER, nSelLayerId)
EgtDraw()
end
---------------------------------------------------------------------
return RunViewManager
-18
View File
@@ -1,18 +0,0 @@
-- MachiningParamCalc.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunMachiningParamCalc = nil
local RMPC = require( 'RunMachiningParamCalc')
-- Calcolo
RMPC.Exec()
-18
View File
@@ -1,18 +0,0 @@
-- MachiningParamCalc.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunMachiningParamEdit = nil
local RMPE = require( 'RunMachiningParamEdit')
-- Calcolo
RMPE.Exec()
-18
View File
@@ -1,18 +0,0 @@
-- MachiningParamCalc.lua by Egaltech s.r.l. 2022/04/09
-- Gestione edit parametri materiali per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunMaterialParamEdit = nil
local RMPE = require( 'RunMaterialParamEdit')
-- Calcolo
RMPE.Exec()
-20
View File
@@ -1,20 +0,0 @@
-- PlacePart.lua by Egaltech s.r.l. 2022/04/11
-- Gestione calcolo disposizione e lavorazioni per stampa 3d
-- 2022/03/21 Creazione file
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunPartPositioning = nil
local RPP = require( 'RunPartPositioning')
-- Calcolo
RPP.Exec()
-18
View File
@@ -1,18 +0,0 @@
-- ShowManager.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunShowManager = nil
local RSM = require( 'RunShowManager')
-- Calcolo
RSM.Exec()
-18
View File
@@ -1,18 +0,0 @@
-- SliceAdvancement.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunSliceAdvancement = nil
local RSA = require( 'RunSliceAdvancement')
-- Calcolo
RSA.Exec()
-18
View File
@@ -1,18 +0,0 @@
-- SlicePalette.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunSlicePalette = nil
local RSP = require( 'RunSlicePalette')
-- Calcolo
RSP.Exec()
+2 -3
View File
@@ -1,4 +1,4 @@
-- Slicing.lua by Egaltech s.r.l. 2022/03/30 -- Slicing.lua by Egaltech s.r.l. 2023/01/11
-- Calcoli prima fase per Stampa 3d -- Calcoli prima fase per Stampa 3d
-- Intestazioni -- Intestazioni
@@ -7,8 +7,7 @@ _ENV = EgtProtectGlobal()
EgtEnableDebug( false) EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d -- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir() EgtAddToPackagePath( PRINT.BASEDIR .. '\\LuaLibs\\?.lua')
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie -- Librerie
_G.package.loaded.RunSlicing = nil _G.package.loaded.RunSlicing = nil
+4
View File
@@ -0,0 +1,4 @@
-- Version.lua by Egaltech s.r.l. 2023/02/28
-- Gestione della versione di 3dPrinting
VERSION = '2.5c2'
-18
View File
@@ -1,18 +0,0 @@
-- ViewManager.lua by Egaltech s.r.l. 2022/04/05
-- Gestione visualizzazione per Stampa 3d
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Imposto direttorio libreria specializzata per Stampa 3d
local sBaseDir = EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- Librerie
_G.package.loaded.RunViewManager = nil
local RVM = require( 'RunViewManager')
-- Calcolo
RVM.Exec()