Compare commits
123 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a86f7798e | |||
| 6a6a194df6 | |||
| dcd600af01 | |||
| 854fafddf2 | |||
| ef6cbc35df | |||
| 2887591da4 | |||
| 3d75344652 | |||
| 1952c937b0 | |||
| 99baaa6320 | |||
| 3ac752861b | |||
| d690906180 | |||
| 1bf70aaf27 | |||
| e5a2a7e5a9 | |||
| b726fbc2cc | |||
| 0771665282 | |||
| 6ba42d19e9 | |||
| 374021ad13 | |||
| dfe405f3b0 | |||
| bd7885d245 | |||
| 1c19c48e55 | |||
| 9a40887d05 | |||
| 02e1bc7881 | |||
| 5791bea4b5 | |||
| 5b39d1a4ac | |||
| 62e00e8854 | |||
| 349f0cb879 | |||
| a53a6f3e63 | |||
| 4f2ffec3ab | |||
| b1dd887899 | |||
| b325ebcd32 | |||
| f17411326b | |||
| 4752ffcfb4 | |||
| dbf17d942c | |||
| 72020a8874 | |||
| 5d422b6edc | |||
| d2b3c32b61 | |||
| b4b3df0f5e | |||
| fdd114a8cd | |||
| d5e47c06fa | |||
| abc61f53ba | |||
| 6e7c4ffda1 | |||
| bfaa85bbf2 | |||
| 5c9e199c5a | |||
| 09127ce576 | |||
| 87cd31bef7 | |||
| 32fdaf5096 | |||
| 2ea09e3ebc | |||
| ce8072ad1b | |||
| 896c0296a4 | |||
| 88fd8d525c | |||
| 01c5037d77 | |||
| 34e7befc10 | |||
| 846d96b967 | |||
| cfd3379c98 | |||
| 6f06755539 | |||
| a0af959c9f | |||
| f397b66e26 | |||
| 31782b904e | |||
| 93fe741f84 | |||
| ba2158a909 | |||
| 6e0758218c | |||
| 401108ce56 | |||
| b7973541e4 | |||
| bf1e9065ae | |||
| 1faa9e2075 | |||
| ceef5b78f3 | |||
| 66e2bd6e45 | |||
| 0508f12673 | |||
| 2bbfe1f3ce | |||
| 4a67fdeeff | |||
| 1c86ed925a | |||
| 3f8540b3df | |||
| c92327641c | |||
| 499e49f4f6 | |||
| 099e81cbfd | |||
| 0f38de8f58 | |||
| d5e30baf06 | |||
| 4531434e79 | |||
| e56074f662 | |||
| 5866566ebe | |||
| c4272d917e | |||
| 52a10eeb9f | |||
| 1d5689c007 | |||
| f402590534 | |||
| b3289195f4 | |||
| f0a07554b2 | |||
| 1ed45a8569 | |||
| 43482f5a6d | |||
| e66831d223 | |||
| 548bc7bc6c | |||
| 3f7a2c016d | |||
| 3763338bb3 | |||
| 767acf2579 | |||
| 4da70c0d3c | |||
| d939e07fd3 | |||
| 67bf77fe19 | |||
| 384d72eb13 | |||
| 22541cfc9b | |||
| 1dac9716e7 | |||
| 68464cf5b1 | |||
| 78bf456326 | |||
| cb4d597369 | |||
| 7bcd159db0 | |||
| abed970b7a | |||
| 96760ac284 | |||
| 392040f8d6 | |||
| 56dc61a9d6 | |||
| ea5e62222c | |||
| 3b098e1541 | |||
| 354cbe85b9 | |||
| 25779abb81 | |||
| 1a4baaf1be | |||
| 20fccb24af | |||
| aa94102b28 | |||
| a2d89cd98d | |||
| 6e2e976675 | |||
| db5ae17d63 | |||
| 3e9da2724b | |||
| a1946a4a41 | |||
| 87cb7480be | |||
| 9563735770 | |||
| d1218915f7 | |||
| 19c7a54aa7 |
+4
-4
@@ -24,14 +24,14 @@ variables:
|
||||
$FileList = Get-ChildItem("*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\$FileName $FileName
|
||||
echo "lua54 -o bin\$FileName $FileName"
|
||||
lua54 -o bin\$FileName -s $FileName
|
||||
echo "lua54 -o bin\$FileName -s $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||
|
||||
+19
-4
@@ -14,6 +14,7 @@
|
||||
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
|
||||
-- 2023/04/09 Aggiunta gestione flag per taglio feature con outline (da WD.CUT_WITH_OUTLINE).
|
||||
-- 2023/04/17 Aggiunta gestione flag per rotazione grezzo di 180deg (da WD.RAWPART_ROT).
|
||||
-- 2024/02/20 Tolleranza su altezza pannello in grezzo portata a 0.1 mm.
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -232,6 +233,9 @@ if bToProcess then
|
||||
end
|
||||
else
|
||||
dExtraW = 10
|
||||
if WD.DEFAULT_RAW_NO_EXTRA_WIDTH then
|
||||
dExtraW = 0
|
||||
end
|
||||
dRawW = dRawW + dExtraW
|
||||
end
|
||||
end
|
||||
@@ -276,6 +280,11 @@ if bToProcess then
|
||||
-- Ne recupero la posizione
|
||||
for i = 1, #vWall do
|
||||
local PosX = EgtGetInfo( vWall[i].Id, 'POSX', 'd')
|
||||
local PosZ = EgtGetInfo( vWall[i].Id, 'POSZ', 'd')
|
||||
if bProj and WD.DEFAULT_RAW_NO_EXTRA_WIDTH and #vWall == 1 then
|
||||
PosX = 0
|
||||
PosZ = 0
|
||||
end
|
||||
vWall[i].PosX = PosX + min( dExtraL, 1200)
|
||||
if WD.USE_POSY then
|
||||
local PosY = EgtGetInfo( vWall[i].Id, 'POSY', 'd')
|
||||
@@ -283,7 +292,6 @@ if bToProcess then
|
||||
else
|
||||
vWall[i].PosY = 0
|
||||
end
|
||||
local PosZ = EgtGetInfo( vWall[i].Id, 'POSZ', 'd')
|
||||
vWall[i].PosZ = PosZ + dExtraW / 2
|
||||
end
|
||||
|
||||
@@ -348,7 +356,7 @@ if bToProcess then
|
||||
local vWallErr = {}
|
||||
for i = 2, #vWall do
|
||||
local dDimH = vWall[i].Box:getDimZ() + vWall[i].PosY
|
||||
if abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL then
|
||||
if abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL then
|
||||
table.insert( vWallErr, i)
|
||||
end
|
||||
end
|
||||
@@ -364,6 +372,12 @@ if bToProcess then
|
||||
PostErrView( WALL.ERR, WALL.MSG)
|
||||
return
|
||||
end
|
||||
|
||||
-- se impostato flag apposito, in vista il grezzo è uguale al pezzo
|
||||
if bProj and WD.DEFAULT_RAW_NO_EXTRA_WIDTH and #vWall == 1 then
|
||||
dRawL = vWall[1].Box:getDimX()
|
||||
dRawW = vWall[1].Box:getDimY()
|
||||
end
|
||||
|
||||
-- Verifico dimensioni massime grezzo
|
||||
if dRawL > WD.MAX_LENGTH + 10 * GEO.EPS_SMALL or dRawW > WD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > WD.MAX_HEIGHT + 10 * GEO.EPS_SMALL then
|
||||
@@ -497,7 +511,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or WALL.FLAG == 3 or WALL.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -561,7 +575,8 @@ if ( WALL.FLAG == 0 and ( bToProcess or bToRecalc)) or WALL.FLAG == 3 or WALL.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if WALL.FLAG == 0 or WALL.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( WALL.FLAG == 0 or WALL.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+11
-6
@@ -275,11 +275,15 @@ if bToProcess then
|
||||
dMinY = ( WD.MINRAWY_HOR_DRILL or 2800)
|
||||
end
|
||||
-- Assegno dimensioni del pannello
|
||||
dPanelLen = vWall[1].Box:getDimX() + 20
|
||||
dPanelWidth = math.max( vWall[1].Box:getDimY() + 20, dMinY)
|
||||
local dExtraW = 10
|
||||
if WD.DEFAULT_RAW_NO_EXTRA_WIDTH then
|
||||
dExtraW = 0
|
||||
end
|
||||
dPanelLen = vWall[1].Box:getDimX() + 2 * dExtraW
|
||||
dPanelWidth = math.max( vWall[1].Box:getDimY() + 2 * dExtraW, dMinY)
|
||||
-- Assegno posizione prima ed unica parete
|
||||
vWall[1].PosX = 10
|
||||
vWall[1].PosZ = 10
|
||||
vWall[1].PosX = dExtraW
|
||||
vWall[1].PosZ = dExtraW
|
||||
vWall[1].Rot = 0
|
||||
vWall[1].Flip = 0
|
||||
end
|
||||
@@ -545,7 +549,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or WALL.FLAG == 3 or WALL.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -609,7 +613,8 @@ if ( WALL.FLAG == 0 and ( bToProcess or bToRecalc)) or WALL.FLAG == 3 or WALL.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if WALL.FLAG == 0 or WALL.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( WALL.FLAG == 0 or WALL.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+26
-25
@@ -1,30 +1,31 @@
|
||||
|
||||
REM Compilazione degli script Wall Egaltech 2023.09.26
|
||||
REM Compilazione degli script Wall Egaltech 2024.03.24
|
||||
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\WallExec.lua LuaLibs\WallExec.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WFeatureTopology.lua LuaLibs\WFeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetWallData.lua GetWallData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Overturn.lua Overturn.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\Squaring.lua -s LuaLibs\Squaring.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallExec.lua -s LuaLibs\WallExec.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua -s LuaLibs\WallLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua -s LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua -s LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua -s LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua -s LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua -s LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WFeatureTopology.lua -s LuaLibs\WFeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua -s LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua -s LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua -s LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua -s LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua -s LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua -s LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua -s LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetWallData.lua -s GetWallData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua -s NestFlipAndRotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua -s NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Overturn.lua -s Overturn.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua -s Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua -s Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua
|
||||
|
||||
@@ -0,0 +1,491 @@
|
||||
-- Squaring.lua by Egaltech s.r.l. 2024/10/15
|
||||
-- Libreria squadratura pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Squaring = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
EgtOutLog( ' Squaring started', 1)
|
||||
|
||||
-- Dati
|
||||
local WD = require( 'WallData')
|
||||
local WM = require( 'WMachiningLib')
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function IsToolOk( Tool, dRawPartHeight)
|
||||
local bIsToolOk = false
|
||||
local bToolExists = false
|
||||
local bToolCanReachDepth = false
|
||||
local dMaxOvermaterial = 0
|
||||
if type( WD.SQUARING_MAX_OVERMATERIAL) == "number" then
|
||||
dMaxOvermaterial = WD.SQUARING_MAX_OVERMATERIAL
|
||||
end
|
||||
|
||||
bToolExists = ( next( Tool) ~= nil)
|
||||
if bToolExists then
|
||||
if Tool.nType == MCH_TY.MILL_NOTIP then
|
||||
bToolCanReachDepth = ( Tool.dThickness > dMaxOvermaterial - 10 * GEO.EPS_SMALL)
|
||||
and ( Tool.dSideDepth > dRawPartHeight - 10 * GEO.EPS_SMALL)
|
||||
else
|
||||
bToolCanReachDepth = Tool.dMaxDepth > dRawPartHeight - 10 * GEO.EPS_SMALL
|
||||
end
|
||||
end
|
||||
bIsToolOk = bToolExists and bToolCanReachDepth
|
||||
|
||||
return bIsToolOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.GetTools()
|
||||
-- TODO vedere se questo valore è coerente sulle diverse macchine
|
||||
local dHeadEncumberance = 130
|
||||
|
||||
local Tool = {}
|
||||
local SquaringTools = {}
|
||||
SquaringTools.Blade = {}
|
||||
SquaringTools.Diskmill = {}
|
||||
SquaringTools.Mill = {}
|
||||
SquaringTools.Blade.H1 = {}
|
||||
SquaringTools.Blade.H2 = {}
|
||||
SquaringTools.Blade.H7 = {}
|
||||
SquaringTools.Diskmill.H1 = {}
|
||||
SquaringTools.Diskmill.H7 = {}
|
||||
SquaringTools.Mill.H1 = {}
|
||||
SquaringTools.Mill.H7 = {}
|
||||
|
||||
Tool.sName = EgtTdbGetFirstTool( MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
while Tool.sName ~= '' do
|
||||
EgtTdbSetCurrTool( Tool.sName)
|
||||
local bIsToolLoadedOnSetup = EgtFindToolInCurrSetup( Tool.sName)
|
||||
local bIsSquaringTool = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SQUARING', 'b') or false
|
||||
|
||||
Tool.nType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
Tool.dDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
Tool.dMaxMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
Tool.dThickness = EgtIf( ( Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD), EgtTdbGetCurrToolParam( MCH_TP.THICK), Tool.dMaxMaterial)
|
||||
Tool.dMaxDepth = EgtTdbGetCurrToolMaxDepth() or Tool.dMaxMaterial
|
||||
Tool.sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
Tool.bIsCcw = EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0
|
||||
Tool.dFeed = EgtTdbGetCurrToolParam( MCH_TP.FEED)
|
||||
Tool.dStartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED)
|
||||
Tool.dEndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED)
|
||||
Tool.dTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
Tool.dMinFeed = EgtTdbGetCurrToolParam( MCH_TP.MINFEED)
|
||||
Tool.dStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'STEP', 'd') or EgtIf( ( Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD), ( Tool.dDiameter / 3), ( Tool.dMaxMaterial / 3))
|
||||
Tool.dSideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd') or ( Tool.dDiameter / 3)
|
||||
Tool.dSideDepth = Tool.dDiameter / 2 - dHeadEncumberance
|
||||
|
||||
if bIsToolLoadedOnSetup and Tool.nType and bIsSquaringTool then
|
||||
-- lame
|
||||
if Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD then
|
||||
SquaringTools.Blade[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = Tool.bIsCcw
|
||||
Tool.dSideStep = Tool.dStep
|
||||
Tool.dStep = Tool.dThickness
|
||||
-- frese standard
|
||||
elseif Tool.nType == MCH_TY.MILL_STD then
|
||||
SquaringTools.Mill[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = not Tool.bIsCcw
|
||||
-- truciolatori
|
||||
elseif Tool.nType == MCH_TY.MILL_NOTIP then
|
||||
SquaringTools.Diskmill[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = Tool.bIsCcw
|
||||
end
|
||||
end
|
||||
|
||||
Tool = {}
|
||||
Tool.sName = EgtTdbGetNextTool( MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
end
|
||||
|
||||
return SquaringTools
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AreToolsOk( sSquaringTool, SquaringTools, dRawPartHeight)
|
||||
local bAreToolsOk = false
|
||||
|
||||
if sSquaringTool == 'DoubleDiskmill' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight)
|
||||
and IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight))
|
||||
elseif sSquaringTool == 'DoubleDiskmillAndBlade' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and ( IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight)))
|
||||
elseif sSquaringTool == 'DoubleBlade' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and ( IsToolOk( SquaringTools.Blade.H1, dRawPartHeight) or IsToolOk( SquaringTools.Blade.H7, dRawPartHeight)))
|
||||
elseif sSquaringTool == 'Diskmill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight)
|
||||
elseif sSquaringTool == 'Blade' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
elseif sSquaringTool == 'DoubleMill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Mill.H1, dRawPartHeight) and IsToolOk( SquaringTools.Mill.H7, dRawPartHeight)
|
||||
elseif sSquaringTool == 'Mill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Mill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Mill.H7, dRawPartHeight)
|
||||
else
|
||||
error( 'Squaring Tool not recognized')
|
||||
end
|
||||
|
||||
return bAreToolsOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.CalculateParameters( sSquaringTool, SquaringTools, RawPart, vPart)
|
||||
local SquaringParameters = {}
|
||||
local sOrigCorner = EgtGetInfo( RawPart.nId, 'ORIGCORNER')
|
||||
local bShrinkToParts = ( WD.SQUARING_TYPE == 2)
|
||||
local bSquaringStartsOnReference = ( type( WD.SQUARING_STARTS_ON_REFERENCE) == "boolean") and ( WD.SQUARING_STARTS_ON_REFERENCE == true)
|
||||
local dOffsetXY = 0
|
||||
local dExtendZ = 0
|
||||
if type( WD.SQUARING_OFFSET_XY) == "number" and ( WD.SQUARING_TYPE < 2) then
|
||||
dOffsetXY = WD.SQUARING_OFFSET_XY
|
||||
end
|
||||
if type( WD.SQUARING_EXTEND_Z) == "number" then
|
||||
dExtendZ = WD.SQUARING_EXTEND_Z
|
||||
end
|
||||
|
||||
local Front = { sSide = 'Front'}
|
||||
local Right = { sSide = 'Right'}
|
||||
local Back = { sSide = 'Back'}
|
||||
local Left = { sSide = 'Left'}
|
||||
local b3Squaring = BBox3d( RawPart.b3)
|
||||
-- se squadratura sui pezzi invece che sul master panel, si costruisce il box minimo che contiene tutti i pezzi
|
||||
if bShrinkToParts then
|
||||
b3Squaring = BBox3d( vPart[1].Box:getCenter())
|
||||
for i = 1, #vPart do
|
||||
b3Squaring:Add( vPart[i].Box)
|
||||
end
|
||||
end
|
||||
local dDimX = b3Squaring:getDimX()
|
||||
local dDimY = b3Squaring:getDimY()
|
||||
local pt1 = b3Squaring:getMin() + Point3d( -dOffsetXY, -dOffsetXY, -dExtendZ)
|
||||
local pt2 = pt1 + Point3d( dDimX + 2 * dOffsetXY, 0, 0)
|
||||
local pt3 = pt2 + Point3d( 0, dDimY + 2 * dOffsetXY,0 )
|
||||
local pt4 = pt3 + Point3d( -dDimX - 2 * dOffsetXY, 0, 0)
|
||||
b3Squaring:Add( pt1)
|
||||
b3Squaring:Add( pt2)
|
||||
b3Squaring:Add( pt3)
|
||||
b3Squaring:Add( pt4)
|
||||
Front.nId = EgtLine( RawPart.nId, pt1, pt2, GDB_RT.GLOB)
|
||||
Right.nId = EgtLine( RawPart.nId, pt2, pt3, GDB_RT.GLOB)
|
||||
Back.nId = EgtLine( RawPart.nId, pt3, pt4, GDB_RT.GLOB)
|
||||
Left.nId = EgtLine( RawPart.nId, pt4, pt1, GDB_RT.GLOB)
|
||||
if not ( sSquaringTool == 'DoubleMill') and not ( sSquaringTool == 'Mill') then
|
||||
EgtModifyCurveExtrusion( Front.nId, -Y_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Right.nId, X_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Back.nId, Y_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Left.nId, -X_AX(), GDB_RT.GLOB)
|
||||
end
|
||||
EgtSetName( Front.nId, 'SquaringGeometry')
|
||||
EgtSetName( Right.nId, 'SquaringGeometry')
|
||||
EgtSetName( Back.nId, 'SquaringGeometry')
|
||||
EgtSetName( Left.nId, 'SquaringGeometry')
|
||||
|
||||
-- in base al caso si assegna l'utensile al lato
|
||||
if sSquaringTool == 'DoubleDiskmill' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Diskmill.H1
|
||||
Front.ToolDouble = SquaringTools.Diskmill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'DoubleDiskmillAndBlade' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
Front.ToolDouble = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'DoubleBlade' then
|
||||
Left.Tool = SquaringTools.Blade.H2
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
Front.ToolDouble = SquaringTools.Blade.H1 or SquaringTools.Blade.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'Diskmill' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Back.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
elseif sSquaringTool == 'Blade' then
|
||||
Left.Tool = SquaringTools.Blade.H2
|
||||
Back.Tool = SquaringTools.Blade.H2
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
elseif sSquaringTool == 'DoubleMill' then
|
||||
Left.Tool = SquaringTools.Mill.H1
|
||||
Right.Tool = SquaringTools.Mill.H1
|
||||
Front.Tool = SquaringTools.Mill.H1
|
||||
Front.ToolDouble = SquaringTools.Mill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'Mill' then
|
||||
Left.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Back.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Right.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Front.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
end
|
||||
|
||||
-- l'ordinamento delle linee dipende dal verso di percorrenza e, se attivato, dal riferimento utilizzato
|
||||
-- con doppio l'ordine cambia
|
||||
-- lato lungo lavorato in doppio
|
||||
if not Back.Tool then
|
||||
for i = 1, 3 do
|
||||
SquaringParameters[i] = {}
|
||||
end
|
||||
if Front.Tool.bIsPathCw then
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
else
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
end
|
||||
else
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
end
|
||||
end
|
||||
-- doppio non attivo
|
||||
else
|
||||
for i = 1, 4 do
|
||||
SquaringParameters[i] = {}
|
||||
end
|
||||
if Front.Tool.bIsPathCw then
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Back
|
||||
SquaringParameters[4] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Back
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Front
|
||||
SquaringParameters[4] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
SquaringParameters[4] = Back
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Back
|
||||
SquaringParameters[3] = Right
|
||||
SquaringParameters[4] = Front
|
||||
end
|
||||
else
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Back
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Front
|
||||
SquaringParameters[4] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Back
|
||||
SquaringParameters[3] = Left
|
||||
SquaringParameters[4] = Front
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Back
|
||||
SquaringParameters[4] = Left
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
SquaringParameters[4] = Back
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return SquaringParameters, b3Squaring
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AddMachinings( SquaringParameters, b3Squaring, nFirstOperationId)
|
||||
local nNotOkCount = 0
|
||||
local sMsgTotal = ''
|
||||
local dSquaringHeight = b3Squaring:getDimZ()
|
||||
local dExtendPath = 0
|
||||
local dMaxOvermaterial = 0
|
||||
if type( WD.SQUARING_MAX_OVERMATERIAL) == "number" then
|
||||
dMaxOvermaterial = WD.SQUARING_MAX_OVERMATERIAL
|
||||
end
|
||||
local bUseZigZagStep = ( type( WD.SQUARING_USE_ZIGZAG) == "boolean") and ( WD.SQUARING_USE_ZIGZAG == true)
|
||||
|
||||
for i = 1, #SquaringParameters do
|
||||
local dToolRadius = SquaringParameters[i].Tool.dDiameter / 2
|
||||
local vtExtr = EgtCurveExtrusion( SquaringParameters[i].nId, GDB_RT.GLOB)
|
||||
local bIsVerticalMilling = false
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
bIsVerticalMilling = true
|
||||
end
|
||||
-- calcolo step laterale
|
||||
local MachiningSteps = { nCount = 1, dStep = 0}
|
||||
if not bIsVerticalMilling then
|
||||
MachiningSteps = WM.GetMachiningSteps( dSquaringHeight, SquaringParameters[i].Tool.dSideStep)
|
||||
end
|
||||
|
||||
for j = 1, MachiningSteps.nCount do
|
||||
local nOperationId = EgtCreateMachining( 'SQUARING_' .. SquaringParameters[i].sSide, MCH_OY.MILLING, SquaringParameters[i].Tool.sName)
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( SquaringParameters[i].nId)
|
||||
-- profondità di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 0)
|
||||
-- workside e inversione
|
||||
if SquaringParameters[i].Tool.bIsPathCw then
|
||||
if SquaringParameters[i].Tool.nType == MCH_TY.MILL_STD then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
if SquaringParameters[i].Tool.nType == MCH_TY.MILL_STD then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
end
|
||||
-- distanza di sicurezza
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, WD.CUT_SIC + dSquaringHeight)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, WD.CUT_SIC)
|
||||
end
|
||||
-- overlap
|
||||
EgtSetMachiningParam( MCH_MP.OVERL, 0)
|
||||
-- tipo di step
|
||||
if bIsVerticalMilling and bUseZigZagStep then
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ZIGZAG)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
end
|
||||
-- step
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, SquaringParameters[i].Tool.dStep)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- offset radiale
|
||||
local dRadialOffset = 0
|
||||
if not bIsVerticalMilling then
|
||||
dRadialOffset = ( MachiningSteps.nCount - j) * MachiningSteps.dStep
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
|
||||
-- offset longitudinale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, 0)
|
||||
-- inversione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
||||
-- faceuse
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.NONE)
|
||||
-- angoli suggeriti
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, '')
|
||||
-- asse bloccato
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, '')
|
||||
-- SCC
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||
-- calcolo estensione percorso
|
||||
if bIsVerticalMilling then
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
dExtendPath = dMaxOvermaterial + dToolRadius + WD.COLL_SIC
|
||||
else
|
||||
-- si calcola l'impronta utensile per uscire quanto basta a garantire il maxOvermaterial, con una distanza di sicurezza
|
||||
dExtendPath = dMaxOvermaterial + WD.COLL_SIC + dToolRadius - ( dToolRadius - sqrt( dToolRadius * dToolRadius - ( ( dToolRadius - dSquaringHeight) * ( dToolRadius - dSquaringHeight))))
|
||||
end
|
||||
-- approccio
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtendPath)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
else
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, WD.CUT_SIC + dSquaringHeight)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LICOMPLEN, 0)
|
||||
-- retrazione
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtendPath)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
else
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, WD.CUT_SIC + dSquaringHeight)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, 0)
|
||||
-- note utente
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
if SquaringParameters[i].ToolDouble then
|
||||
local dYMirrorAx
|
||||
local b3Tab = EgtGetTableArea()
|
||||
dYMirrorAx = b3Squaring:getCenter():getY() - b3Tab:getMin():getY()
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', 2)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', dYMirrorAx)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'TOOLDOUBLE', SquaringParameters[i].ToolDouble.sName)
|
||||
end
|
||||
if not bIsVerticalMilling then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', 0)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
|
||||
local bOk = EgtApplyMachining( true, false)
|
||||
EgtRelocateGlob( nOperationId, nFirstOperationId, GDB_IN.BEFORE)
|
||||
if not bOk then
|
||||
local _, sMsg = EgtGetLastMachMgrError()
|
||||
nNotOkCount = nNotOkCount + 1
|
||||
sMsgTotal = sMsgTotal ..'\n' .. ( sMsg or '')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ( nNotOkCount < 1), sMsgTotal
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AddScrapRemoval( nFirstOperationId)
|
||||
-- pulizia sfridi alla prima lavorazione dopo la squadratura
|
||||
EgtSetCurrMachining( nFirstOperationId)
|
||||
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Squaring
|
||||
@@ -192,6 +192,7 @@ function WFeatureTopology.Classify( Proc, b3Raw)
|
||||
sFamily = 'DRILLING'
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
|
||||
@@ -266,5 +266,17 @@ function WMachiningLib.IsMachiningOkForDouble( sMachining)
|
||||
return bDoubleOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WMachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
local MachiningSteps = {}
|
||||
MachiningSteps.dStep = 0
|
||||
MachiningSteps.nCount = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
|
||||
if MachiningSteps.nCount > 1 then
|
||||
MachiningSteps.dStep = ( dMachiningDepth - dStep) / ( MachiningSteps.nCount - 1)
|
||||
end
|
||||
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WMachiningLib
|
||||
|
||||
@@ -66,9 +66,8 @@ function WPDC.Make( Proc, nRawId, b3Raw)
|
||||
-- se singola faccia, passo a quella lavorazione
|
||||
if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end
|
||||
-- altrimenti due facce e passo alla LapJoint
|
||||
local LapProc = { PartId = Proc.PartId, Id = Proc.Id, Grp = Proc.Grp + 2, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Diam = Proc.Diam, Fcs = Proc.Fcs, Fce = Proc.Fce, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
return LapJoint.Make( LapProc, nRawId, b3Raw)
|
||||
Proc.Grp = Proc.Grp + 2
|
||||
return LapJoint.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
+39
-19
@@ -324,32 +324,41 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
local bAngledContourDrill = false
|
||||
local nAngledContourDrillId = GDB_ID.NULL
|
||||
local dReduceDepth = 0
|
||||
local bUseTabs = false
|
||||
-- se trovata svuotatura, verifico se richiesta invece contornatura
|
||||
if nType == 'Pocket' then
|
||||
-- recupero eventuale flag per fare sola contornatura
|
||||
local nContourOnly = ( EgtGetInfo( Proc.Id, sContourOnly, 'i') or 0)
|
||||
if nContourOnly == 1 then
|
||||
-- imposto riduzione profondita' per evitare distacco pezzo interno
|
||||
dReduceDepth = 5
|
||||
-- se inclinato e passante
|
||||
if abs( vtExtr:getZ()) >= WD.DRILL_VZ_MIN and abs( vtExtr:getZ()) < 0.999 and Proc.Fcs > 0 and Proc.Fce > 0 then
|
||||
-- gruppo ausiliario per preforo
|
||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||
-- ricavo contorno inferiore della superficie
|
||||
local nAngledCircleId, nAngledCircleCnt = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
local dMinZ = 10000
|
||||
local nMinCircleId = GDB_ID.NULL
|
||||
for Circleindex = 1, nAngledCircleCnt do
|
||||
local b3Circle = EgtGetBBoxGlob( nAngledCircleId + Circleindex -1, GDB_BB.EXACT)
|
||||
if b3Circle:getMin():getZ() < dMinZ then
|
||||
nMinCircleId = nAngledCircleId + Circleindex -1
|
||||
-- se passante
|
||||
if Proc.Fcs > 0 and Proc.Fce > 0 then
|
||||
-- se inclinato
|
||||
if abs( vtExtr:getZ()) >= WD.DRILL_VZ_MIN and abs( vtExtr:getZ()) < 0.999 then
|
||||
-- gruppo ausiliario per preforo
|
||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||
-- ricavo contorno inferiore della superficie
|
||||
local nAngledCircleId, nAngledCircleCnt = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
local dMinZ = 10000
|
||||
local nMinCircleId = GDB_ID.NULL
|
||||
for Circleindex = 1, nAngledCircleCnt do
|
||||
local b3Circle = EgtGetBBoxGlob( nAngledCircleId + Circleindex -1, GDB_BB.EXACT)
|
||||
if b3Circle:getMin():getZ() < dMinZ then
|
||||
nMinCircleId = nAngledCircleId + Circleindex -1
|
||||
end
|
||||
end
|
||||
-- estrudo
|
||||
EgtModifyCurveExtrusion( nMinCircleId, vtExtr, GDB_RT.GLOB)
|
||||
EgtModifyCurveThickness( nMinCircleId, dLen)
|
||||
bAngledContourDrill = true
|
||||
nAngledContourDrillId = nMinCircleId
|
||||
-- se non inclinato e abbastanza grande uso i tab
|
||||
-- TODO se si risolve il problema dei tabs non funzionanti sotto ai 200 mm rimuovere il check sul diametro
|
||||
elseif dDiam > 100 - 10 * GEO.EPS_SMALL then
|
||||
bUseTabs = true
|
||||
-- se non inclinato e piccolo non arrivo sul fondo
|
||||
else
|
||||
dReduceDepth = 5
|
||||
end
|
||||
-- estrudo
|
||||
EgtModifyCurveExtrusion( nMinCircleId, vtExtr, GDB_RT.GLOB)
|
||||
EgtModifyCurveThickness( nMinCircleId, dLen)
|
||||
bAngledContourDrill = true
|
||||
nAngledContourDrillId = nMinCircleId
|
||||
end
|
||||
sDrilling = WM.FindMilling( 'FreeContour', dLen, nil, nil, nil, nil, true)
|
||||
if sDrilling then
|
||||
@@ -515,6 +524,17 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', Proc.MirrorAx)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if bUseTabs then
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
EgtSetMachiningParam( MCH_MP.LEAVETAB, true)
|
||||
EgtSetMachiningParam( MCH_MP.TABHEIGHT, EgtClamp( dStep, 0.15 * dDepth, 0.25 * dDepth ))
|
||||
EgtSetMachiningParam( MCH_MP.TABLEN, EgtClamp( 2 * dDiamT, 0.1 * dDiam, 0.2 * dDiam ))
|
||||
EgtSetMachiningParam( MCH_MP.TABANGLE, 45)
|
||||
EgtSetMachiningParam( MCH_MP.TABDIST, 100)
|
||||
EgtSetMachiningParam( MCH_MP.TABMIN, 3)
|
||||
EgtSetMachiningParam( MCH_MP.TABMAX, 3)
|
||||
end
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/10/02
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2024/03/24
|
||||
-- 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/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
||||
@@ -28,6 +28,7 @@
|
||||
-- 2023/11/14 Spostamento di alcune funzioni in WallLib.
|
||||
-- Aggiunta dei FreeContour in doppio.
|
||||
-- 2023/12/13 In MakeByPocket aggiunta la possibilità di svuotare tasche passanti.
|
||||
-- 2024/03/24 Sostituite funzioni di Collision Detection (EgtCDe*) con quelle di verifica interferenza (EgtTest*).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPF = {}
|
||||
@@ -174,6 +175,22 @@ local function IsPointOnRawLongEdges( ptCen, b3Raw)
|
||||
return ( abs( ptCen:getY() - b3Raw:getMin():getY()) < 0.1 or abs( ptCen:getY() - b3Raw:getMax():getY()) < 0.1)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsFaceOutsideSquaring( Proc, Face, b3Squaring)
|
||||
-- faccia esterna al box di squadratura
|
||||
if b3Squaring then
|
||||
local b3SquaringReduced = BBox3d( b3Squaring)
|
||||
b3SquaringReduced:expand( -0.1)
|
||||
local b3Face = EgtSurfTmGetFacetBBoxGlob( Proc.Id, Face.Fac, GDB_BB.STANDARD)
|
||||
if not OverlapsXY( b3SquaringReduced, b3Face) then
|
||||
EgtOutLog( 'Proc ' .. Proc.Id .. ': skipped face ' .. Face.Fac .. ' outside squaring' )
|
||||
return true
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetOtherRegions( nPartId)
|
||||
local vOthers = {}
|
||||
@@ -387,9 +404,12 @@ local function GetFacesData( Proc, bOpposite, bCalclForBlade, dToolDiam, dToolMa
|
||||
dLen = dLen - EgtIf( bCalclForBlade, dWhisk, 0)
|
||||
nType = nType + 2
|
||||
end
|
||||
-- se lunghezza non significativa, non va inserito il taglio
|
||||
if dLen < MIN_LEN_CUT then
|
||||
nType = 4
|
||||
-- se feature taglio esteremità o longitudinale ed è 1 faccia, non controllo lunghezza minima. Si controlla solo interferenza altri pezzi
|
||||
if not( Proc.Prc == 10 and Proc.Fct == 1) then
|
||||
-- se lunghezza non significativa, non va inserito il taglio
|
||||
if dLen < MIN_LEN_CUT then
|
||||
nType = 4
|
||||
end
|
||||
end
|
||||
-- numero dei lati
|
||||
local nEdges = #(EgtSurfTmFacetAdjacencies( nNewProc, i - 1)[1])
|
||||
@@ -699,18 +719,17 @@ end
|
||||
---------------------------------------------------------------------
|
||||
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
|
||||
dTall1, dTall2, dDiam3, dTall3)
|
||||
|
||||
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
|
||||
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
|
||||
local bColl1 = EgtCDeConeSolid( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
||||
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
||||
if bColl1 then return true end
|
||||
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
|
||||
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
|
||||
local bColl2 = EgtCDeCylSolid( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
|
||||
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
|
||||
if bColl2 then return true end
|
||||
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
|
||||
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
|
||||
local bColl3 = EgtCDeCylSolid( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
|
||||
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
|
||||
if bColl3 then return true end
|
||||
-- restituisco risultato controllo collisioni
|
||||
return false
|
||||
@@ -758,9 +777,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- creo superfice locale o esco
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
|
||||
if nSurfToAdd then
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
-- creo copia del percorso principale e gli aggiungo la nuova faccia
|
||||
nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId)
|
||||
nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId)
|
||||
nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true)
|
||||
-- riordino le facce
|
||||
ReorderFacesFromTab( nNewProcLoc, vFace)
|
||||
@@ -771,7 +790,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
return true, ''
|
||||
end
|
||||
else
|
||||
nNewProcLoc = nNewProc
|
||||
nNewProcLoc = nNewProc.Id
|
||||
end
|
||||
-- prendo il primo versore
|
||||
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
|
||||
@@ -828,7 +847,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||
end
|
||||
-- controllo se c'è collisione con le facce della superfice
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
dTall1, dTall2, dDiam3, dTall3) then
|
||||
local sErr = 'Collision detect from clean corner tool and surface'
|
||||
EgtOutLog( sErr)
|
||||
@@ -925,6 +944,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- trasformo in percorso
|
||||
if #pAuxId > 0 then
|
||||
AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true)
|
||||
EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId)
|
||||
EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId)
|
||||
end
|
||||
-- se non c'é il percorso do errore
|
||||
if not AuxId then
|
||||
@@ -939,8 +960,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||
local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id))
|
||||
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -1033,26 +1054,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
-- verifico se ciclo chiuso
|
||||
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||
-- copio la feature nel layer di appoggio
|
||||
local nNewProc
|
||||
local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
if nMasterNewProc then
|
||||
nNewProc = nMasterNewProc
|
||||
nNewProc.Id = nMasterNewProc
|
||||
else
|
||||
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
end
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
local nFacInd, dDepth, nSurfInt
|
||||
local bMakeLocSurf
|
||||
-- RIMUOVERE
|
||||
if false and nFacCnt <= 4 then
|
||||
-- recupero profondità e faccia di fondo
|
||||
_, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId, bClosed)
|
||||
_, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId, bClosed)
|
||||
if nSurfInt then
|
||||
-- aggiungo la faccia di fondo appena calcolata
|
||||
nNewProc = EgtSurfTmBySewing( nAddGrpId, { nNewProc, nSurfInt}, true)
|
||||
nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, { nNewProc.Id, nSurfInt}, true)
|
||||
-- riordino le facce
|
||||
ReorderFacesFromTab( nNewProc, vFace)
|
||||
ReorderFacesFromTab( nNewProc.Id, vFace)
|
||||
-- aggiorno numero di facce e assegno indice di quella di fondo (sempre ultima)
|
||||
nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
nFacInd = nFacCnt - 1
|
||||
else
|
||||
return true
|
||||
@@ -1100,7 +1121,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
ptLoc2 = vFace[k].PPrev
|
||||
end
|
||||
-- ricavo i punti e l'angolo interno
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT)
|
||||
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
|
||||
local tFacAdj = {}
|
||||
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
|
||||
@@ -1138,8 +1159,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
i = i + 1
|
||||
end
|
||||
-- cancello la copia della superfice
|
||||
if nNewProc then
|
||||
EgtErase( nNewProc)
|
||||
if nNewProc.Id then
|
||||
EgtErase( nNewProc.Id)
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -1486,9 +1507,11 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
end
|
||||
--scrivo nell'operazione il vettore somma delle normali alle superfici che servirà per il doppio
|
||||
local vtNSum = Vector3d( 0, 0, 0)
|
||||
for iGeom = 1, #vGeom do
|
||||
local nFace = vGeom[iGeom][2]
|
||||
vtNSum = vtNSum + Proc.Face[ nFace + 1].VtN
|
||||
if Proc.Face and #Proc.Face > 0 then
|
||||
for iGeom = 1, #vGeom do
|
||||
local nFace = vGeom[iGeom][2]
|
||||
vtNSum = vtNSum + Proc.Face[ nFace + 1].VtN
|
||||
end
|
||||
end
|
||||
EgtSetInfo( nMchId or GDB_ID.NULL, 'NORM_SUM', vtNSum)
|
||||
-- eseguo
|
||||
@@ -1703,13 +1726,13 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick, b3Squaring)
|
||||
-- verifico se ciclo chiuso
|
||||
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||
-- ciclo di inserimento dei tagli sulle facce del contorno in esame
|
||||
for i = 1, #vFace do
|
||||
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
|
||||
local bToSkip = ( WD.BEAM_MACHINE and IsPointOnRawLongEdges( vFace[i].Cen, b3Raw))
|
||||
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito oppure se faccia fuori dal box di squadratura
|
||||
local bToSkip = ( WD.BEAM_MACHINE and IsPointOnRawLongEdges( vFace[i].Cen, b3Raw)) or IsFaceOutsideSquaring( Proc, vFace[i], b3Squaring)
|
||||
-- se non è faccia da saltare, inserisco il taglio di lama
|
||||
if not bToSkip and vFace[i].Type ~= 4 then
|
||||
-- indice del successivo
|
||||
@@ -1839,7 +1862,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeByCut( Proc, nRawId, b3Raw)
|
||||
local function MakeByCut( Proc, nRawId, b3Raw, b3Squaring)
|
||||
local sWarn = ''
|
||||
-- ingombro del pezzo
|
||||
local Ls = EgtGetFirstNameInGroup( Proc.PartId, 'Box')
|
||||
@@ -1885,9 +1908,9 @@ local function MakeByCut( Proc, nRawId, b3Raw)
|
||||
-- gruppo ausiliario
|
||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||
-- recupero i dati di tutte le facce
|
||||
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, true, dSawDiam, dSawMaxDepth, dSawThick, nAddGrpId, b3Raw, nil)
|
||||
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, true, dSawDiam, dSawMaxDepth, dSawThick, nAddGrpId, b3Raw)
|
||||
-- inserimento dei tagli di lama
|
||||
local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick, b3Squaring)
|
||||
if not bCtOk then return bCtOk, sCtErr end
|
||||
-- se richiesta solo lama, esco
|
||||
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
||||
@@ -2424,7 +2447,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
|
||||
EgtErase( nAddedBottomSurface)
|
||||
end
|
||||
if not nFacet then
|
||||
return MakeByMill( Proc, nRawId, b3Raw)
|
||||
return MakeByMill( Proc, nRawId, b3Raw, b3Squaring)
|
||||
end
|
||||
-- se ho creato la faccia di fondo utilizzo quella
|
||||
local nSurfId = nProcTmWithAddedBottomSurfaceId or Proc.Id
|
||||
@@ -2571,7 +2594,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function WPF.Make( Proc, nRawId, b3Raw, vNLO)
|
||||
function WPF.Make( Proc, nRawId, b3Raw, vNLO, b3Squaring)
|
||||
-- recupero la tipologia (contorno o tasca)
|
||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||
-- se svuotatura
|
||||
@@ -2594,7 +2617,7 @@ function WPF.Make( Proc, nRawId, b3Raw, vNLO)
|
||||
return MakeByNail( Proc, nRawId, b3Raw, vNLO)
|
||||
-- altrimenti, taglio con lama e pulizia angoli con fresa
|
||||
else
|
||||
return MakeByCut( Proc, nRawId, b3Raw)
|
||||
return MakeByCut( Proc, nRawId, b3Raw, b3Squaring)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
-- 2023/11/14 Aggiunta tasche in doppio.
|
||||
-- Miglioramenti sostanziali nella gestione delle tasche.
|
||||
-- 2023/11/16 Fresature a salire estese a groove cieche.
|
||||
-- 2024/02/20 Piccola correzione ai casi in cui si utilizza il SIDESTEP.
|
||||
-- 2024/08/09 In MakeByMill, se fresa Side trovata ma non applicabile, si considera come se non trovata
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPL = {}
|
||||
@@ -758,9 +760,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- creo superfice locale o esco
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
|
||||
if nSurfToAdd then
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
-- creo copia del percorso principale e gli aggiungo la nuova faccia
|
||||
nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId)
|
||||
nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId)
|
||||
nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true)
|
||||
-- riordino le facce
|
||||
nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace)
|
||||
@@ -773,7 +775,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
return true, ''
|
||||
end
|
||||
else
|
||||
nNewProcLoc = nNewProc
|
||||
nNewProcLoc = nNewProc.Id
|
||||
end
|
||||
-- prendo il primo versore
|
||||
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
|
||||
@@ -827,7 +829,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||
end
|
||||
-- controllo se c'è collisione con le facce della superfice
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
dTall1, dTall2, dDiam3, dTall3) then
|
||||
local sErr = 'Collision detect from clean corner tool and surface'
|
||||
EgtOutLog( sErr)
|
||||
@@ -924,6 +926,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- trasformo in percorso
|
||||
if #pAuxId > 0 then
|
||||
AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true)
|
||||
EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId)
|
||||
EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId)
|
||||
end
|
||||
-- se non c'é il percorso do errore
|
||||
if not AuxId then
|
||||
@@ -938,8 +942,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||
local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id))
|
||||
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -1033,27 +1037,27 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
end
|
||||
end
|
||||
-- copio la feature nel layer di appoggio
|
||||
local nNewProc
|
||||
local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
if nMasterNewProc then
|
||||
nNewProc = nMasterNewProc
|
||||
nNewProc.Id = nMasterNewProc
|
||||
else
|
||||
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
end
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt
|
||||
local bMakeLocSurf
|
||||
-- RIMUOVERE
|
||||
if false and nFacCnt <= 4 then
|
||||
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
|
||||
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
|
||||
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId)
|
||||
if nSurfInt then
|
||||
-- uso la dimensione minima anche nel caso che la cava sborda perchè la lavorazione potrebbe collidere con un pezzo limitrofo
|
||||
local dMinWidth = dDimMin
|
||||
nNewProc = EgtSurfTmBySewing( nAddGrpId, {nNewProc,nSurfInt} , true)
|
||||
nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, {nNewProc.Id,nSurfInt} , true)
|
||||
-- riordino le facce
|
||||
nNewProc = ReorderFacesFromTab( nNewProc, vFace)
|
||||
nNewProc.Id = ReorderFacesFromTab( nNewProc.Id, vFace)
|
||||
-- acquisisco il numero della faccia
|
||||
nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
|
||||
nFacInd = nFacCnt - 1
|
||||
else
|
||||
local sErr = 'Error : cannot create base surface'
|
||||
@@ -1105,7 +1109,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
ptLoc2 = vFace[k].PPrev
|
||||
end
|
||||
-- ricavo i punti e l'angolo interno
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT)
|
||||
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
|
||||
local tFacAdj = {}
|
||||
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
|
||||
@@ -1143,8 +1147,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
i = i + 1
|
||||
end
|
||||
-- cancello la copia della superfice
|
||||
if nNewProc then
|
||||
EgtErase(nNewProc)
|
||||
if nNewProc.Id then
|
||||
EgtErase( nNewProc.Id)
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -1217,7 +1221,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
|
||||
local sStartAngs
|
||||
if WD.GetChainSawStartAngs then
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFacAdj, GDB_ID.ROOT)
|
||||
sStartAngs = WD.GetChainSawStartAngs( vtN2)
|
||||
sStartAngs = WD.GetChainSawStartAngs( vtN2, vtN, ptC)
|
||||
end
|
||||
-- Lati chiusi
|
||||
local bOpenStart = false
|
||||
@@ -1350,7 +1354,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Side not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
return false, sErr, true
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMillDiam = 20
|
||||
@@ -1371,13 +1375,13 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
if dMillDiam < dDiam or dMaxDepth < dElev then
|
||||
local sErr = 'Error : Side Elevation too big'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
return false, sErr, true
|
||||
end
|
||||
local dMillExtra = dMillTotLen - dMillLen
|
||||
if Proc.Box:getMin():getZ() - dMillExtra < b3Raw:getMin():getZ() - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : Tool collide with table'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
return false, sErr, true
|
||||
end
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
@@ -1689,13 +1693,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
dExtraLongEnd = 0
|
||||
end
|
||||
-- se ho abilitato la lavorazione di fresatura per garantire passaggio gambo utensile, inserisco la lavorazione
|
||||
local bThroughRaw = false
|
||||
if bEnablePreMill then
|
||||
-- verifico se feature e' passante
|
||||
if ((Proc.Box:getMin():getX() < ( b3Raw:getMin():getX() + 50)) and (Proc.Box:getMax():getX() > ( b3Raw:getMax():getX() - 50))) or
|
||||
((Proc.Box:getMin():getY() < ( b3Raw:getMin():getY() + 50)) and (Proc.Box:getMax():getY() > ( b3Raw:getMax():getY() - 50))) then
|
||||
bThroughRaw = true
|
||||
end
|
||||
|
||||
-- recupero la lavorazione di taglio
|
||||
local sCuttingGorge = WM.FindCutting( 'Standard')
|
||||
@@ -1743,7 +1741,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
local bSawInvertSE = false
|
||||
|
||||
-- se non passante, aggiungo fresatura area della fresa
|
||||
if not bThroughRaw and nNumStep - 1 > 0 then
|
||||
if not Proc.IsThrough and nNumStep - 1 > 0 then
|
||||
local SquareId -- Id della composita da fresare
|
||||
local dSawShortening = sqrt( b3Raw:getDimZ() * ( dSawDiam - b3Raw:getDimZ())) -- da calcolare in base a raggio lama e spessore grezzo
|
||||
-- gruppo ausiliario
|
||||
@@ -1980,7 +1978,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
local dStepOri
|
||||
if not bExcludeSideMill then
|
||||
local nSideStep = 1
|
||||
if dSideStep > 0 and not ( bEnablePreMill or bAsEnablePreMill) and nModifyLeadInOut < 1 then
|
||||
if dSideStep > 0 and not ( bEnablePreMill or bAsEnablePreMill) then
|
||||
nSideStep = ceil( dElev / dSideStep)
|
||||
dSideStep = max( dElev / nSideStep, 0)
|
||||
end
|
||||
@@ -2013,6 +2011,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
local nStep = ceil( ( dThick - dMaxMat) / dStep)
|
||||
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
|
||||
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
|
||||
-- tasca aperta sopra non necessita di MaxElev
|
||||
if Proc.Fct == 2 and Proc.AffectedFaces.Top then
|
||||
dMaxElev = nil
|
||||
end
|
||||
if nSinglePass and nSinglePass > 0 then
|
||||
dStep = 0
|
||||
if nSinglePass == 1 then
|
||||
@@ -2026,7 +2028,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- aggiungo alle note massima elevazione
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
|
||||
if dMaxElev then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
|
||||
end
|
||||
-- se lavorazione in doppio aggiungo le rispettive note
|
||||
if Proc.Double and Proc.Double == 2 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
@@ -2100,15 +2104,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
-- se ho passate orizzontali riduco l'eventuale allungamento settato dall'utente
|
||||
local dLiPerp = EgtGetMachiningParam( MCH_MP.LIPERP)
|
||||
local dLoPerp = EgtGetMachiningParam( MCH_MP.LOPERP)
|
||||
if dLiPerp > 0 then
|
||||
dLiPerp = dLiPerp - dRadialOffset
|
||||
end
|
||||
if dLoPerp > 0 then
|
||||
dLoPerp = dLoPerp - dRadialOffset
|
||||
end
|
||||
-- tutte le passate partono dalla stessa distanza
|
||||
local dLiPerp = dElev + WD.CUT_SIC - dRadialOffset
|
||||
local dLoPerp = dElev + WD.CUT_SIC - dRadialOffset
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||
-- se richiesto, setto la nota per spostare la lavorazione alla fine
|
||||
@@ -2754,7 +2752,10 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
|
||||
bLikeAsMakeFirstGroove = false
|
||||
return MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove, nil, nil, bDoubleMillOnSide)
|
||||
else
|
||||
local bOk, sErr = MakeByMill( Proc, nFacet, 1 - nFacet, nRawId, b3Raw, dSideDist)
|
||||
local bOk, sErr, bSideMachiningNotFound = MakeByMill( Proc, nFacet, 1 - nFacet, nRawId, b3Raw, dSideDist)
|
||||
if not bOk and bSideMachiningNotFound then
|
||||
bOk, sErr = MakeByPocketing( Proc, nFacet, nRawId, b3Raw)
|
||||
end
|
||||
-- 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)
|
||||
@@ -2858,8 +2859,8 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
end
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local dMaxSlotThicknessForBlade = 25
|
||||
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade + 10 * GEO.EPS_SMALL) and vtN:getZ() > -0.01)
|
||||
local dMaxSlotThicknessForBlade = 19
|
||||
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade - 10 * GEO.EPS_SMALL) and vtN:getZ() > -0.01)
|
||||
-- se di fianco
|
||||
if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then
|
||||
-- recupero elevazione faccia in feature
|
||||
@@ -2881,13 +2882,15 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
-- se ho abilitata lavorazione di fresa di fianco
|
||||
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then
|
||||
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
|
||||
local dMaxDepthOnSide = 0
|
||||
local dMaxDepthOnSide = 999
|
||||
local dMillDiam = 0
|
||||
local dMillDiamTh = EgtTdbGetCurrToolThDiam() or 60
|
||||
if EgtMdbSetCurrMachining( sMillOnSide) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide
|
||||
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
|
||||
dMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide, 0.5 * ( dMillDiam - dMillDiamTh))
|
||||
end
|
||||
end
|
||||
local bMakeFirstGroove
|
||||
@@ -2921,7 +2924,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
end
|
||||
else
|
||||
-- fresatura (se definita); se disponibile, cerco di usare un utensile che non lavori al limite della capacità di sottosquadro
|
||||
local dSideElevMultiplier = 1.2
|
||||
local dSideElevMultiplier = 1.1
|
||||
local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElevMultiplier * dSideElev)
|
||||
-- se non ho trovato un utensile un po' più grande del sottosquadro richiesto, passo alla ricerca standard
|
||||
if not sMilling then
|
||||
@@ -2976,7 +2979,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
else
|
||||
local sErr = 'Side milling not possible'
|
||||
EgtOutLog( sErr)
|
||||
return true, sErr
|
||||
return false, sErr
|
||||
end
|
||||
-- fessura verticale
|
||||
elseif Proc.Stype == 3 then
|
||||
|
||||
@@ -29,7 +29,11 @@ function WPSC.Classify( Proc, b3Raw)
|
||||
if not AuxId then return false end
|
||||
AuxId = AuxId + Proc.Id
|
||||
local vtDir = EgtSV( AuxId, GDB_ID.ROOT)
|
||||
return ( vtDir:getZ() > 0.5)
|
||||
local vtDirZ = vtDir:getZ()
|
||||
if Proc.IsThrough then
|
||||
vtDirZ = abs( vtDir:getZ())
|
||||
end
|
||||
return ( vtDirZ > 0.5)
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
+147
-19
@@ -1,4 +1,4 @@
|
||||
-- WallExec.lua by Egaltech s.r.l. 2023/10/16
|
||||
-- WallExec.lua by Egaltech s.r.l. 2024/02/20
|
||||
-- Libreria esecuzione lavorazioni per Pareti
|
||||
-- 2023/05/25 Aggiunto ordinamento in base a priorità da btl.
|
||||
-- 2023/06/07 Nel caso di outline con priorità aggiunta la rimozione degli sfridi nella lavorazione successiva.
|
||||
@@ -8,6 +8,8 @@
|
||||
-- 2023/11/14 Modifiche sostanziali per l'aggiunta delle lavorazioni in doppio.
|
||||
-- In Collect aggiunto il recupero preliminare di varie informazioni sulla feature.
|
||||
-- 2023/12/11 In ClassifyTopology si passa ora anche l'Id del grezzo (allineamento Topology con Beam).
|
||||
-- 2024/02/20 Aggiunta gestione DeltaX/Y/Z del pannello dall'origine da BTL.
|
||||
-- 2024/08/30 Aggiunta nota altezza sottopezzo, per pareti a layer
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WallExec = {}
|
||||
@@ -43,6 +45,7 @@ _G.package.loaded.WProcessVariant = nil
|
||||
local WM = require( 'WMachiningLib')
|
||||
local WL = require( 'WallLib')
|
||||
local Topology = require( 'WFeatureTopology')
|
||||
local Squaring = require( 'Squaring')
|
||||
local Cut = require( 'WProcessCut')
|
||||
local DoubleCut = require( 'WProcessDoubleCut')
|
||||
local SawCut = require( 'WProcessSawCut')
|
||||
@@ -55,7 +58,6 @@ local Text = require( 'WProcessText')
|
||||
local FreeContour = require( 'WProcessFreeContour')
|
||||
local Variant = require( 'WProcessVariant')
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Inserimento delle pareti nel pannello ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -80,33 +82,43 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
|
||||
local OrigOnTab
|
||||
local nCorner
|
||||
local sOrigCorner = WD.ORIG_CORNER or 'BR'
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
|
||||
if WD.GetOrigCorner then
|
||||
sOrigCorner = WD.GetOrigCorner( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'REFPOS', 'i') or 0)
|
||||
end
|
||||
sOrigCorner = WD.GetOrigCorner( EgtGetInfo( BtlInfoId, 'REFPOS', 'i') or 0)
|
||||
end
|
||||
-- offset da interfaccia
|
||||
local dDeltaXFromBtl = EgtGetInfo( BtlInfoId, 'PANELDELTAY', 'd') or 0
|
||||
local dDeltaYFromBtl = EgtGetInfo( BtlInfoId, 'PANELDELTAX', 'd') or 0
|
||||
local dDeltaZFromBtl = EgtGetInfo( BtlInfoId, 'PANELDELTAZ', 'd') or 0
|
||||
-- se da interfaccia arriva un valore > 0 si usa quello, altrimenti si legge da WallData (default 0)
|
||||
local DeltaX = EgtIf( dDeltaXFromBtl > 0, dDeltaXFromBtl, WD.DELTA_X or 0)
|
||||
local DeltaY = EgtIf( dDeltaYFromBtl > 0, dDeltaYFromBtl, WD.DELTA_Y or 0)
|
||||
local DeltaZ = EgtIf( dDeltaZFromBtl > 0, dDeltaZFromBtl, WD.DELTA_Z or 0)
|
||||
|
||||
if sOrigCorner == 'TL' then
|
||||
nCorner = MCH_CR.TL
|
||||
OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( 0 + abs( DeltaX), b3Tab:getDimY() - abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'BL' then
|
||||
nCorner = MCH_CR.BL
|
||||
OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( 0 + abs( DeltaX), abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'TR' then
|
||||
nCorner = MCH_CR.TR
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( DeltaX), b3Tab:getDimY() - abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'BR' then
|
||||
nCorner = MCH_CR.BR
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( DeltaX), abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'TM' then
|
||||
nCorner = MCH_CR.TR
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( DeltaX), b3Tab:getDimY() - abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'BM' then
|
||||
nCorner = MCH_CR.BR
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( DeltaX), abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'TN' then
|
||||
nCorner = MCH_CR.TL
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( DeltaX), b3Tab:getDimY() - abs( DeltaY), DeltaZ)
|
||||
elseif sOrigCorner == 'BN' then
|
||||
nCorner = MCH_CR.BL
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( DeltaX), abs( DeltaY), DeltaZ)
|
||||
end
|
||||
-- Impostazione dell'attrezzaggio di default
|
||||
EgtImportSetup()
|
||||
@@ -120,6 +132,7 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
|
||||
nRaw = EgtAddRawPart( Point3d( 0, 0, 0), dRawL, dRawW, dRawH, WD.RAWCOL)
|
||||
end
|
||||
EgtMoveToCornerRawPart( nRaw, OrigOnTab, nCorner)
|
||||
EgtSetInfo( nRaw, 'ORIGCORNER', sOrigCorner)
|
||||
EgtSetInfo( nRaw, 'ORD', 1)
|
||||
-- Inserimento dei pezzi nel grezzo
|
||||
for i = 1, #vWall do
|
||||
@@ -154,6 +167,7 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
|
||||
end
|
||||
else
|
||||
local dPosH = EgtIf( vWall[i].PosY < 0.1, ( dRawH - PartHeight) / 2, vWall[i].PosY)
|
||||
EgtSetInfo( nRaw, 'SUBPIECE', dPosH)
|
||||
ptPos = Point3d( dRawL - vWall[i].PosX - PartLen, vWall[i].PosZ, dPosH) + vtOffs
|
||||
end
|
||||
EgtAddPartToRawPart( Pz, ptPos, nRaw)
|
||||
@@ -164,7 +178,7 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Inserimento delle lavorazioni nelle pareti ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WallExec.CollectFeatures( PartId, b3Raw)
|
||||
function WallExec.CollectFeatures( PartId, b3Raw, b3Squaring)
|
||||
-- recupero le feature
|
||||
local vProc = {}
|
||||
local LayerId = {}
|
||||
@@ -205,12 +219,22 @@ function WallExec.CollectFeatures( PartId, b3Raw)
|
||||
Proc.DistanceToRawPart = WL.GetProcessDistanceToRawPart( Proc, b3Raw)
|
||||
-- recupero informazioni sulle facce della feature
|
||||
Proc.Face = {}
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Elevation = WL.GetFaceElevation( Proc.Id, i - 1, PartId)}
|
||||
if Proc.Fct < 50 then
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Elevation = WL.GetFaceElevation( Proc.Id, i - 1, PartId)}
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
table.insert( vProc, Proc)
|
||||
-- se squadratura sui pezzi, si annullano le lavorazioni esterne al box di squadratura
|
||||
if b3Squaring then
|
||||
local b3SquaringReduced = BBox3d( b3Squaring)
|
||||
b3SquaringReduced:expand( -0.1)
|
||||
if not OverlapsXY( Proc.Box, b3SquaringReduced) then
|
||||
Proc.Flag = 0
|
||||
end
|
||||
end
|
||||
-- se foro
|
||||
if Drill.Identify( Proc) then
|
||||
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
||||
@@ -336,7 +360,7 @@ local function PrintFeatures( vProc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddFeatureMachining( Proc, nRawId, b3Raw, vNLO)
|
||||
local function AddFeatureMachining( Proc, nRawId, b3Raw, vNLO, b3Squaring)
|
||||
local bOk = true
|
||||
local sErr = ''
|
||||
EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1)
|
||||
@@ -379,7 +403,7 @@ local function AddFeatureMachining( Proc, nRawId, b3Raw, vNLO)
|
||||
-- se contorno libero, outline o apertura ( 0/3/4-250/251/252-X)
|
||||
elseif FreeContour.Identify( Proc) then
|
||||
-- esecuzione contorno libero
|
||||
bOk, sErr = FreeContour.Make( Proc, nRawId, b3Raw, vNLO)
|
||||
bOk, sErr = FreeContour.Make( Proc, nRawId, b3Raw, vNLO, b3Squaring)
|
||||
-- se feature custom (Variant)
|
||||
elseif Variant.Identify( Proc) then
|
||||
-- esecuzione
|
||||
@@ -1062,6 +1086,52 @@ local function SetMirroredOperations()
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CalculateSquaring( sSquaringTool, RawPart, vPart)
|
||||
local dRawPartHeight = RawPart.b3:getDimZ()
|
||||
local bOk
|
||||
local sMsg = ''
|
||||
local SquaringTools = {}
|
||||
local SquaringParameters = {}
|
||||
local b3Squaring
|
||||
|
||||
SquaringTools = Squaring.GetTools()
|
||||
bOk = Squaring.AreToolsOk( sSquaringTool, SquaringTools, dRawPartHeight)
|
||||
if not bOk then
|
||||
sMsg = 'Squaring failed: cannot find matching tools'
|
||||
return false, {}, nil, sMsg
|
||||
end
|
||||
|
||||
SquaringParameters, b3Squaring = Squaring.CalculateParameters( sSquaringTool, SquaringTools, RawPart, vPart)
|
||||
if not SquaringParameters or next( SquaringParameters) == nil then
|
||||
sMsg = 'Squaring failed: cannot calculate parameters'
|
||||
return false, {}, nil, sMsg
|
||||
end
|
||||
|
||||
return true, SquaringParameters, b3Squaring, sMsg
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddSquaring( SquaringParameters, b3Squaring)
|
||||
local nFirstOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( 1))
|
||||
local bOk
|
||||
local sMsg = ''
|
||||
local OperationsId = {}
|
||||
|
||||
bOk, sMsg, OperationsId = Squaring.AddMachinings( SquaringParameters, b3Squaring, nFirstOperationId)
|
||||
if not bOk then
|
||||
for i = 1, #OperationsId do
|
||||
EgtRemoveOperation( i)
|
||||
end
|
||||
sMsg = 'Squaring failed: cannot apply machinings'
|
||||
return false, sMsg
|
||||
end
|
||||
|
||||
Squaring.AddScrapRemoval( nFirstOperationId)
|
||||
|
||||
return true, sMsg
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WallExec.ProcessFeatures()
|
||||
-- errori e stato
|
||||
@@ -1079,11 +1149,57 @@ function WallExec.ProcessFeatures()
|
||||
table.insert( vPart, {Id=nPartId, Box=b3Solid})
|
||||
nPartId = EgtGetNextPartInRawPart( nPartId)
|
||||
end
|
||||
|
||||
-- calcolo i parametri della squadratura, se richiesta
|
||||
local SquaringParameters = {}
|
||||
local b3Squaring
|
||||
if WD.SQUARING_TYPE and WD.SQUARING_TYPE > 0 then
|
||||
local RawPart = { nId = nRawId, b3 = b3Raw}
|
||||
local bOk, sMsg
|
||||
if type( WD.SQUARING_TOOL) ~= "number" then
|
||||
WD.SQUARING_TOOL = 0
|
||||
end
|
||||
|
||||
if WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 1 then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'DoubleDiskmill', RawPart, vPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 2) then
|
||||
-- attualmente non gestito, va modificata la configurazione macchina e non si sa se sia gestito in macchina (PLC)
|
||||
bOk = false
|
||||
sMsg = 'Squaring not possible : double blade + diskmill not supported'
|
||||
--SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'DoubleDiskmillAndBlade', RawPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 3) then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'DoubleBlade', RawPart, vPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 4) then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'Diskmill', RawPart, vPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 5) then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'Blade', RawPart, vPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 6) then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'DoubleMill', RawPart, vPart)
|
||||
end
|
||||
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 7) then
|
||||
bOk, SquaringParameters, b3Squaring, sMsg = CalculateSquaring( 'Mill', RawPart, vPart)
|
||||
end
|
||||
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
|
||||
elseif sMsg and #sMsg > 0 then
|
||||
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
|
||||
else
|
||||
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=0, TaskId=0})
|
||||
end
|
||||
end
|
||||
|
||||
-- raccolgo l'elenco delle feature da lavorare, ciclando sui pezzi
|
||||
local vProc = {}
|
||||
for i = 1, #vPart do
|
||||
-- recupero le feature di lavorazione della parete
|
||||
local vPartProc = WallExec.CollectFeatures( vPart[i].Id, b3Raw)
|
||||
local vPartProc = WallExec.CollectFeatures( vPart[i].Id, b3Raw, b3Squaring)
|
||||
vProc = EgtJoinTables( vProc, vPartProc)
|
||||
end
|
||||
-- classifico topologicamente le feature
|
||||
@@ -1110,7 +1226,7 @@ function WallExec.ProcessFeatures()
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 then
|
||||
local bOk, sMsg = AddFeatureMachining( Proc, nRawId, b3Raw, vNLO)
|
||||
local bOk, sMsg = AddFeatureMachining( Proc, nRawId, b3Raw, vNLO, b3Squaring)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -1210,7 +1326,19 @@ function WallExec.ProcessFeatures()
|
||||
end
|
||||
-- ordinamento standard
|
||||
SortMachinings( nPhase, PrevMch)
|
||||
-- squadratura, se richiesta
|
||||
if SquaringParameters and next( SquaringParameters) ~= nil then
|
||||
local bOk, sMsg = AddSquaring( SquaringParameters, b3Squaring)
|
||||
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
|
||||
elseif sMsg and #sMsg > 0 then
|
||||
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
|
||||
else
|
||||
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=0, TaskId=0})
|
||||
end
|
||||
end
|
||||
-- Aggiornamento finale di tutto
|
||||
if nGetPriorityFromBtl > 0 then
|
||||
InsertScrapRemoval( nPhase)
|
||||
|
||||
@@ -157,9 +157,9 @@ local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b')
|
||||
|
||||
-- FLIP
|
||||
local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part)
|
||||
local bFlip
|
||||
|
||||
if not bManualFlip then
|
||||
local bFlip
|
||||
-- analizzo stati flip delle feature
|
||||
local nFlip0Min = 100
|
||||
local nFlip0Cnt = 0
|
||||
@@ -440,7 +440,7 @@ if not bManualRot then
|
||||
-- setto info nel pezzo
|
||||
if nRotate > 0 then
|
||||
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bFlip, -nRotate, nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
|
||||
|
||||
+47
-41
@@ -19,7 +19,7 @@ NEST.MACH_AREA_OTHER_DIAM = 200
|
||||
NEST.MACH_AREA_IGNORE_3rdFACE = 1 -- 0
|
||||
|
||||
|
||||
local sLog = 'NestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN["1"] .. ', ' .. WIDTH["1"]
|
||||
local sLog = 'NestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1] .. ', ' .. WIDTH[1]
|
||||
EgtOutLog( sLog)
|
||||
|
||||
-- Cancello file di log specifico
|
||||
@@ -1128,9 +1128,10 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
||||
if nRotate >= 360 then
|
||||
nRotate = nRotate - 360
|
||||
end
|
||||
if nRotate > 0 then
|
||||
if nRotate > 0 then
|
||||
local bPartFlip = ( ( EgtGetInfo( nPartId, "INVERTED", 'i') or 0) == 180)
|
||||
local nPartRot = EgtGetInfo( nPartId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -nRotate, nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( nPartId, "ROTATED", nTotRot)
|
||||
EgtSetInfo( nPartId, "MODIFIEDFORNEST", 1)
|
||||
@@ -1325,8 +1326,9 @@ local function ComputeRestrictedZones( RawParts)
|
||||
bOnOppositeSide = true
|
||||
-- aggiorno le info di rotazione
|
||||
if res.nRotate > 0 then
|
||||
local bPartFlip = ( ( EgtGetInfo( AngleClassification[nInd].PartId, "INVERTED", 'i') or 0) == 180)
|
||||
local nPartRot = EgtGetInfo( AngleClassification[nInd].PartId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - res.nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -res.nRotate, res.nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( AngleClassification[nInd].PartId, "ROTATED", nTotRot)
|
||||
EgtSetInfo( AngleClassification[nInd].PartId, "MODIFIEDFORNEST", 1)
|
||||
@@ -1507,7 +1509,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
||||
bRotNest = false
|
||||
elseif EgtExistsInfo( nPartId, "NestRot") then
|
||||
nStepRotNest = EgtGetInfo( nPartId, "NestStepRot", 'i')
|
||||
nRotate = EgtGetInfo( nPartId, "NestRot", 'i')
|
||||
bRotNest = EgtGetInfo( nPartId, "NestAllowRot", 'b')
|
||||
-- verifico se rotazione è valida (pezzo è contenuto nel grezzo)
|
||||
local bValidRotationInRaw = b3Part:getDimX() < RawParts[1].Len - 2 * NEST.KERF + GEO.EPS_SMALL and b3Part:getDimY() < dRawMaxWidth - 2 * NEST.KERF + GEO.EPS_SMALL
|
||||
@@ -1628,7 +1629,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
||||
if bOnEdge or bOnAngle then
|
||||
local nBoxLayerId = EgtGetFirstNameInGroup( nPartId, "Box")
|
||||
local nBoxId = EgtGetFirstNameInGroup( nBoxLayerId, "Box")
|
||||
local b3Part = EgtGetBBoxGlob(nBoxId, GDB_BB.STANDARD)
|
||||
local b3Part = EgtGetBBoxGlob(nBoxId, GDB_BB.STANDARD)
|
||||
|
||||
-- punto di riferimento sul pezzo
|
||||
local ptRef
|
||||
@@ -1806,40 +1807,39 @@ if bNestingOk then
|
||||
end
|
||||
end
|
||||
|
||||
-- aggiungo pezzi nestati a mano
|
||||
nPartCount = 0
|
||||
for nInd = 1, #vDoneManually do
|
||||
if vDoneManually[nInd].SheetId == nId then
|
||||
vDoneManually[nInd].Done = 1
|
||||
for nInd2 = 1, #(vDoneManually[nInd].Parts) do
|
||||
nPartCount = nPartCount + 1
|
||||
local nPartDuploId = EgtDuploNew( vDoneManually[nInd].Parts[nInd2].Id)
|
||||
|
||||
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
||||
local sToolOutlines = EgtGetInfo( vDoneManually[nInd].Parts[nInd2].Id, "ToolOutlines", 's')
|
||||
if sToolOutlines then
|
||||
-- recupero o creo il gruppo per gli outlines
|
||||
local nToolOutlinesGrp = EgtGetFirstNameInGroup( nPartDuploId, "ToolOutlines")
|
||||
if not nToolOutlinesGrp then
|
||||
nToolOutlinesGrp = EgtGroup( nPartDuploId)
|
||||
EgtSetName( nToolOutlinesGrp, "ToolOutlines")
|
||||
EgtSetStatus( nToolOutlinesGrp, GDB_ST.ON)
|
||||
end
|
||||
|
||||
for str in string.gmatch(sToolOutlines, "([^"..",".."]+)") do
|
||||
EgtCopyGlob( tonumber(str), nToolOutlinesGrp)
|
||||
-- aggiungo pezzi nestati a mano
|
||||
nPartCount = 0
|
||||
for nInd = 1, #vDoneManually do
|
||||
if vDoneManually[nInd].SheetId == nId then
|
||||
vDoneManually[nInd].Done = 1
|
||||
for nInd2 = 1, #(vDoneManually[nInd].Parts) do
|
||||
nPartCount = nPartCount + 1
|
||||
local nPartDuploId = EgtDuploNew( vDoneManually[nInd].Parts[nInd2].Id)
|
||||
|
||||
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
||||
local sToolOutlines = EgtGetInfo( vDoneManually[nInd].Parts[nInd2].Id, "ToolOutlines", 's')
|
||||
if sToolOutlines then
|
||||
-- recupero o creo il gruppo per gli outlines
|
||||
local nToolOutlinesGrp = EgtGetFirstNameInGroup( nPartDuploId, "ToolOutlines")
|
||||
if not nToolOutlinesGrp then
|
||||
nToolOutlinesGrp = EgtGroup( nPartDuploId)
|
||||
EgtSetName( nToolOutlinesGrp, "ToolOutlines")
|
||||
EgtSetStatus( nToolOutlinesGrp, GDB_ST.ON)
|
||||
end
|
||||
|
||||
for str in string.gmatch(sToolOutlines, "([^"..",".."]+)") do
|
||||
EgtCopyGlob( tonumber(str), nToolOutlinesGrp)
|
||||
end
|
||||
end
|
||||
|
||||
-- applico flip, rotazione e traslazione pezzo e box da nesting
|
||||
EgtSetInfo( nMachGroup, "PART" .. nPartCount, nPartDuploId .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posX, 3) .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posY, 3) .. "," .. 0 .."," .. 0)
|
||||
EgtSetInfo( nPartDuploId, "POSX", vDoneManually[nInd].Parts[nInd2].posX)
|
||||
EgtSetInfo( nPartDuploId, "POSY", vDoneManually[nInd].Parts[nInd2].posY)
|
||||
end
|
||||
|
||||
-- applico flip, rotazione e traslazione pezzo e box da nesting
|
||||
EgtSetInfo( nMachGroup, "PART" .. nPartCount, nPartDuploId .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posX, 3) .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posY, 3) .. "," .. 0 .."," .. 0)
|
||||
EgtSetInfo( nPartDuploId, "POSX", vDoneManually[nInd].Parts[nInd2].posX)
|
||||
EgtSetInfo( nPartDuploId, "POSY", vDoneManually[nInd].Parts[nInd2].posY)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- altrimenti pezzo
|
||||
else
|
||||
@@ -1884,15 +1884,21 @@ if bNestingOk then
|
||||
EgtSetInfo( nPartDuploId, "POSX", ptPos:getX() + dXCorr)
|
||||
EgtSetInfo( nPartDuploId, "POSY", ptPos:getY() + dYCorr)
|
||||
|
||||
local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0
|
||||
local nTotRot = dAngRot - nPartRot
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( nPartDuploId, "ROT", nTotRot)
|
||||
|
||||
local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i')
|
||||
local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i') or 0
|
||||
nPartFlip = EgtIf( nPartFlip == 180, 1, 0)
|
||||
local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0)
|
||||
EgtSetInfo( nPartDuploId, "FLIP", nTotFlip)
|
||||
|
||||
local bPartFlip = ( nTotFlip == 180)
|
||||
local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -dAngRot, dAngRot)
|
||||
if nTotRot < 0 then
|
||||
nTotRot = nTotRot + 360
|
||||
elseif nTotRot >= 360 then
|
||||
nTotRot = nTotRot - 360
|
||||
end
|
||||
EgtSetInfo( nPartDuploId, "ROT", nTotRot)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+67
-2
@@ -1,9 +1,74 @@
|
||||
==== Wall Update Log ====
|
||||
|
||||
Versione 2.6k3 (27/11/2024)
|
||||
- Modif : migliorato calcolo approccio e retrazione in Sidemill/Sidegroove
|
||||
|
||||
Versione 2.6k2 (19/11/2024)
|
||||
- Modif : in Nesting riportata allo stato precedente la tolleranza posizionamento pannelli sul bordo
|
||||
|
||||
Versione 2.6k1 (14/11/2024)
|
||||
- Added : aggiunta squadratura master panel
|
||||
- Modif : L010 si inseriscono con lama anche se il percorso è breve
|
||||
- Fixed : in Nesting corretto errore in posizionamento pannelli che devono stare necessariamente sul bordo della tavola
|
||||
|
||||
Versione 2.6j2 (04/11/2024)
|
||||
- Modif : Modificato limite dimensione tasca per utilizzo lama come SideGroove
|
||||
|
||||
Versione 2.6j1 (29/10/2024)
|
||||
- Fixed : in Nesting e Flip/Rot corretto problema in rotazione pezzi che causava ribaltamenti non voluti nella copia grezzo
|
||||
|
||||
Versione 2.6i2 (30/09/2024)
|
||||
- Modif : aggiunta nota altezza sottopezzo, per pareti a layer
|
||||
|
||||
Versione 2.6i1 (25/09/2024)
|
||||
- Fixed : in NestProcess correzione in lettura array per cambio dll di lettura
|
||||
|
||||
Versione 2.6h2 (28/08/2024)
|
||||
- Modif : Aggiunto controllo licenza/chiave per abilitazione generazione PartProgram
|
||||
- Fixed : in FreeContour corretto caso in cui si chiedevano informazioni sulla faccia non presenti.
|
||||
|
||||
Versione 2.6h1 (20/08/2024)
|
||||
- Modif : in LapJoint, se fresa Side trovata ma non applicabile, si considera come se non trovata
|
||||
- Modif : in Collect analisi facce limitata a feature che ne hanno meno di 50
|
||||
- Modif : aggiunti nuovi parametri alla chiamata della funzione GetChainSawStartAngs da WallData della macchina
|
||||
|
||||
Versione 2.6g2 (19/07/2024)
|
||||
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
|
||||
|
||||
Versione 2.6g1 (17/07/2024)
|
||||
- Modif : in ProcessDrill, se foro verticale passante e diametro inferiore a 100 mm, riduzione affondamento di 5 mm sostituito con tab
|
||||
- Fixed : correzioni a utilizzo DEFAULT_RAW_NO_EXTRA_WIDTH
|
||||
|
||||
Versione 2.6f1 (21/06/2024)
|
||||
- Added : in BatchProcess e BatchProcessNew aggiunto DEFAULT_RAW_NO_EXTRA_WIDTH per eliminare il sovramateriale grezzo in vista
|
||||
|
||||
Versione 2.6e2 (24/05/2024)
|
||||
- Modif : in LapJoint se non si trova una lavorazione di tipo side si cerca una pocketing
|
||||
- Fixed : in BatchProcessNew se generazione non abilitata si salta questa fase invece di restituire errore
|
||||
- Fixed : piccoli errori in LapJoint e DoubleCut.
|
||||
|
||||
Versione 2.6e1 (03/03/5/2024)
|
||||
- Fixed : correzione per assegnazione a SawCut di flag passante (bIsThrough).
|
||||
|
||||
Versione 2.6c3 (26/03/2024)
|
||||
- Modif : modifica per richiamare le nuove funzioni di Test interferenza solidi superfici nel controllo validità lavorazione pulizia spigoli interni
|
||||
- Modif : in compilazione vengono eliminate le info di debug
|
||||
- Fixed : in processSawCut si ignora verso vettore se taglio passante.
|
||||
|
||||
Versione 2.6b2 (21/02/2024)
|
||||
- Added : aggiunta gestione spostamento pannello rispetto a origine da dato BTL di TS3v7.
|
||||
|
||||
Versione 2.6b1 (20/02/2024)
|
||||
- Modif : In BatchProcess tolleranza su altezza pannello in grezzo portata a 0.1 mm
|
||||
- Fixed : in LapJoint piccola correzione ai casi in cui si utilizza il SIDESTEP.
|
||||
|
||||
Versione 2.5l2 (21/12/2023)
|
||||
- Fixed : in FreeContour -> MakeByPocket corretto un bug che provocava la cancellazione della feature dopo averla lavorata
|
||||
|
||||
Versione 2.5l1 (13/12/2023)
|
||||
- Modif : modifiche a WallExec, WallLib, FeatureTopology per allineamento Topology con Beam
|
||||
- Modif : In FreeContour -> MakeByPocket aggiunta la possibilità di svuotare tasche passanti
|
||||
- Modif : In FreeContour -> MakeByPocket in tasche speciali cliente 90480029 forzato step unico
|
||||
- Modif : in FreeContour -> MakeByPocket aggiunta la possibilità di svuotare tasche passanti
|
||||
- Modif : in FreeContour -> MakeByPocket in tasche speciali cliente 90480029 forzato step unico
|
||||
|
||||
Versione 2.5k1 (14/11/2023)
|
||||
- Added : aggiunte lavorazioni in doppio.
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
-- Version.lua by Egalware s.r.l. 2023/12/13
|
||||
-- Version.lua by Egalware s.r.l. 2024/08/20
|
||||
-- Gestione della versione di Wall
|
||||
|
||||
NAME = 'Wall'
|
||||
VERSION = '2.5l1'
|
||||
MIN_EXE = '2.5b3'
|
||||
VERSION = '2.6k3'
|
||||
MIN_EXE = '2.6k1'
|
||||
|
||||
Reference in New Issue
Block a user