Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d6e98875fa | |||
| ba6142dbc5 | |||
| cfaa30d55c | |||
| ea79ac1366 | |||
| 2468599200 | |||
| ea598ef7ff | |||
| 9290d3f1cf | |||
| 698a913a93 | |||
| f62c42475e | |||
| f397b220b9 | |||
| d19cf453e0 | |||
| a9d497925d | |||
| ef5170b6e6 | |||
| 3d2b740e89 | |||
| b7078cfe11 | |||
| 30726886c1 | |||
| ed80dccaf0 | |||
| 0f4a0804e2 |
@@ -214,7 +214,8 @@ function WMachiningLib.FindSurfacing( sType)
|
|||||||
local Surfacing = Surfacings[i]
|
local Surfacing = Surfacings[i]
|
||||||
if Surfacing.On and Surfacing.Type == sType and SetCurrMachiningAndTool( Surfacing.Name) then
|
if Surfacing.On and Surfacing.Type == sType and SetCurrMachiningAndTool( Surfacing.Name) then
|
||||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||||
if nMchType == MCH_MY.SURFFINISHING then
|
if (( sType == 'Roughing' and nMchType == MCH_MY.SURFROUGHING) or
|
||||||
|
( sType == 'Finishing' and nMchType == MCH_MY.SURFFINISHING)) then
|
||||||
return Surfacing.Name
|
return Surfacing.Name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2024/03/24
|
-- ProcessFreeContour.lua by Egaltech s.r.l. 2026/03/30
|
||||||
-- Gestione calcolo profilo libero per Pareti
|
-- Gestione calcolo profilo libero per Pareti
|
||||||
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
||||||
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
||||||
@@ -717,19 +717,19 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
|
local function CalcInterference( nNewProc, vtExtr, ptCentr,
|
||||||
dTall1, dTall2, dDiam3, dTall3)
|
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3)
|
||||||
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
|
local ptCentrGrid1 = ptCentr + 0.1 * vtExtr
|
||||||
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
|
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
|
||||||
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1 / 2, dDiam2 / 2 - 0.1, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl1 then return true end
|
if bColl1 then return true end
|
||||||
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
|
local ptCentrGrid2 = ptCentr + dTall1 * vtExtr
|
||||||
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
|
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
|
||||||
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
|
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2 / 2 - 0.1, dTall2, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl2 then return true end
|
if bColl2 then return true end
|
||||||
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
|
local ptCentrGrid3 = ptCentr + ( dTall1 + dTall2) * vtExtr
|
||||||
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
|
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
|
||||||
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
|
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3 / 2 - 0.1, dTall3, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl3 then return true end
|
if bColl3 then return true end
|
||||||
-- restituisco risultato controllo collisioni
|
-- restituisco risultato controllo collisioni
|
||||||
return false
|
return false
|
||||||
@@ -785,8 +785,8 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
|
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
|
||||||
bThruThick, dThSurf, dDiam1, dDiam2, dTall1,
|
bThruThick, dThSurf, dConeSideAng, dDiam1, dTall1,
|
||||||
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
|
dDiam2, dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
|
||||||
-- variabili costruzione geometria
|
-- variabili costruzione geometria
|
||||||
local pAuxId = {}
|
local pAuxId = {}
|
||||||
local nAuxId
|
local nAuxId
|
||||||
@@ -854,23 +854,21 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
-- sommo i tre versori per avere una direzione media
|
-- sommo i tre versori per avere una direzione media
|
||||||
vtExtrExit = vtN2 + vtN3
|
vtExtrExit = vtN2 + vtN3
|
||||||
vtExtrExit:normalize()
|
vtExtrExit:normalize()
|
||||||
-- se tipo 1 calcolo angolo tilt di 45°
|
-- calcolo la componente Z dipendente dall'angolo tilt
|
||||||
if nTypeConeCut == 1 then
|
local dAlfa = EgtClamp( dConeSideAng, 15, 30)
|
||||||
vtExtr = vtExtrExit + Z_AX()
|
local dGamma = 90 - asin( sqrt( 2) * sin( dConeSideAng))
|
||||||
-- altrimenti tipo 2, calcolo angolo tilt di 33° (dalla verticale)
|
local dTanGamma = sin( dGamma) / cos( dGamma)
|
||||||
else
|
vtExtr = vtExtrExit + Vector3d( 0, 0, dTanGamma)
|
||||||
vtExtr = vtExtrExit + Vector3d(0,0,1.539865)
|
|
||||||
end
|
|
||||||
vtExtr:normalize()
|
vtExtr:normalize()
|
||||||
local vtCheck = Vector3d(vtExtr)
|
local vtCheck = Vector3d( vtExtr)
|
||||||
-- se ho un offset angolare ruoto il percorso
|
-- se ho un offset angolare ruoto il percorso
|
||||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
if abs( dOffsAng) > 100 * GEO.EPS_ANG_SMALL then
|
||||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||||
end
|
end
|
||||||
-- controllo se c'è collisione con le facce della superfice
|
-- controllo se c'è collisione con le facce della superfice
|
||||||
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach),
|
||||||
dTall1, dTall2, dDiam3, dTall3) then
|
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3) then
|
||||||
local sErr = 'Collision detect from clean corner tool and surface'
|
local sErr = 'Collision detected between clean corner tool and surface'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return true, ''
|
return true, ''
|
||||||
end
|
end
|
||||||
@@ -1054,22 +1052,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
|||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dMillDiam = 20
|
local dMillDiam = 20
|
||||||
local dMillTotDiam = 20
|
local dMillTotDiam = 20
|
||||||
local dMillDiamTh = 20
|
local dMillLength = 20
|
||||||
local dToolLength = 20
|
local dMillThick = 20
|
||||||
local dThickTool = 20
|
local dMillSideAng = 0
|
||||||
local dSideAng = 0
|
local dMillStemLength = 10
|
||||||
|
local dMillThDiam = 70
|
||||||
|
local dMillThLength = 20
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
|
dMillThDiam = EgtTdbGetCurrToolThDiam() or dMillThDiam
|
||||||
|
dMillThLength = EgtTdbGetCurrToolThLength() or dMillThLength
|
||||||
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
|
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
|
||||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
dMillSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dMillSideAng
|
||||||
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||||
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
|
dMillThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMillThick
|
||||||
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
|
dMillLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLength
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile
|
-- diametro massimo del cono
|
||||||
-- calcolo il secondo diametro del cono
|
dMillTotDiam = dMillDiam + ( abs( dMillThick) * tan( dMillSideAng)) * 2
|
||||||
dMillTotDiam = dMillDiam + ( abs( dThickTool) * tan( dSideAng)) * 2
|
-- lunghezza del gambo
|
||||||
|
dMillStemLength = dMillLength - abs( dMillThick) - dMillThLength
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- verifico se ciclo chiuso
|
-- verifico se ciclo chiuso
|
||||||
@@ -1157,21 +1159,21 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
|||||||
-- primo taglio
|
-- primo taglio
|
||||||
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
|
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- secondo taglio
|
-- secondo taglio
|
||||||
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
|
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- altrimenti ho un solo percorso
|
-- altrimenti ho un solo percorso
|
||||||
else
|
else
|
||||||
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, 0, dDepthMach,
|
dToolDiam, dThick, sMilling, 0, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1684,8 +1686,14 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
|
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
|
||||||
|
-- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa
|
||||||
|
local bToInvert = vFace[i].Norm:getX() >= 0.018
|
||||||
|
-- allungamento e accorciamento percorso
|
||||||
local dSal = - dSawDiam / 2
|
local dSal = - dSawDiam / 2
|
||||||
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
||||||
|
if bToInvert then
|
||||||
|
dSal, dEal = dEal, dSal
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
-- assegno utilizzo faccia
|
-- assegno utilizzo faccia
|
||||||
@@ -1695,12 +1703,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
-- assegno affondamento
|
-- assegno affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- assegno lato di lavoro e inversione direzione movimento
|
-- assegno lato di lavoro e inversione direzione movimento
|
||||||
if vFace[i].Norm:getX() < 0.018 then
|
if bToInvert then
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
||||||
else
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
|
else
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||||
@@ -1732,11 +1740,17 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
|
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
|
||||||
|
-- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa
|
||||||
|
local bToInvert = vFace[i].Norm:getX() >= 0.018
|
||||||
|
-- allungamento e accorciamento percorso
|
||||||
local dSal = - dSawDiam / 2
|
local dSal = - dSawDiam / 2
|
||||||
local dEal = - dSawDiam / 2
|
local dEal = - dSawDiam / 2
|
||||||
if ( vFace[i].Type & 2) ~= 0 then
|
if ( vFace[i].Type & 2) ~= 0 then
|
||||||
dSal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
dSal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
||||||
end
|
end
|
||||||
|
if bToInvert then
|
||||||
|
dSal, dEal = dEal, dSal
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
-- assegno utilizzo faccia
|
-- assegno utilizzo faccia
|
||||||
@@ -1746,12 +1760,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
-- assegno affondamento
|
-- assegno affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- assegno lato di lavoro e inversione direzione movimento
|
-- assegno lato di lavoro e inversione direzione movimento
|
||||||
if vFace[i].Norm:getX() < 0.018 then
|
if bToInvert then
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
||||||
else
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
|
else
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/10/02
|
-- WProcessLapJoint.lua by Egaltech s.r.l. 2026/03/30
|
||||||
-- Gestione calcolo mezzo-legno per Pareti
|
-- Gestione calcolo mezzo-legno per Pareti
|
||||||
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
|
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
|
||||||
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
||||||
@@ -698,20 +698,20 @@ local function ReorderFacesFromTab( nIdSurf, vFace)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
|
local function CalcInterference( nNewProc, vtExtr, ptCentr,
|
||||||
dTall1, dTall2, dDiam3, dTall3)
|
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3)
|
||||||
|
|
||||||
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
|
local ptCentrGrid1 = ptCentr + 0.1 * vtExtr
|
||||||
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
|
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
|
||||||
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1 / 2, dDiam2 / 2 - 0.1, dTall1, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl1 then return true end
|
if bColl1 then return true end
|
||||||
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
|
local ptCentrGrid2 = ptCentr + dTall1 * vtExtr
|
||||||
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
|
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
|
||||||
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
|
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2 / 2 - 0.1, dTall2, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl2 then return true end
|
if bColl2 then return true end
|
||||||
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
|
local ptCentrGrid3 = ptCentr + ( dTall1 + dTall2) * vtExtr
|
||||||
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
|
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
|
||||||
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
|
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3 / 2 - 0.1, dTall3, nNewProc, 0, GDB_RT.GLOB)
|
||||||
if bColl3 then return true end
|
if bColl3 then return true end
|
||||||
-- restituisco risultato controllo collisioni
|
-- restituisco risultato controllo collisioni
|
||||||
return false
|
return false
|
||||||
@@ -758,8 +758,8 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
|
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
|
||||||
bThruThick, dThSurf, dDiam1, dDiam2, dTall1,
|
bThruThick, dThSurf, dConeSideAng, dDiam1, dTall1,
|
||||||
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
|
dDiam2, dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
|
||||||
-- variabili costruzione geometria
|
-- variabili costruzione geometria
|
||||||
local pAuxId = {}
|
local pAuxId = {}
|
||||||
local nAuxId
|
local nAuxId
|
||||||
@@ -826,23 +826,21 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
-- sommo i tre versori per avere una direzione media
|
-- sommo i tre versori per avere una direzione media
|
||||||
vtExtrExit = vtN2 + vtN3
|
vtExtrExit = vtN2 + vtN3
|
||||||
vtExtrExit:normalize()
|
vtExtrExit:normalize()
|
||||||
-- se tipo 1 calcolo angolo tilt di 45°
|
-- calcolo la componente Z dipendente dall'angolo tilt
|
||||||
if nTypeConeCut == 1 then
|
local dAlfa = EgtClamp( dConeSideAng, 15, 30)
|
||||||
vtExtr = vtExtrExit + Z_AX()
|
local dGamma = 90 - asin( sqrt( 2) * sin( dConeSideAng))
|
||||||
-- altrimenti tipo 2, calcolo angolo tilt di 33° (dalla verticale)
|
local dTanGamma = sin( dGamma) / cos( dGamma)
|
||||||
else
|
vtExtr = vtExtrExit + Vector3d( 0, 0, dTanGamma)
|
||||||
vtExtr = vtExtrExit + Vector3d(0,0,1.539865)
|
|
||||||
end
|
|
||||||
vtExtr:normalize()
|
vtExtr:normalize()
|
||||||
local vtCheck = Vector3d(vtExtr)
|
local vtCheck = Vector3d(vtExtr)
|
||||||
-- se ho un offset angolare ruoto il percorso
|
-- se ho un offset angolare ruoto il percorso
|
||||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
if abs( dOffsAng) > 100 * GEO.EPS_ANG_SMALL then
|
||||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||||
end
|
end
|
||||||
-- controllo se c'è collisione con le facce della superfice
|
-- controllo se c'è collisione con le facce della superfice
|
||||||
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach),
|
||||||
dTall1, dTall2, dDiam3, dTall3) then
|
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3) then
|
||||||
local sErr = 'Collision detect from clean corner tool and surface'
|
local sErr = 'Collision detected between clean corner tool and surface'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return true, ''
|
return true, ''
|
||||||
end
|
end
|
||||||
@@ -1029,22 +1027,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
|||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dMillDiam = 20
|
local dMillDiam = 20
|
||||||
local dMillTotDiam = 20
|
local dMillTotDiam = 20
|
||||||
local dMillDiamTh = 20
|
local dMillLength = 20
|
||||||
local dToolLength = 20
|
local dMillThick = 20
|
||||||
local dThickTool = 20
|
local dMillSideAng = 0
|
||||||
local dSideAng = 0
|
local dMillStemLength = 10
|
||||||
|
local dMillThDiam = 70
|
||||||
|
local dMillThLength = 20
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
|
dMillThDiam = EgtTdbGetCurrToolThDiam() or dMillThDiam
|
||||||
|
dMillThLength = EgtTdbGetCurrToolThLength() or dMillThLength
|
||||||
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
|
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
|
||||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
dMillSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dMillSideAng
|
||||||
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||||
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
|
dMillThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMillThick
|
||||||
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
|
dMillLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLength
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile
|
-- diametro massimo del cono
|
||||||
-- calcolo il secondo diametro del cono
|
dMillTotDiam = dMillDiam + ( abs( dMillThick) * tan( dMillSideAng)) * 2
|
||||||
dMillTotDiam = dMillDiam + ( abs(dThickTool) * tan(dSideAng)) * 2
|
-- lunghezza del gambo
|
||||||
|
dMillStemLength = dMillLength - abs( dMillThick) - dMillThLength
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- copio la feature nel layer di appoggio
|
-- copio la feature nel layer di appoggio
|
||||||
@@ -1135,21 +1137,21 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
|||||||
-- primo taglio
|
-- primo taglio
|
||||||
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
|
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- secondo taglio
|
-- secondo taglio
|
||||||
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
|
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- altrimenti ho un solo percorso
|
-- altrimenti ho un solo percorso
|
||||||
else
|
else
|
||||||
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
|
||||||
dToolDiam, dThick, sMilling, 0, dDepthMach,
|
dToolDiam, dThick, sMilling, 0, dDepthMach,
|
||||||
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
|
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
|
||||||
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
|
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2302,7 +2304,7 @@ end
|
|||||||
-- se necessario forza la tasca a chiusa
|
-- se necessario forza la tasca a chiusa
|
||||||
local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
||||||
|
|
||||||
local bForceClosedPocket = false
|
local dToolOvershoot
|
||||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||||
-- verifico se la feature è sul bordo (non ci sono altri pezzi davanti alla tasca). Se è sul bordo, l'utensile potrà attaccare da fuori.
|
-- verifico se la feature è sul bordo (non ci sono altri pezzi davanti alla tasca). Se è sul bordo, l'utensile potrà attaccare da fuori.
|
||||||
local bIsFeatureOnEdge = ( Proc.Topology == 'Groove' and Proc.Fct == 4 and Proc.DistanceToNearestParts.Front > b3Raw:getDimY())
|
local bIsFeatureOnEdge = ( Proc.Topology == 'Groove' and Proc.Fct == 4 and Proc.DistanceToNearestParts.Front > b3Raw:getDimY())
|
||||||
@@ -2364,21 +2366,15 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
|||||||
if Proc.AffectedFaces.Right then
|
if Proc.AffectedFaces.Right then
|
||||||
dDistanceToNearestPart = min( dDistanceToNearestPart, Proc.DistanceToNearestParts.Right)
|
dDistanceToNearestPart = min( dDistanceToNearestPart, Proc.DistanceToNearestParts.Right)
|
||||||
end
|
end
|
||||||
-- se la distanza è inferiore ad un valore minimo forzo la tasca chiusa per evitare che la ricerca utensile fallisca
|
|
||||||
local dMinToolDiameter = 25
|
|
||||||
if dDistanceToNearestPart < dMinToolDiameter / 2 - 10 * GEO.EPS_SMALL then
|
|
||||||
bForceClosedPocket = true
|
|
||||||
dDistanceToNearestPart = dMaxDiameter
|
|
||||||
end
|
|
||||||
|
|
||||||
local bExcludeNoTipFeed = ( Proc.Topology == 'Pocket')
|
local bExcludeNoTipFeed = ( Proc.Topology == 'Pocket')
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local bUseDElevToFindPocketing = true
|
local bUseDElevToFindPocketing = true
|
||||||
local sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
|
local sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed)
|
||||||
-- se tasca troppo profonda cerco senza elevazione e limiterò la profondità
|
-- se tasca troppo profonda cerco senza elevazione e limiterò la profondità
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
bUseDElevToFindPocketing = false
|
bUseDElevToFindPocketing = false
|
||||||
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
|
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed)
|
||||||
end
|
end
|
||||||
local dMillDiam = 20
|
local dMillDiam = 20
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
@@ -2389,7 +2385,7 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
|||||||
-- se doppio cerco una lavorazione adatta
|
-- se doppio cerco una lavorazione adatta
|
||||||
if Proc.Double and Proc.Double == 2 then
|
if Proc.Double and Proc.Double == 2 then
|
||||||
local sPocketingBackup = sPocketing
|
local sPocketingBackup = sPocketing
|
||||||
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true, dDistanceToNearestPart)
|
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true)
|
||||||
if not WM.IsMachiningOkForDouble( sPocketing) then
|
if not WM.IsMachiningOkForDouble( sPocketing) then
|
||||||
Proc.Double = 0
|
Proc.Double = 0
|
||||||
sPocketing = sPocketingBackup
|
sPocketing = sPocketingBackup
|
||||||
@@ -2402,41 +2398,10 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
|||||||
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- verifico se la lavorazione (o il suo eventuale mirror) potrebbe danneggiare le parti limitrofe e devo quindi forzare una tasca chiusa
|
dToolOvershoot = min( dDistanceToNearestPart, dMillDiam / 2 + 1)
|
||||||
local bIsMachiningDamagingOtherParts = IsMachiningDamagingOtherParts( Proc, dMillDiam, nRawId)
|
|
||||||
if bIsMachiningDamagingOtherParts then
|
|
||||||
bForceClosedPocket = true
|
|
||||||
end
|
|
||||||
-- disattivo il doppio se devo forzare una tasca chiusa ma l'altra no
|
|
||||||
if Proc.Double and Proc.Double > 0 then
|
|
||||||
local bIsMirrorMachiningDamagingOtherParts = IsMachiningDamagingOtherParts( Proc.Mirror, dMillDiam, nRawId)
|
|
||||||
if bIsMachiningDamagingOtherParts ~= bIsMirrorMachiningDamagingOtherParts then
|
|
||||||
Proc.Double = 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- altrimenti diametro utensile troppo piccolo: devo forzare tasca chiusa
|
-- altrimenti diametro utensile troppo piccolo: devo forzare tasca chiusa
|
||||||
else
|
else
|
||||||
bForceClosedPocket = true
|
dToolOvershoot = 0
|
||||||
end
|
|
||||||
|
|
||||||
-- se tasca chiusa cerco lavorazione con diametro massimo pari a dimensione tasca e riverifico per eventuale doppio
|
|
||||||
if bForceClosedPocket then
|
|
||||||
dMaxDiameter = 0.9 * dStartDiameter
|
|
||||||
bUseDElevToFindPocketing = true
|
|
||||||
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
|
|
||||||
if not sPocketing then
|
|
||||||
bUseDElevToFindPocketing = false
|
|
||||||
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
|
|
||||||
end
|
|
||||||
-- se doppio cerco una lavorazione adatta
|
|
||||||
if Proc.Double and Proc.Double == 2 then
|
|
||||||
local sPocketingBackup = sPocketing
|
|
||||||
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true, dDistanceToNearestPart)
|
|
||||||
if not WM.IsMachiningOkForDouble( sPocketing) then
|
|
||||||
Proc.Double = 0
|
|
||||||
sPocketing = sPocketingBackup
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- recupero dati utensile
|
-- recupero dati utensile
|
||||||
@@ -2449,7 +2414,7 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return sPocketing, bForceClosedPocket, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam
|
return sPocketing, dToolOvershoot, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam
|
||||||
end
|
end
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
||||||
@@ -2460,7 +2425,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
|||||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||||
local nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
|
local nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
|
||||||
-- cerco lavorazione adatta e recupero i dati utensile
|
-- cerco lavorazione adatta e recupero i dati utensile
|
||||||
local sPocketing, bForceClosedPocket, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam = VerifyPocket( Proc, nFacet, dElev, nRawId)
|
local sPocketing, dToolOvershoot, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam = VerifyPocket( Proc, nFacet, dElev, nRawId)
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
local sErr = 'Error : pocketing not found in library'
|
local sErr = 'Error : pocketing not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2511,8 +2476,11 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
|||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxOptSize', 0.1)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxOptSize', 0.1)
|
||||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALOUT)
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALOUT)
|
||||||
end
|
end
|
||||||
-- setto eventuale nota per forzare tasca chiusa
|
-- setto eventuale nota per forzare massima uscita dalla geometria
|
||||||
if bForceClosedPocket then sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', 0) end
|
if dToolOvershoot then
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', dToolOvershoot)
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'ExtProj', dToolOvershoot)
|
||||||
|
end
|
||||||
-- setto eventuale nota per forzare attacco esterno, fino ad un certo spessore del grezzo
|
-- setto eventuale nota per forzare attacco esterno, fino ad un certo spessore del grezzo
|
||||||
local dMaxRawThicknessToStartOut = 75
|
local dMaxRawThicknessToStartOut = 75
|
||||||
if bIsFeatureOnEdge and ( not Proc.Double or Proc.Double == 0) then sUserNotes = EgtSetValInNotes( sUserNotes, 'OpenMinSafe', dMaxRawThicknessToStartOut) end
|
if bIsFeatureOnEdge and ( not Proc.Double or Proc.Double == 0) then sUserNotes = EgtSetValInNotes( sUserNotes, 'OpenMinSafe', dMaxRawThicknessToStartOut) end
|
||||||
|
|||||||
+48
-34
@@ -52,6 +52,7 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
local function MakeCode_1( Proc, nRawId, b3Raw)
|
local function MakeCode_1( Proc, nRawId, b3Raw)
|
||||||
|
local sWarn
|
||||||
-- recupero e verifico l'entità curva associata
|
-- recupero e verifico l'entità curva associata
|
||||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||||
if AuxId then
|
if AuxId then
|
||||||
@@ -63,41 +64,54 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId or GDB_ID.NULL, GDB_ID.ROOT)
|
local vtExtr = EgtCurveExtrusion( AuxId or GDB_ID.NULL, GDB_ID.ROOT)
|
||||||
-- recupero la lavorazione
|
-- cerco e applico le lavorazioni di superficie opportune
|
||||||
local sSurfFin = WM.FindSurfacing( 'Finishing')
|
local sMachIni = EgtGetCurrMachineDir()..'\\'..EgtGetCurrMachineName()..'.ini'
|
||||||
if not sSurfFin then
|
local bSurfRough = ( EgtGetNumberFromIni( 'Machinings', 'SurfRoughing', 0, sMachIni) >= 1)
|
||||||
local sErr = 'Error : surface finishing not found in library'
|
local SurfLav = { { Type='Roughing', Name='SurfRou_', Err=true}, { Type='Finishing', Name='SurfFin_', Err=true}}
|
||||||
EgtOutLog( sErr)
|
local nStart = EgtIf( bSurfRough, 1, 2)
|
||||||
return false, sErr
|
for i = nStart, 2 do
|
||||||
|
-- recupero la lavorazione
|
||||||
|
local sSurfLav = WM.FindSurfacing( SurfLav[i].Type)
|
||||||
|
if not sSurfLav then
|
||||||
|
if SurfLav[i].Err then
|
||||||
|
local sErr = 'Error : surface '.. SurfLav[i].Type .. ' not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
else
|
||||||
|
sWarn = 'Warning : surface '.. SurfLav[i].Type .. ' not found in library'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- inserisco la lavorazione di superficie
|
||||||
|
local sName = SurfLav[i].Name .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
local nMchFId = WM.AddMachining( Proc, sName, sSurfLav)
|
||||||
|
if not nMchFId then
|
||||||
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfLav
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
|
||||||
|
-- se lavorazione di fianco setto la nota per spostarla dopo i tagli di lama
|
||||||
|
if vtExtr:getZ() < WD.NZ_MINA then
|
||||||
|
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||||
|
end
|
||||||
|
-- aggiungo geometria
|
||||||
|
EgtSetMachiningGeometry( {{ Proc.Id, -1},{AuxId, -1}})
|
||||||
|
-- imposto posizione braccio porta testa
|
||||||
|
local nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||||
|
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
|
-- eseguo
|
||||||
|
if not EgtApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione di finitura superficie
|
return true, sWarn
|
||||||
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
||||||
local nMchFId = WM.AddMachining( Proc, sName, sSurfFin)
|
|
||||||
if not nMchFId then
|
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
|
|
||||||
-- se lavorazione di fianco setto la nota per spostarla dopo i tagli di lama
|
|
||||||
if vtExtr:getZ() < WD.NZ_MINA then
|
|
||||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
|
||||||
end
|
|
||||||
-- aggiungo geometria
|
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, -1},{AuxId, -1}})
|
|
||||||
-- imposto posizione braccio porta testa
|
|
||||||
local nSCC = MCH_SCC.ADIR_ZP
|
|
||||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
|
||||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
||||||
-- eseguo
|
|
||||||
if not EgtApplyMachining( true, false) then
|
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
|
||||||
EgtSetOperationMode( nMchFId, false)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
+11
-9
@@ -525,10 +525,8 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
|||||||
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
|
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
|
||||||
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
|
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
|
||||||
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
|
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
|
||||||
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
|
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or ( not bExistName and not ContainsStartName( nOperId, StartNames))) and
|
||||||
( not bExistName and not ContainsStartName( nOperId, StartNames))) and
|
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or ( not bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') ~= 1)) then
|
||||||
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
|
|
||||||
( not bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') ~= 1)) then
|
|
||||||
-- non si deve cambiare lo stato di attivazione della lavorazione (se disabilitata errata)
|
-- non si deve cambiare lo stato di attivazione della lavorazione (se disabilitata errata)
|
||||||
EgtSetCurrMachining( nOperId)
|
EgtSetCurrMachining( nOperId)
|
||||||
if not EgtIsMachiningEmpty() then
|
if not EgtIsMachiningEmpty() then
|
||||||
@@ -652,13 +650,15 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
|
|||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
|
||||||
-- Forature e Svuotature
|
-- Forature e Svuotature
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
|
||||||
-- -- Forature ***
|
-- Forature ***
|
||||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, nil, false, nil, true, nil, nil)
|
||||||
-- -- Svuotature ***
|
-- -- Svuotature ***
|
||||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', false)
|
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', false)
|
||||||
-- -- Fresature che sono rifiniture di spigoli
|
-- -- Fresature che sono rifiniture di spigoli
|
||||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
||||||
-- Lavorazioni di superficie
|
-- Lavorazioni di sgrossatura superficie
|
||||||
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFROUGHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
||||||
|
-- Lavorazioni di finitura superficie
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
||||||
-- Fresature per gole
|
-- Fresature per gole
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
||||||
@@ -686,7 +686,9 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
|
|||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
||||||
-- Svuotature che vanno fatte dopo i tagli con lama
|
-- Svuotature che vanno fatte dopo i tagli con lama
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
||||||
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
|
-- Lavorazioni di sgrossatura superficie che vanno fatte dopo i tagli con lama
|
||||||
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFROUGHING, nil, nil, 'MOVE_AFTER', true)
|
||||||
|
-- Lavorazioni di finitura superficie che vanno fatte dopo i tagli con lama
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
|
||||||
end
|
end
|
||||||
return PrevMch
|
return PrevMch
|
||||||
@@ -1325,7 +1327,7 @@ function WallExec.ProcessFeatures()
|
|||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
for j = 1, #vProc do
|
for j = 1, #vProc do
|
||||||
local ProcMirror = vProc[j]
|
local ProcMirror = vProc[j]
|
||||||
if Proc.Mirror.Id == ProcMirror.Id then
|
if Proc.Mirror and ( Proc.Mirror.Id == ProcMirror.Id) then
|
||||||
-- per i fori l'operazione si basa sulla geometria ausiliaria
|
-- per i fori l'operazione si basa sulla geometria ausiliaria
|
||||||
if Proc.TopologyLongName == 'DRILLING' then
|
if Proc.TopologyLongName == 'DRILLING' then
|
||||||
local AuxId = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') or 0
|
local AuxId = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') or 0
|
||||||
|
|||||||
+8
-4
@@ -1,4 +1,4 @@
|
|||||||
-- Process.lua by Egaltech s.r.l. 2022/05/09
|
-- Process.lua by Egaltech s.r.l. 2026/03/30
|
||||||
-- Gestione calcolo disposizione e lavorazioni per Pareti
|
-- Gestione calcolo disposizione e lavorazioni per Pareti
|
||||||
-- Si opera sulla macchina corrente
|
-- Si opera sulla macchina corrente
|
||||||
-- 2020/12/09 Come per BatchProcess.lua si gestiscono anche rotazioni di inversione con valori negativi.
|
-- 2020/12/09 Come per BatchProcess.lua si gestiscono anche rotazioni di inversione con valori negativi.
|
||||||
@@ -108,6 +108,10 @@ local function MyProcessInputData()
|
|||||||
|
|
||||||
-- Recupero informazione se progetto o produzione
|
-- Recupero informazione se progetto o produzione
|
||||||
local bProj = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'PROJECT', 'i') == 1)
|
local bProj = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'PROJECT', 'i') == 1)
|
||||||
|
|
||||||
|
-- Verifico se progetto deriva da BeamWall
|
||||||
|
local _, _, sExt = EgtSplitPath( EgtGetCurrFilePath() or '')
|
||||||
|
local bBwProj = ( ( string.upper( sExt or '') == '.BWE'))
|
||||||
|
|
||||||
-- Eseguo eventuali rotazioni e inversioni testa-coda
|
-- Eseguo eventuali rotazioni e inversioni testa-coda
|
||||||
for i = 1, #vWall do
|
for i = 1, #vWall do
|
||||||
@@ -115,7 +119,7 @@ local function MyProcessInputData()
|
|||||||
-- rotazione
|
-- rotazione
|
||||||
local dRotAng = EgtGetInfo( vWall[i].Id, 'ROTATED', 'd')
|
local dRotAng = EgtGetInfo( vWall[i].Id, 'ROTATED', 'd')
|
||||||
if dRotAng then
|
if dRotAng then
|
||||||
if abs( dRotAng) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'ROTATED_DONE') then
|
if abs( dRotAng) > GEO.EPS_ANG_SMALL and not bBwProj and not EgtExistsInfo( vWall[i].Id, 'ROTATED_DONE') then
|
||||||
local ptRotCen = b3Solid:getCenter()
|
local ptRotCen = b3Solid:getCenter()
|
||||||
EgtRotate( vWall[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
|
EgtRotate( vWall[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
|
||||||
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
|
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
|
||||||
@@ -125,7 +129,7 @@ local function MyProcessInputData()
|
|||||||
-- inversione
|
-- inversione
|
||||||
local dInvAng = EgtGetInfo( vWall[i].Id, 'INVERTED', 'd')
|
local dInvAng = EgtGetInfo( vWall[i].Id, 'INVERTED', 'd')
|
||||||
if dInvAng then
|
if dInvAng then
|
||||||
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
|
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL and not bBwProj and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
|
||||||
local ptInvCen = b3Solid:getCenter()
|
local ptInvCen = b3Solid:getCenter()
|
||||||
EgtRotate( vWall[i].Id, ptInvCen, Z_AX(), dInvAng - 180, GDB_RT.GLOB)
|
EgtRotate( vWall[i].Id, ptInvCen, Z_AX(), dInvAng - 180, GDB_RT.GLOB)
|
||||||
b3Solid:rotate( ptInvCen, Z_AX(), dInvAng - 180)
|
b3Solid:rotate( ptInvCen, Z_AX(), dInvAng - 180)
|
||||||
@@ -134,7 +138,7 @@ local function MyProcessInputData()
|
|||||||
end
|
end
|
||||||
-- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre multipli di 90 deg)
|
-- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre multipli di 90 deg)
|
||||||
local sType = EgtGetInfo( vWall[i].Id, 'TYPE', 's')
|
local sType = EgtGetInfo( vWall[i].Id, 'TYPE', 's')
|
||||||
if not bProj and dRotAng and dInvAng and sType ~= 'LAYER' then
|
if not bProj and not bBwProj and dRotAng and dInvAng and sType ~= 'LAYER' then
|
||||||
if abs( dInvAng - 0) < GEO.EPS_ANG_SMALL then
|
if abs( dInvAng - 0) < GEO.EPS_ANG_SMALL then
|
||||||
if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then
|
if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then
|
||||||
vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY()
|
vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY()
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
==== Wall Update Log ====
|
==== Wall Update Log ====
|
||||||
|
|
||||||
|
Versione 3.1d2 (23/04/2026)
|
||||||
|
- Modif : Tutte le forature vengono ordinate per diametro decrescente
|
||||||
|
|
||||||
|
Versione 3.1d1 (08/04/2026)
|
||||||
|
- Modif : in LapJoint, svuotature, l'uscita dalla geometria viene limitata della massima quantità che non rovina il pezzo vicino
|
||||||
|
- Fixed : correzione per chiodature
|
||||||
|
|
||||||
|
Versione 3.1c1 (02/04/2026)
|
||||||
|
- Added : in CleanCorner si gestiscono angoli diversi da 30
|
||||||
|
- Fixed : in puliture con sega a catena corrett scelta errata del lato
|
||||||
|
|
||||||
Versione 2.7k1 (20/11/2025)
|
Versione 2.7k1 (20/11/2025)
|
||||||
- Modif : in LapJoint con Q08=1 ora si fanno con milling anche tasche a L cieche da sopra
|
- Modif : in LapJoint con Q08=1 ora si fanno con milling anche tasche a L cieche da sopra
|
||||||
- Fixed : in LapJoint correzione alle lavorazioni inclinate
|
- Fixed : in LapJoint correzione alle lavorazioni inclinate
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
-- Version.lua by Egalware s.r.l. 2025/07/17
|
-- Version.lua by Egalware s.r.l. 2026/03/30
|
||||||
-- Gestione della versione di Wall
|
-- Gestione della versione di Wall
|
||||||
|
|
||||||
NAME = 'Wall'
|
NAME = 'Wall'
|
||||||
VERSION = '2.7k1'
|
VERSION = '3.1d2'
|
||||||
MIN_EXE = '2.7f2'
|
MIN_EXE = '3.1c1'
|
||||||
|
|||||||
Reference in New Issue
Block a user