- In STR0001 aggiunta lavorazione ti riduzione tenone in caso di P14>0
- Aggiornata gestione in BCS per Essetre - Aggiunta funzione che verifica se un punto si trova su estremità box del pezzo
This commit is contained in:
@@ -492,7 +492,7 @@ local function GetTools_Essetre( Proc, sMachiningCategory)
|
||||
-- CATEGORIE PREVISTE :
|
||||
-- Cutting
|
||||
-- Drill
|
||||
-- Milling, MillingFinish, MillingAntiSplint
|
||||
-- Milling, MillingFinish, MillingAntiSplint, MillingChamfer
|
||||
-- Pocketing
|
||||
-- ChainSawing
|
||||
|
||||
@@ -521,7 +521,12 @@ local function GetTools_Essetre( Proc, sMachiningCategory)
|
||||
elseif ID.IsTenon( Proc) then
|
||||
TagList = { 'Tenon'}
|
||||
elseif ID.IsDovetailTenon( Proc) then
|
||||
TagList = { 'DtTenon'}
|
||||
-- gestione passaggio di taglio tenone superiore in caso di P14>0. Si prendono le frese per tenone standard dato che serve fresa cilindrica
|
||||
if sMachiningCategory == 'MillingFinish' then
|
||||
TagList = { 'Tenon'}
|
||||
else
|
||||
TagList = { 'DtTenon'}
|
||||
end
|
||||
elseif ID.IsDovetailMortise( Proc) then
|
||||
TagList = { 'DtMortise'}
|
||||
elseif ID.IsHeadConcaveProfile( Proc) or ID.IsHeadConvexProfile( Proc) or ID.IsHeadCamberedProfile( Proc) or ID.IsRoundArch( Proc) or ID.IsHeadProfile( Proc) then
|
||||
|
||||
+15
-7
@@ -118,6 +118,19 @@ function BeamLib.AddPhaseWithRawParts( idRaw, OriXR, PosXR, dDeltaSucc)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.IsPointOnBoxLimit( ptPointToCheck, b3Solid)
|
||||
local bOnBoxLimit = false
|
||||
if abs( ptPointToCheck:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL or
|
||||
abs( ptPointToCheck:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL or
|
||||
abs( ptPointToCheck:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL or
|
||||
abs( ptPointToCheck:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL or
|
||||
abs( ptPointToCheck:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL or
|
||||
abs( ptPointToCheck:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL then
|
||||
bOnBoxLimit = true
|
||||
end
|
||||
return bOnBoxLimit
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.SetOpenSide( nPathInt, b3Solid)
|
||||
-- fondo tra loro le curve compatibili
|
||||
@@ -130,14 +143,9 @@ function BeamLib.SetOpenSide( nPathInt, b3Solid)
|
||||
-- se segmento di retta
|
||||
if EgtCurveCompoRadius( nPathInt, i) == -1 then
|
||||
-- verifico se giace in uno dei piani limite del pezzo quindi se è un lato aperto
|
||||
local ptIni = EgtUP( nPathInt, i, GDB_RT.GLOB)
|
||||
local ptIni = EgtUP( nPathInt, i, GDB_RT.GLOB)
|
||||
local ptFin = EgtUP( nPathInt, i + 1, GDB_RT.GLOB)
|
||||
if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
|
||||
if BeamLib.IsPointOnBoxLimit( ptIni, b3Solid) and BeamLib.IsPointOnBoxLimit( ptFin, b3Solid) then
|
||||
-- aggiorno il vettore dei lati aperti
|
||||
table.insert( vOpen, i)
|
||||
end
|
||||
|
||||
@@ -15,6 +15,20 @@ local BladeToWaste = require('BLADETOWASTE')
|
||||
local STR0001 = {}
|
||||
local Strategy = {}
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetSCC( Machining)
|
||||
local nSCC
|
||||
|
||||
if Machining.vtToolDirection:getX() > 0 then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
end
|
||||
|
||||
return nSCC
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetTenonStrategy( Proc, Part)
|
||||
local Machining = {}
|
||||
@@ -149,7 +163,7 @@ local function GetTenonStrategy( Proc, Part)
|
||||
|
||||
Machining.Milling.sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( Proc.FeatureInfo.dTenonLength, 1)) .. ';'
|
||||
|
||||
-- TODO calcolare SCC
|
||||
Machining.Milling.nSCC = GetSCC( Machining.Milling)
|
||||
|
||||
-- passate con sovramateriale
|
||||
Machining.nMillingPathsNeeded = ceil( Proc.FeatureInfo.dTenonMaxDist / TOOLS[Machining.Milling.ToolInfo.nToolIndex].dSideStep)
|
||||
@@ -339,6 +353,64 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- aggiunge lavorazione
|
||||
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machining.Milling, Strategy.Machining.Milling.AuxiliaryData)
|
||||
end
|
||||
|
||||
-- controllo se serve passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0)
|
||||
if abs( Proc.FeatureInfo.vtTenonN * EgtSurfTmFacetNormVersor( Proc.id, Proc.nFct-1, GDB_ID.ROOT)) < GEO.EPS_ANG_SMALL then
|
||||
-- verifico che entrambi i punti iniziale e finale della curva no giacciano in uno dei piani limite del pezzo, quindi se è un lato aperto
|
||||
local ptIni = EgtSP( Proc.FeatureInfo.idAddAuxGeom, GDB_RT.GLOB)
|
||||
local ptFin = EgtEP( Proc.FeatureInfo.idAddAuxGeom, GDB_RT.GLOB)
|
||||
-- se entrambi i punti non sono sul limite pezzo
|
||||
if not( BeamLib.IsPointOnBoxLimit( ptIni, Part.b3Part) and BeamLib.IsPointOnBoxLimit( ptFin, Part.b3Part)) then
|
||||
-- cerco utensile
|
||||
local ToolSearchParameters = {}
|
||||
local FinishMach = {}
|
||||
ToolSearchParameters.dElevation = Proc.FeatureInfo.dTenonLength
|
||||
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, 'MillingFinish')
|
||||
FinishMach.ToolInfo = {}
|
||||
FinishMach.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
if FinishMach.ToolInfo.nToolIndex then
|
||||
|
||||
-- aggiungo geometria e imposto tutti i dati
|
||||
FinishMach.Geometry = {{ Proc.id, Proc.nFct-1}}
|
||||
FinishMach.nToolIndex = FinishMach.ToolInfo.nToolIndex
|
||||
FinishMach.nType = MCH_MY.MILLING
|
||||
FinishMach.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
||||
FinishMach.sDepth = 'TH'
|
||||
|
||||
-- LeadIn / LeadOut
|
||||
FinishMach.LeadIn = {}
|
||||
FinishMach.LeadOut = {}
|
||||
FinishMach.LeadIn.nType = MCH_MILL_LI.TANGENT
|
||||
FinishMach.LeadOut.nType = MCH_MILL_LI.TANGENT
|
||||
FinishMach.LeadIn.dTangentDistance = TOOLS[FinishMach.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
FinishMach.LeadIn.dPerpDistance = TOOLS[FinishMach.ToolInfo.nToolIndex].dSideStep
|
||||
FinishMach.LeadOut.dTangentDistance = TOOLS[FinishMach.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
FinishMach.LeadOut.dPerpDistance = TOOLS[FinishMach.ToolInfo.nToolIndex].dSideStep
|
||||
|
||||
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
|
||||
FinishMach.sStage = 'AfterTail'
|
||||
end
|
||||
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
FinishMach.bInvert = EgtIf( TOOLS[FinishMach.ToolInfo.nToolIndex].bIsCCW, false, true)
|
||||
FinishMach.nWorkside = EgtIf( TOOLS[FinishMach.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
|
||||
FinishMach.sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( Proc.FeatureInfo.dTenonLength, 1)) .. ';'
|
||||
|
||||
FinishMach.nSCC = GetSCC( FinishMach)
|
||||
|
||||
-- imposto utilizzo faccia (--TODO verificare se serve riconoscere il lato specifico)
|
||||
local nOrthoOpposite = BeamLib.GetNearestParalOpposite( Proc.FeatureInfo.vtTenonN, Proc.FeatureInfo.vtTenonN)
|
||||
FinishMach.nFaceuse = nOrthoOpposite
|
||||
|
||||
-- aggiunge lavorazione
|
||||
bAreAllMachiningsAdded = bAreAllMachiningsAdded and MachiningLib.AddMachinings( Proc, FinishMach)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
|
||||
Reference in New Issue
Block a user