- aggiunte lavorazioni SawPlusChainsaw funzionanti
- manca la gestione nel caso la feature non sia parallela al pezzo
This commit is contained in:
+300
-138
@@ -4585,152 +4585,314 @@ local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkD
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeBySawPlusChain( Proc, sTopologyLongName, b3Raw)
|
||||
--#region SawPlusChain
|
||||
local SawPlusChain = {}
|
||||
|
||||
if sTopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' then
|
||||
|
||||
-- se tasca su faccia sotto la strategia non è applicabile (la sega a catena in generale non può lavorare da sotto)
|
||||
if Proc.AffectedFaces.Bottom then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket on bottom face'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- faccia da lavorare, la stessa per lama e motosega
|
||||
do
|
||||
Proc.Pocket = {}
|
||||
-- faccia di fondo
|
||||
local vBottomFace = Topology.GetFacesWithGivenAdjacencyNumber( Proc, Proc.vAdj, 4)
|
||||
Proc.Pocket.BottomFace = {}
|
||||
Proc.Pocket.BottomFace.Id = vBottomFace[1]
|
||||
Proc.Pocket.BottomFace.Width = Proc.Face[ Proc.Pocket.BottomFace.Id + 1].Width
|
||||
Proc.Pocket.BottomFace.Height = Proc.Face[ Proc.Pocket.BottomFace.Id + 1].Height
|
||||
Proc.Pocket.BottomFace.Elevation = Proc.Face[ Proc.Pocket.BottomFace.Id + 1].Elevation
|
||||
Proc.Pocket.BottomFace.vtN = Proc.Face[ Proc.Pocket.BottomFace.Id + 1].VtN
|
||||
if Proc.Pocket.BottomFace.Height > Proc.Pocket.BottomFace.Width then
|
||||
Proc.Pocket.BottomFace.Width, Proc.Pocket.BottomFace.Height = Proc.Pocket.BottomFace.Height, Proc.Pocket.BottomFace.Width
|
||||
end
|
||||
-- facce adiacenti a quella di fondo
|
||||
local vFacesAdjacentToBottom = EgtSurfTmFacetAdjacencies( Proc.Id, Proc.Pocket.BottomFace.Id)[1]
|
||||
-- si cerca la faccia adiacente a quella di fondo sul lato lungo
|
||||
local dMaxLen = 0
|
||||
for i = 1, #vFacesAdjacentToBottom do
|
||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, Proc.Pocket.BottomFace.Id, vFacesAdjacentToBottom[i], GDB_ID.ROOT)
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
if dLen > dMaxLen then
|
||||
Proc.Pocket.FaceToMachine = vFacesAdjacentToBottom[i]
|
||||
dMaxLen = dLen
|
||||
function SawPlusChain.GetBottomFace( Proc)
|
||||
-- la faccia di fondo ha sempre Fct - 1 adiacenze. Se si trovano più facce di fondo si sceglie quella con minor elevazione
|
||||
local vBottomFace = Topology.GetFacesWithGivenAdjacencyNumber( Proc, Proc.vAdj, Proc.Fct - 1)
|
||||
local nBottomFace
|
||||
if #vBottomFace > 1 then
|
||||
local dMinElevation = GEO.INFINITO
|
||||
for i = 1, #vBottomFace do
|
||||
for j = 1, Proc.Fct do
|
||||
if vBottomFace[i] == Proc.Face[j].Id then
|
||||
if Proc.Face[j].Elevation < dMinElevation then
|
||||
dMinElevation = Proc.Face[j].Elevation
|
||||
nBottomFace = Proc.Face[j].Id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- caratteristiche della tasca
|
||||
Proc.Pocket.Width = Proc.Pocket.BottomFace.Width
|
||||
Proc.Pocket.Height = Proc.Pocket.BottomFace.Height
|
||||
Proc.Pocket.Depth = Proc.Pocket.BottomFace.Elevation
|
||||
Proc.Pocket.Direction = Proc.Pocket.BottomFace.vtN
|
||||
|
||||
-- lavorazione di lama e relativi dati
|
||||
local Cutting = {}
|
||||
Cutting.Tool = {}
|
||||
Cutting.Name, Cutting.IsDownHead = ML.FindCutting( 'HeadSide')
|
||||
Cutting.Tool.Diameter = 0
|
||||
Cutting.Tool.Thickness = 0
|
||||
Cutting.Tool.MaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( Cutting.Name) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
Cutting.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or Cutting.Tool.Diameter
|
||||
Cutting.Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or Cutting.Tool.Thickness
|
||||
Cutting.Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or Cutting.Tool.MaxDepth
|
||||
end
|
||||
end
|
||||
|
||||
-- lavorazione di sega a catena e relativi dati
|
||||
local Chainsawing = {}
|
||||
Chainsawing.Tool = {}
|
||||
Chainsawing.Name, Chainsawing.IsDownHead = ML.FindSawing( 'Sawing')
|
||||
Chainsawing.Tool.Length = 0
|
||||
Chainsawing.Tool.Width = 0
|
||||
Chainsawing.Tool.MaxMat = 0
|
||||
Chainsawing.Tool.Thickness = 0
|
||||
Chainsawing.Tool.CornerRadius = 0
|
||||
if EgtMdbSetCurrMachining( Chainsawing.Name) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
Chainsawing.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or Chainsawing.Tool.Length
|
||||
Chainsawing.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or Chainsawing.Tool.MaxMat
|
||||
Chainsawing.Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or Chainsawing.Tool.Width
|
||||
Chainsawing.Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or Chainsawing.Tool.Thickness
|
||||
Chainsawing.Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or Chainsawing.Tool.CornerRadius
|
||||
end
|
||||
end
|
||||
|
||||
-- se tasca più stretta della lama la strategia non è applicabile
|
||||
if Cutting.Tool.Diameter > Proc.Pocket.Width - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket too narrow for saw blade diameter'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se tasca più stretta della sega a catena la strategia non è applicabile
|
||||
if Chainsawing.Tool.Width > Proc.Pocket.Width - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket too narrow for chainsaw width'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se tasca meno spessa della lama la strategia non è applicabile
|
||||
if Cutting.Tool.Thickness > Proc.Pocket.Height - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket too narrow for saw blade thickness'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se tasca meno spessa della sega a catena la strategia non è applicabile
|
||||
if Chainsawing.Tool.Thickness > Proc.Pocket.Height - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket too narrow for chainsaw thickness'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- parametri della lavorazione con lama
|
||||
-- profondità e offset radiale
|
||||
if Cutting.Tool.MaxDepth > Proc.Pocket.Depth - 10 * GEO.EPS_SMALL then
|
||||
Cutting.Depth = Proc.Pocket.Depth
|
||||
Cutting.RadialOffset = 0
|
||||
else
|
||||
Cutting.Depth = Cutting.Tool.MaxDepth
|
||||
Cutting.RadialOffset = Proc.Pocket.Depth - Cutting.Depth
|
||||
end
|
||||
-- faceuse
|
||||
Cutting.Direction = Proc.Pocket.Direction
|
||||
-- approccio e retrazione
|
||||
Cutting.LeadIn = {}
|
||||
Cutting.LeadOut = {}
|
||||
Cutting.LeadIn.Type = MCH_MILL_LI.LINEAR
|
||||
Cutting.LeadOut.Type = MCH_MILL_LI.LINEAR
|
||||
Cutting.LeadIn.StartAddLength = -sqrt( Cutting.Depth * Cutting.Tool.Diameter - Cutting.Depth * Cutting.Depth)
|
||||
Cutting.LeadOut.StartAddLength = -sqrt( Cutting.Depth * Cutting.Tool.Diameter - Cutting.Depth * Cutting.Depth)
|
||||
Cutting.LeadIn.TangentDistance = 0
|
||||
Cutting.LeadOut.TangentDistance = 0
|
||||
Cutting.LeadIn.PerpDistance = 1
|
||||
Cutting.LeadOut.PerpDistance = 1
|
||||
Cutting.LeadIn.Elevation = 0
|
||||
Cutting.LeadOut.Elevation = 0
|
||||
Cutting.LeadIn.CompLength = 0
|
||||
Cutting.LeadOut.CompLength = 0
|
||||
|
||||
-- lavorazione con lama
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, Proc.Pocket.FaceToMachine, Cutting.Name, Cutting.Tool.Diameter, Cutting.Direction, 2, Cutting.RadialOffset, BD.CUT_SIC, 0, -Cutting.LeadIn.StartAddLength, -Cutting.LeadOut.StartAddLength, sNotes, b3Raw)
|
||||
|
||||
return bOk, sErr
|
||||
|
||||
elseif sTopologyLongName == 'Groove-Through-RightAngles-Parallel-3' then
|
||||
return
|
||||
elseif sTopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
|
||||
return
|
||||
else
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ' : Strategy not implemented for topology ' .. sTopologyLongName
|
||||
nBottomFace = vBottomFace[1]
|
||||
end
|
||||
|
||||
local BottomFace = {}
|
||||
BottomFace.Id = nBottomFace
|
||||
BottomFace.Width = Proc.Face[nBottomFace + 1].Width
|
||||
BottomFace.Height = Proc.Face[nBottomFace + 1].Height
|
||||
BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation
|
||||
BottomFace.VtN = Proc.Face[nBottomFace + 1].VtN
|
||||
if BottomFace.Height > BottomFace.Width then
|
||||
BottomFace.Height, BottomFace.Width = BottomFace.Width, BottomFace.Height
|
||||
end
|
||||
|
||||
return BottomFace
|
||||
end
|
||||
|
||||
function SawPlusChain.GetFaceToMachine( Proc)
|
||||
-- si cercano le facce adiacenti a quella di fondo
|
||||
local FacesAdjacentToBottom = {}
|
||||
local vBottomFaceAdjacencies = EgtSurfTmFacetAdjacencies( Proc.Id, Proc.Pocket.BottomFace.Id)[1]
|
||||
for i = 1, #vBottomFaceAdjacencies do
|
||||
if vBottomFaceAdjacencies[i] > -1 then
|
||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, Proc.Pocket.BottomFace.Id, vBottomFaceAdjacencies[i], GDB_ID.ROOT)
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
table.insert( FacesAdjacentToBottom, { Id = vBottomFaceAdjacencies[i], LengthOnBottom = dLen})
|
||||
end
|
||||
end
|
||||
|
||||
-- si sceglie la faccia adiacente sul lato più lungo
|
||||
local FaceToMachine = {}
|
||||
table.sort( FacesAdjacentToBottom, function( a, b) return a.LengthOnBottom > b.LengthOnBottom end)
|
||||
FaceToMachine.Id = FacesAdjacentToBottom[1].Id
|
||||
for i = 1, Proc.Fct do
|
||||
if FaceToMachine.Id == Proc.Face[i].Id then
|
||||
FaceToMachine.Width = Proc.Face[i].Width
|
||||
FaceToMachine.Height = Proc.Face[i].Height
|
||||
FaceToMachine.Elevation = Proc.Face[i].Elevation
|
||||
FaceToMachine.VtN = Proc.Face[i].VtN
|
||||
if FaceToMachine.Height > FaceToMachine.Width then
|
||||
FaceToMachine.Height, FaceToMachine.Width = FaceToMachine.Width, FaceToMachine.Height
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return FaceToMachine
|
||||
end
|
||||
|
||||
function SawPlusChain.GetToolFromMachining( sMachiningName)
|
||||
local Tool = {}
|
||||
if EgtMdbSetCurrMachining( sMachiningName) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
-- lama
|
||||
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
|
||||
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
|
||||
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||
-- sega a catena
|
||||
elseif Tool.Type == MCH_TY.MORTISE_STD then
|
||||
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
|
||||
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
|
||||
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
|
||||
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
|
||||
-- altri utensili al momento non previsti
|
||||
else
|
||||
error( 'Wrong tool type')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Tool
|
||||
end
|
||||
|
||||
function SawPlusChain.GetSCC( vMachiningDirection)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if AreSameVectorApprox( vMachiningDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif AreOppositeVectorApprox( vMachiningDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif AreSameVectorApprox( vMachiningDirection, Y_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif AreOppositeVectorApprox( vMachiningDirection, Y_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif AreSameVectorApprox( vMachiningDirection, X_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif AreOppositeVectorApprox( vMachiningDirection, X_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
end
|
||||
|
||||
return nSCC
|
||||
end
|
||||
|
||||
function SawPlusChain.GetVerticalSteps( Proc, Machining)
|
||||
VerticalSteps = {}
|
||||
VerticalSteps.Count = ceil( ( Proc.Pocket.Height - 10 * GEO.EPS_SMALL) / Machining.Tool.Thickness)
|
||||
VerticalSteps.StepLength = 0
|
||||
if VerticalSteps.Count > 1 then
|
||||
VerticalSteps.StepLength = ( Proc.Pocket.Height - Machining.Tool.Thickness) / ( VerticalSteps.Count - 1)
|
||||
end
|
||||
|
||||
return VerticalSteps
|
||||
end
|
||||
|
||||
function SawPlusChain.ApplyMachining( Machining, sOperationNamePrefix, b3Raw)
|
||||
local sOperationName = sOperationNamePrefix .. ( EgtGetName( Machining.ProcId) or tostring( Machining.ProcId)) .. '_' .. tostring( Machining.FaceToMachine.Id + 1)
|
||||
local nOperationId = EgtAddMachining( sOperationName, Machining.Name)
|
||||
if not nOperationId then
|
||||
local sErr = 'Error adding machining ' .. sOperationName .. '-' .. Machining.Name
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- impostazione parametri lavorazione
|
||||
EgtSetMachiningGeometry( {{ Machining.ProcId, Machining.FaceToMachine.Id}})
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, Machining.Faceuse)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, Machining.SCC)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, Machining.Invert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, Machining.Workside)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, Machining.ToolInvert)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, Machining.RadialOffset)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, Machining.LongitudinalOffset)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, Machining.LeadIn.TangentDistance)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, Machining.LeadIn.PerpDistance)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, Machining.LeadOut.TangentDistance)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, Machining.LeadOut.PerpDistance)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Machining.LeadIn.StartAddLength)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Machining.LeadOut.EndAddLength)
|
||||
-- imposto angolo 3° asse rot
|
||||
local sBlockedAxis = 'perpendicular'
|
||||
local vtOut = EgtIf( Machining.FaceToMachine.VtN:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, sBlockedAxis, b3Raw, Machining.FaceToMachine.VtN, vtOut))
|
||||
|
||||
local bIsApplyOk = ML.ApplyMachining( true, false)
|
||||
if not bIsApplyOk then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nOperationId, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SawPlusChain.Make( Proc, b3Raw)
|
||||
Proc.Pocket = {}
|
||||
Proc.Pocket.Strategy = 'SawPlusChain'
|
||||
|
||||
if Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' then
|
||||
Proc.Pocket.SideOpeningsCount = 0
|
||||
elseif Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' then
|
||||
Proc.Pocket.SideOpeningsCount = 1
|
||||
elseif Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
|
||||
Proc.Pocket.SideOpeningsCount = 2
|
||||
else
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ' : Strategy ' .. Proc.Pocket.Strategy .. ' not implemented for topology ' .. Proc.TopologyLongName
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se tasca su faccia sotto la strategia non è applicabile (la sega a catena in generale non può lavorare da sotto)
|
||||
if Proc.AffectedFaces.Bottom then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy not applicable - pocket on bottom face'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- caratteristiche della tasca
|
||||
Proc.Pocket.BottomFace = SawPlusChain.GetBottomFace( Proc)
|
||||
Proc.Pocket.FaceToMachine = SawPlusChain.GetFaceToMachine( Proc)
|
||||
Proc.Pocket.Width = Proc.Pocket.BottomFace.Width
|
||||
Proc.Pocket.Height = Proc.Pocket.BottomFace.Height
|
||||
Proc.Pocket.Depth = Proc.Pocket.BottomFace.Elevation
|
||||
Proc.Pocket.Direction = Proc.Pocket.BottomFace.VtN
|
||||
|
||||
-- lavorazione di lama e relativi dati
|
||||
local Cutting = {}
|
||||
Cutting.ProcId = Proc.Id
|
||||
Cutting.Name = ML.FindCutting( 'HeadSide', true, false)
|
||||
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
|
||||
Cutting.FaceToMachine = Proc.Pocket.FaceToMachine
|
||||
|
||||
-- lavorazione di sega a catena e relativi dati
|
||||
local Chainsawing = {}
|
||||
Chainsawing.ProcId = Proc.Id
|
||||
Chainsawing.Name = ML.FindSawing( 'Sawing')
|
||||
Chainsawing.Tool = SawPlusChain.GetToolFromMachining( Chainsawing.Name)
|
||||
|
||||
-- verifica dimensioni tasca compatibili con utensili
|
||||
-- se tasca meno spessa della lama la strategia non è applicabile
|
||||
if Cutting.Tool.Thickness > Proc.Pocket.Height - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for saw blade thickness'
|
||||
return false, sErr
|
||||
end
|
||||
-- se tasca meno spessa della sega a catena la strategia non è applicabile
|
||||
if Chainsawing.Tool.Thickness > Proc.Pocket.Height - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for chainsaw thickness'
|
||||
return false, sErr
|
||||
end
|
||||
if Proc.Pocket.SideOpeningsCount == 0 then
|
||||
-- se tasca più stretta della lama la strategia non è applicabile
|
||||
if Cutting.Tool.Diameter > Proc.Pocket.Width - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for saw blade diameter'
|
||||
return false, sErr
|
||||
end
|
||||
-- se tasca più stretta della sega a catena la strategia non è applicabile
|
||||
if Chainsawing.Tool.Width > Proc.Pocket.Width - 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Feature '.. Proc.FeatureId .. ': Strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for chainsaw width'
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
-- parametri della lavorazione con lama
|
||||
-- lato di lavoro e inversioni
|
||||
if Cutting.Tool.IsCCW then
|
||||
Cutting.Workside = MCH_MILL_WS.RIGHT
|
||||
Cutting.Invert = true
|
||||
else
|
||||
Cutting.Workside = MCH_MILL_WS.LEFT
|
||||
Cutting.Invert = false
|
||||
end
|
||||
if Cutting.FaceToMachine.VtN:getZ() < - 10 * GEO.EPS_SMALL then
|
||||
Cutting.ToolInvert = true
|
||||
Cutting.Invert = not Cutting.Invert
|
||||
else
|
||||
Cutting.ToolInvert = false
|
||||
end
|
||||
-- profondità e offset radiale
|
||||
if Cutting.Tool.MaxDepth > Proc.Pocket.Depth - 10 * GEO.EPS_SMALL then
|
||||
Cutting.Depth = Proc.Pocket.Depth
|
||||
Cutting.RadialOffset = 0
|
||||
else
|
||||
Cutting.Depth = Cutting.Tool.MaxDepth
|
||||
Cutting.RadialOffset = Proc.Pocket.Depth - Cutting.Depth
|
||||
end
|
||||
-- offset longitudinale
|
||||
Cutting.LongitudinalOffset = 0
|
||||
-- faceuse
|
||||
Cutting.Faceuse = BL.GetNearestOrthoOpposite( Proc.Pocket.Direction)
|
||||
-- SCC
|
||||
Cutting.SCC = SawPlusChain.GetSCC( Proc.Pocket.Direction)
|
||||
-- approccio e retrazione
|
||||
local dAddLengthToReduce = sqrt( Cutting.Depth * Cutting.Tool.Diameter - Cutting.Depth * Cutting.Depth)
|
||||
Cutting.LeadIn = {}
|
||||
Cutting.LeadOut = {}
|
||||
Cutting.LeadIn.Type = MCH_MILL_LI.LINEAR
|
||||
Cutting.LeadOut.Type = MCH_MILL_LI.LINEAR
|
||||
Cutting.LeadIn.StartAddLength = 0
|
||||
Cutting.LeadOut.EndAddLength = 0
|
||||
Cutting.LeadIn.TangentDistance = 0
|
||||
Cutting.LeadOut.TangentDistance = 0
|
||||
Cutting.LeadIn.PerpDistance = 0
|
||||
Cutting.LeadOut.PerpDistance = 0
|
||||
Cutting.LeadIn.Elevation = 0
|
||||
Cutting.LeadOut.Elevation = 0
|
||||
Cutting.LeadIn.CompLength = 0
|
||||
Cutting.LeadOut.CompLength = 0
|
||||
if Proc.Pocket.SideOpeningsCount == 0 then
|
||||
Cutting.LeadIn.StartAddLength = -dAddLengthToReduce
|
||||
Cutting.LeadOut.EndAddLength = -dAddLengthToReduce
|
||||
Cutting.LeadIn.PerpDistance = 1
|
||||
Cutting.LeadOut.PerpDistance = 1
|
||||
elseif Proc.Pocket.SideOpeningsCount == 1 then
|
||||
-- BISOGNA CAPIRE DA CHE LATO ACCORCIARE!
|
||||
end
|
||||
|
||||
-- lavorazione con lama
|
||||
Cutting.VerticalSteps = SawPlusChain.GetVerticalSteps( Proc, Cutting)
|
||||
local bOk, sErr
|
||||
for i = 1, Cutting.VerticalSteps.Count do
|
||||
if Cutting.ToolInvert then
|
||||
Cutting.LongitudinalOffset = ( ( i - 1) * -Cutting.VerticalSteps.StepLength) - Cutting.Tool.Thickness
|
||||
else
|
||||
Cutting.LongitudinalOffset = ( i - 1) * Cutting.VerticalSteps.StepLength
|
||||
end
|
||||
|
||||
bOk, sErr = SawPlusChain.ApplyMachining( Cutting, 'Cut_', b3Raw)
|
||||
end
|
||||
|
||||
-- parametri della lavorazione con sega a catena
|
||||
|
||||
-- lavorazione con sega a catena
|
||||
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
--#endregion SawPlusChain
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePart, bPrevBhSideMill, bAllWithEndCap)
|
||||
if not BD.MAXDIAM_POCK_CORNER then
|
||||
@@ -4762,7 +4924,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if true or EgtGetInfo( Proc.Id, Q_SAW_PLUS_CHAIN, 'i') == 1 then --TEST
|
||||
local bOk
|
||||
local sErr
|
||||
bOk, sErr = MakeBySawPlusChain( Proc, Proc.TopologyLongName, b3Raw)
|
||||
bOk, sErr = SawPlusChain.Make ( Proc, b3Raw)
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user