|
|
|
@@ -418,7 +418,7 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
|
|
|
|
|
|
|
|
|
-- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco
|
|
|
|
|
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
|
|
|
|
|
if Proc.Prc ~= 37 and nUseSideTool == 0 and not BD.BH_MACHINE then
|
|
|
|
|
if Proc.Prc ~= 37 and not BD.BH_MACHINE and ( nUseSideTool == 0 or ( nUseSideTool == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right))) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -873,12 +873,25 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
-- se è presente il rinvio angolare con lavorazioni di tasca ed è una tasca perfettamente verticale da sotto, non ruoto
|
|
|
|
|
if BD.ANG_TRASM and Proc.Fct >= 4 and not bClosedOrthoFaces then
|
|
|
|
|
local vtNBottomFace = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
|
|
|
|
if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) and
|
|
|
|
|
if AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) and
|
|
|
|
|
( Proc.Fct >= 5 and ML.FindPocketing( 'Pocket_AT') or ( Proc.Fct < 5 and ML.FindPocketing( 'OpenPocket_AT'))) then
|
|
|
|
|
return true, false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se groove da sotto e possibile fresatura tipo SideMillAsBlade non ruoto
|
|
|
|
|
if Proc.AllRightAngles and ( Proc.Topology == 'Groove' or Proc.Topology == 'Pocket') and not( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) then
|
|
|
|
|
-- recupero gruppo per geometria addizionale
|
|
|
|
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
|
|
|
|
if not nAddGrpId then
|
|
|
|
|
local sErr = 'Error : missing AddGroup'
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
if VerifySideMillAsSaw( Proc, nAddGrpId, Proc.Face[nFacInd + 1].VtN, min( Proc.Face[nFacInd + 1].Height, Proc.Face[nFacInd + 1].Width) , Proc.Face[nFacInd + 1].Elevation) then
|
|
|
|
|
Proc.OkFromBottom = true
|
|
|
|
|
return true, false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se scanalatura chiusa lavoro la faccia di fondo
|
|
|
|
|
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
|
|
|
|
|
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, nil, 4)[1]
|
|
|
|
@@ -922,7 +935,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|
|
|
|
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
|
|
|
|
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare
|
|
|
|
|
local nSideRoughTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd')
|
|
|
|
|
local bForceSideMill = ( ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4))
|
|
|
|
|
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4)
|
|
|
|
|
if bForceSideMill then
|
|
|
|
|
bDown = false
|
|
|
|
|
elseif nFacInd2 and dElev2 < 160 and dElev2 < 2 * dElev then
|
|
|
|
@@ -4750,6 +4763,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
|
|
|
|
|
|
|
|
|
@@ -5037,38 +5051,6 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
|
|
|
|
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)
|
|
|
|
|
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
|
|
|
|
-- lama
|
|
|
|
|
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
|
|
|
|
|
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
|
|
|
|
|
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
|
|
|
|
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
|
|
|
|
|
-- 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.CalculateLeadInOut( Machining, EdgeToMachine)
|
|
|
|
|
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
|
|
|
|
|
|
|
|
|
@@ -5268,14 +5250,19 @@ 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)
|
|
|
|
|
Cutting.Tool = BL.GetToolFromMachining( Cutting.Name)
|
|
|
|
|
|
|
|
|
|
-- verifica dimensioni tasca e direzione compatibili
|
|
|
|
|
-- se tasca meno spessa della lama la strategia non è applicabile
|
|
|
|
@@ -5473,7 +5460,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
|
|
|
|
EgtOutLog( Mortising.Message)
|
|
|
|
|
end
|
|
|
|
|
Mortising.Type = MCH_OY.MORTISING
|
|
|
|
|
Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name)
|
|
|
|
|
Mortising.Tool = BL.GetToolFromMachining( Mortising.Name)
|
|
|
|
|
|
|
|
|
|
-- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke)
|
|
|
|
|
if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then
|
|
|
|
@@ -5673,7 +5660,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)
|
|
|
|
@@ -5957,7 +5944,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
|
|
|
|
|
-- se parametro Q03=2 forzo la fresatura di lato; con Q03=3 forzo solo se la faccia di lavoro non è rivolta verso l'alto +/-10°; per rabbet che guardano in giù sempre fresatura di lato
|
|
|
|
|
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
|
|
|
|
local bForceSideMill = bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2))
|
|
|
|
|
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2)))
|
|
|
|
|
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
|
|
|
|
|
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
|
|
|
|
if bPrevBhSideMill == nil then
|
|
|
|
@@ -5975,8 +5962,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
vtN, vtN2 = vtN2, vtN
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- informazioni utensile
|
|
|
|
|
local Tool = BL.GetToolFromMachining( sMilling)
|
|
|
|
|
-- se lavorazione da sotto e lunga, va divisa in due metà
|
|
|
|
|
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
|
|
|
|
|
local bDouble = not Tool.IsOnAggregate and ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
|
|
|
|
|
-- inserisco la lavorazione di fresatura
|
|
|
|
|
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local nMchFId = EgtAddMachining( sName, sMilling)
|
|
|
|
@@ -6044,6 +6033,22 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
|
|
|
-- impostazioni per fresa a disco su aggregato
|
|
|
|
|
if Tool.IsOnAggregate then
|
|
|
|
|
if AreSameVectorApprox( vtN, -Z_AX()) then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
|
|
|
|
if bHeadDir then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
else
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eseguo
|
|
|
|
|
if not ML.ApplyMachining( true, false) then
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
@@ -6203,7 +6208,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
if BD.ANG_TRASM and Proc.Fct >= 4 and AreOppositeVectorApprox( vtN, Z_AX()) then
|
|
|
|
|
bLapJointAngTrasm = true
|
|
|
|
|
-- se orientata verso il basso e non c'è testa da sotto, verifico l'alternativa
|
|
|
|
|
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then
|
|
|
|
|
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 and not Proc.OkFromBottom then
|
|
|
|
|
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
|
|
|
|
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
|
|
|
|
dFacElev, dFacElev2 = dFacElev2, dFacElev
|
|
|
|
@@ -6211,7 +6216,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
end
|
|
|
|
|
-- verifico non sia orientata verso il basso o ci sia una testa dal basso o la lavorazione sia dal lato.
|
|
|
|
|
local bFaceDown = ( vtN:getZ() < BD.NZ_MINA)
|
|
|
|
|
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm then
|
|
|
|
|
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm and not Proc.OkFromBottom then
|
|
|
|
|
local sErr = 'Error : LapJoint from bottom impossible'
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return false, sErr
|
|
|
|
@@ -7021,7 +7026,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
for i = 1, #vAddId do
|
|
|
|
|
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
|
|
|
|
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
|
|
|
|
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces}
|
|
|
|
|
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces, OkFromBottom = Proc.OkFromBottom}
|
|
|
|
|
Topology.Classify( AddProc, b3Raw)
|
|
|
|
|
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
|
|
|
|
|
local bOk, sMyWarn
|
|
|
|
@@ -7302,6 +7307,9 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
if Proc.Prc == 30 or Proc.Prc == 20 then
|
|
|
|
|
local nBladeAntisplint = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
|
|
|
|
|
local nUseRoughToolOnSide = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
|
|
|
|
|
if nUseRoughToolOnSide == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) then
|
|
|
|
|
nUseRoughToolOnSide = 0
|
|
|
|
|
end
|
|
|
|
|
nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, Q_BLADE_ON_ALONG_FACE, 'i') or 0
|
|
|
|
|
-- se antischeggia di fresa o abilitato sgrossatore di fianco
|
|
|
|
|
if nBladeAntisplint == 2 or nUseRoughToolOnSide > 0 then
|
|
|
|
|