Compare commits

...

22 Commits

Author SHA1 Message Date
daniele.nicoli 4f24b32705 - PreSimulationLib - Unificata funzione per la pre simulazione della distanza tra punto e grezzo
-LeadInOutLib - unificata con funzione in PreSimulationLib
- STR0011 - Aggiunto calcolo per approccio in velocità di lavoro
- MachiningLib - Drill - Calcolo massima profondità del foro rispetto a portautensile
2026-07-28 17:07:30 +02:00
luca.mazzoleni da37e7e45a - in STR0010 rimosso require inutile 2026-07-27 10:32:06 +02:00
andrea.villa 8969b8bc9f Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/databeamnew into develop 2026-07-24 14:51:36 +02:00
andrea.villa 237fa742fc - In calcolo tempo delle svuotature non si utilizza più la funzione EgtCurveCompoSetTempProp ma si setta direttaemnte la nota sul percorso
- In BLADETOWASTE la alvorazione di un lato "brutto" con lama ha comunque una finitura migliore che standard
2026-07-24 14:51:31 +02:00
luca.mazzoleni b6ccdd59ea Merge branch 'DiceRawFix' into develop 2026-07-24 14:37:15 +02:00
luca.mazzoleni b10844beed - in BLADETOWASTE corretta UpdateDiceRaw
- in FACEBYBLADE tutte le feature aperte sul retro e che occupano tutta la sezione diventano AfterTail
2026-07-24 14:37:03 +02:00
luca.mazzoleni 793aff4ffb - in BLADETOWASTE.UpdateDiceRaw corretto (rifatto) il calcolo del grezzo dinamico per cubetti
- in PreSimulationLib se trovata collisione i solidi interessati si copiano nel livello Mach (temporaneamente, sarà da mettere in gruppo apposito)
2026-07-23 18:02:48 +02:00
luca.mazzoleni 3d2d17e11f Merge branch 'develop' into DiceRawFix 2026-07-23 10:48:37 +02:00
luca.mazzoleni 16c9ac9771 Merge branch 'main' into develop 2026-07-23 10:48:13 +02:00
luca.mazzoleni 098c4e1fe3 Merge branch 'develop' 2026-07-23 09:19:54 +02:00
luca.mazzoleni 33ede89b64 update version 2026-07-23 09:19:42 +02:00
luca.mazzoleni b171ba5d0d - in STR0001 correzione in lettura parametro dOverMatOnLength 2026-07-23 09:13:37 +02:00
luca.mazzoleni ed658fffa6 - in BLADETOWASTE corretta UpdateDiceRaw per funzionare anche con tagli obliqui 2026-07-23 09:11:45 +02:00
andrea.villa 18789c30f2 In STR0011 (foratura), si setta AfterTail in caso sia aperto sulla faccia di coda 2026-07-22 17:52:05 +02:00
luca.mazzoleni 4e2afcd4bf Merge branch 'main' into develop 2026-07-22 10:39:14 +02:00
luca.mazzoleni 4e4e183382 Merge branch 'develop' 2026-07-22 10:38:41 +02:00
luca.mazzoleni d769b603bd update version 2026-07-22 10:38:31 +02:00
luca.mazzoleni 06ed12b1fe - in STR0015 gestito correttamente lato di lavoro per FreeContour; aggiunta vtHead 2026-07-22 10:37:56 +02:00
luca.mazzoleni 2e289e1921 - commenti 2026-07-21 17:50:03 +02:00
luca.mazzoleni c55395f829 Merge branch 'main' into develop 2026-07-20 18:04:04 +02:00
luca.mazzoleni 4ae8525573 Merge branch 'develop' 2026-07-20 18:03:31 +02:00
luca.mazzoleni 7b092ecb93 - update version 2026-07-20 18:03:25 +02:00
10 changed files with 170 additions and 84 deletions
+11 -14
View File
@@ -9,6 +9,7 @@ require( 'EgtBase')
local BeamData = require( 'BeamDataNew')
local FaceData = require( 'FaceData')
local BeamLib = require( 'BeamLib')
local PreSimulationLib = require( 'PreSimulationLib')
EgtOutLog( ' LeadInOutLib started', 1)
@@ -71,24 +72,20 @@ end
local function CalculateLeadInOutLength( ptToolCenter, vtNFace, b3Box, vtLeadInOut, Tool)
-- al momento gestita solo lama
if not Tool.sFamily == 'SawBlade' then
if not Tool.sFamily == 'SAWBLADE' then
error(' Tool family not implemented')
end
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
local ptStart = Point3d( ptToolCenter)
local DistanceData = {}
DistanceData.vtNFace = vtNFace
DistanceData.vtMove = vtLeadInOut
DistanceData.dToolThickness = Tool.dThickness
DistanceData.dToolDiameter = Tool.dDiameter
DistanceData.sToolFamily = Tool.sFamily
DistanceData.ptReferencePoint = ptStart + DistanceData.dToolThickness * DistanceData.vtNFace
-- si setta utensile lama per il controllo collisione
EgtCAvSetSawTool( Tool.dThickness, Tool.dDiameter, Tool.dThickness, 0, 0)
-- calcolo distanza di cui retrarre con funzioni Tool Collision Avoidance
local dLength = min( EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxX, vtLeadInOut),
EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxY, vtLeadInOut),
EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxZ, vtLeadInOut))
return dLength
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
end
+32 -6
View File
@@ -791,6 +791,25 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
return ToolInfo
end
-- Calcolo profondità massima del foro rispetto al Portautensile (solo per utensile punta)
-------------------------------------------------------------------------------------------------------------
function MachiningLib.GetDrillMaxDepthFromToolHolderSideEncumbrance( FeatureInfo, nToolIndex, b3Raw)
local b3Box = BBox3d( b3Raw)
b3Box:expand( BeamData.COLL_SIC)
local ptStart = Point3d( FeatureInfo.ptDrillCenter)
local dToolLength = TOOLS[nToolIndex].dLength
local dMaxDepth = TOOLS[nToolIndex].dMaxDepth
local DistanceData = {}
DistanceData.vtNFace = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.vtMove = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.dToolLength = TOOLS[nToolIndex].ToolHolder.dLength
DistanceData.dToolDiameter = TOOLS[nToolIndex].ToolHolder.dDiameter
DistanceData.sToolFamily = 'TOOLHOLDER'
DistanceData.ptReferencePoint = ptStart + ( ( dToolLength - dMaxDepth - DistanceData.dToolLength) * DistanceData.vtNFace)
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo PUNTA A FORARE con certe caratteristiche
function MachiningLib.FindDrill( Proc, ToolSearchParameters)
@@ -907,6 +926,13 @@ function MachiningLib.FindDrill( Proc, ToolSearchParameters)
ToolInfo.nToolIndex = nBestToolIndex
ToolInfo.dResidualDepth = dBestToolResidualDepth
if nBestToolIndex then
local dTHReduction = MachiningLib.GetDrillMaxDepthFromToolHolderSideEncumbrance( Proc.FeatureInfo, nBestToolIndex, ToolSearchParameters.Part.b3Raw)
local dTHResidualDepth = ToolSearchParameters.dElevation + dTHReduction - TOOLS[nBestToolIndex].dMaxDepth
if dTHResidualDepth < dBestToolResidualDepth then
ToolInfo.dResidualDepth = dTHResidualDepth
end
end
-- si salva se la punta ha lo stesso diametro del foro
if nBestToolIndex and TOOLS[nBestToolIndex].dDiameter - ToolSearchParameters.dToolDiameter > 100 * GEO.EPS_SMALL then
ToolInfo.bDrillIsExactDiameter = true
@@ -1662,12 +1688,16 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
local idTempGroup = Part.idTempGroup
-- 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)
-- si settano i lati aperti della curva derivata dalla superficie
local sOpenEdges = ''
for i = 1, #ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges do
if ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].bIsOpen then
EgtCurveCompoSetTempProp( idFaceContour, ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id, 1)
sOpenEdges = sOpenEdges .. EgtNumToString( ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id) .. ','
end
end
EgtSetInfo( idFaceContour, 'OPEN', sOpenEdges)
-- dal momento che la funzione EgtPocketing non considera il grezzo, nei casi ottimizzati si deve correggere l'offset
local idTestCurve = EgtCopyGlob( idFaceContour, idTempGroup )
local bIsOptimizedPocketing = ( TOOLS[Machining.nToolIndex].dDiameter > TOOLS[Machining.nToolIndex].dSideStep - 10 * GEO.EPS_SMALL)
@@ -1678,11 +1708,7 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
dOffset = TOOLS[Machining.nToolIndex].dDiameter - TOOLS[Machining.nToolIndex].dSideStep
end
EgtOffsetCurve( idFaceContour, dOffset)
-- 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
EgtRemoveInfo( idFaceContour, 'OPEN')
end
-- 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)
+44 -6
View File
@@ -103,6 +103,35 @@ function PreSimulationLib.GetPointOnToolTipCenter( ptPointAtDepth, vtHead, vtNFa
return ptPointAtDepth + vtToolOffset * Tool.dDiameter / 2 + vtNFace * EgtIf( AreSameVectorApprox( vtHead, vtNFace), 0, Tool.dThickness)
end
-------------------------------------------------------------------------------------------------------------
function PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
-- Imposta l'utensile correttamente
if DistanceData.sToolFamily == 'DRILLBIT' then
-- si setta utensile Punta per il controllo collisione
EgtCAvSetAdvTool( DistanceData.dToolLength, DistanceData.dToolDiameter, ( DistanceData.dToolTotalLength - DistanceData.dToolLength), 0, 0)
elseif DistanceData.sToolFamily == 'SAWBLADE' then
-- si setta utensile Lama per il controllo collisione
EgtCAvSetSawTool( DistanceData.dToolThickness, DistanceData.dToolDiameter, DistanceData.dToolThickness, 0, 0)
elseif DistanceData.sToolFamily == 'TOOLHOLDER' then
-- si setta utensile Cilindrico per simulare il portautensile in caso di fori inclinati nei quali è possibile che il portautensile collida
EgtCAvSetStdTool( DistanceData.dToolLength, DistanceData.dToolDiameter, 0)
-- altre tipologie non gestite
else
return nil
end
-- calcolo distanza di cui retrarre con funzioni Tool Collision Avoidance *da top dell'utensile*
local dLength = min( EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxX, DistanceData.vtMove),
EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxY, DistanceData.vtMove),
EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxZ, DistanceData.vtMove))
return dLength
end
-------------------------------------------------------------------------------------------------------------
-- calcolo punto sull'uscita testa a partire dal punto di lavorazione o di attacco sul diametro utensile
local function GetToolExitPoint( ptMachining, vtNEdge, vtHead, Tool, bIsDownUp)
@@ -301,6 +330,8 @@ end
-------------------------------------------------------------------------------------------------------------
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
local idAddGroup = BeamLib.GetAddGroup( Part.id)
-- spostamento assi macchina in posizione
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
@@ -350,17 +381,23 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
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
if bCollisionFoundPiece then
break
end
end
-- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then
-- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then
return true
end
return true
end
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
local bCollisionFoundRestLength = false
@@ -430,8 +467,8 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
if bCheckFlange and Tool.sType == 'SAW_FLAT' then
local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness
local frHead = Frame3d( ptCenterFlange, vtHead)
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(), dExtraSafety + Tool.dDiameter / 2 - Tool.dMaxDepth, GDB_RT.GLOB)
local dFlangeRadius = Tool.ToolHolder.dDiameter / 2
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dFlangeRadius, GDB_RT.GLOB)
EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB)
-- TODO verificare se questo controllo serve
@@ -443,6 +480,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
end
-- TODO raggruppare parametri opzionali!
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
-- 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
Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnLength, -5, 5)
-- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda
local dLengthOnX = Proc.b3Box:getDimX()
-1
View File
@@ -10,7 +10,6 @@ local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib')
-- strategie di base
local FaceByMill = require( 'FACEBYMILL')
local FaceByBlade = require( 'FACEBYBLADE')
local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
-- Tabella per definizione modulo
+25
View File
@@ -8,6 +8,7 @@ local BeamLib = require( 'BeamLib')
local BeamData = require( 'BeamDataNew')
local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib')
local PreSimulationLib = require( 'PreSimulationLib')
-- strategie di base
-- Tabella per definizione modulo
@@ -37,6 +38,24 @@ local function GetSCC( vtMachiningDirection)
return nSCC
end
-- Calcolo distanza dalla quale andare a velocità di lavoro ( Start Safety Length)
-------------------------------------------------------------------------------------------------------------
local function GetDrillApprochSafeDistance( FeatureInfo, nToolIndex, b3Raw)
local b3Box = BBox3d( b3Raw)
b3Box:expand( BeamData.COLL_SIC)
local ptStart = Point3d( FeatureInfo.ptDrillCenter)
local DistanceData = {}
DistanceData.vtNFace = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.vtMove = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.dToolLength = TOOLS[nToolIndex].dLength
DistanceData.dToolTotalLength = TOOLS[nToolIndex].dTotalLength
DistanceData.dToolDiameter = TOOLS[nToolIndex].dDiameter
DistanceData.sToolFamily = TOOLS[nToolIndex].sFamily
DistanceData.ptReferencePoint = ptStart + DistanceData.dToolLength * DistanceData.vtNFace
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
end
-------------------------------------------------------------------------------------------------------------
local function GetDrillingStrategy( Proc, Part)
local ToolSearchParameters = {}
@@ -51,6 +70,7 @@ local function GetDrillingStrategy( Proc, Part)
ToolSearchParameters.dDiameterTolerance = Strategy.Parameters.dDiameterTolerance
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sDrillBitList, 'Drilling')
ToolSearchParameters.ptCheckOutStroke = { Proc.FeatureInfo.ptDrillCenter + ( EgtMdbGetGeneralParam( MCH_GP.SAFEZ) * ToolSearchParameters.vtToolDirection)}
ToolSearchParameters.Part = Part
Drilling.ToolInfo = {}
Drilling.ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
@@ -61,6 +81,7 @@ local function GetDrillingStrategy( Proc, Part)
Drilling.vtToolDirection = Proc.FeatureInfo.vtDrillExtrusion
Drilling.dStep = TOOLS[Drilling.nToolIndex].dStep
Drilling.nSCC = GetSCC( -Drilling.vtToolDirection)
Drilling.dStartSafetyLength = max( BeamData.COLL_SIC, GetDrillApprochSafeDistance( Proc.FeatureInfo, Drilling.ToolInfo.nToolIndex, Part.b3Raw))
end
-- TODO se utensile 2 che si torverà è il gemello da usare nelle lavorazioni in doppio, allora gestire di conseguenza l'applicazione delle lavorazioni in doppio
@@ -84,6 +105,7 @@ local function GetDrillingStrategy( Proc, Part)
Drilling2.vtToolDirection = -Proc.FeatureInfo.vtDrillExtrusion
Drilling2.dStep = TOOLS[Drilling2.nToolIndex].dStep
Drilling2.nSCC = GetSCC( -Drilling2.vtToolDirection)
Drilling2.dStartSafetyLength = max( BeamData.COLL_SIC, GetDrillApprochSafeDistance( Proc.FeatureInfo, Drilling.ToolInfo.nToolIndex, Part.b3Raw))
end
end
@@ -216,6 +238,9 @@ function STR0011.Make( bAddMachining, Proc, Part, CustomParameters)
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
-- aggiunge lavorazione
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].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j])
+23 -9
View File
@@ -858,24 +858,38 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadInForSplit.dTangentDistance = 0
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
if not ID.IsFreeContour( Proc) then
CurrentMachining.LeadInForSplit.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
if CurrentMachining.bOtherDirection then
CurrentMachining.bToolInvert = true
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
-- sistemo il lato e la direzione di lavoro; se FreeContour il lato è determinato dalla Feature, altrimenti dalla concordanza
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
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)
if CurrentMachining.bOtherDirection then
CurrentMachining.bToolInvert = true
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
else
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)
end
end
CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
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.dLengthOnX = Proc.b3Box:getDimX()
CurrentMachining.vtHead = CurrentMachining.vtToolDirection
local MachiningToSplit = {}
table.insert( MachiningToSplit, CurrentMachining)
+26 -40
View File
@@ -358,8 +358,8 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
end
local function SetDiceFaceInfo( Proc, idDiceFace)
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice')
local function SetDiceFaceInfo( Proc, idDiceFace, sType)
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice_' .. sType)
end
@@ -770,7 +770,7 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
-- per tagli con lati brutti o ghigliottina si abbassa la qualità
if ( sChosenBladeType ~= 'Top') and ( sChosenBladeType ~= 'Bottom') then
Result.dQuality = FeatureLib.GetStrategyQuality( 'STD')
Result.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
end
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
Result.dMRR = ( FeatureInfo.dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
@@ -782,45 +782,30 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
end
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part)
-- frame solidale alla feature
local vtZ = MainFace.vtN
local vtX = OtherFace and OtherFace.vtN or nil
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
-- contorno della faccia parallela
local vtNParallelFaceTm = EgtSurfTmFacetNormVersor( idParallelTm, 0, GDB_ID.ROOT)
local idParallelFaceCurveCompo = EgtExtractSurfTmLoops( idParallelTm, Part.idTempGroup)
EgtModifyCurveExtrusion( idParallelFaceCurveCompo, vtNParallelFaceTm, GDB_RT.GLOB)
EgtOffsetCurve( idParallelFaceCurveCompo, 100, GDB_OT.EXTEND)
-- box del cubetto in riferimento feature
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
-- trimesh da sottrarre, tagliata con il piano perpendicolare
local vtExtrusion = 1000 * vtNParallelFaceTm
local idSurfTmToSubtract = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idParallelFaceCurveCompo, vtExtrusion, 0.05, GDB_RT.GLOB)
if idPerpendicularTm then
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
b3Surf:Add( b3SurfPerpendicular)
else
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
b3Surf:Add( ptDeltaZ)
local ptCenterPerpendicularTm, vtNPerpendicularTm = EgtSurfTmFacetCenter( idPerpendicularTm, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( idSurfTmToSubtract, ptCenterPerpendicularTm, -vtNPerpendicularTm, false, GDB_RT.GLOB)
-- dove la trimesh è stata tagliata mancherà la faccia: si riaggiunge
local idRemovedFaceCurveCompo = EgtExtractSurfTmLoops( idSurfTmToSubtract, Part.idTempGroup)
local idRemovedFaceTm = EgtSurfTmByFlatContour( Part.idTempGroup, idRemovedFaceCurveCompo)
local vtNRemovedFace = EgtSurfTmFacetNormVersor( idRemovedFaceTm, 0, GDB_ID.ROOT)
if AreSameVectorApprox( vtNPerpendicularTm, vtNRemovedFace) then
EgtInvertSurf( idRemovedFaceTm)
end
idSurfTmToSubtract = EgtSurfTmBySewing( Part.idTempGroup, { idSurfTmToSubtract, idRemovedFaceTm})
end
-- 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
-- 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
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
@@ -856,7 +841,8 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local bAreOrthogonalCutsInverted = false
for i = 1, #vCuts do
for j = 1, #vCuts[i] do
SetDiceFaceInfo( Proc, vCuts[i][j])
local sType = ( i % 2 == 0) and 'Paral' or 'Perp'
SetDiceFaceInfo( Proc, vCuts[i][j], sType)
end
end
-- calcolo lavorazioni
@@ -922,7 +908,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end
-- aggiornamento grezzo dinamico
if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, nil, Part)
end
else
EgtErase( idSurfToCut)
@@ -986,7 +972,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end
-- aggiornamento grezzo dinamico
if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part)
end
end
end
+6 -5
View File
@@ -603,14 +603,15 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- 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
local bIsTruncatingCutOnTail = Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut') and Proc.AffectedFaces.bLeft
if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail then
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'
elseif Proc.AffectedFaces.bLeft and
( 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
AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Y_AX()))))) then
( 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
local dLengthOnX = Cutting.dLengthOnX
-- se feature splittata non si considera la lunghezza della feature per il check spostamento dopo separazione
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT
NAME = 'BeamNT'
VERSION = '3.1g1'
MIN_EXE = '3.1g1'
VERSION = '3.1g4'
MIN_EXE = '3.1g3'