|
|
|
@@ -553,7 +553,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
|
|
|
|
@@ -4617,8 +4617,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 +4679,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 +4711,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 +4725,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 +4747,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 +4761,6 @@ function SawPlusChain.GetLongFace( Proc)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, LongFace)
|
|
|
|
|
|
|
|
|
|
return LongFace
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -4799,6 +4798,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 +4813,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 +4893,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 +5130,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 +5295,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 +5375,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 +5445,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
|
|
|
|
EgtOutLog( sDamageNextPieceMessage)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return Mortising
|
|
|
|
|
return Mortising, bNeedToMachineOtherSide
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5434,7 +5500,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 +5521,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 +5569,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 +5581,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
|
|
|
|
|