This commit is contained in:
luca.mazzoleni
2025-02-27 14:29:58 +01:00
5 changed files with 271 additions and 10 deletions
+2
View File
@@ -216,6 +216,7 @@ local function GetStrategies_Egalware( Proc)
---------------------------------------------------------------------
-- Feature : Dovetail Tenon
elseif ID.IsDovetailTenon( Proc) then
Strategies = { { sStrategyId = 'STR0001'}}
---------------------------------------------------------------------
-- Feature : Dovetail Mortise
elseif ID.IsDovetailMortise( Proc) then
@@ -474,6 +475,7 @@ local function GetStrategies_Essetre( Proc)
---------------------------------------------------------------------
-- Feature : Dovetail Tenon
elseif ID.IsDovetailTenon( Proc) then
Strategies = { { sStrategyId = 'STR0001'}}
---------------------------------------------------------------------
-- Feature : Dovetail Mortise
elseif ID.IsDovetailMortise( Proc) then
+1 -1
View File
@@ -140,7 +140,7 @@ function BeamExec.GetToolsFromDB()
Tool.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or Tool.ToolHolder.dDiameter -- se non settato, considero diametro come ToolHolder
Tool.dSideAngle = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or 0
-- verifico che parametri siano compatibili con una fresa a coda di rondine ( angolo di fianco standard Coda di rondine -> 15°)
Tool.bIsDoveTail = Tool.Type == 'MILL_NOTIP' and abs( abs( Tool.dSideAngle) - SIDEANGLE_DOVETAIL) < 1
Tool.bIsDoveTail = Tool.sType == 'MILL_NOTIP' and abs( abs( Tool.dSideAngle) - SIDEANGLE_DOVETAIL) < 1
-- verifico che sia una fresa tipo T-Mill o BlockHaus
Tool.dSideDepth = EgtGetValInNotes( Tool.sUserNotes, 'SIDEDEPTH', 'd') or 0 -- se non settato nell'utensile, dico che non ha massimo affondamento laterale
Tool.bIsTMill = Tool.dSideDepth > 0
+67
View File
@@ -209,6 +209,19 @@ function FeatureLib.ClassifyTopology( Proc, Part)
return FeatureTopology
end
-------------------------------------------------------------------------------------------------------------
function FeatureLib.GetAdditionalInfo( Proc, Part)
-- se foro calcolo altri dati
if ID.IsDrilling( Proc) then
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
Proc.dDiam, Proc.dLen, Proc.nFcs, Proc.nFce = FeatureLib.GetDrillingData( Proc)
elseif ID.IsDovetailTenon( Proc) then
Proc.dDTLength, Proc.dDTMaxDist, Proc.vtDTNormal, Proc.ptDTCenter, Proc.idAddAuxGeom = FeatureLib.GetDoveTailTenonData( Proc)
end
return Proc
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati foro e adattamento se speciale
function FeatureLib.GetDrillingData( Proc)
@@ -230,6 +243,60 @@ function FeatureLib.GetDrillingData( Proc)
return dDiam, dLen, nFcs, nFce
end
-------------------------------------------------------------------------------------------------------------
-- Recupero dati tenone a coda di rondine
function FeatureLib.GetDoveTailTenonData( Proc)
-- recupero e verifico l'entità curva
local idAux = EgtGetInfo( Proc.id, 'AUXID', 'i')
if idAux then idAux = idAux + Proc.id end
-- recupero i dati della curva
local vtExtr = EgtCurveExtrusion( idAux, GDB_RT.GLOB)
local ptBC = EgtGP( idAux, GDB_RT.GLOB)
-- determino altezza del tenone
local frDtTen = Frame3d( ptBC, vtExtr)
local b3DtTen = EgtGetBBoxRef( Proc.id, GDB_BB.STANDARD, frDtTen)
local dDtTenH = b3DtTen:getDimZ()
-- assegno centro e normale della faccia top
local vtN = vtExtr
local ptC = ptBC + vtN * dDtTenH
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
local dMaxDist
for i = 0, Proc.nFct - 1 do
local ptFC, vtFN = EgtSurfTmFacetCenter( Proc.id, i, GDB_ID.ROOT)
if not AreSameVectorApprox( vtFN, vtN) or abs( ( ptFC - ptBC) * vtN) > 100 * GEO.EPS_SMALL then
break
end
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.id, i, EgtGetParent( Proc.id))
if nLoopId then
local dUmin, dUmax = EgtCurveDomain( nLoopId)
for dU = dUmin, dUmax do
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT)
local ptNear = EgtNP( idAux, ptP, GDB_ID.ROOT)
local dDist = dist( ptP, ptNear)
if not dMaxDist or dDist > dMaxDist then
dMaxDist = dDist
end
end
for j = 1, nLoopCnt do
EgtErase( nLoopId + j - 1)
end
end
end
if not dMaxDist then
local b3DtAux = EgtGetBBoxRef( idAux, GDB_BB.STANDARD, frDtTen)
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
end
Proc.dDTLength = dDtTenH
Proc.dDTMaxDist = dMaxDist
Proc.vtDTNormal = vtExtr
Proc.ptDTCenter = ptC
Proc.idAddAuxGeom = idAux
return Proc.dDTLength, Proc.dDTMaxDist, Proc.vtDTNormal, Proc.ptDTCenter, Proc.idAddAuxGeom
end
-------------------------------------------------------------------------------------------------------------
-- funzione che restituisce indice di completamento in base alla percentuale di volume lavorato
function FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage)
+3 -3
View File
@@ -214,7 +214,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
elseif TOOLS[i].bIsProfiledTool then
bIsToolCompatible = false
-- controlli standard
elseif TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
elseif ToolSearchParameters.dMaxToolDiameter and TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
bIsToolCompatible = false
elseif TOOLS[i].SetupInfo.dMinNz and ToolSearchParameters.vtToolDirection:getZ() < TOOLS[i].SetupInfo.dMinNz - GEO.EPS_ZERO then
bIsToolCompatible = false
@@ -228,7 +228,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
bIsToolCompatible = false
elseif ToolSearchParameters.sMillShape == 'PEN' and not TOOLS[i].bIsPen then
bIsToolCompatible = false
elseif TOOLS[i].sType ~= ToolSearchParameters.sType then
elseif ToolSearchParameters.sType and TOOLS[i].sType ~= ToolSearchParameters.sType then
-- se sto cercando una fresa che non può lavorare di testa, quelle che lavorano di testa sono comunque ammesse
if TOOLS[i].sType == 'MILL_STD' and ToolSearchParameters.sType == 'MILL_NOTIP' then
bIsToolCompatible = true
@@ -252,7 +252,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
if ToolEntryAngle.dValue > 0 and ToolEntryAngle.dValue < 90 then
dCurrentMaxMatReduction = dCurrentMaxMatReduction / ToolEntryAngle.dSin + ( ( dDimObjToCheck - TOOLS[i].dDiameter) / 2) / ToolEntryAngle.dTan
end
-- dCurrMachReduction = negativo -> limitare, positivo -> mm extra disponibili
-- dCurrentResidualDepth = negativo -> mm extra disponibili, positivo -> limitare
local dCurrentResidualDepth = ToolSearchParameters.dElevation + dCurrentMaxMatReduction - TOOLS[i].dMaxDepth
-- se non ancora trovato, oppure se completo e il migliore fino ad ora non è completo: corrente è il migliore