Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d4c9843597 | |||
| 077cb2c586 | |||
| 8e9de6026e | |||
| b382560cfa | |||
| 339c6acb37 | |||
| 570a65c7a1 | |||
| e18a816647 | |||
| d578194d43 | |||
| e0f20d19f0 | |||
| cff4ef0d47 | |||
| d9fb464066 | |||
| 9d6a5fb496 | |||
| c3fab404a5 | |||
| fa139c84f3 | |||
| ae6853cd3f | |||
| c0618cd628 | |||
| 524b6a470c | |||
| cd4aa8ee11 | |||
| 242f5f4516 | |||
| e6a3e0c519 | |||
| 640c8af05f | |||
| 48ceceb8e0 | |||
| 5165463dbd | |||
| 9e1d424bc7 | |||
| 15c96303de | |||
| 3211f21869 | |||
| 1f4fe3597b | |||
| 0749e56b9f | |||
| 7424bdc147 | |||
| a623072e89 | |||
| 7f15b08b20 | |||
| 82d4fadaaa | |||
| d9f4d0584a | |||
| 2e5b4c9976 | |||
| 511af04c8b | |||
| 8b1d38c451 | |||
| abe3465514 | |||
| fc753c47be | |||
| ad8a7bf73f | |||
| 4a21a4be36 | |||
| aafe565474 | |||
| b6ef0a8d7a | |||
| 779f2105ba | |||
| c2b9c4b19f | |||
| 8eadb81e91 | |||
| 2bac228fe9 | |||
| c312e72fd2 | |||
| fd4683e4fa | |||
| 70661aa3d2 | |||
| a82486e9fb | |||
| cd4a7d3b91 |
@@ -2038,10 +2038,6 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- se tenone di coda è attraversato da foro allora anche il foro deve essere di coda
|
||||
if Tenon.Identify( Proc) and Proc.Tail and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
ProcB.Tail = true
|
||||
end
|
||||
-- verifiche per specchiature
|
||||
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
|
||||
-- forature
|
||||
|
||||
@@ -1239,6 +1239,40 @@ function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
||||
return Face
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetEdgesInfo( Proc, Face)
|
||||
local Edges = {}
|
||||
local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, Face.Id, GDB_ID.ROOT)
|
||||
|
||||
if nFaceType < 1 then
|
||||
for j = 1, #vEdges do
|
||||
local nPreviousEdgeIndex = j - 1
|
||||
if j == 1 then
|
||||
nPreviousEdgeIndex = #vEdges
|
||||
end
|
||||
local nNextEdgeIndex = j + 1
|
||||
if j == #vEdges then
|
||||
nNextEdgeIndex = 1
|
||||
end
|
||||
|
||||
local CurrentEdge = {}
|
||||
CurrentEdge.AdjacentFaceId = vEdges[j].Adj
|
||||
CurrentEdge.ToolDirection = Vector3d( vEdges[j].Norm)
|
||||
CurrentEdge.Length = vEdges[j].Len
|
||||
CurrentEdge.Elevation = vEdges[j].Elev
|
||||
CurrentEdge.IsOpen = vEdges[j].Open
|
||||
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
|
||||
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
|
||||
|
||||
table.insert( Edges, CurrentEdge)
|
||||
end
|
||||
else
|
||||
error( 'Face with closed hole')
|
||||
end
|
||||
|
||||
return Edges
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
||||
function BeamLib.GetAdjacencyMatrix( Proc)
|
||||
|
||||
+4
-1
@@ -275,12 +275,15 @@ local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart, dNzLimDwnUp)
|
||||
-- normale alla faccia ortogonale
|
||||
local _, vtO = EgtSurfTmFacetCenter( CutOId, 0, GDB_ID.ROOT)
|
||||
vtO = vtO - vtO * vtN1 * vtN1 ; vtO:normalize()
|
||||
local dMaxElev = EgtSurfTmFacetElevationInBBox( CutOId, 0, BBoxRawPart, true, GDB_ID.ROOT)
|
||||
-- calcolo lunghezza prima semi-faccia
|
||||
local asseX1 = vtO
|
||||
local asseY1 = vtN1 ^ asseX1
|
||||
local Frame1 = Frame3d( ptC1, ptC1+asseX1, ptC1+asseY1)
|
||||
local Box1 = EgtGetBBoxRef( Cut1Id, GDB_BB.STANDARD, Frame1)
|
||||
local x1 = Box1:getDimX()
|
||||
-- prendo il massimo tra la lugnhezza della faccia parallela e l'elevazione della corrispondente ortogonale
|
||||
x1 = max( x1, dMaxElev)
|
||||
-- calcolo lunghezza seconda semi-faccia
|
||||
local asseX2 = vtO
|
||||
local asseY2 = vtN2 ^ asseX2
|
||||
@@ -430,7 +433,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
if dElevO then
|
||||
local m = ceil( dElevO / OffsetO)
|
||||
OffsetO = dElevO / m
|
||||
end
|
||||
end
|
||||
|
||||
-- elenco di tutte le superfici generate dai tagli
|
||||
local TabFUCHSIA = {}
|
||||
|
||||
+13
-3
@@ -309,7 +309,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
bIsBiLinea = true
|
||||
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
|
||||
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
|
||||
local dCosMax = 0.951 -- cos( 18°)
|
||||
local dCosMax = 0.966 -- cos( 15°)
|
||||
local dLenMin = 30
|
||||
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
|
||||
dCosAngleL1L2 = vtTg1 * vtTg2
|
||||
@@ -467,9 +467,19 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if BD.C_SIMM and bMaximizeVerticalDepth then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
|
||||
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
|
||||
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
end
|
||||
else
|
||||
if BD.TURN == 2 then
|
||||
|
||||
@@ -170,7 +170,7 @@ function VerifyTool( Machining, MachiningType, Params, bH2)
|
||||
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
|
||||
end
|
||||
elseif MachiningType == MCH_MY.SAWING then
|
||||
return true, { H2 = bH2}
|
||||
return ( not Params.Depth or Machining.Tool.MaxMat > Params.Depth - GEO.EPS_SMALL), { H2 = bH2}
|
||||
elseif MachiningType == MCH_MY.MILLING then
|
||||
return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
|
||||
elseif MachiningType == MCH_MY.POCKETING then
|
||||
@@ -450,8 +450,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
|
||||
return FindMachining( MCH_MY.SAWING, sType, nil, bTopHead, bDownHead)
|
||||
function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion)
|
||||
return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
@@ -47,7 +47,7 @@ local ML = require( 'MachiningLib')
|
||||
-- Riconoscimento della feature
|
||||
function ProcessCut.Identify( Proc)
|
||||
-- se richiesto si forza fresatura
|
||||
Proc.bForceMill = ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1
|
||||
Proc.bForceMill = ( ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1))
|
||||
|
||||
if Proc.bForceMill then
|
||||
return false
|
||||
@@ -274,7 +274,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if bFromBottom == nil then
|
||||
bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
|
||||
end
|
||||
local dMinFeatureLengthForLongCut = 590.000
|
||||
local dMinFeatureLengthForLongCut = EgtIf( BD.C_SIMM, 590, 400)
|
||||
-- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo)
|
||||
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
|
||||
|
||||
@@ -1190,14 +1190,14 @@ local function Make2Faces( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
|
||||
return MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Solid)
|
||||
-- altrimenti provo con il truciolatore
|
||||
else
|
||||
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
-- se non ho la lavorazione esco
|
||||
if not sMilling then
|
||||
local sErr = 'Error, machining or tool not found ' .. sName .. '-' .. sMilling
|
||||
local sErr = 'Error, machining or tool not found ' .. sName
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
|
||||
@@ -250,8 +250,13 @@ function ProcessDrill.Classify( Proc, b3Raw, sDownOrSideOrStd)
|
||||
-- se ci sono delle dipendenze da altre feature da rispettare
|
||||
if sDownOrSideOrStd then
|
||||
if sDownOrSideOrStd == 'DOWN' then
|
||||
if vtExtr:getZ() < - BD.DRILL_VZ_MIN then
|
||||
Proc.Down = true
|
||||
-- se foro fatto in doppio entrambe le forature (valore assoluto) devono essere sopra al valore limite, se foro singolo deve essere sopra al valore limite se ribaltato
|
||||
if ( abs( Proc.Flg) == 2 and ( abs( vtExtr:getZ()) < - BD.DRILL_VZ_MIN) or ( abs( Proc.Flg) ~= 2 and vtExtr:getZ() < - BD.DRILL_VZ_MIN)) then
|
||||
-- in doppio non cambio di fase al foro perchè devo garantire il lato master su H1
|
||||
if not( Proc.Double) or Proc.Double == 0 then
|
||||
Proc.Down = true
|
||||
Proc.Side = false
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -599,6 +604,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
-- calcolo gli step reali
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
local nNumStep = ceil( dDepth/dStep)
|
||||
local dRealStep = dDepth / nNumStep
|
||||
-- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
|
||||
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
|
||||
dRealStep = ceil( dDepth / (nNumStep - 1))
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
|
||||
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
|
||||
end
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= Proc.PrevDouble then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
|
||||
@@ -365,7 +365,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
-- eventuali informazioni sul tipo di finitura
|
||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'HeadSide')
|
||||
local sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest')
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+98
-37
@@ -117,6 +117,7 @@ local ProcessLapJoint = {}
|
||||
require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Fbp = require( 'FaceByPocket')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DoubleCut = require( 'ProcessDoubleCut')
|
||||
local LongCut = require( 'ProcessLongCut')
|
||||
@@ -783,14 +784,16 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- verifico se è in coda
|
||||
|
||||
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
||||
if dEndDist > BD.MAX_DIST_HTFEA then
|
||||
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
|
||||
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
|
||||
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
|
||||
@@ -3479,6 +3482,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
|
||||
local sMchFind = 'Pocket'
|
||||
local dAngLimit = 40
|
||||
local sWarn
|
||||
|
||||
-- se feature é larga come trave imposto openpocket
|
||||
if nDiffWidth == 0 then
|
||||
@@ -3492,6 +3496,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
-- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della
|
||||
-- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente
|
||||
local dDiffFromSqAng = dAng + 90
|
||||
-- informazioni sul lato da lavorare
|
||||
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nSideFace + 1])
|
||||
local EdgeToMachine = {}
|
||||
for i = 1, #Edges do
|
||||
local CurrentEdge = Edges[i]
|
||||
if CurrentEdge.AdjacentFaceId == nBaseFace then
|
||||
EdgeToMachine = CurrentEdge
|
||||
end
|
||||
end
|
||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||
-- applico la svuotatura
|
||||
@@ -3517,14 +3530,28 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nSideFace}})
|
||||
-- imposto uso faccia
|
||||
local nFaceUse = BL.GetNearestOrthoOpposite(tvtN[1])
|
||||
-- imposto vettore direzione e faceUse
|
||||
local vtFaceUse = EdgeToMachine.ToolDirection
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(),3) .. ',' .. EgtNumToString( vtFaceUse:getY(),3) .. ',' .. EgtNumToString( vtFaceUse:getZ(),3))
|
||||
local nFaceUse = BL.GetNearestOrthoOpposite( vtFaceUse)
|
||||
-- aggiusto i parametri
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
|
||||
-- imposto allungamenti iniziale e finale
|
||||
if EdgeToMachine.IsStartOpen then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dDiamTool / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dDiamTool / 2)
|
||||
end
|
||||
if EdgeToMachine.IsEndOpen then
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dDiamTool / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dDiamTool / 2)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
if tvtN[2]:getY() < GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
@@ -3532,9 +3559,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
@@ -3554,36 +3581,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
bOpenStart = true
|
||||
bOpenEnd = true
|
||||
else
|
||||
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, (nBaseFace))[1]
|
||||
for j = 1, #vAdj2 do
|
||||
if vAdj2[j] == (nSideFace) then
|
||||
-- Se non esiste faccia adiacente a lato precedente -> inizio aperto
|
||||
local i = EgtIf( j > 1, j - 1, #vAdj2)
|
||||
while vAdj2[i] == (nSideFace) do
|
||||
i = EgtIf( i > 1, i - 1, #vAdj2)
|
||||
end
|
||||
bOpenStart = ( vAdj2[i] < 0)
|
||||
-- Se non esiste faccia adiacente a lato successivo -> fine aperto
|
||||
local k = EgtIf( j < #vAdj2, j + 1, 1)
|
||||
while vAdj2[k] == (nSideFace) do
|
||||
k = EgtIf( k < #vAdj2, k + 1, 1)
|
||||
end
|
||||
bOpenEnd = ( vAdj2[k] < 0)
|
||||
end
|
||||
end
|
||||
bOpenStart = EdgeToMachine.IsStartOpen
|
||||
bOpenEnd = EdgeToMachine.IsEndOpen
|
||||
end
|
||||
local sMilling
|
||||
if nUseRoughTool > 0 then
|
||||
sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
|
||||
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) end
|
||||
else
|
||||
sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk) end
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
sMilling = ML.FindMilling( 'LongSmallCut')
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
else
|
||||
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
|
||||
end
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dTDiam = 50
|
||||
@@ -3609,7 +3627,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- sistemazione inversione del percorso
|
||||
local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT))
|
||||
local bInvert = nWrkSide ~= MCH_MILL_WS.RIGHT
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
if bInvert then
|
||||
bOpenStart, bOpenEnd = bOpenEnd, bOpenStart
|
||||
end
|
||||
-- setto a 0 eventuali offset
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
-- calcolo elevazione per allungamenti attacchi con fianchi chiusi
|
||||
@@ -3632,7 +3654,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
if bOpenEnd then
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
end
|
||||
end
|
||||
end
|
||||
if bOpenEnd then
|
||||
@@ -3645,8 +3671,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
if bOpenStart then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
@@ -3657,7 +3687,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -4719,6 +4750,7 @@ SawPlusChain.ApplyOnlySawblade = false
|
||||
function SawPlusChain.IsTopologyOk( Proc)
|
||||
if Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' or
|
||||
Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' or
|
||||
Proc.TopologyLongName == 'Groove-Through-RightAngles-NotParallel-3' or
|
||||
Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' or
|
||||
Proc.TopologyLongName == 'Tunnel-Through-RightAngles-Parallel-4' then
|
||||
|
||||
@@ -5237,11 +5269,16 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
end
|
||||
|
||||
-- ricerca lavorazione
|
||||
Cutting.Name = ML.FindCutting( 'HeadSide', true, false)
|
||||
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, abs( EdgeToMachine.Elevation))
|
||||
if not Cutting.Name then
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
|
||||
Cutting.CanApply = false
|
||||
EgtOutLog( Cutting.Message)
|
||||
-- ricerca lavorazione senza considerare massima elevazione
|
||||
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, nil, 'Longest')
|
||||
if not Cutting.Name then
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
|
||||
Cutting.CanApply = false
|
||||
EgtOutLog( Cutting.Message)
|
||||
return Cutting
|
||||
end
|
||||
end
|
||||
Cutting.Type = MCH_OY.MILLING
|
||||
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
|
||||
@@ -5642,7 +5679,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
end
|
||||
else
|
||||
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
||||
if Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
|
||||
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
|
||||
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
|
||||
if Proc.MainFaces.LongFace.Edges.BottomEdge.IsStartOpen then
|
||||
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.SideEdges.StartEdge)
|
||||
@@ -6304,6 +6341,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if sMyPocketing and
|
||||
( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
|
||||
( bIsL and nUseRoughTool == 0) or
|
||||
( bIsL and Proc.Prc == 20) or
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) or
|
||||
( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then
|
||||
sPocketing = sMyPocketing
|
||||
@@ -6366,6 +6404,21 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
bUseOtherFace = true
|
||||
rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
end
|
||||
|
||||
-- se forma a U (recupero la larghezza della faccia perpendicolarmente alle altre)
|
||||
if Proc.Fct == 3 and bIsU then
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
|
||||
local vtX = vtN2 ^ vtN
|
||||
if not vtX:isSmall() then
|
||||
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
|
||||
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef)
|
||||
if b3Ref then
|
||||
dH = b3Ref:getDimX()
|
||||
dV = b3Ref:getDimY()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- eseguo
|
||||
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
rfFac, dH, dV, dFacElev, bForceUseBlade,
|
||||
@@ -7389,6 +7442,14 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se è una spianatura a una faccia richiamo la LongCut
|
||||
elseif Proc.Prc == 90 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se arriva da una cut si applica una svuotatura
|
||||
elseif Proc.Prc == 10 then
|
||||
local dDiam = min( Proc.Face[1].Height, Proc.Face[1].Width) * 3
|
||||
local bMillUp = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() < 0.342)
|
||||
local sMchFindMaster = 'OpenPocket'
|
||||
local _, sPocketing = VerifyPocket( Proc, dDiam, nil, nil, sMchFindMaster, bMillUp, bMillDown)
|
||||
return Fbp.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||
-- altrimenti, con lama
|
||||
else
|
||||
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
|
||||
@@ -209,7 +209,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
|
||||
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
end
|
||||
end
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
@@ -218,7 +223,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
|
||||
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
end
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dTCI)
|
||||
end
|
||||
|
||||
@@ -196,28 +196,47 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
end
|
||||
end
|
||||
|
||||
local dDiceFaceMaxH = 0
|
||||
local dDiceFaceMinH = GEO.INFINITO
|
||||
-- controllo per eseguire solo un taglio ottimizzato
|
||||
local bExecJustOneCut = false
|
||||
local dDiceFaceDim = GEO.INFINITO
|
||||
if ( i % 2) == 0 then
|
||||
for cont = 1, #vCuts[i] do
|
||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
|
||||
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
|
||||
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
|
||||
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][cont]) ) / dDiceFaceV - dDiceFaceH
|
||||
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
|
||||
-- se feature verso Z, si ammette anche lavorazione in doppio
|
||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceH
|
||||
break
|
||||
end
|
||||
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
|
||||
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceV
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se si può fare, faccio unico taglio parallelo
|
||||
if ( i % 2) == 0 and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
|
||||
if bExecJustOneCut then
|
||||
local bDoubleCut = false
|
||||
local dCutExtra = BD.CUT_EXTRA
|
||||
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
|
||||
if dMaxDepth < dDiceFaceDim then
|
||||
bDoubleCut = true
|
||||
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
|
||||
end
|
||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
if Proc.Tail then
|
||||
|
||||
local nFaceUseCut1, nFaceUseCut2
|
||||
-- se feature rivolta verso alto setto direzione taglio davanti e dietro
|
||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
-- altrimenti taglio da sopra
|
||||
else
|
||||
nFaceUseCut2 = MCH_MILL_FU.ORTHO_DOWN
|
||||
end
|
||||
|
||||
if Proc.Tail and AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
|
||||
end
|
||||
if bDoubleCut then
|
||||
|
||||
@@ -573,7 +573,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'TailSide')
|
||||
local sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest')
|
||||
if not sCutting then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6k2 (28/11/2024)
|
||||
- Modif : nei tagli migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno
|
||||
- Modif : nei tagli migliorato controllo rimozione del primo cubetto molto piccolo
|
||||
- Modif : nei tagli migliorati i casi con bilinea
|
||||
- Fixed : in lapjoint corretto un caso in cui si sbagliava a calcolare la dimensione della tasca
|
||||
|
||||
Versione 2.6k1 (15/11/2024)
|
||||
- Modif : in macchine tipo Fast lunghezza minima feature per considerare taglio lungo portata a 400 mm
|
||||
- Modif : in tacche si applica svuotatura anche nel caso di elevazione non raggiunta
|
||||
- Modif : in forature in doppio, se necessario, si aumenta lo step per evitare collisione tra le punte durante lavorazione
|
||||
- Fixed : in L010 correzione in utilizzo Q07 (forzatura frese)
|
||||
- Fixed : in coda di rondine corretto bug che causava un blocco anomalo del programma
|
||||
|
||||
Versione 2.6j4 (06/11/2024)
|
||||
- Fixed : corretto caso in cui i fori passanti fatti con due teste finiviano nella rotazione sbagliata, provocando un errore di chariot collision
|
||||
|
||||
Versione 2.6j3 (18/10/2024)
|
||||
- Modif : nei tagli orizzontali si inverte SCC per evitare problemi di cubetti incastrati
|
||||
- Modif : modifiche in ordinamento fori che intersecano tenoni
|
||||
- Fixed : corretto caso con fori sul tenone spostati in coda nella fase errata
|
||||
|
||||
Versione 2.6j2 (17/10/2024)
|
||||
- Fixed : in forature con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse
|
||||
|
||||
Versione 2.6j1 (10/10/2024)
|
||||
- Modif : se la macchina è tipo BlockHaus, i LapJoint vengono fatti prima del taglio di separazione
|
||||
- Modif : se tenone di coda è attraversato da foro allora anche il foro sarà di coda
|
||||
- Modif : migliorato ordinamento per tenoni con foro secante
|
||||
- Modif : in FreeContour migliorato pinzaggio
|
||||
- Modif : in LapJoint miglioramenti vari alla lavorazione delle facce oblique
|
||||
- Modif : In RidgeLap l'ingombro testa coda considera inclinazione feature per pinzaggio
|
||||
- Added : in FreeContour aggiunta Q08 per forzare come pinzabile l'area della feature e Q07 per ignorare possibili problemi di lettura laser
|
||||
- Added : in tagli aggiunta Q07 per forzare uso fresa
|
||||
|
||||
Versione 2.6i3 (08/10/2024)
|
||||
- Modif : In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio.
|
||||
|
||||
Versione 2.6i2 (13/09/2024)
|
||||
- Modif : in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split
|
||||
- Modif : in nesting correzione in lettura array per cambio dll di lettura
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6i2'
|
||||
VERSION = '2.6k2'
|
||||
MIN_EXE = '2.6e5'
|
||||
|
||||
Reference in New Issue
Block a user