Compare commits

..

2 Commits

Author SHA1 Message Date
luca.mazzoleni a8036e1645 Merge branch 'develop' into DeleteOldAlternatives 2026-07-20 18:01:59 +02:00
luca.mazzoleni 37ff2e7f4c - in BeamExec.ProcessAlternatives si azzerano le alternative non usate 2026-07-16 17:07:28 +02:00
12 changed files with 190 additions and 191 deletions
+1 -3
View File
@@ -647,13 +647,11 @@ if bToProcess then
PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}}
PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil
PARTS[i].idTempGroup = idTempGroup PARTS[i].idTempGroup = idTempGroup
PARTS[i].RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( PARTS[i].dRawWidth, PARTS[i].dRawHeight, PARTS[i].dRawLength))
or BeamData.LEN_VERY_SHORT_PART
or 400
PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere ( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
-- si carica configurazione lavorazioni -- si carica configurazione lavorazioni
TIMER:startElapsed('Json') TIMER:startElapsed('Json')
BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig) BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig)
+33 -10
View File
@@ -547,9 +547,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
CurrentPart.dHeadOverMaterial = dStartOffset CurrentPart.dHeadOverMaterial = dStartOffset
CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's' ) or nil CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's' ) or nil
CurrentPart.idTempGroup = idTempGroup CurrentPart.idTempGroup = idTempGroup
CurrentPart.RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( dPartWidth, dPartHeight, dPartLen))
or BeamData.LEN_VERY_SHORT_PART
or 400
-- Notifiche al Post-Processor basate sulla nuova scomposizione -- Notifiche al Post-Processor basate sulla nuova scomposizione
if ( dStartOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset ) end if ( dStartOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset ) end
@@ -2656,17 +2653,43 @@ function BeamExec.ProcessAlternatives( PARTS)
end end
-- passaggio info a interfaccia da scrivere sul pezzo -- passaggio info a interfaccia da scrivere sul pezzo
local function IsStateInAlternativesNest2D( sState)
for _, v in ipairs( AlternativesNest2D) do
if v == sState then
return true
end
end
return false
end
BEAM.INFONGEPART = {} BEAM.INFONGEPART = {}
for i = 1, #AlternativesNest2D do local States = {
"1000",
"0100",
"0010",
"0001",
"1000_INV",
"0100_INV",
"0010_INV",
"0001_INV",
}
for i = 1, #States do
local sState = States[i]
if IsStateInAlternativesNest2D( sState) then
if PARTS[nPart].HeadcutInfo then if PARTS[nPart].HeadcutInfo then
local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',') local HeadcutInfo = PARTS[nPart].HeadcutInfo[sState]
local sVtN = ( tostring( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "") local sOffsetX = table.concat( HeadcutInfo.OffsetX, ',')
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i].. '_H' .. '=' .. sOffsetX .. ';' .. sVtN) local sVtN = ( tostring( HeadcutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '=' .. sOffsetX .. ';' .. sVtN )
end end
if PARTS[nPart].TailcutInfo then if PARTS[nPart].TailcutInfo then
local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',') local TailCutInfo = PARTS[nPart].TailcutInfo[sState]
local sVtN = ( tostring( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "") local sOffsetX = table.concat( TailCutInfo.OffsetX, ',')
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i] .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN) local sVtN = ( tostring( TailCutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN)
end
else
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '= ')
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_T' .. '= ')
end end
end end
-3
View File
@@ -36,9 +36,6 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom)
if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then
Proc.dVolume = ProcToCopyFrom.dVolume Proc.dVolume = ProcToCopyFrom.dVolume
end end
Proc.nParts = EgtSurfTmPartCount( Proc.id) or 1
Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part)
-- TODO servono anche altri dati raccolti nel collect?? -- TODO servono anche altri dati raccolti nel collect??
return Proc return Proc
+6 -6
View File
@@ -1662,16 +1662,12 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
local idTempGroup = Part.idTempGroup local idTempGroup = Part.idTempGroup
-- TODO in futuro creare flatregion (se ci fossero isole il calcolo del percorso non sarebbe corretto) -- TODO in futuro creare flatregion (se ci fossero isole il calcolo del percorso non sarebbe corretto)
local idFaceContour = EgtExtractSurfTmFacetLoops( ProcTm.id, Machining.Geometry[1][2], idTempGroup) local idFaceContour = EgtExtractSurfTmFacetLoops( ProcTm.id, Machining.Geometry[1][2], idTempGroup)
-- si settano i lati aperti della curva derivata dalla superficie -- si settano i lati aperti della curva derivata dalla superficie
local sOpenEdges = ''
for i = 1, #ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges do for i = 1, #ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges do
if ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].bIsOpen then if ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].bIsOpen then
sOpenEdges = sOpenEdges .. EgtNumToString( ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id) .. ',' EgtCurveCompoSetTempProp( idFaceContour, ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id, 1)
end end
end end
EgtSetInfo( idFaceContour, 'OPEN', sOpenEdges)
-- dal momento che la funzione EgtPocketing non considera il grezzo, nei casi ottimizzati si deve correggere l'offset -- dal momento che la funzione EgtPocketing non considera il grezzo, nei casi ottimizzati si deve correggere l'offset
local idTestCurve = EgtCopyGlob( idFaceContour, idTempGroup ) local idTestCurve = EgtCopyGlob( idFaceContour, idTempGroup )
local bIsOptimizedPocketing = ( TOOLS[Machining.nToolIndex].dDiameter > TOOLS[Machining.nToolIndex].dSideStep - 10 * GEO.EPS_SMALL) local bIsOptimizedPocketing = ( TOOLS[Machining.nToolIndex].dDiameter > TOOLS[Machining.nToolIndex].dSideStep - 10 * GEO.EPS_SMALL)
@@ -1682,7 +1678,11 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
dOffset = TOOLS[Machining.nToolIndex].dDiameter - TOOLS[Machining.nToolIndex].dSideStep dOffset = TOOLS[Machining.nToolIndex].dDiameter - TOOLS[Machining.nToolIndex].dSideStep
end end
EgtOffsetCurve( idFaceContour, dOffset) EgtOffsetCurve( idFaceContour, dOffset)
EgtRemoveInfo( idFaceContour, 'OPEN') -- si settano tutti i lati chiusi per la curva offsettata
local _, nFaceCountourCurveCount = EgtCurveDomain( idFaceContour)
for i = 1, nFaceCountourCurveCount do
EgtCurveCompoSetTempProp( idFaceContour, i - 1, 0)
end
end end
-- calcolo percorso di svuotatura replicando il calcolo che fa la svuotatura -- calcolo percorso di svuotatura replicando il calcolo che fa la svuotatura
local idPocketingPath = EgtPocketing( idFaceContour, TOOLS[Machining.nToolIndex].dDiameter / 2, TOOLS[Machining.nToolIndex].dSideStep, 0, Machining.nSubType, true, idTempGroup) local idPocketingPath = EgtPocketing( idFaceContour, TOOLS[Machining.nToolIndex].dDiameter / 2, TOOLS[Machining.nToolIndex].dSideStep, 0, Machining.nSubType, true, idTempGroup)
+2 -11
View File
@@ -301,8 +301,6 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm) local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
local idAddGroup = BeamLib.GetAddGroup( Part.id)
-- spostamento assi macchina in posizione -- spostamento assi macchina in posizione
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux) local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
@@ -352,12 +350,6 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
end end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED()) EgtSetColor( CollisionSurfTmId[i], RED())
local idBeamCopy = EgtCopyGlob( idCheckCollisionTm, idAddGroup)
EgtSetName( idBeamCopy, 'COLL_BEAM')
local idHeadCopy = EgtCopyGlob( CollisionSurfTmId[i], idAddGroup)
EgtSetName( idHeadCopy, 'COLL_' .. sAxis)
EgtVector( idAddGroup, vtHead, ptOnToolTipCenter, GDB_RT.GLOB)
EgtSetStatus( { idBeamCopy, idHeadCopy}, GDB_ST.OFF)
end end
if bCollisionFoundPiece then if bCollisionFoundPiece then
break break
@@ -438,8 +430,8 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
if bCheckFlange and Tool.sType == 'SAW_FLAT' then if bCheckFlange and Tool.sType == 'SAW_FLAT' then
local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness
local frHead = Frame3d( ptCenterFlange, vtHead) local frHead = Frame3d( ptCenterFlange, vtHead)
local dFlangeRadius = Tool.ToolHolder.dDiameter / 2 local dExtraSafety = 2 -- valore empirico che serve nei casi molto inclinati, ci potrebbero essere casi in cui va aumentato
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dFlangeRadius, GDB_RT.GLOB) local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dExtraSafety + Tool.dDiameter / 2 - Tool.dMaxDepth, GDB_RT.GLOB)
EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB) EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB)
-- TODO verificare se questo controllo serve -- TODO verificare se questo controllo serve
@@ -451,7 +443,6 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB) idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
end end
-- TODO raggruppare parametri opzionali!
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm) local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
-- se trovata collisione con pezzo è inutile controllare gli altri punti -- se trovata collisione con pezzo è inutile controllare gli altri punti
+1 -1
View File
@@ -326,7 +326,7 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters)
-- controllo conformità offset tenone -- controllo conformità offset tenone
Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5) Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnLength, -5, 5) Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
-- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda -- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda
local dLengthOnX = Proc.b3Box:getDimX() local dLengthOnX = Proc.b3Box:getDimX()
+1
View File
@@ -10,6 +10,7 @@ local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib') local FeatureLib = require( 'FeatureLib')
-- strategie di base -- strategie di base
local FaceByMill = require( 'FACEBYMILL') local FaceByMill = require( 'FACEBYMILL')
local FaceByBlade = require( 'FACEBYBLADE')
local AntiSplintOnFace = require( 'ANTISPLINTONFACE') local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
-- Tabella per definizione modulo -- Tabella per definizione modulo
-3
View File
@@ -216,9 +216,6 @@ function STR0011.Make( bAddMachining, Proc, Part, CustomParameters)
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
-- aggiunge lavorazione -- aggiunge lavorazione
for j = 1, #Strategy.Machinings do for j = 1, #Strategy.Machinings do
if Proc.AffectedFaces.bLeft and not Proc.FeatureInfo.bIsDrillOpen then
Strategy.Machinings[j].sStage = 'AfterTail'
end
Strategy.Machinings[j].nType = MCH_MY.DRILLING Strategy.Machinings[j].nType = MCH_MY.DRILLING
Strategy.Machinings[j].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep Strategy.Machinings[j].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j]) bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j])
+2 -16
View File
@@ -858,23 +858,11 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadInForSplit.dTangentDistance = 0 CurrentMachining.LeadInForSplit.dTangentDistance = 0
CurrentMachining.LeadOutForSplit.dTangentDistance = 0
if not ID.IsFreeContour( Proc) then
CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
CurrentMachining.LeadOutForSplit.dTangentDistance = 0
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
end
-- sistemo il lato e la direzione di lavoro; se FreeContour il lato è determinato dalla Feature, altrimenti dalla concordanza -- sistemo il lato e la direzione di lavoro
if ID.IsFreeContour( Proc) then
CurrentMachining.bInvert = false
if Proc.nGrp == 0 then
CurrentMachining.nWorkside = MCH_MILL_WS.CENTER
elseif Proc.nGrp == 3 then
CurrentMachining.nWorkside = MCH_MILL_WS.LEFT
elseif Proc.nGrp == 4 then
CurrentMachining.nWorkside = MCH_MILL_WS.RIGHT
end
else
if CurrentMachining.bOtherDirection then if CurrentMachining.bOtherDirection then
CurrentMachining.bToolInvert = true CurrentMachining.bToolInvert = true
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false) CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
@@ -883,13 +871,11 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true) CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true)
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT) CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
end end
end
CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom) CurrentMachining.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
CurrentMachining.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.dLengthOnX = Proc.b3Box:getDimX() CurrentMachining.dLengthOnX = Proc.b3Box:getDimX()
CurrentMachining.vtHead = CurrentMachining.vtToolDirection
local MachiningToSplit = {} local MachiningToSplit = {}
table.insert( MachiningToSplit, CurrentMachining) table.insert( MachiningToSplit, CurrentMachining)
+39 -30
View File
@@ -358,8 +358,8 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
end end
local function SetDiceFaceInfo( Proc, idDiceFace, sType) local function SetDiceFaceInfo( Proc, idDiceFace)
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice_' .. sType) EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice')
end end
@@ -577,11 +577,6 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
end end
end end
-- se la feature non è piccola il taglio doppio verticale non si può fare
if not FeatureInfo.bIsFeatureSmall then
return CuttingParametersList, EdgeToMachine
end
-- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva) -- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva)
EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical') EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical')
local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN
@@ -775,7 +770,7 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings) Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
-- per tagli con lati brutti o ghigliottina si abbassa la qualità -- per tagli con lati brutti o ghigliottina si abbassa la qualità
if ( sChosenBladeType ~= 'Top') and ( sChosenBladeType ~= 'Bottom') then if ( sChosenBladeType ~= 'Top') and ( sChosenBladeType ~= 'Bottom') then
Result.dQuality = FeatureLib.GetStrategyQuality( 'FINE') Result.dQuality = FeatureLib.GetStrategyQuality( 'STD')
end end
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings) Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
Result.dMRR = ( FeatureInfo.dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6) Result.dMRR = ( FeatureInfo.dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
@@ -787,30 +782,45 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
end end
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part) local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
-- contorno della faccia parallela -- frame solidale alla feature
local vtNParallelFaceTm = EgtSurfTmFacetNormVersor( idParallelTm, 0, GDB_ID.ROOT) local vtZ = MainFace.vtN
local idParallelFaceCurveCompo = EgtExtractSurfTmLoops( idParallelTm, Part.idTempGroup) local vtX = OtherFace and OtherFace.vtN or nil
EgtModifyCurveExtrusion( idParallelFaceCurveCompo, vtNParallelFaceTm, GDB_RT.GLOB) local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
EgtOffsetCurve( idParallelFaceCurveCompo, 100, GDB_OT.EXTEND)
-- trimesh da sottrarre, tagliata con il piano perpendicolare -- box del cubetto in riferimento feature
local vtExtrusion = 1000 * vtNParallelFaceTm local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
local idSurfTmToSubtract = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idParallelFaceCurveCompo, vtExtrusion, 0.05, GDB_RT.GLOB)
if idPerpendicularTm then if idPerpendicularTm then
local ptCenterPerpendicularTm, vtNPerpendicularTm = EgtSurfTmFacetCenter( idPerpendicularTm, 0, GDB_ID.ROOT) local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
EgtCutSurfTmPlane( idSurfTmToSubtract, ptCenterPerpendicularTm, -vtNPerpendicularTm, false, GDB_RT.GLOB) b3Surf:Add( b3SurfPerpendicular)
-- dove la trimesh è stata tagliata mancherà la faccia: si riaggiunge else
local idRemovedFaceCurveCompo = EgtExtractSurfTmLoops( idSurfTmToSubtract, Part.idTempGroup) -- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
local idRemovedFaceTm = EgtSurfTmByFlatContour( Part.idTempGroup, idRemovedFaceCurveCompo) local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
local vtNRemovedFace = EgtSurfTmFacetNormVersor( idRemovedFaceTm, 0, GDB_ID.ROOT) b3Surf:Add( ptDeltaZ)
if AreSameVectorApprox( vtNPerpendicularTm, vtNRemovedFace) then
EgtInvertSurf( idRemovedFaceTm)
end end
idSurfTmToSubtract = EgtSurfTmBySewing( Part.idTempGroup, { idSurfTmToSubtract, idRemovedFaceTm})
-- estensione box per non avere problemi nella sottrazione booleana
if OtherFace and idPerpendicularTm then
local vtY = vtZ ^ vtX
local ptDeltaX = b3Surf:getMax() + vtX * 1
local ptDeltaZ = b3Surf:getMax() + vtZ * 1
local ptDeltaYplus = b3Surf:getMax() + vtY * 1
local ptDeltaYminus = b3Surf:getMin() - vtY * 1
b3Surf:Add( ptDeltaX)
b3Surf:Add( ptDeltaZ)
b3Surf:Add( ptDeltaYplus)
b3Surf:Add( ptDeltaYminus)
else
b3Surf:expand( 1)
end end
-- si porta il box in riferimento globale
b3Surf:toGlob( frMainFace)
-- conversione box cubetto in superficie
local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
-- sottrazione del cubetto dal grezzo -- sottrazione del cubetto dal grezzo
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract) EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
@@ -846,8 +856,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local bAreOrthogonalCutsInverted = false local bAreOrthogonalCutsInverted = false
for i = 1, #vCuts do for i = 1, #vCuts do
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
local sType = ( i % 2 == 0) and 'Paral' or 'Perp' SetDiceFaceInfo( Proc, vCuts[i][j])
SetDiceFaceInfo( Proc, vCuts[i][j], sType)
end end
end end
-- calcolo lavorazioni -- calcolo lavorazioni
@@ -913,7 +922,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end end
-- aggiornamento grezzo dinamico -- aggiornamento grezzo dinamico
if i % 2 == 0 then if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, nil, Part) UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
end end
else else
EgtErase( idSurfToCut) EgtErase( idSurfToCut)
@@ -977,7 +986,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end end
-- aggiornamento grezzo dinamico -- aggiornamento grezzo dinamico
if i % 2 == 0 then if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part) UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
end end
end end
end end
+5 -8
View File
@@ -602,17 +602,14 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc -- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc
-- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi -- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi
Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit
local bIsTruncatingCutOnTail = Proc.AffectedFaces.bLeft and local bIsTruncatingCutOnTail = Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut') and Proc.AffectedFaces.bLeft
( ( Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut')) or if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail then
( FaceToMachine.vtN:getX() < GEO.EPS_SMALL and not OptionalParameters.dPocketHeight))
local bIsFeatureBigAsRawOnTail = ( Proc.b3Box:getDimY() > Part.b3Raw:getDimY() - 100 * GEO.EPS_SMALL) and
( Proc.b3Box:getDimZ() > Part.b3Raw:getDimZ() - 100 * GEO.EPS_SMALL) and
Proc.AffectedFaces.bLeft
if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail or bIsFeatureBigAsRawOnTail then
Cutting.sStage = 'AfterTail' Cutting.sStage = 'AfterTail'
elseif Proc.AffectedFaces.bLeft and elseif Proc.AffectedFaces.bLeft and
( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.sType == 'Bottom' or
( Cutting.vtToolDirection:getX() < 0.707 and not ( Cutting.vtToolDirection:getX() > - 10 * GEO.EPS_SMALL and ( AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Z_AX()) or ( Cutting.vtToolDirection:getX() < 0.707 and
not ( Cutting.vtToolDirection:getX() > - 10 * GEO.EPS_SMALL and
( AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Z_AX()) or
AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Y_AX()))))) then AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Y_AX()))))) then
local dLengthOnX = Cutting.dLengthOnX local dLengthOnX = Cutting.dLengthOnX
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT -- Gestione della versione di BeamNT
NAME = 'BeamNT' NAME = 'BeamNT'
VERSION = '3.1g5' VERSION = '3.1g1'
MIN_EXE = '3.1g3' MIN_EXE = '3.1g1'