8 Commits

Author SHA1 Message Date
luca.mazzoleni beedbc71f1 - in BLADETOWASTE.CalculateDiceMachinings grezzo dinamico per evitare collisioni in presimulazione, da completare 2026-06-10 09:20:37 +02:00
luca.mazzoleni 8da693817d - in BeamExec.GetFeatureInfoAndDependency correzione importante 2026-06-08 13:27:40 +02:00
luca.mazzoleni 19f35ccd61 - in BeamExec.ProcessBeams modifiche minori 2026-06-08 11:58:15 +02:00
luca.mazzoleni 0806e1bab8 Merge branch 'main' into ObliqueNesting 2026-06-08 11:17:04 +02:00
luca.mazzoleni 387eda8b4a - in BeamExec corretta ProcessBeams per i casi in cui dPosX non è definito 2026-06-08 11:16:50 +02:00
andrea.villa c7045499f4 Merge remote-tracking branch 'origin/develop' 2026-05-29 11:15:28 +02:00
andrea.villa 44478b91f0 Aggiornato log e versione 2026-05-29 11:15:09 +02:00
andrea.villa 1f4aa15af4 Aggiunto tipo fresa da cercare 2026-05-29 11:10:41 +02:00
7 changed files with 56 additions and 24 deletions
+1 -2
View File
@@ -390,8 +390,7 @@ if bToProcess then
end end
end end
-- Assegno lunghezza della barra -- Assegno lunghezza della barra
-- TODO nella ProcessBeams andava in errore con 10mm!!! CONTROLLARE dBarLen = PARTS[1].b3PartOriginal:getDimX() + 10
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 20
if dBarLen < 2200 then if dBarLen < 2200 then
dBarLen = dBarLen + 1800 dBarLen = dBarLen + 1800
end end
+28 -17
View File
@@ -436,36 +436,47 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dPartWidth = CurrentPart.b3PartOriginal:getDimY( ) local dPartWidth = CurrentPart.b3PartOriginal:getDimY( )
local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( ) local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( )
local dStartOffset = dNextStartOffset -- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
local dEndOffset = dOvmMid if ( not CurrentPart.dPosX) then
if ( i == 1) then
CurrentPart.dPosX = dOvmHead
else
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid
end
end
-- LOGICA LOOK-AHEAD: Analisi del gap reale per la ripartizione specchiata -- Se il pezzo SUCCESSIVO non ha coordinata, si calcola da OvmMid
if ( i < #PARTS and not PARTS[i + 1].dPosX) then
PARTS[i + 1].dPosX = CurrentPart.dPosX + dPartLen + dOvmMid
end
local dStartOffset = dNextStartOffset
local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui)
if ( i < #PARTS ) then if ( i < #PARTS ) then
local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen
if ( dTotalGap > dOvmMid ) then if ( dTotalGap > dOvmMid ) then
dEndOffset = dOvmMid -- Max 5.4mm sulla coda (lato sinistro del grezzo) dEndOffset = dOvmMid
dNextStartOffset = dTotalGap - dOvmMid -- Il residuo sulla testa del prossimo (lato destro) dNextStartOffset = dTotalGap - dOvmMid
else else
-- Gestione automatica sotto-soglia o compenetrazione geometrica (Nesting Obliquo) -- Gap minore dello spessore lama (compenetrazione per nesting obliqui)
dEndOffset = dTotalGap dEndOffset = dTotalGap
dNextStartOffset = 0 dNextStartOffset = 0
end end
end end
-- MATEMATICA CORRETTA PER X CAD INVERTITA: local dCurrentRawLen = dPartLen + dStartOffset + dEndOffset
-- Il grezzo idRaw si estende verso destra. Spostando il pezzo internamente di dEndOffset (dDelta),
-- lasciamo dEndOffset a sinistra (coda) e matematicamente dStartOffset a destra (testa).
local dCrawLen = dPartLen + dStartOffset + dEndOffset
local dDelta = dEndOffset local dDelta = dEndOffset
local dStartPos = (CurrentPart.dPosX or 0) - dStartOffset local dStartPos = CurrentPart.dPosX - dStartOffset
local bIsSectionOk = ( ( abs( dPartWidth - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH ) < 100 * GEO.EPS_SMALL ) or local bIsSectionOk = ( ( abs( dPartWidth - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH ) < 100 * GEO.EPS_SMALL ) or
( abs( dPartHeight - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH ) < 100 * GEO.EPS_SMALL ) ) ( abs( dPartHeight - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH ) < 100 * GEO.EPS_SMALL ) )
if ( bIsSectionOk and ( dStartPos + dCrawLen <= dRawL + GEO.EPS_SMALL ) ) then if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= dRawL + GEO.EPS_SMALL ) ) then
-- 5. Creazione e Posizionamento del Contenitore RawPart -- 5. Creazione e Posizionamento del Contenitore RawPart
CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCrawLen, dRawW, dRawH, BeamData.RAWCOL ) CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL )
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR ) EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR )
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) ) EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) )
@@ -530,7 +541,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot ) CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot )
-- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra) -- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra)
dMaxX = max( dMaxX, dStartPos + dCrawLen ) dMaxX = max( dMaxX, dStartPos + dCurrentRawLen )
CurrentPart.dRestLength = dRawL - dMaxX CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw idPrevRaw = CurrentPart.idRaw
else else
@@ -849,7 +860,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
ProcB.nFlg = 0 ProcB.nFlg = 0
end end
-- il secondo taglio è più verso il centro della trave -- il secondo taglio è più verso il centro della trave
elseif Proc.b3Box:getMin():getX() >= ProcB.b3Box:getMin():getX() - 10 * GEO.EPS_SMALL then else
HeadProc = ProcB HeadProc = ProcB
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup) local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup) local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
@@ -884,7 +895,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
ProcB.nFlg = 0 ProcB.nFlg = 0
end end
-- il secondo taglio è più verso il centro della trave -- il secondo taglio è più verso il centro della trave
elseif Proc.b3Box:getMax():getX() >= ProcB.b3Box:getMax():getX() - 10 * GEO.EPS_SMALL then else
TailProc = ProcB TailProc = ProcB
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup) local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup) local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
@@ -968,7 +979,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
local PtSortedTail = BeamLib.GetSortedVertices( TailProc) local PtSortedTail = BeamLib.GetSortedVertices( TailProc)
if PtSortedTail then if PtSortedTail then
TailcutInfo.OffsetX = {} TailcutInfo.OffsetX = {}
for i = 1, #PtSortedHead do for i = 1, #PtSortedTail do
table.insert( TailcutInfo.OffsetX, Part.b3Part:getMin():getX() - PtSortedTail[i]:getX()) table.insert( TailcutInfo.OffsetX, Part.b3Part:getMin():getX() - PtSortedTail[i]:getX())
end end
end end
+1
View File
@@ -87,6 +87,7 @@ local function GetTenonStrategy( Proc, Part)
ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT) ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT)
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
ToolSearchParameters.sMillShape = 'STANDARD'
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing') ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters) Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-1
View File
@@ -215,7 +215,6 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
end end
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone -- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
-- TODO Girando il pezzo trova sempre che limitano il pinzaggio se pezzo piccolo!! Il controllo non va bene. Da rifare
if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)' local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
EgtOutLog( sErr) EgtOutLog( sErr)
+22
View File
@@ -797,6 +797,10 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
local bReduceDiceDepth = Parameters.bReduceDiceDepth local bReduceDiceDepth = Parameters.bReduceDiceDepth
-- trimesh con RestLength
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
local idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria -- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
local bAreOrthogonalCutsInverted = false local bAreOrthogonalCutsInverted = false
for i = 1, #vCuts do for i = 1, #vCuts do
@@ -877,6 +881,15 @@ local function CalculateDiceMachinings( vCuts, Parameters)
bMoveAfterSplit = true bMoveAfterSplit = true
end end
end end
-- aggiornamento grezzo dinamico
-- TODO
if ( i >= 3) and ( i % 2) > 0 then
local idMergedParallelCutsSurf = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
idCheckCollisionTm = nil
end
else else
EgtErase( nSurfToCut) EgtErase( nSurfToCut)
bIsDicingOk = false bIsDicingOk = false
@@ -936,6 +949,15 @@ local function CalculateDiceMachinings( vCuts, Parameters)
if Cutting.sStage == 'AfterTail' then if Cutting.sStage == 'AfterTail' then
bMoveAfterSplit = true bMoveAfterSplit = true
end end
-- aggiornamento grezzo dinamico
-- TODO
if ( i >= 3) and ( i % 2) > 0 then
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
local idMergedParallelCutsSurf = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
idCheckCollisionTm = nil
end
end end
end end
end end
+2 -2
View File
@@ -1,4 +1,4 @@
==== Beam Update Log ==== ==== Beam Update Log ====
Versione 2.6-- (--/--/2024) Versione 3.1e1 (29/05/2026)
- Primo commit creazione nuovo automatismo BEAM con strategie - Primo commit nuovo automatismo a strategie
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '2.8a1' VERSION = '3.1e1'
MIN_EXE = '2.7j2' MIN_EXE = '3.1e1'