Compare commits

..

13 Commits

Author SHA1 Message Date
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
7 changed files with 53 additions and 57 deletions
+6 -6
View File
@@ -1662,12 +1662,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 +1682,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)
+10 -2
View File
@@ -301,6 +301,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,6 +352,12 @@ 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
@@ -430,8 +438,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
+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()
+3
View File
@@ -216,6 +216,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])
+26 -42
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,47 +782,30 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
end
-- TODO da rivedere!! Si devono creare trimesh estruse nelle direzioni normali alle due facce, unirle e poi sottrarle al solido
-- nel modo attuale funziona solo se i cubetti sono orientati come le direzioni principali
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)
@@ -858,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
@@ -924,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)
@@ -988,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
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT
NAME = 'BeamNT'
VERSION = '3.1g3'
VERSION = '3.1g4'
MIN_EXE = '3.1g3'