Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 350aaabbbe | |||
| 4eb3b38dd4 | |||
| e9534b4eee | |||
| da061a05e5 | |||
| ba432f5029 | |||
| 812397a047 | |||
| cbb42ec088 | |||
| 0c802464e1 | |||
| 498c65b006 | |||
| d81a0e8fbd | |||
| 47fde315a3 | |||
| 3ac61219c9 | |||
| bad0018381 | |||
| 48261c36d8 | |||
| 4f9093b1d2 | |||
| 52830876e9 | |||
| 4513833fb3 | |||
| 26cc812ed1 | |||
| cc3ff75ea2 | |||
| b150c75e96 | |||
| cc3b0da9e5 | |||
| 6c8e3017d0 |
@@ -1267,5 +1267,32 @@ function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
|
||||
if not dOvmTail then
|
||||
dOvmTail = BD.OVM_MID
|
||||
end
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
+1
-1
@@ -155,7 +155,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
|
||||
-- se faccia non troppo lunga, con un lato piccolo e non diretta troppo verso il basso, non servono dice
|
||||
local dMaxLen = BD.MAX_LEN_DICE or 600
|
||||
if dLen < dMaxLen and dWidth < dMaxLen and
|
||||
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > dNzLimDwnUp then
|
||||
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and ( vtN:getZ() > dNzLimDwnUp or BD.DOWN_HEAD) then
|
||||
return nil, nil, nil
|
||||
end
|
||||
|
||||
|
||||
@@ -407,7 +407,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.TURN then
|
||||
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||
-- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
|
||||
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)
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
|
||||
+28
-45
@@ -74,40 +74,34 @@ local function SetCurrMachineHeadType()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che conferma e rende attivi testa e utensile ipotizzati
|
||||
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
|
||||
local function ConfirmNextMachining()
|
||||
-- se non definita testa successiva, esco
|
||||
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end
|
||||
-- altrimenti, la confermo come attiva
|
||||
nActiveHead = nNextMachHead
|
||||
if nNextMachHead == 1 then
|
||||
H1_TOOL = H1_NEXT_TOOL
|
||||
elseif nNextMachHead == 2 then
|
||||
H2_TOOL = H2_NEXT_TOOL
|
||||
-- utensile corrente
|
||||
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
|
||||
EgtTdbSetCurrTool( sToolName or '')
|
||||
-- testa dell'utensile corrente
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
|
||||
|
||||
if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
|
||||
-- testa che non richiede ottimizzazione
|
||||
return
|
||||
elseif nHead >= 20 then
|
||||
nHead = 2
|
||||
elseif nHead >= 10 then
|
||||
nHead = 1
|
||||
end
|
||||
|
||||
-- se la testa richiede ottimizzazione, confermo testa attiva
|
||||
nActiveHead = nHead
|
||||
if nActiveHead == 1 then
|
||||
H1_TOOL = sToolName
|
||||
elseif nActiveHead == 2 then
|
||||
H2_TOOL = sToolName
|
||||
end
|
||||
-- reset prossima testa
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che traccia testa e utensile ipotizzati
|
||||
local function SetNextMachining( sToolName, nHead, bFixed)
|
||||
if nHead < 1 or nHead > 2 then return end
|
||||
if bFixed then
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
nNextMachHead = nHead
|
||||
if nHead == 1 then
|
||||
H1_NEXT_TOOL = sToolName
|
||||
elseif nHead == 2 then
|
||||
H2_NEXT_TOOL = sToolName
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetCurrMachiningAndTool( Machining)
|
||||
EgtMdbSetCurrMachining( Machining.Name)
|
||||
@@ -356,16 +350,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||
_, sType = EgtEndsWith( sType, '_H2')
|
||||
elseif ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bDownHead then
|
||||
elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
||||
if not EgtEndsWith( sType, '_H2') then
|
||||
sType = sType .. '_H2'
|
||||
end
|
||||
end
|
||||
local MachineHeadUse = MachineHeadType
|
||||
if not BEAM or not BEAM.BW then
|
||||
if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
MachineHeadUse = ONE_HEAD
|
||||
end
|
||||
if BEAM and BEAM.BW and MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||
MachineHeadUse = TWO_EQUAL_HEADS
|
||||
end
|
||||
@@ -374,7 +368,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
for i = ForStart, ForEnd, ForStep do
|
||||
local Machining = Machinings[i]
|
||||
local sMachiningType = Machining.Type
|
||||
if BEAM and BEAM.BW then
|
||||
if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||
end
|
||||
-- recupero dati utensile
|
||||
@@ -383,18 +377,15 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
|
||||
if bOk then
|
||||
if MachineHeadUse == ONE_HEAD then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
-- se nessuna testa attiva, prendo la prima lavorazione disponibile
|
||||
if nActiveHead == 0 then
|
||||
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
||||
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -414,10 +405,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||
if bTopHead and not bH2 then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif bDownHead and bH2 then
|
||||
SetNextMachining( sToolName, 2, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -428,31 +417,25 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
end
|
||||
end
|
||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||
if nActiveHead == 1 then
|
||||
if sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
elseif sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
end
|
||||
elseif nActiveHead == 2 then
|
||||
if sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
elseif sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
end
|
||||
|
||||
+1
-14
@@ -821,20 +821,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- se taglio di testa
|
||||
if not bForced then
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
+100
-21
@@ -203,6 +203,8 @@ local function AssignQIdent( Proc)
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q07' -- d
|
||||
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
||||
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
||||
@@ -553,7 +555,7 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
|
||||
-- cancello la copia del percorso
|
||||
EgtErase( nTestId)
|
||||
-- eseguo test
|
||||
if not bNewIsU and not Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' then
|
||||
if not bNewIsU and not ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2') then
|
||||
return false
|
||||
end
|
||||
-- Verifico sia abbastanza lunga
|
||||
@@ -3339,7 +3341,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
-- eventuale massima elevazione imposta dall'utente
|
||||
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
|
||||
dMaxElev = dMaxElev or dElev
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
if bOpenOutRaw then
|
||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||
@@ -4617,8 +4623,6 @@ end
|
||||
|
||||
-- TODO gestione messaggi in funzione apposita (almeno per append)
|
||||
|
||||
-- TODO gestire topologia tunnel (anche da due lati)
|
||||
|
||||
local SawPlusChain = {}
|
||||
SawPlusChain.Saw = {}
|
||||
SawPlusChain.Chainsaw = {}
|
||||
@@ -4681,6 +4685,7 @@ function SawPlusChain.GetTunnelFaces( Proc)
|
||||
if TunnelAddedFaces.MiddleFaceTm.Height > TunnelAddedFaces.MiddleFaceTm.Width then
|
||||
TunnelAddedFaces.MiddleFaceTm.Height, TunnelAddedFaces.MiddleFaceTm.Width = TunnelAddedFaces.MiddleFaceTm.Width, TunnelAddedFaces.MiddleFaceTm.Height
|
||||
end
|
||||
TunnelAddedFaces.MiddleFaceTm.Type = 'Tunnel'
|
||||
|
||||
return TunnelAddedFaces
|
||||
end
|
||||
@@ -4712,6 +4717,7 @@ function SawPlusChain.GetBottomFace( Proc)
|
||||
end
|
||||
|
||||
BottomFace.Id = nBottomFace
|
||||
BottomFace.Type = 'Bottom'
|
||||
BottomFace.Width = Proc.Face[nBottomFace + 1].Width
|
||||
BottomFace.Height = Proc.Face[nBottomFace + 1].Height
|
||||
BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation
|
||||
@@ -4725,6 +4731,7 @@ end
|
||||
|
||||
|
||||
function SawPlusChain.GetLongFace( Proc)
|
||||
local LongFace = {}
|
||||
if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then
|
||||
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
|
||||
end
|
||||
@@ -4746,10 +4753,10 @@ function SawPlusChain.GetLongFace( Proc)
|
||||
end
|
||||
|
||||
-- si sceglie la più grande (tunnel) o quella adiacente sul lato lungo
|
||||
local LongFace = {}
|
||||
LongFace.Id = FacesToAnalyze[1].Id
|
||||
for i = 1, Proc.Fct do
|
||||
if LongFace.Id == Proc.Face[i].Id then
|
||||
LongFace.Type = 'Long'
|
||||
LongFace.Width = Proc.Face[i].Width
|
||||
LongFace.Height = Proc.Face[i].Height
|
||||
LongFace.Elevation = Proc.Face[i].Elevation
|
||||
@@ -4760,8 +4767,6 @@ function SawPlusChain.GetLongFace( Proc)
|
||||
end
|
||||
end
|
||||
|
||||
LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, LongFace)
|
||||
|
||||
return LongFace
|
||||
end
|
||||
|
||||
@@ -4799,6 +4804,7 @@ function SawPlusChain.GetSideFaces( Proc)
|
||||
( bIsLongFaceTheLargest and i > 2) then
|
||||
table.insert( SideFaces, FacesToAnalyze[i])
|
||||
SideFaces[#SideFaces].Id = FacesToAnalyze[i].Id
|
||||
SideFaces[#SideFaces].Type = 'Side'
|
||||
SideFaces[#SideFaces].Width = Proc.Face[FacesToAnalyze[i].Id + 1].Width
|
||||
SideFaces[#SideFaces].Height = Proc.Face[FacesToAnalyze[i].Id + 1].Height
|
||||
SideFaces[#SideFaces].Elevation = Proc.Face[FacesToAnalyze[i].Id + 1].Elevation
|
||||
@@ -4813,6 +4819,51 @@ function SawPlusChain.GetSideFaces( Proc)
|
||||
end
|
||||
|
||||
|
||||
function SawPlusChain.GetBottomFaceEdges( Proc, Face)
|
||||
local Edges = {}
|
||||
Edges.SideEdges = {}
|
||||
Edges.LongEdges = {}
|
||||
|
||||
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)
|
||||
|
||||
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then
|
||||
table.insert( Edges.LongEdges, CurrentEdge)
|
||||
Edges.LongEdges[#Edges.LongEdges].Type = 'Long'
|
||||
elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.LongFace.Id or vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.LongFace.Id then
|
||||
table.insert( Edges.SideEdges, CurrentEdge)
|
||||
Edges.SideEdges[#Edges.SideEdges].Type = 'Side'
|
||||
else
|
||||
table.insert( Edges.LongEdges, CurrentEdge)
|
||||
Edges.LongEdges[#Edges.LongEdges].Type = 'Long'
|
||||
end
|
||||
end
|
||||
else
|
||||
error( 'Face with closed hole')
|
||||
end
|
||||
|
||||
return Edges
|
||||
end
|
||||
|
||||
|
||||
function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
||||
local Edges = {}
|
||||
Edges.SideEdges = {}
|
||||
@@ -4848,12 +4899,16 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
||||
else
|
||||
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.BottomEdge = CurrentEdge
|
||||
Edges.BottomEdge.Type = 'Bottom'
|
||||
elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.SideEdges.StartEdge = CurrentEdge
|
||||
Edges.SideEdges.StartEdge.Type = 'Side'
|
||||
elseif vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.SideEdges.EndEdge = CurrentEdge
|
||||
Edges.SideEdges.EndEdge.Type = 'Side'
|
||||
else
|
||||
table.insert( Edges.OppositeEdges, CurrentEdge)
|
||||
Edges.OppositeEdges[#Edges.OppositeEdges].Type = 'Opposite'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5081,7 +5136,11 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
|
||||
else
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Height
|
||||
if FaceToMachine.Type == 'Long' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.SideEdges[1].Length
|
||||
elseif FaceToMachine.Type == 'Side' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.LongEdges[1].Length
|
||||
end
|
||||
end
|
||||
|
||||
-- ricerca lavorazione
|
||||
@@ -5242,32 +5301,43 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.CanApply = true
|
||||
Mortising.Message = ''
|
||||
Mortising.ProcId = Proc.Id
|
||||
local bNeedToMachineOtherSide = false
|
||||
local dTestCornerRadius = 43
|
||||
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
|
||||
local sMortisingType
|
||||
|
||||
local dPocketHeight = 0
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
|
||||
else
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Height
|
||||
if FaceToMachine.Type == 'Long' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.SideEdges[1].Length
|
||||
elseif FaceToMachine.Type == 'Side' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.LongEdges[1].Length
|
||||
end
|
||||
end
|
||||
|
||||
-- ricerca lavorazione
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = "OneSideAndExtend"
|
||||
sMortisingType = 'OneSideAndExtend'
|
||||
if not Mortising.Name then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = "BothSidesAndExtend"
|
||||
sMortisingType = 'BothSidesAndExtend'
|
||||
end
|
||||
elseif EdgeToMachine.Type == 'Side' and #( Proc.MainFaces.SideFaces) == 0 then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = 'BothSidesAndExtend'
|
||||
else
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation))
|
||||
sMortisingType = "OneSide"
|
||||
sMortisingType = 'OneSide'
|
||||
end
|
||||
if not Mortising.Name then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
sMortisingType = "BothSides"
|
||||
if sMortisingType == 'BothSidesAndExtend' then
|
||||
sMortisingType = 'BothSides'
|
||||
elseif sMortisingType == 'OneSideAndExtend' then
|
||||
sMortisingType = 'OneSide'
|
||||
end
|
||||
end
|
||||
if not Mortising.Name then
|
||||
@@ -5311,14 +5381,16 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.ToolInvert = true
|
||||
end
|
||||
-- profondità e offset longitudinale
|
||||
if sMortisingType == "OneSide" then
|
||||
if sMortisingType == 'OneSide' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation)
|
||||
elseif sMortisingType == 'OneSideAndExtend' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
|
||||
elseif sMortisingType == 'BothSides' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2
|
||||
bNeedToMachineOtherSide = true
|
||||
elseif sMortisingType == 'BothSidesAndExtend' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
|
||||
bNeedToMachineOtherSide = true
|
||||
end
|
||||
if Mortising.Tool.MaxMat > Mortising.Depth - 10 * GEO.EPS_SMALL then
|
||||
if EdgeToMachine.Elevation > -10 * GEO.EPS_SMALL then
|
||||
@@ -5379,7 +5451,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
EgtOutLog( sDamageNextPieceMessage)
|
||||
end
|
||||
|
||||
return Mortising
|
||||
return Mortising, bNeedToMachineOtherSide
|
||||
end
|
||||
|
||||
|
||||
@@ -5434,7 +5506,10 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
Proc.MainFaces.SideFaces = SawPlusChain.GetSideFaces( Proc)
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Proc.MainFaces.TunnelAddedFaces = SawPlusChain.GetTunnelFaces( Proc)
|
||||
else
|
||||
Proc.MainFaces.BottomFace.Edges = SawPlusChain.GetBottomFaceEdges( Proc, Proc.MainFaces.BottomFace)
|
||||
end
|
||||
Proc.MainFaces.LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, Proc.MainFaces.LongFace)
|
||||
|
||||
-- lama
|
||||
-- lavorazione di lama - fondo della tasca o fino a massimo materiale se tunnel
|
||||
@@ -5452,7 +5527,6 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
local dBottomDepthToMachine = Cutting.RadialOffset
|
||||
|
||||
-- lato opposto del tunnel
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
|
||||
@@ -5501,8 +5575,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
-- sega a catena
|
||||
-- parametri lavorazione con sega a catena - fondo della tasca o tunnel
|
||||
local Mortising = {}
|
||||
local bNeedToMachineOtherSide = false
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1])
|
||||
Mortising, bNeedToMachineOtherSide = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1])
|
||||
else
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.BottomEdge)
|
||||
-- si lavora solo quanto non lavorato dalla lama
|
||||
@@ -5512,9 +5587,8 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
if Mortising.CanApply then
|
||||
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
||||
end
|
||||
|
||||
-- lato opposto del tunnel
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
if Proc.Topology == 'Tunnel' and bNeedToMachineOtherSide then
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
|
||||
bIsMortisingOk = false
|
||||
if Mortising.CanApply then
|
||||
@@ -6853,6 +6927,7 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
|
||||
local nFacetRiser, nFacetTread = 0, 1
|
||||
if abs( vtNRiser:getZ()) > abs( vtNTread:getZ()) then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
vtNRiser, vtNTread = vtNTread, vtNRiser
|
||||
end
|
||||
-- riferimenti e dimensioni delle facce
|
||||
@@ -7078,7 +7153,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- se lunghezza richiede spezzatura
|
||||
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) then
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
|
||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > BD.LEN_SHORT_PART or 1000)) then
|
||||
-- una faccia
|
||||
if Proc.Fct == 1 then
|
||||
if bUseBlade then
|
||||
@@ -7117,6 +7193,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
if bUseBlade then
|
||||
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
|
||||
@@ -7156,10 +7233,12 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if b3Fac1:getDimX() < 1 and b3Fac3:getDimX() < 1 then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
elseif b3Fac1:getDimX() < 1 and b3Fac2:getDimX() < 1 then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
elseif b3Fac2:getDimX() < 1 and b3Fac3:getDimX() < 1 then
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
|
||||
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DC = require( 'DiceCut')
|
||||
local LapJoint = require( 'ProcessLapJoint')
|
||||
|
||||
EgtOutLog( ' ProcessRidgeLap started', 1)
|
||||
|
||||
@@ -48,6 +49,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- ingombro del pezzo
|
||||
@@ -133,8 +135,15 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
elseif nForceUseBladeOnNotContinueFace > 0 then
|
||||
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
|
||||
Proc.Fct = Proc.Fct - 1
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
|
||||
@@ -320,10 +320,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if bAdj12 then
|
||||
if dAng12 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
elseif bAdj20 then
|
||||
if dAng20 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 1, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- dati delle facce
|
||||
|
||||
@@ -11,6 +11,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local DC = require( 'DiceCut')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
||||
|
||||
@@ -384,6 +385,8 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
Topology.Classify( NewProc, b3Raw)
|
||||
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6f1 (06/06/2024)
|
||||
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
|
||||
- Modif : migliorie al taglio a cubetti
|
||||
- Modif : in LapJoint -> MakePocket abilitata Q per forzare massima elevazione
|
||||
- Fixed : correzione a SCC per lama da sotto con aggregato
|
||||
- Fixed : correzioni a ottimizzazione teste per macchine con teste sopra/sotto
|
||||
|
||||
Versione 2.6e5 (27/05/2024)
|
||||
- Modif : in LapJoint corretto typo in lavorazione lamello che impediva il funzionamento corretto.
|
||||
|
||||
Versione 2.6e4 (20/05/2024)
|
||||
- Modif : in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
|
||||
- Modif : in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
|
||||
|
||||
Versione 2.6e3 (14/05/2024)
|
||||
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
|
||||
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6e3'
|
||||
VERSION = '2.6f1'
|
||||
MIN_EXE = '2.6e2'
|
||||
|
||||
Reference in New Issue
Block a user