Compare commits

..
Author SHA1 Message Date
andrea.villa dc06e65aab Cambio versione per rilascio a cliente 2026-08-28 09:37:57 +02:00
andrea.villa 83f5841ece - In BLADEKEEPWASTE testimoni perpendicolari anche con lama che lavora i due edges. In caso MaxMat maggiore di 3 volte elevazione faccia, si fa comunque solo da un lato (anche in caso trovi la lavorazione del lato2).
- se taglio troncante e rivolto verso la coda, lo si considera come un taglio di coda da fare dopo quello di separazione
- pulizia spigoli con fresa in STR0010 da fare in un'unica lavorazione, non spezzata
2026-08-27 15:50:35 +02:00
andrea.villa c1eee0201c In FeatureLib, quando si costruisce la Proc su una Trimesh, si ricava anche la Topologia 2026-08-21 14:38:01 +02:00
8 changed files with 79 additions and 137 deletions
+7
View File
@@ -36,6 +36,9 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom)
if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then
Proc.dVolume = ProcToCopyFrom.dVolume
end
Proc.nParts = EgtSurfTmPartCount( Proc.id) or 1
Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part)
-- TODO servono anche altri dati raccolti nel collect??
return Proc
@@ -220,6 +223,10 @@ function FeatureLib.ClassifyTopology( Proc, Part)
elseif Proc.nFct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
sFamily = 'Cut'
bIsThrough = true
-- se taglia intera sezione ed è rivolto verso la coda, bisogna considerare come se tocchi la faccia di coda
if Proc.Faces[1].vtN:getX() < 0 then
Proc.AffectedFaces.bLeft = true
end
elseif Proc.nFct == 1 then
sFamily = 'Bevel'
bIsThrough = true
+14 -11
View File
@@ -9,7 +9,6 @@ require( 'EgtBase')
local BeamData = require( 'BeamDataNew')
local FaceData = require( 'FaceData')
local BeamLib = require( 'BeamLib')
local PreSimulationLib = require( 'PreSimulationLib')
EgtOutLog( ' LeadInOutLib started', 1)
@@ -72,20 +71,24 @@ 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
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
-- 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)
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
-- 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
end
-26
View File
@@ -791,25 +791,6 @@ 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)
@@ -926,13 +907,6 @@ 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
-29
View File
@@ -103,35 +103,6 @@ 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)
+6 -4
View File
@@ -316,10 +316,11 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
local dDepthToMachine = EdgesClosedNotMachined[i].dElevation - dMillingOffsetFromSide
local dToolMarkLength = Milling1.dToolMarkLength or 0
local OptionalParameters = {
bIsSplitFeature = bIsSplitFeature,
bIsSplitFeature = false, -- anche se feature splittata, le facce di chiusura si lavorano intere
dExtendAfterTail = dExtendAfterTail,
dRadialStepSpan = dToolMarkLength,
dDepthToMachine = dDepthToMachine
dDepthToMachine = dDepthToMachine,
nStepType = MCH_MILL_ST.ONEWAY
}
local Milling = FaceByMill.Make( Proc, Part, BottomFace1, EdgesClosedNotMachined[i], OptionalParameters)
Milling.nInternalSortingPriority = 3
@@ -342,10 +343,11 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
local dDepthToMachine = EdgesClosedNotMachined[i].dElevation - dMillingOffsetFromSide
local dToolMarkLength = Milling2.dToolMarkLength or 0
local OptionalParameters = {
bIsSplitFeature = bIsSplitFeature,
bIsSplitFeature = false, -- anche se feature splittata, le facce di chiusura si lavorano intere
dExtendAfterTail = dExtendAfterTail,
dRadialStepSpan = dToolMarkLength,
dDepthToMachine = dDepthToMachine
dDepthToMachine = dDepthToMachine,
nStepType = MCH_MILL_ST.ONEWAY
}
local Milling = FaceByMill.Make( Proc, Part, BottomFace2, EdgesClosedNotMachined[i], OptionalParameters)
Milling.nInternalSortingPriority = 3
+1 -24
View File
@@ -8,7 +8,6 @@ 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
@@ -38,24 +37,6 @@ 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 = {}
@@ -70,7 +51,6 @@ 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)
@@ -81,7 +61,6 @@ 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
@@ -95,8 +74,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 + ( ( Proc.FeatureInfo.dDrillLen + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) * ToolSearchParameters.vtToolDirection)}
ToolSearchParameters.Part = Part
Drilling2.ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
-- se trovato utensile si settano i parametri comuni
if Drilling2.ToolInfo.nToolIndex then
@@ -106,7 +84,6 @@ 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, Drilling2.ToolInfo.nToolIndex, Part.b3Raw))
end
end
+50 -42
View File
@@ -171,50 +171,58 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
Cutting2.nInternalSortingPriority = 2
Cutting2.dResultWeight = 0.3
-- se uno dei due lati non è riuscito, si estende il più possibile il lato rimasto
if not Cutting1.bIsApplicable and Cutting2.bIsApplicable then
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting2.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting2.nToolIndex].dMaxMaterial - 10
else
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
Cutting2.nInternalSortingPriority = 2
Cutting2.dResultWeight = 0.3
table.insert( Cuttings, Cutting2)
elseif not Cutting2.bIsApplicable and Cutting1.bIsApplicable then
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting1.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting2.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting1.nToolIndex].dMaxMaterial - 10
else
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
Cutting1.nInternalSortingPriority = 2
Cutting1.dResultWeight = 0.3
-- se entrambi i lati lavorati e codolo centrale, si aggiungono in lista senza fare altro
if Cutting1.bIsApplicable and Cutting2.bIsApplicable and not bAllowPerpendicularStrip then
table.insert( Cuttings, Cutting1)
table.insert( Cuttings, Cutting2)
else
table.insert( Cuttings, Cutting1)
table.insert( Cuttings, Cutting2)
-- si estende il lato il più possibile
if Cutting1.bIsApplicable then
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting1.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting1.nToolIndex].dMaxMaterial - 10
-- CASO SPECIALE : se il massimo materiale è più di 3 volte la faccia, si fa lavorazione solo da un lato, l'altro viene annullato
if TOOLS[Cutting1.nToolIndex].dMaxMaterial / 3 > EdgeToMachine.dElevation then
Cutting2.bIsApplicable = false
end
else
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
Cutting1.nInternalSortingPriority = 2
Cutting1.dResultWeight = 0.3
table.insert( Cuttings, Cutting1)
end
-- si estende il lato il più possibile
if Cutting2.bIsApplicable then
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting2.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting2.nToolIndex].dMaxMaterial - 10
else
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
Cutting2.nInternalSortingPriority = 2
Cutting2.dResultWeight = 0.3
table.insert( Cuttings, Cutting2)
end
end
return Cuttings
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT
NAME = 'BeamNT'
VERSION = '3.1g5'
VERSION = '3.1h1_DEV1'
MIN_EXE = '3.1g3'