Aggiunta lavorazione (primordiale) di foratura
This commit is contained in:
@@ -12,8 +12,8 @@ local WinData = require( 'WinData')
|
||||
function FeatureData.GetDrillingData( Proc)
|
||||
local bOk, ptCentre, vtDir, dRadius = EgtCurveIsACircle( Proc.id)
|
||||
|
||||
Proc.dDiam = dRadius * 2
|
||||
Proc.dLen = abs( EgtCurveThickness( Proc.id)) or 0
|
||||
Proc.dDiameter = dRadius * 2
|
||||
Proc.dLength = abs( EgtCurveThickness( Proc.id)) or 0
|
||||
Proc.ptCentre = ptCentre
|
||||
Proc.vtDir = vtDir
|
||||
|
||||
@@ -28,14 +28,14 @@ function FeatureData.GetCuttingData( Proc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati foro
|
||||
-- Recupero dati svuotatura
|
||||
function FeatureData.GetPocketingData( Proc)
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati foro
|
||||
-- Recupero dati per fresatura
|
||||
function FeatureData.GetMillingData( Proc)
|
||||
|
||||
return Proc
|
||||
|
||||
@@ -122,7 +122,35 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per cercare utensile tipo PUNTA A FORARE con certe caratteristiche
|
||||
-- TODO da fare
|
||||
function MachiningLib.FindDrill()
|
||||
function MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
local ToolInfo = {}
|
||||
|
||||
if not ToolSearchParameters.dTolerance then
|
||||
ToolSearchParameters.dTolerance = 0
|
||||
end
|
||||
|
||||
local nBestToolIndex
|
||||
for i = 1, #TOOLS do
|
||||
local bIsToolCompatible = false
|
||||
|
||||
-- TODO per il momento si cercano solo le punte. Bisognerebbe valutare anche frese che possono lavorare di testa
|
||||
if TOOLS[i].sFamily == 'DRILLBIT' then
|
||||
bIsToolCompatible = true
|
||||
end
|
||||
if bIsToolCompatible then
|
||||
--TODO per il momento si prende il primo utensile con lo stesso diametro, senza considerare altri parametri tipo lunghezza ecc...
|
||||
if abs( TOOLS[i].dDiameter - ToolSearchParameters.dDiameter) < ToolSearchParameters.dTolerance + GEO.EPS_SMALL * 10 then
|
||||
if not nBestToolIndex then
|
||||
nBestToolIndex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -194,11 +222,11 @@ function MachiningLib.AddOperation( OperationToInsert)
|
||||
|
||||
-- creazione lavorazione
|
||||
local nOperationId = EgtCreateMachining( OperationToInsert.Machining.sOperationName, OperationToInsert.Machining.nType, OperationToInsert.Machining.sToolName)
|
||||
EgtSetCurrMachining( nOperationId)
|
||||
|
||||
if nOperationId then
|
||||
-- impostazione geometria
|
||||
EgtSetMachiningGeometry( OperationToInsert.Machining.Geometry)
|
||||
local bOk = true
|
||||
bOk = EgtSetMachiningGeometry( OperationToInsert.Machining.Geometry)
|
||||
|
||||
-- impostazione parametri lavorazione
|
||||
if OperationToInsert.Machining.sDepth then
|
||||
|
||||
@@ -397,7 +397,7 @@ function WinExec.ProcessFeatures( PARTS)
|
||||
for nPart = 1, #PARTS do
|
||||
-- recupero le feature di lavorazione della trave
|
||||
vProc = CollectFeatures( vProc, PARTS[nPart])
|
||||
|
||||
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature dello stesso pezzo
|
||||
vProc = GetFeatureInfoAndDependency( vProc, PARTS[nPart])
|
||||
end
|
||||
|
||||
@@ -9,12 +9,60 @@ require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
|
||||
EgtOutLog( ' Drilling started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Drilling.Make( Proc, Part)
|
||||
local ToolInfo = {}
|
||||
|
||||
local Machining = {}
|
||||
local AuxInfo = {}
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadOut = {}
|
||||
Machining.Steps = {}
|
||||
local ToolSearchParameters = {}
|
||||
|
||||
-- cerco utensile punta a forare
|
||||
ToolSearchParameters.dDiameter = Proc.dDiameter
|
||||
ToolSearchParameters.dLength = Proc.dLength
|
||||
ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_OY.DRILLING
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.sDepth = 'th'
|
||||
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
|
||||
Machining.Geometry = Proc.id
|
||||
AuxInfo.nPhase = 1 -- TODO gestire fase
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxInfo)
|
||||
else
|
||||
-- provo a cercare uan fresa che faccia una svuotatura
|
||||
ToolSearchParameters.dMaxToolDiameter = Proc.dDiameter
|
||||
ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_OY.POCKETING
|
||||
Machining.nSubType = MCH_POCK_SUB.SPIRALOUT
|
||||
Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
|
||||
Machining.Steps.dSideStep = TOOLS[ToolInfo.nToolIndex].dSideStep
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.LeadIn.dTangentDistance = TOOLS[ToolInfo.nToolIndex].dDiameter/2
|
||||
Machining.LeadIn.dElevation = TOOLS[ToolInfo.nToolIndex].dDiameter/2
|
||||
Machining.sDepth = 0
|
||||
Machining.Geometry = Proc.id
|
||||
AuxInfo.nPhase = 1 -- TODO gestire fase
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxInfo)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user