Compare commits

...

39 Commits

Author SHA1 Message Date
luca.mazzoleni bc5c99422b 2.5c4
- in LapJoint Gestito caso riconoscimento errato Stype 3
- piccola correzione a MachiningLib -> FindMilling
2023-03-09 09:34:43 +01:00
luca.mazzoleni c5e3af9180 Merge remote-tracking branch 'origin/master' into develop 2023-03-09 09:19:23 +01:00
DarioS 714b3be628 DataWall :
- in FreeContour con fresa, se imposto Tool_ID non controllo più possibilità di lavorare di testa.
2023-03-08 13:05:30 +01:00
DarioS 29b63c77a6 DataWall 2.5c3 :
- aggiunta gestione DELTA_X e DELTA_Y per programma EgtBeamWall.
2023-03-08 11:51:30 +01:00
luca.mazzoleni 53af42724b Merge branch 'master' into develop 2023-03-08 10:41:07 +01:00
DarioS 0be8849f2e DataWall 2.5c2 :
- aggiunta possibilità di spostare grezzo da corner di riferimento anche in X.
2023-03-08 08:45:44 +01:00
DarioS 246f64e4ce DataWall 2.5c1 :
- corretto nome variabile restituzione stringa errore per sega a catena.
2023-03-02 12:13:40 +01:00
luca.mazzoleni 4d3669a24b Merge remote-tracking branch 'origin/master' into develop 2023-02-28 15:18:09 +01:00
DarioS de682d511c DataWall 2.5b2 :
- modifica a FreeContour con sega a catena per non usare MCH_SCC.OPPOSITE sostituiti con Invert e Left.
2023-02-28 15:13:33 +01:00
luca.mazzoleni 55e7d9f2e7 Merge branch 'master' into develop 2023-02-27 17:38:41 +01:00
DarioS bf08515edf Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataWall 2023-02-27 17:33:17 +01:00
DarioS b0b5a7f91d DataWall 2.5b1 :
- aggiunto file Version.lua.
2023-02-27 17:32:51 +01:00
luca.mazzoleni 7cded14384 Improvement/SideMortisingAndMarking:
- modificato valore di accettazione offset z a 99.9
2023-01-24 12:47:48 +01:00
luca.mazzoleni 2bf9d01c50 Merge branch 'develop' 2023-01-24 12:02:45 +01:00
DarioS c654e00984 DataWall :
- modifiche per lua54 e compilati unificati 32/64 bit solo bin.
2023-01-12 15:19:08 +01:00
luca.mazzoleni f9f2b07489 Merge branch 'Improvement/SideMortisingAndMarking' into develop 2023-01-05 16:06:30 +01:00
luca.mazzoleni a21d93cc6b Improvement/SideMortisingAndMarking:
- in presenza di offset Z tra grezzo e tavola, rese possibili le lavorazioni di mortising e marking sul fianco
2023-01-05 16:04:20 +01:00
luca.mazzoleni 89f553a49f Merge branch 'develop' 2022-12-22 17:53:56 +01:00
luca.mazzoleni 577362c6d2 BugFix:
- in LapJoint esteso lo step negativo agli angoli ottusi
2022-12-22 17:53:40 +01:00
luca.mazzoleni de14fb91ce Merge remote-tracking branch 'origin/master' into develop 2022-12-22 16:14:26 +01:00
DarioS 564de1d22d DataWall :
- in LapJoint abilitato step negativo se tasca guarda verso il basso (MakeSideGrooveByMill).
2022-12-22 15:20:00 +01:00
DarioS 2051a327a5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataWall 2022-12-22 10:04:06 +01:00
luca.mazzoleni 4237f50b5f Merge branch 'BugFix/Approx3EdgesFaces' into develop 2022-12-14 18:24:40 +01:00
luca.mazzoleni c01fa1f08a Merge branch 'develop' 2022-12-14 12:57:00 +01:00
luca.mazzoleni a0bd97e7aa BugFix/FreeContourBladeUpsideDownAdjFace:
- Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso
- in Lapjoint piccola modifica al modo di oridinare le facce
2022-12-14 12:02:54 +01:00
luca.mazzoleni a548c26eed Merge branch 'develop' into BugFix/Approx3EdgesFaces 2022-12-13 09:49:43 +01:00
luca.mazzoleni 3b46a5b285 BugFix/Approx3EdgesFaces:
- in freeContour aggiunta la funzione Is3EdgesApprox per riconoscere come 3 lati anche facce con lati aggiuntivi molto corti (<15 mm)
2022-12-13 09:48:53 +01:00
luca.mazzoleni 3bf3ba3b43 Improvement/SideMillGreater90:
- piccole correzioni e miglioramenti
2022-12-06 12:41:47 +01:00
luca.mazzoleni d236b19d6a Improvement/SideMillGreater90:
- piccola correzione
2022-12-02 18:35:46 +01:00
luca.mazzoleni b62b694112 Improvement/SideMillGreater90:
- Corretto calcolo profondità per lavorazione verticale con angolo ottuso
2022-12-02 18:10:17 +01:00
SaraP ade9d3ffe9 DataWall :
- nel nesting aggiunto controllo sul diametro dei fori
- in FlipAndRot corretto controllo sulle rotazioni.
2022-12-02 17:58:39 +01:00
luca.mazzoleni b2f1645322 Improvement/SideMillGreater90:
- aggiunto ripasso lato inclinato anche per svuotatura
2022-12-02 15:38:04 +01:00
luca.mazzoleni 5023887f2e Improvement/SideMillGreater90:
- aggiunto warning per lapjoint da sotto con angolo ottuso non completata
2022-12-01 16:08:15 +01:00
luca.mazzoleni d37e4bdf8d Improvement/SideMillGreater90: - in lapjoint, per 2 facce con angolo > 90°, implementata lavorazione principale verticale; per quelle dall'alto si fa anche finitura del lato inclinato 2022-12-01 11:46:50 +01:00
SaraP 6ccbc4f0cd DataWall :
- nel nesting corretta la rimozione dei parametri Q.
2022-11-30 15:00:44 +01:00
luca.mazzoleni 9babfe01f3 Merge remote-tracking branch 'origin/HEAD' into develop 2022-11-29 09:29:40 +01:00
DarioS 4c6d40ee11 DataWall :
- taglio lama quasi orizzontale ora viene fatto con svuotatura
- LapJoint con lama massima inclinazione 60deg
2022-11-25 15:37:58 +01:00
DarioS e07a1d63cb DataWall :
- in nesting migliorati controlli esistenza dati
- in controllo spessori per inserimento in pannello si usa tolleranza di 0.1 (prima era 0.01) come in EgtBeamWall.
2022-11-25 09:40:34 +01:00
luca.mazzoleni be4df143e4 Merge branch 'BugFix/SideGrooveMaxElevation' into develop 2022-09-30 12:51:04 +02:00
19 changed files with 533 additions and 386 deletions
+4 -7
View File
@@ -13,12 +13,9 @@
/Debug64 /Debug64
/Release64 /Release64
/ipch /ipch
/bin
/obj /obj
/.vs /.vs
/32/*.lua /bin/*.lua
/32/LuaLibs/*.lua /bin/*.ini
/32/Images/*.png /bin/LuaLibs/*.lua
/64/*.lua /bin/Images/*.png
/64/LuaLibs/*.lua
/64/Images/*.png
+21 -55
View File
@@ -7,60 +7,33 @@ variables:
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" echo "Copia file *.ini"
$FileList = Get-ChildItem("*.ini") $FileList = Get-ChildItem("*.ini")
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 Copy-Item -Path $FileName -Destination bin\$FileName
echo "Copy-Item -Path $FileName -Destination 32\$FileName" echo "Copy-Item -Path $FileName -Destination bin\$FileName"
} }
echo "Compilazione file *.lua 32bit" echo "Compilazione file *.lua 32/64bit"
$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
lua53 -o 32\$FileName $FileName lua54 -o bin\$FileName $FileName
echo "lua53 -o 32\$FileName $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 "Compilazione file *.lua 64bit"
$FileList = Get-ChildItem("*.lua")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua53 -o 64\$FileName $FileName
echo "lua53 -o 64\$FileName $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
- | - |
@@ -70,28 +43,23 @@ variables:
SLEEP 2 SLEEP 2
net use R: /delete net use R: /delete
# helper copia script verso cartella di rete R:\ delle cartelle bin
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
.ReplicaR: &ReplicaR .ReplicaR: &ReplicaR
- | - |
net use R: /delete net use R: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR 32 R:\EgtData\$env:APP_NAME\32 ROBOCOPY /MIR bin R:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR 64 R:\EgtData\$env:APP_NAME\64 ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\bin\Images
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 R: /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
.ReplicaZ: &ReplicaZ .ReplicaZ: &ReplicaZ
- | - |
net use Z: /delete net use Z: /delete
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\bin\Images
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
@@ -100,15 +68,13 @@ stages:
LuaCompile:build: LuaCompile:build:
stage: build stage: build
# only: only:
# - main - main
# - master - master
tags: tags:
- win - win
script: script:
- *LuaCompile32 - *LuaCompile
- *LuaCompile64
- *CodeReplicaR - *CodeReplicaR
- *ReplicaR - *ReplicaR
- *ReplicaZ - *ReplicaZ
View File
View File
+1 -1
View File
@@ -358,7 +358,7 @@ if bToProcess then
local vWallErr = {} local vWallErr = {}
for i = 2, #vWall do for i = 2, #vWall do
local dDimH = vWall[i].Box:getDimZ() local dDimH = vWall[i].Box:getDimZ()
if abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL then if abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL then
table.insert( vWallErr, i) table.insert( vWallErr, i)
end end
end end
+25 -49
View File
@@ -1,53 +1,29 @@
REM Compilazione degli script Wall Egaltech 2022.05.09 REM Compilazione degli script Wall Egaltech 2023.02.27
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
REM Compilazione 32 bit REM Compilazione 32 e 64 bit
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WallExec.lua LuaLibs\WallExec.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WallLib.lua LuaLibs\WallLib.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
\EgtProg\Dll32\luac53 -o 32\BatchProcess.lua BatchProcess.lua \EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua
\EgtProg\Dll32\luac53 -o 32\BatchProcessNew.lua BatchProcessNew.lua \EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua
\EgtProg\Dll32\luac53 -o 32\GetWallData.lua GetWallData.lua \EgtProg\Dll32\luac54 -o bin\GetWallData.lua GetWallData.lua
\EgtProg\Dll32\luac53 -o 32\NestFlipAndRotate.lua NestFlipAndRotate.lua \EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua NestFlipAndRotate.lua
\EgtProg\Dll32\luac53 -o 32\NestProcess.lua NestProcess.lua \EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua
\EgtProg\Dll32\luac53 -o 32\Overturn.lua Overturn.lua \EgtProg\Dll32\luac54 -o bin\Overturn.lua Overturn.lua
\EgtProg\Dll32\luac53 -o 32\Process.lua Process.lua \EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
\EgtProg\Dll32\luac53 -o 32\Rotate.lua Rotate.lua \EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
REM Compilazione 64 bit
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
\EgtProg\Dll64\luac53 -o 64\BatchProcess.lua BatchProcess.lua
\EgtProg\Dll64\luac53 -o 64\BatchProcessNew.lua BatchProcessNew.lua
\EgtProg\Dll64\luac53 -o 64\GetWallData.lua GetWallData.lua
\EgtProg\Dll64\luac53 -o 64\NestFlipAndRotate.lua NestFlipAndRotate.lua
\EgtProg\Dll64\luac53 -o 64\NestProcess.lua NestProcess.lua
\EgtProg\Dll64\luac53 -o 64\Overturn.lua Overturn.lua
\EgtProg\Dll64\luac53 -o 64\Process.lua Process.lua
\EgtProg\Dll64\luac53 -o 64\Rotate.lua Rotate.lua
+3 -1
View File
@@ -1,4 +1,4 @@
-- GetWallData.lua by Egaltech s.r.l. 2022/06/28 -- GetWallData.lua by Egaltech s.r.l. 2023/03/08
-- Recupero dati da file WallData.lua di macchina -- Recupero dati da file WallData.lua di macchina
-- Intestazioni -- Intestazioni
@@ -37,6 +37,8 @@ local WD = require( 'WallData')
-- Assegno valori di interesse -- Assegno valori di interesse
GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR
GWD.ORIG_CORNER = WD.ORIG_CORNER GWD.ORIG_CORNER = WD.ORIG_CORNER
GWD.DELTA_X = WD.DELTA_X
GWD.DELTA_Y = WD.DELTA_Y
GWD.NESTING_CORNER = WD.NESTING_CORNER GWD.NESTING_CORNER = WD.NESTING_CORNER
GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM
GWD.MIN_HEIGHT = WD.MIN_HEIGHT GWD.MIN_HEIGHT = WD.MIN_HEIGHT
+3 -2
View File
@@ -2,6 +2,7 @@
-- Libreria ricerca lavorazioni per Pareti -- Libreria ricerca lavorazioni per Pareti
-- Tabella per definizione modulo -- Tabella per definizione modulo
-- 2023/03/09 Piccola correzione alla SideDepth in FindMilling
local WMachiningLib = {} local WMachiningLib = {}
-- Include -- Include
@@ -56,13 +57,13 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
local Milling = Millings[i] local Milling = Millings[i]
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
local sMyTuuid = EgtGetMachiningParam( MCH_MP.TUUID) local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth()) local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth())
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0 local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0
local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
local dTMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 0, 0.5 * ( dTDiam - dTDiamTh)) local dTMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh))
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i') local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
if nMchType == MCH_MY.MILLING and if nMchType == MCH_MY.MILLING and
( not sTuuid or sTuuid == sMyTuuid) and ( not sTuuid or sTuuid == sMyTuuid) and
+10 -4
View File
@@ -1,4 +1,4 @@
-- WProcessCut.lua by Egaltech s.r.l. 2020/11/13 -- WProcessCut.lua by Egaltech s.r.l. 2020/11/25
-- Gestione calcolo taglio di testa o longitudinale per Pareti -- Gestione calcolo taglio di testa o longitudinale per Pareti
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -8,6 +8,7 @@ local WPC = {}
require( 'EgtBase') require( 'EgtBase')
local WL = require( 'WallLib') local WL = require( 'WallLib')
local FreeContour = require( 'WProcessFreeContour') local FreeContour = require( 'WProcessFreeContour')
local LapJoint = require( 'WProcessLapJoint')
EgtOutLog( ' WProcessCut started', 1) EgtOutLog( ' WProcessCut started', 1)
@@ -29,7 +30,7 @@ function WPC.Classify( Proc, b3Raw)
-- verifico abbia una sola faccia -- verifico abbia una sola faccia
if Proc.Fct ~= 1 then return false end if Proc.Fct ~= 1 then return false end
-- controllo la normale -- controllo la normale
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
if vtN:getZ() < - 0.5 then return false end if vtN:getZ() < - 0.5 then return false end
return true return true
end end
@@ -41,7 +42,7 @@ function WPC.FlipClassify( Proc)
-- verifico abbia una sola faccia -- verifico abbia una sola faccia
if Proc.Fct ~= 1 then return 0, 0 end if Proc.Fct ~= 1 then return 0, 0 end
-- controllo la normale -- controllo la normale
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
local vtNZ = vtN:getZ() local vtNZ = vtN:getZ()
if vtNZ > - GEO.EPS_SMALL then if vtNZ > - GEO.EPS_SMALL then
nFlip0 = 100 nFlip0 = 100
@@ -67,7 +68,12 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function WPC.Make( Proc, nRawId, b3Raw) function WPC.Make( Proc, nRawId, b3Raw)
return FreeContour.Make( Proc, nRawId, b3Raw) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
if vtN :getZ() > 0.866 then
return LapJoint.Make( Proc, nRawId, b3Raw)
else
return FreeContour.Make( Proc, nRawId, b3Raw)
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+88 -30
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/08/29 -- ProcessFreeContour.lua by Egaltech s.r.l. 2023/03/08
-- Gestione calcolo profilo libero per Pareti -- Gestione calcolo profilo libero per Pareti
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto. -- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox. -- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
@@ -12,6 +12,10 @@
-- 2022/04/26 Migliorata gestione caso pocketing. -- 2022/04/26 Migliorata gestione caso pocketing.
-- 2022/08/05 Aggiunta segnalazione aree vietate non gestite. -- 2022/08/05 Aggiunta segnalazione aree vietate non gestite.
-- 2022/08/29 Corretta gestione tipo Pocket senza fondo (sono lavorabili da entrambe le parti con fresatura). -- 2022/08/29 Corretta gestione tipo Pocket senza fondo (sono lavorabili da entrambe le parti con fresatura).
-- 2022/12/13 Aggiunta la funzione Is3EdgesApprox per riconoscere come 3 lati anche facce con lati aggiuntivi molto corti (<15 mm)
-- 2022/12/14 Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso
-- 2023/02/28 In lavorazioni con sega a catena per invertire lato mandrino ora Invert + Left invece di MCH_SCC.OPPOSITE.
-- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPF = {} local WPF = {}
@@ -1233,6 +1237,33 @@ local function GetMaxDepth( vtNz, dMillDiam, dDiamTh, dMaxDepth, dFreeLen)
end end
end end
---------------------------------------------------------------------
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
local function Is3EdgesApprox( Proc, nFacet, nAddGrpId)
local bResult = false
local nContourId = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
EgtMergeCurvesInCurveCompo( nContourId)
-- recupero il numero effettivo di lati
local _, nEntityCount = EgtCurveDomain( nContourId)
local nEdges = nEntityCount
if nContourId then
if nEntityCount and nEntityCount == 3 then
bResult = true
-- rimuovo i lati molto corti dal conteggio totale
elseif nEntityCount then
for i = 1, nEntityCount do
local dLength = EgtCurveCompoLength( nContourId, i - 1)
if dLength < 15 then nEdges = nEdges - 1 end
end
end
if nEdges == 3 then bResult = true end
end
if bResult == true then
EgtOutLog( 'FreeContour : Face with ' .. tointeger( nEntityCount) .. ' edges skipped (approx 3 edges)')
end
return bResult
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAddGrpId) local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAddGrpId)
-- flag per fresature non passanti -- flag per fresature non passanti
@@ -1253,13 +1284,19 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
end end
end end
-- verifico se la facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
for currentFace = 1, #vFace do
if Is3EdgesApprox( Proc, vFace[currentFace].Fac, nAddGrpId) then
vFace[currentFace].Is3EdgesApprox = true
end
end
-- verifico se ciclo chiuso -- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].PrevAng) > 0.1) local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
-- ciclo di inserimento delle fresate sulle facce del contorno in esame -- ciclo di inserimento delle fresate sulle facce del contorno in esame
local i = 1 local i = 1
-- se faccia finale con fine non lavorato, forzo partenza da prima faccia non tutta saltata (tipo 4) -- se faccia finale con fine non lavorato, forzo partenza da prima faccia non tutta saltata (tipo 4)
if bClosed and ( ( vFace[#vFace].Type == 4 and vFace[#vFace].Edges > 3) or ( vFace[#vFace].Type & 2) ~= 0) then if bClosed and ( ( vFace[#vFace].Type == 4 and ( vFace[#vFace].Edges > 3 and not vFace[#vFace].Is3EdgesApprox)) or ( vFace[#vFace].Type & 2) ~= 0) then
while i <= #vFace and vFace[i].Type == 4 and vFace[i].Edges > 3 and abs( vFace[i].SideAng) < 0.1 do while i <= #vFace and vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and abs( vFace[i].SideAng) < 0.1 do
i = i + 1 i = i + 1
end end
end end
@@ -1322,6 +1359,10 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
end end
end end
local dEal = vFace[i].Whisk - vFace[i].Len local dEal = vFace[i].Whisk - vFace[i].Len
-- se faccia precedente inclinata verso il basso prolungo il finale per adeguarmi all percorso della lama
if j and vFace[j].Norm:getZ() < -0.017 then
dEal = dEal - vFace[j].Width * vFace[j].Norm:getZ()
end
-- se angolo interno prima e faccia precedente inclinata verso l'alto oltre 16.1deg -- se angolo interno prima e faccia precedente inclinata verso l'alto oltre 16.1deg
if vFace[i].PrevAng < -30 and j and vFace[j].Norm:getZ() < 0.96078 and vFace[j].Norm:getZ() > 0 then if vFace[i].PrevAng < -30 and j and vFace[j].Norm:getZ() < 0.96078 and vFace[j].Norm:getZ() > 0 then
dEal = dEal + vFace[j].Width * vFace[j].Norm:getZ() dEal = dEal + vFace[j].Width * vFace[j].Norm:getZ()
@@ -1359,7 +1400,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
end end
end end
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura -- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = EgtAddMachining( sName, sMilling)
@@ -1400,7 +1441,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
local LastJ local LastJ
i = i + 1 i = i + 1
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1)) local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1))
while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and vFace[j].Edges > 3)) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and ( vFace[j].Edges > 3 and not vFace[j].Is3EdgesApprox))) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do
table.insert( vGeom, { Proc.Id, vFace[j].Fac}) table.insert( vGeom, { Proc.Id, vFace[j].Fac})
LastJ = j LastJ = j
dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0) dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0)
@@ -1411,13 +1452,13 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1)) j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1))
end end
-- se faccia singola è da fare tutta senza oltrepassare estremi -- se faccia singola è da fare tutta senza oltrepassare estremi
if #vFace == 1 and vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then if #vFace == 1 and vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
dSal = -dMillDiam / 2 dSal = -dMillDiam / 2
dEal = -dMillDiam / 2 dEal = -dMillDiam / 2
-- altrimenti va verificato -- altrimenti va verificato
else else
-- se lavorazione completa su faccia iniziale -- se lavorazione completa su faccia iniziale
if vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then if vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
-- se angolo interno prima -- se angolo interno prima
if vFace[OrigI].PrevAng < -30 then if vFace[OrigI].PrevAng < -30 then
local dSinA = -sin( vFace[OrigI].PlPrevAng + 90) local dSinA = -sin( vFace[OrigI].PlPrevAng + 90)
@@ -1438,7 +1479,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
-- se lavorazione completa o finale su faccia finale -- se lavorazione completa o finale su faccia finale
local LastFace = ( LastJ or OrigI) local LastFace = ( LastJ or OrigI)
local OrigK = EgtIf( LastFace < #vFace, LastFace + 1, EgtIf( bClosed, 1, nil)) local OrigK = EgtIf( LastFace < #vFace, LastFace + 1, EgtIf( bClosed, 1, nil))
if ( vFace[LastFace].Type == 4 and vFace[LastFace].Edges > 3) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then if ( vFace[LastFace].Type == 4 and ( vFace[LastFace].Edges > 3 and not vFace[LastFace].Is3EdgesApprox)) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then
-- se angolo interno dopo -- se angolo interno dopo
if OrigK and vFace[OrigK].PrevAng < -30 then if OrigK and vFace[OrigK].PrevAng < -30 then
local dSinA = -sin( vFace[OrigK].PlPrevAng + 90) local dSinA = -sin( vFace[OrigK].PlPrevAng + 90)
@@ -1675,23 +1716,22 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2 local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- percorso da non invertire
EgtSetMachiningParam( MCH_MP.INVERT, false)
-- assegno utilizzo faccia -- assegno utilizzo faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
-- assegno affondamento -- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro -- assegno lato di lavoro e inversione direzione movimento
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- posizione braccio porta testa
if vFace[i].Norm:getX() < 0.018 then if vFace[i].Norm:getX() < 0.018 then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE) EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
else else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.OPPOSITE) EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.OFFSR, dSawThick) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
-- eseguo -- eseguo
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -1700,7 +1740,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
end end
end end
-- se fine faccia non tagliato completamente o faccia non tagliata completamente e abbastanza lunga, inserisco un ripasso con sega a catena -- se fine faccia non tagliato completamente o faccia non tagliata completamente e abbastanza lunga, inserisco un ripasso con sega a catena
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3 and vFace[i].Len > dSawDiam + 1) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sSawing) local nMchId = EgtAddMachining( sName, sSawing)
@@ -1727,23 +1767,22 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
end end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- percorso da non invertire
EgtSetMachiningParam( MCH_MP.INVERT, false)
-- assegno utilizzo faccia -- assegno utilizzo faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
-- assegno affondamento -- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro -- assegno lato di lavoro e inversione direzione movimento
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) if vFace[i].Norm:getX() < 0.018 then
-- posizione braccio porta testa EgtSetMachiningParam( MCH_MP.INVERT, false)
if vFace[i].Norm:getX() < 0.018 then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
else else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.OPPOSITE) EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.OFFSR, dSawThick) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
-- eseguo -- eseguo
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -1761,6 +1800,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick) local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
-- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
-- ciclo di inserimento dei tagli sulle facce del contorno in esame -- ciclo di inserimento dei tagli sulle facce del contorno in esame
for i = 1, #vFace do for i = 1, #vFace do
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito -- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
@@ -1769,6 +1810,8 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
if not bToSkip and vFace[i].Type ~= 4 then if not bToSkip and vFace[i].Type ~= 4 then
-- indice del successivo -- indice del successivo
local j = EgtIf( i < #vFace, i + 1, 1) local j = EgtIf( i < #vFace, i + 1, 1)
-- indice del precedente
local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = EgtAddMachining( sName, sCutting)
@@ -1812,7 +1855,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, nLeadIn) EgtSetMachiningParam( MCH_MP.LEADINTYPE, nLeadIn)
local dSal = 0 local dSal = 0
if ( not bInvert and vFace[i].PrevAng < -0.1) or ( bInvert and vFace[j].PrevAng < -0.1) then if ( not bInvert and vFace[i].PrevAng < -0.1) or ( bInvert and vFace[j].PrevAng < -0.1) then
dSal = -WHISK_SAFE -- se faccia precedente inclinata verso il basso
if not bInvert and h and vFace[h].Norm:getZ() < -0.017 then
dSal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
elseif bInvert and j and vFace[j].Norm:getZ() < -0.017 then
dSal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
else
dSal = -WHISK_SAFE
end
end end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
-- assegno i dati di uscita (sicurezza solo se angolo interno) -- assegno i dati di uscita (sicurezza solo se angolo interno)
@@ -1823,7 +1873,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, nLeadOut) EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, nLeadOut)
local dEal = 0 local dEal = 0
if ( not bInvert and vFace[j].PrevAng < -0.1) or ( bInvert and vFace[i].PrevAng < -0.1) then if ( not bInvert and vFace[j].PrevAng < -0.1) or ( bInvert and vFace[i].PrevAng < -0.1) then
dEal = -WHISK_SAFE -- se faccia precedente inclinata verso il basso
if not bInvert and j and vFace[j].Norm:getZ() < -0.017 then
dEal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
elseif bInvert and h and vFace[h].Norm:getZ() < -0.017 then
dEal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
else
dEal = -WHISK_SAFE
end
end end
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- posizione braccio porta testa -- posizione braccio porta testa
@@ -1979,7 +2036,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
end end
-- altrimenti provo con la sega a catena -- altrimenti provo con la sega a catena
elseif sSawing then elseif sSawing then
local nCsOk, sCSErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) local nCsOk, sCsErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
if nCsOk == 0 then return false, sCsErr end if nCsOk == 0 then return false, sCsErr end
bDone = ( dThick ~= nil) bDone = ( dThick ~= nil)
-- se ci sono almeno due facce e lavorato almeno un angolo -- se ci sono almeno due facce e lavorato almeno un angolo
@@ -2069,7 +2126,8 @@ local function MakeByMill( Proc, nRawId, b3Raw)
local bToolInv = ( vtExtr:getZ() < -0.1) local bToolInv = ( vtExtr:getZ() < -0.1)
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
-- recupero la lavorazione -- recupero la lavorazione
local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, true) local bTipFeed = EgtIf( nTool_ID, false, true)
local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, bTipFeed)
if not sMilling then if not sMilling then
local sErr = 'Error : milling not found in library' local sErr = 'Error : milling not found in library'
if nTool_ID then sErr = sErr .. ' (Tool_ID=' .. tostring( nTool_ID) .. ')' end if nTool_ID then sErr = sErr .. ' (Tool_ID=' .. tostring( nTool_ID) .. ')' end
+216 -122
View File
@@ -1,4 +1,4 @@
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/02/04 -- WProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22
-- Gestione calcolo mezzo-legno per Pareti -- Gestione calcolo mezzo-legno per Pareti
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant). -- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli. -- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
@@ -10,6 +10,11 @@
-- 2022/02/03 DS Gorge larga come gambo più sicurezza. -- 2022/02/03 DS Gorge larga come gambo più sicurezza.
-- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno. -- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno.
-- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca. -- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca.
-- 2022/10/05 In MakeSideGrooveByMill implementata l'inversione dello step se la tasca guarda verso il basso
-- 2022/11/15 DS Con lama massima inclinazione 60deg.
-- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato.
-- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce.
-- 2023/03/09 Gestito caso riconoscimento errato Stype 3
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPL = {} local WPL = {}
@@ -113,7 +118,7 @@ function WPL.Classify( Proc, b3Raw)
vtN[1] = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) vtN[1] = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
vtN[2] = EgtSurfTmFacetNormVersor( Proc.Id, 1, GDB_ID.ROOT) vtN[2] = EgtSurfTmFacetNormVersor( Proc.Id, 1, GDB_ID.ROOT)
-- verifico se è lavorabile da sopra o di fianco -- verifico se è lavorabile da sopra o di fianco
return ( vtN[1]:getZ() >= - 0.01 or vtN[2]:getZ() >= - 0.01) return ( vtN[1]:getZ() >= - 0.028 or vtN[2]:getZ() >= - 0.028)
-- se più di 2 facce -- se più di 2 facce
else else
local nFacInd, dElev, nFacInd2, dElev2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId) local nFacInd, dElev, nFacInd2, dElev2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId)
@@ -138,6 +143,26 @@ function WPL.Classify( Proc, b3Raw)
bAllowNegativeFace = true bAllowNegativeFace = true
end end
end end
-- conto le adiacenze delle facce
local vAdj = {}
local nFacesWithMoreThanOneAdj = 0
for i = 1, Proc.Fct do
-- recupero le adiacenze del loop esterno
local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1]
-- le conto
local nCount = 0
for j = 1, #vFacAdj do
if vFacAdj[j] >= 0 then
nCount = nCount + 1
end
end
vAdj[i] = nCount
if nCount > 1 then
nFacesWithMoreThanOneAdj = nFacesWithMoreThanOneAdj + 1
end
end
-- verifico se la faccia è lavorabile da sopra o di fianco -- verifico se la faccia è lavorabile da sopra o di fianco
if ( vtN:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and ( vtN:getZ() > - 0.01 or bAllowNegativeFace))) then if ( vtN:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and ( vtN:getZ() > - 0.01 or bAllowNegativeFace))) then
Proc.Stype = 1 Proc.Stype = 1
@@ -151,7 +176,7 @@ function WPL.Classify( Proc, b3Raw)
Proc.Stype = 2 Proc.Stype = 2
return ( vtN2:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and vtN2:getZ() > - 0.01)) return ( vtN2:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and vtN2:getZ() > - 0.01))
-- se tre facce -- se tre facce
elseif Proc.Fct == 3 then elseif Proc.Fct == 3 and nFacesWithMoreThanOneAdj < 2 then
-- verifico se U da sopra -- verifico se U da sopra
-- dati della faccia -- dati della faccia
local nFac2 = EgtIf( nFacInd == 0, 1, 0) local nFac2 = EgtIf( nFacInd == 0, 1, 0)
@@ -1374,10 +1399,18 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, dMaxDepthOnSide, bEnablePreMill, bMachFromDn, dAng, bAsEnablePreMill, nSinglePass) local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, dMaxDepthOnSide, bEnablePreMill, bMachFromDn, dAng, bAsEnablePreMill, nSinglePass, bExcludeFinishing)
-- dati della faccia local sWarn
-- dati della faccia principale (la più verticale)
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacet, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacet, GDB_ID.ROOT)
local dElev = WL.GetFaceElevation( Proc.Id, nFacet, nRawId) local dElev = WL.GetFaceElevation( Proc.Id, nFacet, nRawId)
-- dati della faccia più orizzontale
local nOtherFacet = abs( nFacet - 1)
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nOtherFacet, GDB_ID.ROOT)
local dElevOtherFacet = WL.GetFaceElevation( Proc.Id, nOtherFacet, nRawId)
-- se lap joint 2 facce dal basso e angolo negativo
local bExcludeSideMill = Proc.Fct == 2 and vtN:getZ() < -0.01 and vtN2:getZ() < -0.01
-- dimensioni della faccia principale
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT)
local dThick = min( dH, dV) local dThick = min( dH, dV)
local frFace = Frame3d( ptC, vtN) local frFace = Frame3d( ptC, vtN)
@@ -1792,121 +1825,138 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
end end
end end
-- inserisco la lavorazione di ribasso o gola
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) -- se la groove è rivolta verso il basso (-85°) lavoro a salire con step negativo
local nMchFId = EgtAddMachining( sName, sMilling) local bUpwardMilling = false
if not nMchFId then if Proc.Fct == 2 and vtN2:getZ() < -0.996 then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling bUpwardMilling = true
EgtOutLog( sErr)
return false, sErr
end end
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
-- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama local dStepOri
if bEnablePreMill or bAsEnablePreMill then if not bExcludeSideMill then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) -- inserisco la lavorazione di ribasso o gola
end local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
-- aggiungo geometria local nMchFId = EgtAddMachining( sName, sMilling)
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) if not nMchFId then
-- imposto posizione braccio porta testa local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
--local nSCC = MCH_SCC.ADIR_ZP EgtOutLog( sErr)
--if abs( vtN:getZ()) < GEO.EPS_SMALL then return false, sErr
-- nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
--end
local nSCC = MCH_SCC.ADIR_NEAR
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto modo di lavorare la faccia
local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione e step
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
end end
end EgtSetInfo( nMchFId, 'Part', Proc.PartId)
EgtSetMachiningParam( MCH_MP.STEP, dStep) -- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';') if bEnablePreMill or bAsEnablePreMill then
-- setto il lato di lavoro standard EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
EgtSetMachiningParam( MCH_MP.INVERT, true) end
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) -- aggiungo geometria
-- modifico ingressi e uscita EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
-- se ho inserito il pretaglio modifico -- imposto posizione braccio porta testa
if bEnablePreMill or bAsEnablePreMill then --local nSCC = MCH_SCC.ADIR_ZP
if nModifyLeadInOut > 0 then --if abs( vtN:getZ()) < GEO.EPS_SMALL then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita -- nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
if dElev > ( 0.5 * dMillDiam) then --end
if nModifyLeadInOut == 1 then local nSCC = MCH_SCC.ADIR_NEAR
-- setto il tipo di passo a una via EgtSetMachiningParam( MCH_MP.SCC, nSCC)
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY) -- imposto modo di lavorare la faccia
-- modifico il tipo di uscita local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione e step
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
dStepOri = dStep
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
end
end
if bUpwardMilling then
dStep = -dStep
end
EgtSetMachiningParam( MCH_MP.STEP, dStep)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
-- setto il lato di lavoro standard
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- modifico ingressi e uscita
-- se ho inserito il pretaglio modifico
if bEnablePreMill or bAsEnablePreMill then
if nModifyLeadInOut > 0 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
if nModifyLeadInOut == 1 then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
-- modifico il tipo di uscita
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
else
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
end
end
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
else
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto allungamenti perpendicolari
EgtSetMachiningParam( MCH_MP.LIPERP, 0) EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5) end
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd)) end
else -- se richiesto, setto la nota per spostare la lavorazione alla fine
EgtSetMachiningParam( MCH_MP.LIPERP, dElev) if not WD.SIDEMILL_BEFORE then
EgtSetMachiningParam( MCH_MP.LOPERP, dElev) EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
if nModifyLeadInOut > 0 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
end
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end end
end end
-- setto allungamenti iniziali e finali -- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
if bInvertMach then -- se richiesto, setto la nota per spostare la lavorazione alla fine
-- setto il lato di lavoro invertito if not WD.SIDEMILL_BEFORE then
EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
else
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto allungamenti perpendicolari
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
end end
end end
-- se richiesto, setto la nota per spostare la lavorazione alla fine -- eseguo
if not WD.SIDEMILL_BEFORE then if not EgtApplyMachining( true, false) then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end end
else else
if nModifyLeadInOut > 0 then sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed'
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita EgtOutLog( sWarn)
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
end
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
end
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end end
-- verifico se devo lavorare anche la seconda faccia basandomi sul valore dell'angolo interno -- verifico se devo lavorare anche la seconda faccia basandomi sul valore dell'angolo interno
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL then if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
local nOtherFacet = abs( nFacet - 1)
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = EgtAddMachining( sName, sMilling)
@@ -1919,7 +1969,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nOtherFacet}}) EgtSetMachiningGeometry( {{ Proc.Id, nOtherFacet}})
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nOtherFacet, GDB_ID.ROOT)
local nSCC = MCH_SCC.ADIR_ZP local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtN2, Z_AX()) then if AreSameOrOppositeVectorApprox( vtN2, Z_AX()) then
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP) nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
@@ -1927,12 +1976,25 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto modo di lavorare la faccia -- imposto modo di lavorare la faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFace2ndFace) EgtSetMachiningParam( MCH_MP.FACEUSE, nFace2ndFace)
EgtSetMachiningParam( MCH_MP.STEP, 0)
local dMaxElev = dMaxMat local dMaxElev = dMaxMat
local dStepOtherFace = 0
local dDepthOtherFace = dMaxMat
if Proc.Fct == 2 and abs( vtN2:getZ()) > 0.99 and abs( vtN2:getZ()) < 1.01 then
dStepOtherFace = dStepOri or EgtGetMachiningParam( MCH_MP.STEP)
if dStepOtherFace < GEO.EPS_SMALL then dStepOtherFace = 0.75 * dMaxMat end
local nStepOtherFace = ceil( ( dElevOtherFacet - dMaxMat) / dStepOtherFace)
dStepOtherFace = max( ( dElevOtherFacet - dMaxMat) / max( nStepOtherFace, 1), 0)
dMaxElev = max( ( nStepOtherFace + 1) * dStepOtherFace - GEO.EPS_SMALL, 0)
dDepthOtherFace = dElevOtherFacet
end
if bUpwardMilling then
dStepOtherFace = -dStepOtherFace
end
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';') EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
if bMachFromDn then if bMachFromDn then
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) EgtSetMachiningParam( MCH_MP.DEPTH, dDepthOtherFace)
else else
EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.INVERT, false)
end end
@@ -1978,7 +2040,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
end end
-- se richiesto, setto la nota per spostare la lavorazione alla fine -- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then if bEnablePreMill or bAsEnablePreMill or not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end end
else else
@@ -2012,9 +2074,12 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
EgtSetOperationMode( nMchFId, false) EgtSetOperationMode( nMchFId, false)
return false, sErr return false, sErr
end end
elseif bExcludeSideMill then
local sErr = 'Feature not machinable by orientation'
EgtOutLog( sErr)
return false, sErr
end end
return true, sWarn
return true
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2027,6 +2092,10 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
-- gruppo ausiliario -- gruppo ausiliario
local nAddGrpId = WL.GetAddGroup( Proc.PartId) local nAddGrpId = WL.GetAddGroup( Proc.PartId)
local nNewProc, nNumFacet = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet) local nNewProc, nNumFacet = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
-- se una sola faccia
if Proc.Fct == 1 then
dDiam = 2 * dDiam
end
-- se forma ad L -- se forma ad L
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc.Id, Proc.Fct) or TestElleShape4( Proc.Id, Proc.Fct) == 2) local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc.Id, Proc.Fct) or TestElleShape4( Proc.Id, Proc.Fct) == 2)
if bIsL then if bIsL then
@@ -2067,8 +2136,9 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
local dMillDiam = 20 local dMillDiam = 20
local dMaxDepth = 0 local dMaxDepth = 0
local dThDiam = 100 local dThDiam = 100
local sTuuid
if EgtMdbSetCurrMachining( sPocketing) then if EgtMdbSetCurrMachining( sPocketing) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
@@ -2135,7 +2205,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
else else
EgtErase( nNewProc) EgtErase( nNewProc)
end end
return true, sWarn return true, sWarn, sTuuid
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -2198,7 +2268,8 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
-- se equivalente ad un contorno -- se equivalente ad un contorno
if abs( ptP1:getZ() - ptP2:getZ()) > 0.9 * b3Raw:getDimZ() then if abs( ptP1:getZ() - ptP2:getZ()) > 0.9 * b3Raw:getDimZ() then
-- verifico ordinamento (esterno a destra) -- verifico ordinamento (esterno a destra)
if ( vtN[1] ^ ( ptP1 - ptC[1])) * Z_AX() < 0 then local ptPM = ( ptP1 + ptP2) / 2
if ( vtN[1] ^ ( ptPM - ptC[1])) * Z_AX() < 0 then
EgtSurfTmSwapFacets( Proc.Id, 0, 1) EgtSurfTmSwapFacets( Proc.Id, 0, 1)
end end
-- applico lavorazione di contorno libero -- applico lavorazione di contorno libero
@@ -2313,11 +2384,12 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local vtNTemp = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
local dSideDist local dSideDist
local ptMid = ( ptP1 + ptP2) / 2 local ptMid = ( ptP1 + ptP2) / 2
-- faccia orizzontale -- faccia orizzontale
local nFacet = EgtIf( vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2) local nFacet = EgtIf( vtNTemp:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
-- faccia verticale -- faccia verticale
local nFacetVert = EgtIf( nFacet == nFacInd, nFacInd2, nFacInd) local nFacetVert = EgtIf( nFacet == nFacInd, nFacInd2, nFacInd)
local vtNV = EgtSurfTmFacetNormVersor( Proc.Id, nFacetVert, GDB_ID.ROOT) local vtNV = EgtSurfTmFacetNormVersor( Proc.Id, nFacetVert, GDB_ID.ROOT)
@@ -2369,8 +2441,13 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
if bEnableMillOnSide and dMaxDepthOnSide > 0 then if bEnableMillOnSide and dMaxDepthOnSide > 0 then
bLikeAsMakeFirstGroove = false bLikeAsMakeFirstGroove = false
return MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove) return MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove)
elseif MakeByMill( Proc, nFacet, 1 - nFacet, nRawId, b3Raw, dSideDist) then else
return true local bOk, sErr = MakeByMill( Proc, nFacet, 1 - nFacet, nRawId, b3Raw, dSideDist)
-- se angolo ottuso riprendo il lato quasi verticale
if bOk and dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
local bOk2, sErr2 = MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, false, nil, true)
end
return bOk, sErr
end end
elseif bEnableMillOnSide and dMaxDepthOnSide > 0 then elseif bEnableMillOnSide and dMaxDepthOnSide > 0 then
bLikeAsMakeFirstGroove = true bLikeAsMakeFirstGroove = true
@@ -2378,9 +2455,27 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
if bOk then return true end if bOk then return true end
end end
-- se non inclinate o capacità di taglio non sufficiente o non molto grandi (80mm), provo con contornatura o svuotatura -- se non inclinate o capacità di taglio non sufficiente o non molto grandi (80mm), provo con contornatura o svuotatura
if not sCutting or dSawMaxDepth < dDimY[1] + WD.CUT_SIC or dSawMaxDepth < dDimY[2] + WD.CUT_SIC or dDimY[1] < 80 or dDimY[2] < 80 then if vtN:getZ() > 0.866 or vtNV:getZ() > 0.866 or not sCutting or dSawMaxDepth < dDimY[1] + WD.CUT_SIC or dSawMaxDepth < dDimY[2] + WD.CUT_SIC or dDimY[1] < 80 or dDimY[2] < 80 then
-- eseguo la svuotatura -- eseguo la svuotatura
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw) local bOk, sErr, sTuuid = MakeByPocketing( Proc, nFacet, nRawId, b3Raw)
-- se angolo ottuso riprendo il lato quasi verticale
if bOk and dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
local _, dHVert, dVVert = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacetVert, GDB_ID.ROOT)
local dDepth = min( dHVert, dVVert)
local _, dHHor, dVHor = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT)
local dDiam = 2 * min( dHHor, dVHor)
local sMillObtuseAngle = WM.FindMilling( 'FreeContour', dDepth, sTuuid, nil, dDiam, nil, nil, nil)
if not sMillObtuseAngle then
sMillObtuseAngle = WM.FindMilling( 'FreeContour', dDepth, nil, nil, dDiam, nil, nil, nil)
end
if not sMillObtuseAngle then
local sErrMillNotFound = 'Error : Processing to finish obtuse angle not found in library'
EgtOutLog( sErrMillNotFound)
return true, sErrMillNotFound
end
local bOk2, sErr2 = MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, sMillObtuseAngle, dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, false, nil, true)
end
return bOk, sErr
end end
-- se una delle due facce rivolta verso il basso -- se una delle due facce rivolta verso il basso
elseif vtN[1]:getZ() < -0.001 or vtN[2]:getZ() < -0.001 then elseif vtN[1]:getZ() < -0.001 or vtN[2]:getZ() < -0.001 then
@@ -2538,7 +2633,6 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
local sErr = 'Side milling not possible' local sErr = 'Side milling not possible'
EgtOutLog( sErr) EgtOutLog( sErr)
return true, sErr return true, sErr
end end
-- fessura verticale -- fessura verticale
elseif Proc.Stype == 3 then elseif Proc.Stype == 3 then
+20 -7
View File
@@ -1,5 +1,6 @@
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20 -- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
-- Gestione calcolo marcatura per Pareti -- Gestione calcolo marcatura per Pareti
-- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPMK = {} local WPMK = {}
@@ -33,8 +34,13 @@ function WPMK.Classify( Proc, b3Raw)
if not vtN then if not vtN then
return false return false
end end
-- verifico se la marcatura è lavorabile (solo da sopra) -- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
return ( vtN:getZ() > WD.NZ_MINA) local dMinZRaw = b3Raw:getMin():getZ()
local b3Tab = EgtGetTableArea()
local dMaxZTable = b3Tab:getMax():getZ()
local dDeltaZ = dMinZRaw - dMaxZTable
local MIN_Z_OFFSET = 100
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
end end
---------------------------------------------------------------------- ----------------------------------------------------------------------
@@ -79,11 +85,18 @@ function WPMK.Make( Proc, nRawId, b3Raw)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- verifico che la marcatura non sia orientata verso il basso -- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
if vtExtr:getZ() < WD.NZ_MINA then local dMinZRaw = b3Raw:getMin():getZ()
local sErr = 'Error : Mark from bottom impossible' local b3Tab = EgtGetTableArea()
EgtOutLog( sErr) local dMaxZTable = b3Tab:getMax():getZ()
return false, sErr local dDeltaZ = dMinZRaw - dMaxZTable
local MIN_Z_OFFSET = 99.9
if vtExtr:getZ() < WD.NZ_MINA then
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
local sErr = 'Error : Mark from bottom impossible'
EgtOutLog( sErr)
return false, sErr
end
end end
-- recupero la lavorazione -- recupero la lavorazione
local sMilling = WM.FindMilling( 'Text') local sMilling = WM.FindMilling( 'Text')
+20 -7
View File
@@ -1,5 +1,6 @@
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30 -- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
-- Gestione calcolo mortase per Pareti -- Gestione calcolo mortase per Pareti
-- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPM = {} local WPM = {}
@@ -45,8 +46,13 @@ function WPM.Classify( Proc, b3Raw)
return true return true
-- altrimenti è chiusa -- altrimenti è chiusa
else else
-- verifico se la mortasa è lavorabile da sopra -- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
return ( vtN:getZ() > WD.NZ_MINA) local dMinZRaw = b3Raw:getMin():getZ()
local b3Tab = EgtGetTableArea()
local dMaxZTable = b3Tab:getMax():getZ()
local dDeltaZ = dMinZRaw - dMaxZTable
local MIN_Z_OFFSET = 99.9
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
end end
end end
@@ -182,11 +188,18 @@ function WPM.Make( Proc, nRawId, b3Raw)
local bForceOneSide local bForceOneSide
local bRevertSide local bRevertSide
if bClosedBtm then if bClosedBtm then
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) -- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
if vtN:getZ() < WD.NZ_MINA then local dMinZRaw = b3Raw:getMin():getZ()
local sErr = 'Error : Mortise from bottom impossible' local b3Tab = EgtGetTableArea()
EgtOutLog( sErr) local dMaxZTable = b3Tab:getMax():getZ()
return false, sErr local dDeltaZ = dMinZRaw - dMaxZTable
local MIN_Z_OFFSET = 100
if vtExtr:getZ() < WD.NZ_MINA then
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
local sErr = 'Error : Mortise from bottom impossible'
EgtOutLog( sErr)
return false, sErr
end
end end
-- altrimenti passante -- altrimenti passante
else else
+7 -7
View File
@@ -1,4 +1,4 @@
-- WallExec.lua by Egaltech s.r.l. 2022/05/12 -- WallExec.lua by Egaltech s.r.l. 2023/03/06
-- Libreria esecuzione lavorazioni per Pareti -- Libreria esecuzione lavorazioni per Pareti
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -75,22 +75,22 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
end end
if sOrigCorner == 'TL' then if sOrigCorner == 'TL' then
nCorner = MCH_CR.TL nCorner = MCH_CR.TL
OrigOnTab = Point3d( 0, b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'BL' then elseif sOrigCorner == 'BL' then
nCorner = MCH_CR.BL nCorner = MCH_CR.BL
OrigOnTab = Point3d( 0, abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'TR' then elseif sOrigCorner == 'TR' then
nCorner = MCH_CR.TR nCorner = MCH_CR.TR
OrigOnTab = Point3d( b3Tab:getDimX(), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'BR' then elseif sOrigCorner == 'BR' then
nCorner = MCH_CR.BR nCorner = MCH_CR.BR
OrigOnTab = Point3d( b3Tab:getDimX(), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'TM' then elseif sOrigCorner == 'TM' then
nCorner = MCH_CR.TR nCorner = MCH_CR.TR
OrigOnTab = Point3d( WD.MID_REF, b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'BM' then elseif sOrigCorner == 'BM' then
nCorner = MCH_CR.BR nCorner = MCH_CR.BR
OrigOnTab = Point3d( WD.MID_REF, abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
end end
-- Impostazione dell'attrezzaggio di default -- Impostazione dell'attrezzaggio di default
EgtImportSetup() EgtImportSetup()
+6 -5
View File
@@ -349,16 +349,17 @@ if not bManualRot then
local nRotateOpt = 0 local nRotateOpt = 0
if #RotateFeatureStates > 0 then if #RotateFeatureStates > 0 then
-- calcolo lato con punteggio minore o molteplicita' piu' alta -- calcolo lato con punteggio minore o molteplicita' piu' alta
local nRotMax = 0 local nRotMax = MinList[1].Rot
local nScoreMax = 0 local nScoreMax = MinList[1].Score
local nScoreCnt = 0 local nScoreCnt = MinList[1].ScoreCnt
for nInd = 1, #MinList do for nInd = 2, #MinList do
if MinList[nInd].Score > nScoreMax then if MinList[nInd].Score > nScoreMax then
nRotMax = MinList[nInd].Rot nRotMax = MinList[nInd].Rot
nScoreMax = MinList[nInd].Score nScoreMax = MinList[nInd].Score
nScoreCnt = MinList[nInd].ScoreCnt nScoreCnt = MinList[nInd].ScoreCnt
elseif MinList[nInd].Score == nScoreMax then elseif MinList[nInd].Score == nScoreMax then
if MinList[nInd].ScoreCnt > nScoreCnt then -- se punteggio > 0 conservo quello con molteplicità più alta, se punteggio = 0 conservo quello con molteplicità più bassa
if ( nScoreMax ~= 0 and MinList[nInd].ScoreCnt > nScoreCnt) or ( nScoreMax == 0 and MinList[nInd].ScoreCnt < nScoreCnt) then
nRotMax = MinList[nInd].Rot nRotMax = MinList[nInd].Rot
nScoreMax = MinList[nInd].Score nScoreMax = MinList[nInd].Score
nScoreCnt = MinList[nInd].ScoreCnt nScoreCnt = MinList[nInd].ScoreCnt
+105 -89
View File
@@ -1,4 +1,4 @@
-- NestProcess.lua by Egaltech s.r.l. 2022/06/23 -- NestProcess.lua by Egaltech s.r.l. 2022/11/24
-- Gestione nesting automatico pareti -- Gestione nesting automatico pareti
-- Intestazioni -- Intestazioni
@@ -509,80 +509,84 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
local vPartProc = WE.CollectFeatures( nPartId) local vPartProc = WE.CollectFeatures( nPartId)
for nInd = 1, #vPartProc do repeat for nInd = 1, #vPartProc do repeat
if Drill.Identify( vPartProc[nInd]) then if Drill.Identify( vPartProc[nInd]) then
-- identifico su quali facce si trova il foro -- identifico su quali facce si trova il foro
local bOpen = ( vPartProc[nInd].Fcs ~= 0 and vPartProc[nInd].Fce ~= 0) local bOpen = ( vPartProc[nInd].Fcs ~= 0 and vPartProc[nInd].Fce ~= 0)
local AuxId = EgtGetInfo( vPartProc[nInd].Id, 'AUXID', 'i') or 0 local AuxId = EgtGetInfo( vPartProc[nInd].Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + vPartProc[nInd].Id end if AuxId then AuxId = AuxId + vPartProc[nInd].Id end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB) -- verifico se diametro compatibile con la punta
local dLen = abs( EgtCurveThickness( AuxId)) local dDiam = 2 * EgtArcRadius( AuxId)
local bLong = dLen > WD.HOR_DRILL_LEN - 1 if abs( dDiam - WD.HOR_DRILL_DIAM) < WD.DRILL_TOL + GEO.EPS_SMALL then
local bOnlyOnRef = dLen + dDeltaRaw > WD.HOR_DRILL_LEN - GEO.EPS_SMALL and not bLong local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
local dLen = abs( EgtCurveThickness( AuxId))
-- faccia Front local bLong = dLen > WD.HOR_DRILL_LEN - 1
local dTol = GEO.EPS_SMALL local bOnlyOnRef = dLen + dDeltaRaw > WD.HOR_DRILL_LEN - GEO.EPS_SMALL and not bLong
if ( abs( ptDrill:getY() - ptPartMin:getY()) < dTol) then
DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
if bOpen then
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
else
DrillOnFaces.F.closed = true
end
if bLong then
DrillOnFaces.F.long = true
if bOpen then DrillOnFaces.B.long = true end
end
-- faccia Back -- faccia Front
elseif ( abs( ptDrill:getY() - ptPartMax:getY()) < dTol) then local dTol = GEO.EPS_SMALL
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1 if ( abs( ptDrill:getY() - ptPartMin:getY()) < dTol) then
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
if bOpen then
DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1 DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
else if bOpen then
DrillOnFaces.B.closed = true DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
end if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
if bLong then else
DrillOnFaces.B.long = true DrillOnFaces.F.closed = true
if bOpen then DrillOnFaces.F.long = true end
end end
if bLong then
-- faccia Left DrillOnFaces.F.long = true
elseif ( abs( ptDrill:getX() - ptPartMin:getX()) < dTol) then if bOpen then DrillOnFaces.B.long = true end
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1 end
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
if bOpen then -- faccia Back
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1 elseif ( abs( ptDrill:getY() - ptPartMax:getY()) < dTol) then
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
else if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
DrillOnFaces.L.closed = true if bOpen then
end DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
else
DrillOnFaces.B.closed = true
end
if bLong then if bLong then
DrillOnFaces.L.long = true DrillOnFaces.B.long = true
if bOpen then DrillOnFaces.R.long = true end if bOpen then DrillOnFaces.F.long = true end
end end
-- faccia Right -- faccia Left
elseif ( abs( ptDrill:getX() - ptPartMax:getX()) < dTol) then elseif ( abs( ptDrill:getX() - ptPartMin:getX()) < dTol) then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1 DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
if bOpen then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
else if bOpen then
DrillOnFaces.R.closed = true DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
end if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
if bLong then else
DrillOnFaces.R.long = true DrillOnFaces.L.closed = true
if bOpen then DrillOnFaces.L.long = true end end
if bLong then
DrillOnFaces.L.long = true
if bOpen then DrillOnFaces.R.long = true end
end
-- faccia Right
elseif ( abs( ptDrill:getX() - ptPartMax:getX()) < dTol) then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
if bOpen then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
else
DrillOnFaces.R.closed = true
end
if bLong then
DrillOnFaces.R.long = true
if bOpen then DrillOnFaces.L.long = true end
end
end end
end end
end end
until true until true
@@ -1574,33 +1578,33 @@ local function AddParts(RawParts, vPartsDoneManually)
end end
nOutline, nCnt = EgtGetSurfTmSilhouette( SolidId, Z_AX(), 10, nOutlineLayer, GDB_RT.GLOB) nOutline, nCnt = EgtGetSurfTmSilhouette( SolidId, Z_AX(), 10, nOutlineLayer, GDB_RT.GLOB)
EgtBeamShowSolid( nPartId, false) EgtBeamShowSolid( nPartId, false)
for nInd = 0, nCnt - 1 do for nInd = 0, nCnt - 1 do
EgtSetName( nOutline + nInd, 'ON_TMP') EgtSetName( nOutline + nInd, 'ON_TMP')
EgtSetStatus( nOutline + nInd, 0) EgtSetStatus( nOutline + nInd, 0)
end end
local nCurrOutline = nOutline local nCurrOutline = nOutline
if nCnt > 0 then if nCnt > 0 then
local frSum local frSum
EgtScale( nOutline, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB) EgtScale( nOutline, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB)
EgtModifyCurveExtrusion( nOutline, Z_AX(), GDB_RT.GLOB) EgtModifyCurveExtrusion( nOutline, Z_AX(), GDB_RT.GLOB)
-- verifico che la prima curva sia l'unico loop esterno -- verifico che la prima curva sia l'unico loop esterno
local vCrvRef = EgtCurveArea( nOutline) local vtCrvRefN = EgtCurveArea( nOutline)
for nInd = 1, nCnt - 1 do for nInd = 1, nCnt - 1 do
local vCrv = EgtCurveArea( nOutline + nInd) local vtCrvN = EgtCurveArea( nOutline + nInd)
-- se trovo più loop esterni uso come contorno quello del box (quindi forzo nCurrOutline a nil) -- se trovo più loop esterni uso come contorno quello del box (quindi forzo nCurrOutline a nil)
if abs( vCrv * vCrvRef - 1) < GEO.EPS_SMALL then if vtCrvN and vtCrvRefN and AreSameVectorApprox( vtCrvN, vtCrvRefN) then
nCurrOutline = nil nCurrOutline = nil
for nInd2 = 0, nCnt - 1 do for nInd2 = 0, nCnt - 1 do
EgtErase( nOutline + nInd2) EgtErase( nOutline + nInd2)
end end
nCnt = 1 nCnt = 1
break break
end end
end end
--local frSum = EgtSurfFlatRegion(nOutlineLayer, nOutline) --local frSum = EgtSurfFlatRegion(nOutlineLayer, nOutline)
--EgtSaveFile("c:\\Temp\\ProvaNesting.nge") --EgtSaveFile("c:\\Temp\\ProvaNesting.nge")
-- -- per ogni contorno creo flat region e le sommo -- -- per ogni contorno creo flat region e le sommo
@@ -1626,7 +1630,7 @@ local function AddParts(RawParts, vPartsDoneManually)
-- EgtErase(nOutline + nIndex) -- EgtErase(nOutline + nIndex)
-- end -- end
end end
if nCurrOutline and nCurrOutline ~= GDB_ID.NULL then if nCurrOutline and nCurrOutline ~= GDB_ID.NULL then
nOutline = nCurrOutline nOutline = nCurrOutline
else else
@@ -1769,11 +1773,11 @@ local function AddParts(RawParts, vPartsDoneManually)
end end
-- aggiungo finestre -- aggiungo finestre
for nInd = 1, nCnt - 1 do for nInd = 1, nCnt - 1 do
local tmp1, tmp2, area = EgtCurveArea( nOutline + nInd) local _, _, dArea = EgtCurveArea( nOutline + nInd)
if area > WD.NEST_HOLE_MIN_AREA then if dArea and dArea > WD.NEST_HOLE_MIN_AREA then
EgtModifyCurveExtrusion( nOutline + nInd, Z_AX(), GDB_RT.GLOB) EgtModifyCurveExtrusion( nOutline + nInd, Z_AX(), GDB_RT.GLOB)
EgtAutoNestAddHoleToPart( nPartId, nOutline + nInd) EgtAutoNestAddHoleToPart( nPartId, nOutline + nInd)
end end
end end
-- aggiungo aree di lavorazione del pezzo -- aggiungo aree di lavorazione del pezzo
@@ -2177,21 +2181,33 @@ if bNestingOk then
end end
end end
-- se è lap joint dall'alto -- se è lap joint dall'alto
if nFaceInd ~= -1 and nFaceDownInd == -1 then if nFaceInd ~= -1 and nFaceDownInd == -1 then
local bResetQ = false
local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT) local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT)
-- se all'interno rimuovo info Q -- se all'interno rimuovo info Q
if EnclosesPointXY( b3Raw, ptCen) then if EnclosesPointXY( b3Raw, ptCen) then
bResetQ = true
elseif Proc.Fct == 2 then
-- se non è interno ma ha 2 facce non ortogonali rimuovo info Q
local vtN1 = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, 1, GDB_ID.ROOT)
if abs( vtN1 * vtN2) > GEO.EPS_SMALL then
bResetQ = true
end
end
if bResetQ then
-- resetto parametro Q -- resetto parametro Q
if Proc.Prc == 30 then if Proc.Prc == 30 then
EgtRemoveInfo( Proc.Id, "Q08") EgtRemoveInfo( Proc.Id, "Q08")
EgtRemoveInfo( Proc.Id, "Q08A") EgtRemoveInfo( Proc.Id, "Q08A")
else else
EgtRemoveInfo( Proc.Id, "Q03") EgtRemoveInfo( Proc.Id, "Q03")
EgtRemoveInfo( Proc.Id, "Q03A") EgtRemoveInfo( Proc.Id, "Q03A")
end end
end end
end end
elseif DoubleCut.Identify( Proc) then elseif DoubleCut.Identify( Proc) then
-- verifico se due facce e rivolto verso l'alto -- verifico se due facce e rivolto verso l'alto
if Proc.Fct == 2 then if Proc.Fct == 2 then
+4
View File
@@ -0,0 +1,4 @@
-- Version.lua by Egalware s.r.l. 2023/03/08
-- Gestione della versione di Wall
VERSION = '2.5c4'