Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/databeamnew into develop
This commit is contained in:
@@ -13,20 +13,39 @@ local BeamData = require( 'BeamData')
|
||||
local ID = require( 'Identity')
|
||||
|
||||
|
||||
|
||||
-- TODO tabella da compleatare man mano che si inseriscono le varie strategie
|
||||
-- ESEMPIO SCRITTURA TABELLA CON STRATEGIE DISPONIBILI
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
-- if ID.TipoFeature( Proc) then
|
||||
-- if Proc.Topology.sName == 'QQQQQQQQQ' then
|
||||
-- Strategies = {
|
||||
-- { sStrategyId = 'STR9999',
|
||||
-- Parameters = {
|
||||
-- { sName = 'Val_1', sValue = '15', sType = 'd'},
|
||||
-- { sName = 'Val_2', sValue = 'false', sType = 'b'}
|
||||
-- }
|
||||
-- }
|
||||
-- { sStrategyId = 'STR9998'}
|
||||
-- }
|
||||
-- end
|
||||
-- end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- *** EGALWARE ***
|
||||
----------------------------------------------------------------------------------
|
||||
local function GetStrategies_Egalware( Proc)
|
||||
local Strategies = {}
|
||||
|
||||
-- TODO tabella da compleatare man mano che si inseriscono le varie strategie
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
if ID.IsHeadCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'HEADCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
elseif ID.IsSplitCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'SPLITCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
elseif ID.IsCut( Proc) then
|
||||
@@ -277,24 +296,14 @@ end
|
||||
local function GetStrategies_Essetre( Proc)
|
||||
local Strategies = {}
|
||||
|
||||
-- TODO tabella da compleatare man mano che si inseriscono le varie strategie
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
if ID.IsHeadCut( Proc) then -- TODO TOGLIERE STRATEGIA. Inserita solo per mostrare come devono essere scritti i dati
|
||||
if Proc.Topology.sName == 'QQQQQQQQQ' then
|
||||
Strategies = {
|
||||
{ sStrategyId = 'STR9999',
|
||||
Parameters = {
|
||||
{ sName = 'Step', sValue = '15', sType = 'd'},
|
||||
{ sName = 'AntiSplint', sValue = 'false', sType = 'b'}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
if ID.IsHeadCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'HEADCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
elseif ID.IsSplitCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'SPLITCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut
|
||||
elseif ID.IsCut( Proc) then
|
||||
|
||||
+21
-6
@@ -120,7 +120,6 @@ function BeamExec.GetToolsFromDB()
|
||||
Tool.Feeds.dStartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED)
|
||||
Tool.Feeds.dEndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED)
|
||||
Tool.Feeds.dTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
-- TODO serve funzione in BeamData che data la posizione dell'utensile e della testa, capisca il montaggio (testa sopra - testa sotto - aggregato - ecc...)
|
||||
Tool.sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
Tool.SetupInfo = {}
|
||||
Tool.SetupInfo = BeamData.GetSetupInfo( Tool.sHead)
|
||||
@@ -132,6 +131,7 @@ function BeamExec.GetToolsFromDB()
|
||||
Tool.ToolHolder.dLength = EgtTdbGetCurrToolThLength() or TH_LENGTH_HSK63 -- lunghezza standard HSK63
|
||||
-- parametri scritti nelle note
|
||||
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE')
|
||||
Tool.bIsProfiledTool = not EgtTdbIsCurrToolStandardDraw()
|
||||
|
||||
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
|
||||
if sToolFamily ~= 'DRILLBIT' then
|
||||
@@ -152,7 +152,7 @@ function BeamExec.GetToolsFromDB()
|
||||
Tool.bIsPen = abs( Tool.dSpeed) < 5
|
||||
-- recupero parametri propri delle lame
|
||||
elseif sToolFamily == 'SAWBLADE' then
|
||||
Tool.bIsUsedForLongCut = EgtGetValInNotes( Tool.sUserNotes, 'LONGCUT') == 1 or false -- false coem valore di default
|
||||
Tool.bIsUsedForLongCut = EgtGetValInNotes( Tool.sUserNotes, 'LONGCUT') == 1 or false -- false come valore di default
|
||||
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or Tool.dThickness -- se non settato nell'utensile, considero lo spessore lama
|
||||
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or Tool.dMaxMaterial -- se non settato nell'utensile, considero un quarto del diametro
|
||||
-- recupero parametri propri delle motoseghe
|
||||
@@ -344,7 +344,11 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS)
|
||||
PARTS[i].dDistanceToNextPiece = dDelta
|
||||
PARTS[i].dRestLength = dLen
|
||||
PARTS[i].b3Raw = EgtGetRawPartBBox( PARTS[i].idRaw)
|
||||
PARTS[i].dLength = PARTS[i].b3Raw:getDimX()
|
||||
PARTS[i].dWidth = PARTS[i].b3Raw:getDimY()
|
||||
PARTS[i].dHeight = PARTS[i].b3Raw:getDimZ()
|
||||
PARTS[i].b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
PARTS[i].nIndexInParts = i
|
||||
else
|
||||
local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for raw part L(' .. EgtNumToString( dLen - 0.1, 1) .. ')'
|
||||
return false, sOut
|
||||
@@ -482,6 +486,8 @@ local function CollectFeatures( Part)
|
||||
if nGrp and nPrc and nDo == 1 then
|
||||
local Proc = {}
|
||||
Proc.idPart = Part.id
|
||||
Proc.idRaw = Part.idRaw
|
||||
Proc.nIndexPartInParts = Part.nIndexInParts
|
||||
Proc.id = ProcId
|
||||
-- id della feature btl ( se non presente info, si prende id dell'entità geometrica)
|
||||
Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id
|
||||
@@ -882,7 +888,6 @@ function BeamExec.ProcessFeatures( PARTS)
|
||||
local vProcRot = {}
|
||||
-- lista contenente le feature da eseguire
|
||||
local vProc = {}
|
||||
|
||||
|
||||
-- TODO da rimuovere o lasciare solo per debug
|
||||
if EgtGetDebugLevel() >= 3 then
|
||||
@@ -939,11 +944,11 @@ end
|
||||
if nOrd == 1 then
|
||||
EgtSetCurrPhase( 1)
|
||||
else
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart], BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart].idRaw, BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
end
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'TYPE', EgtIf( PARTS[nPart].id, 'START', 'REST'))
|
||||
EgtSetInfo( nDispId, 'TYPE', 'START')
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
EgtOutLog( ' *** Phase=' .. tostring( nPhase) .. ' Raw=' .. tostring( PARTS[nPart].idRaw) .. ' Part=' .. tostring( PARTS[nPart].id) .. ' ***', 1)
|
||||
|
||||
@@ -981,10 +986,20 @@ end
|
||||
|
||||
|
||||
EgtOutLog( ' *** End AddMachinings ***', 1)
|
||||
-- passo al grezzo successivo
|
||||
-- indice pezzo successivo
|
||||
nOrd = nOrd + 1
|
||||
end
|
||||
|
||||
-- ===== finiti i pezzi, si scarica il restante =====
|
||||
local idRestPart = EgtGetNextRawPart( PARTS[#PARTS].idRaw)
|
||||
if idRestPart and EgtGetRawPartBBox( idRestPart):getDimX() >= BeamData.dMinRaw then
|
||||
BeamLib.AddPhaseWithRawParts( idRestPart, BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'REST')
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
end
|
||||
|
||||
-- Aggiornamento finale di tutto
|
||||
EgtSetCurrPhase( 1)
|
||||
local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings()
|
||||
|
||||
+1
-2
@@ -91,9 +91,8 @@ function BeamLib.AddPartEndFace( PartId, b3Solid)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.AddPhaseWithRawParts( Part, OriXR, PosXR, dDeltaSucc)
|
||||
function BeamLib.AddPhaseWithRawParts( nRawId, OriXR, PosXR, dDeltaSucc)
|
||||
EgtAddPhase()
|
||||
local nRawId = Part.idRaw
|
||||
local dRawMove = 0
|
||||
while nRawId do
|
||||
EgtKeepRawPart( nRawId)
|
||||
|
||||
@@ -20,6 +20,10 @@ function FeatureData.NeedTopologyFeature( Proc)
|
||||
-- features tipo taglio
|
||||
if ID.IsCut( Proc) then
|
||||
return true
|
||||
elseif ID.IsHeadCut( Proc) then
|
||||
return true
|
||||
elseif ID.IsSplitCut( Proc) then
|
||||
return true
|
||||
elseif ID.IsDoubleCut( Proc) then
|
||||
return true
|
||||
elseif ID.IsSawCut( Proc) then
|
||||
|
||||
+60
-23
@@ -10,6 +10,7 @@ require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local BeamData = require( 'BeamData')
|
||||
local BeamLib = require( 'BeamLib')
|
||||
|
||||
EgtOutLog( ' MachiningLib started', 1)
|
||||
|
||||
@@ -83,7 +84,14 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
for i = 1, #TOOLS do
|
||||
-- prima verifico che utensile sia compatibile
|
||||
local bIsToolCompatible = true
|
||||
if TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
|
||||
-- se viene passato il nome, tutti gli altri sono incompatibili
|
||||
if ToolSearchParameters.sName and ToolSearchParameters.sName ~= TOOLS[i].sName then
|
||||
bIsToolCompatible = false
|
||||
-- si cercano solo frese standard. Se utensile disegnato manualmente, si setta subito che è incompatibile
|
||||
elseif TOOLS[i].bIsProfiledTool then
|
||||
bIsToolCompatible = false
|
||||
-- controlli standard
|
||||
elseif TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
|
||||
bIsToolCompatible = false
|
||||
elseif TOOLS[i].SetupInfo.bIsTopHead and ToolSearchParameters.vtToolDirection:getZ() < TOOLS[i].SetupInfo.dMaxNegativeAngle then
|
||||
bIsToolCompatible = false
|
||||
@@ -199,8 +207,14 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
end
|
||||
|
||||
if bIsToolCompatible then
|
||||
nBestToolIndex = i
|
||||
break
|
||||
if not nBestToolIndex then
|
||||
nBestToolIndex = i
|
||||
else
|
||||
-- prediligo utensile per tagli lunghi, se richiesto
|
||||
if ToolSearchParameters.bForceLongcutBlade and not TOOLS[nBestToolIndex].bIsUsedForLongCut and TOOLS[i].bIsUsedForLongCut then
|
||||
nBestToolIndex = i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -300,27 +314,27 @@ function MachiningLib.AddNewMachining( ProcToAdd, MachiningToAdd, AuxiliaryDataT
|
||||
return false
|
||||
end
|
||||
|
||||
-- Drilling
|
||||
if MachiningToAdd.nType == MCH_MY.DRILLING then
|
||||
MachiningToAdd.sTypeName = 'Drill_'
|
||||
-- Milling
|
||||
elseif MachiningToAdd.nType == MCH_MY.MILLING then
|
||||
-- se utensile lama
|
||||
if TOOLS[MachiningToAdd.nToolIndex].sFamily == 'SAWBLADE' then
|
||||
MachiningToAdd.sTypeName = 'Cut_'
|
||||
else
|
||||
MachiningToAdd.sTypeName = 'Mill_'
|
||||
end
|
||||
-- Pocketing
|
||||
elseif MachiningToAdd.nType == MCH_MY.POCKETING then
|
||||
MachiningToAdd.sTypeName = 'Pocket_'
|
||||
-- Mortising
|
||||
elseif MachiningToAdd.nType == MCH_MY.MORTISING then
|
||||
MachiningToAdd.sTypeName = 'ChSaw_'
|
||||
end
|
||||
-- se nome non definito, assegno alla lavorazioen un nome standard
|
||||
if not MachiningToAdd.sOperationName then
|
||||
MachiningToAdd.sOperationName = MachiningToAdd.sTypeName .. ( EgtGetName( ProcToAdd.id) or tostring( ProcToAdd.id)) .. '_' .. tostring( MachiningToAdd.Geometry[1][2])
|
||||
-- Drilling
|
||||
if MachiningToAdd.nType == MCH_MY.DRILLING then
|
||||
MachiningToAdd.sTypeName = 'Drill_'
|
||||
-- Milling
|
||||
elseif MachiningToAdd.nType == MCH_MY.MILLING then
|
||||
-- se utensile lama
|
||||
if TOOLS[MachiningToAdd.nToolIndex].sFamily == 'SAWBLADE' then
|
||||
MachiningToAdd.sTypeName = 'Cut_'
|
||||
else
|
||||
MachiningToAdd.sTypeName = 'Mill_'
|
||||
end
|
||||
-- Pocketing
|
||||
elseif MachiningToAdd.nType == MCH_MY.POCKETING then
|
||||
MachiningToAdd.sTypeName = 'Pocket_'
|
||||
-- Mortising
|
||||
elseif MachiningToAdd.nType == MCH_MY.MORTISING then
|
||||
MachiningToAdd.sTypeName = 'ChSaw_'
|
||||
end
|
||||
MachiningToAdd.sOperationName = MachiningToAdd.sTypeName .. ( EgtGetName( ProcToAdd.id) or tostring( ProcToAdd.id)) -- .. '_' .. tostring( MachiningToAdd.Geometry)
|
||||
end
|
||||
if not MachiningToAdd.sToolName then
|
||||
MachiningToAdd.sToolName = TOOLS[MachiningToAdd.nToolIndex].sName
|
||||
@@ -394,7 +408,13 @@ function MachiningLib.AddOperations( vProc, Part)
|
||||
|
||||
-- parametri da scrivere nelle note utente
|
||||
local UserNotes = {
|
||||
{ sName = 'dMaxElev', sMchParam = 'MaxElev'}
|
||||
{ sName = 'dMaxElev', sMchParam = 'MaxElev'},
|
||||
{ sName = 'dOpenMinSafe', sMchParam = 'OpenMinSafe'},
|
||||
{ sName = 'nVMRS', sMchParam = 'VMRS'},
|
||||
{ sName = 'dStartZmax', sMchParam = 'StartZmax'},
|
||||
{ sName = 'nOutRaw', sMchParam = 'OutRaw'},
|
||||
{ sName = 'nOpenOutRaw', sMchParam = 'OpenOutRaw'},
|
||||
{ sName = 'nPlunge', sMchParam = 'Plunge'}
|
||||
}
|
||||
|
||||
-- parametri da scrivere nelle note di sistema
|
||||
@@ -506,6 +526,23 @@ function MachiningLib.AddOperations( vProc, Part)
|
||||
nErr, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nOperationId, false)
|
||||
end
|
||||
|
||||
|
||||
-- TODO è giusto inserire queste info alla fine della lavorazione? oppure conviene creare un record in MACHININGS apposito per la disposizione?
|
||||
-- se era taglio di separazione, aggiungo nuova fase
|
||||
if MACHININGS[i].AuxiliaryData.bAddNewPhase then
|
||||
BeamLib.AddPhaseWithRawParts( MACHININGS[i].Proc.idRaw, BeamData.ptOriXR, BeamData.dPosXR, BeamData.RAW_OFFSET)
|
||||
-- se grezzo successivo senza pezzi e finale, va tolto
|
||||
local nNextRawId = EgtGetNextRawPart( MACHININGS[i].Proc.idRaw)
|
||||
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BeamData.dMinRaw then
|
||||
EgtRemoveRawPartFromCurrPhase( nNextRawId)
|
||||
end
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'END')
|
||||
EgtSetInfo( nDispId, 'ORD', MACHININGS[i].Proc.nIndexPartInParts)
|
||||
end
|
||||
|
||||
else
|
||||
return false, 'UNEXPECTED ERROR: Error on creating machining'
|
||||
end
|
||||
|
||||
+7
-1
@@ -7,7 +7,7 @@
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
EgtEnableDebug( true)
|
||||
|
||||
-- Imposto direttorio libreria specializzata per Travi
|
||||
EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||
@@ -42,6 +42,11 @@ _G.package.loaded.BasicCustomerStrategies = nil
|
||||
_G.package.loaded.FeatureData = nil
|
||||
_G.package.loaded.FaceData = nil
|
||||
_G.package.loaded.MachiningLib = nil
|
||||
-- strategie di base sempre presenti
|
||||
_G.package.loaded['SPLITCUT\\SPLITCUT'] = nil
|
||||
_G.package.loaded['SPLITCUT\\SPLITCUTConfig'] = nil
|
||||
_G.package.loaded['HEADCUT\\HEADCUT'] = nil
|
||||
_G.package.loaded['HEADCUT\\HEADCUTConfig'] = nil
|
||||
|
||||
-- TODO controllare se c'è un modo migliore per resettare librerie delle strategie caricate precedentemente
|
||||
-- Per ottimizzare potremmo anche ciclare solo fino al numero di strategie raggiunto per il momento.
|
||||
@@ -66,6 +71,7 @@ for i = 1, #vtCoreStrategiesNames do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local BeamExec = require( 'BeamExec')
|
||||
|
||||
-- Variabili globali
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
-- Strategia: FACEBYBLADE
|
||||
-- Descrizione
|
||||
-- Strategia di base per la lavorazione di una faccia con lama
|
||||
-- Feature: tutte
|
||||
|
||||
-- carico librerie
|
||||
local BeamLib = require( 'BeamLib')
|
||||
local BeamData = require( 'BeamData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FACEBYBLADE = {}
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CalculateLeadInOut( EdgeToMachine)
|
||||
|
||||
local LeadIn = {}
|
||||
local LeadOut = {}
|
||||
LeadIn.dStartAddLength = 0
|
||||
LeadOut.dEndAddLength = 0
|
||||
LeadIn.nType = MCH_MILL_LI.LINEAR
|
||||
LeadOut.nType = MCH_MILL_LI.LINEAR
|
||||
LeadIn.dTangentDistance = 0
|
||||
LeadOut.dTangentDistance = 0
|
||||
if EdgeToMachine.Elev > -10 * GEO.EPS_SMALL then
|
||||
LeadIn.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC
|
||||
LeadOut.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC
|
||||
else
|
||||
LeadIn.dPerpDistance = BeamData.CUT_SIC
|
||||
LeadOut.dPerpDistance = BeamData.CUT_SIC
|
||||
end
|
||||
LeadIn.dElevation = 0
|
||||
LeadOut.dElevation = 0
|
||||
LeadIn.dCompLength = 0
|
||||
LeadOut.dCompLength = 0
|
||||
LeadIn.dStartAddLength = BeamData.CUT_EXTRA
|
||||
LeadOut.dEndAddLength = BeamData.CUT_EXTRA
|
||||
|
||||
return LeadIn, LeadOut
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO da sistemare
|
||||
local function GetSCC( vtMachiningDirection)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
|
||||
if vtMachiningDirection:getZ() < -0.9 then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif vtMachiningDirection:getZ() > 0.9 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif vtMachiningDirection:getY() < -0.707 then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif vtMachiningDirection:getY() > 0.707 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif vtMachiningDirection:getX() < -0.707 then
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
elseif vtMachiningDirection:getX() > 0.707 then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
end
|
||||
|
||||
return nSCC
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO funziona da fare completamente
|
||||
function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalParameters)
|
||||
local Cutting = {}
|
||||
|
||||
local vtMachiningDirection = EdgeToMachine.Norm
|
||||
local vtN = Proc.Faces[FaceToMachine+1].vtN
|
||||
Cutting.sDepth = OptionalParameters.sDepth
|
||||
|
||||
Cutting.nType = MCH_MY.MILLING
|
||||
Cutting.nToolIndex = OptionalParameters.nToolIndex
|
||||
Cutting.Geometry = {{ Proc.id, FaceToMachine}}
|
||||
Cutting.id = Proc.id
|
||||
|
||||
|
||||
-- ===== calcolo LeadIn/out =====
|
||||
if OptionalParameters.LeadIn and OptionalParameters.LeadOut then
|
||||
Cutting.LeadIn, Cutting.LeadOut = OptionalParameters.LeadIn, OptionalParameters.LeadOut
|
||||
else
|
||||
Cutting.LeadIn, Cutting.LeadOut = CalculateLeadInOut( EdgeToMachine)
|
||||
end
|
||||
|
||||
-- ===== scelta soluzione braccio C del motore =====
|
||||
Cutting.nSCC = GetSCC( vtMachiningDirection)
|
||||
|
||||
-- ===== parametri da settare in UserNotes =====
|
||||
Cutting.nFaceuse = OptionalParameters.nFaceuse
|
||||
Cutting.sUserNotes = EgtSetValInNotes( Cutting.sUserNotes, 'VtFaceUse', vtMachiningDirection)
|
||||
if OptionalParameters.sUserNotes then
|
||||
Cutting.sUserNotes = Cutting.sUserNotes .. OptionalParameters.sUserNotes
|
||||
end
|
||||
|
||||
-- ===== scelta senso di lavorazione =====
|
||||
local bIsSawCCW = TOOLS[Cutting.nToolIndex].bIsCCW
|
||||
local bInvert
|
||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||
if bInvert == nil then
|
||||
bInvert = ( not bIsSawCCW)
|
||||
if bIsSawCCW then
|
||||
bInvert = (( Cutting.nFaceuse == MCH_MILL_FU.ORTHO_FRONT and vtN:getX() < 0) or ( Cutting.nFaceuse == MCH_MILL_FU.ORTHO_BACK and vtN:getX() > 0))
|
||||
else
|
||||
bInvert = (( Cutting.nFaceuse == MCH_MILL_FU.ORTHO_FRONT and vtN:getX() > 0) or ( Cutting.nFaceuse == MCH_MILL_FU.ORTHO_BACK and vtN:getX() < 0))
|
||||
end
|
||||
end
|
||||
Cutting.bInvert = bInvert
|
||||
Cutting.nWorkside = EgtIf( bInvert, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
|
||||
return Cutting
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
return FACEBYBLADE
|
||||
@@ -0,0 +1,37 @@
|
||||
-- Strategia: HEADCUT
|
||||
-- Descrizione
|
||||
-- HeadCut
|
||||
-- Feature: HeadCut
|
||||
|
||||
-- carico librerie
|
||||
local BeamLib = require( 'BeamLib')
|
||||
local BeamData = require( 'BeamData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
local FeatureData = require( 'FeatureData')
|
||||
-- strategie di base
|
||||
local SlotByBlade = require( 'SLOTBYBLADE')
|
||||
local SlotByChainSaw = require( 'SLOTBYCHAINSAW')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local HEADCUT = {}
|
||||
local Strategy = {}
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function HEADCUT.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local StrategyLib = {}
|
||||
StrategyLib.Config = require( 'HEADCUT\\HEADCUTConfig')
|
||||
Strategy.sName = StrategyLib.Config.sStrategyId
|
||||
CustomParameters = BeamLib.GetUpdateCustomParameters( CustomParameters, StrategyLib.Config.Parameters)
|
||||
Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( CustomParameters)
|
||||
Strategy.Result = {}
|
||||
Strategy.Result.sInfo = ''
|
||||
|
||||
local bAreAllMachiningsAdded = true
|
||||
|
||||
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
return HEADCUT
|
||||
@@ -0,0 +1,11 @@
|
||||
-- Parametri configurabili da cliente per strategia: HEADCUT
|
||||
|
||||
local HEADCUTData = {
|
||||
sStrategyId = 'HEADCUT',
|
||||
Parameters = {
|
||||
{ sName = 'bForceChainSaw', sValue = 'false', sDescriptionShort = 'Force to use chain saw', sDescriptionLong = 'Force to use chain saw', sType = 'b', sMessageId = '', sMinUserLevel = '1'},
|
||||
{ sName = 'bFinishWithMill', sValue = 'true', sDescriptionShort = 'Finish with mill', sDescriptionLong = 'Use a mill to finish the surface if splitted with chain saw', sType = 'b', sMessageId = '', sMinUserLevel = '1'}
|
||||
}
|
||||
}
|
||||
|
||||
return HEADCUTData
|
||||
@@ -0,0 +1,295 @@
|
||||
-- Strategia: SPLITCUT
|
||||
-- Descrizione
|
||||
-- Taglio di separazione
|
||||
-- Feature: SplitCut
|
||||
|
||||
-- carico librerie
|
||||
local BeamLib = require( 'BeamLib')
|
||||
local BeamData = require( 'BeamData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
local FeatureData = require( 'FeatureData')
|
||||
-- strategie di base
|
||||
local FaceByBlade = require('FACEBYBLADE')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local SPLITCUT = {}
|
||||
local Strategy = {}
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function LoadStrategyParameters( CustomParameters)
|
||||
local StrategyLib = {}
|
||||
StrategyLib.Config = require( 'SPLITCUT\\SPLITCUTConfig')
|
||||
Strategy.sName = StrategyLib.Config.sStrategyId
|
||||
CustomParameters = BeamLib.GetUpdateCustomParameters( CustomParameters, StrategyLib.Config.Parameters)
|
||||
Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( CustomParameters)
|
||||
Strategy.Result = {}
|
||||
Strategy.Machining = {}
|
||||
Strategy.Result.sInfo = ''
|
||||
return Strategy
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CalculateLeadInOut( Machining, EdgeToMachine)
|
||||
|
||||
local LeadIn = {}
|
||||
local LeadOut = {}
|
||||
LeadIn.dStartAddLength = 0
|
||||
LeadOut.dEndAddLength = 0
|
||||
LeadIn.nType = MCH_MILL_LI.LINEAR
|
||||
LeadOut.nType = MCH_MILL_LI.LINEAR
|
||||
LeadIn.dTangentDistance = 0
|
||||
LeadOut.dTangentDistance = 0
|
||||
if EdgeToMachine.Elev > -10 * GEO.EPS_SMALL then
|
||||
LeadIn.dPerpDistance = EdgeToMachine.Elev + BeamData.CUT_SIC
|
||||
LeadOut.dPerpDistance = EdgeToMachine.Elev + BeamData.CUT_SIC
|
||||
else
|
||||
LeadIn.dPerpDistance = BeamData.CUT_SIC
|
||||
LeadOut.dPerpDistance = BeamData.CUT_SIC
|
||||
end
|
||||
LeadIn.dElevation = 0
|
||||
LeadOut.dElevation = 0
|
||||
LeadIn.dCompLength = 0
|
||||
LeadOut.dCompLength = 0
|
||||
LeadIn.dStartAddLength = BeamData.CUT_EXTRA
|
||||
LeadOut.dEndAddLength = BeamData.CUT_EXTRA
|
||||
|
||||
return LeadIn, LeadOut
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MakeChamfer()
|
||||
-- TODO funzionalità da aggiungere
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetEdgeToMachine( Proc, vtEdge)
|
||||
local Edge
|
||||
for i = 1, #Proc.Faces[1].Edges do
|
||||
if AreSameVectorApprox( Proc.Faces[1].Edges[i].Norm, vtEdge) then
|
||||
Edge = Proc.Faces[1].Edges[i]
|
||||
end
|
||||
end
|
||||
return Edge
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetSplitStrategy( Proc, Part)
|
||||
-- se non sono stati caricati i parametri, si ricaricano
|
||||
if not Strategy.Parameters then
|
||||
Strategy = LoadStrategyParameters()
|
||||
end
|
||||
|
||||
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile
|
||||
local nNextRawId = EgtGetNextRawPart( Part.idRaw)
|
||||
Strategy.bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BeamData.dMinRaw))
|
||||
|
||||
-- imposto paraemtri di ricerca utensile in base a topologia
|
||||
local Machining = {}
|
||||
-- sTypeMachining = BladeSideSingle\ BladeSideDouble\ BladeHorizontalSingle\ BladeHorizontalDouble\ ChainSawHorizontal\ ChainSawSideSingle\ ChainSawSideDouble\ ChainSawPlusBlade\ Mill\ None
|
||||
Machining.sTypeMachining = 'None'
|
||||
local Splitting = {}
|
||||
local ToolSearchParameters = {}
|
||||
ToolSearchParameters.vtToolDirection = Proc.Faces[1].vtN
|
||||
|
||||
|
||||
-- ===== RICERCA UTENSILE =====
|
||||
-- cerco lama sopra
|
||||
Splitting.bIsApplicable = false
|
||||
ToolSearchParameters.bAllowTopHead = true
|
||||
ToolSearchParameters.bAllowBottomHead = false
|
||||
Splitting.ToolInfo = {}
|
||||
Splitting.ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
if Splitting.ToolInfo.nToolIndex then
|
||||
Splitting.bIsApplicable = true
|
||||
local ParametersMRR = {}
|
||||
ParametersMRR.nToolIndex = Splitting.ToolInfo.nToolIndex
|
||||
Splitting.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
||||
end
|
||||
table.insert( Machining, Splitting)
|
||||
|
||||
-- cerco lama sotto
|
||||
Splitting = {}
|
||||
Splitting.bIsApplicable = false
|
||||
ToolSearchParameters.bAllowTopHead = false
|
||||
ToolSearchParameters.bAllowBottomHead = true
|
||||
Splitting.ToolInfo = {}
|
||||
Splitting.ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
if Splitting.ToolInfo.nToolIndex then
|
||||
Splitting.bIsApplicable = true
|
||||
local ParametersMRR = {}
|
||||
ParametersMRR.nToolIndex = Splitting.ToolInfo.nToolIndex
|
||||
Splitting.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
||||
end
|
||||
table.insert( Machining, Splitting)
|
||||
|
||||
-- cerco motosega
|
||||
Splitting = {}
|
||||
Splitting.bIsApplicable = false
|
||||
table.insert( Machining, Splitting)
|
||||
|
||||
-- cerco fresa
|
||||
Splitting = {}
|
||||
Splitting.bIsApplicable = false
|
||||
table.insert( Machining, Splitting)
|
||||
|
||||
-- ===== SCELTA LAVORAZIONI =====
|
||||
-- forzature da parametri
|
||||
if Strategy.Parameters.bForceChainSaw then
|
||||
Machining[1].bIsApplicable = false
|
||||
Machining[2].bIsApplicable = false
|
||||
end
|
||||
|
||||
-- setto valori di default. Impossibile che taglio di separazione sia incompleto
|
||||
Strategy.Result.sStatus = 'Completed'
|
||||
Strategy.Result.nCompletionIndex = FeatureData.GetFeatureCompletionIndex( 100)
|
||||
Strategy.Result.dMRR = 1
|
||||
|
||||
-- correzioni sul massimo materiale lama, considerando ingombri vari
|
||||
local dMaxMatBladeSideSingle
|
||||
local dMaxMatBladeSideDouble
|
||||
local dMaxMatBladeHorizontalSingle
|
||||
local dMaxMatBladeHorizontalDouble
|
||||
if Machining[1].bIsApplicable then
|
||||
local dMaxMat = TOOLS[Machining[1].ToolInfo.nToolIndex].dMaxMaterial
|
||||
local dRadius = TOOLS[Machining[1].ToolInfo.nToolIndex].dDiameter / 2
|
||||
local sHead = TOOLS[Machining[1].ToolInfo.nToolIndex].sHead
|
||||
-- se taglio di fianco disponibile, si controlla il massimo materiale reale. Per pezzi alti, bisogna controllare anche l'ingombro asse Z nelle 4 direzioni.
|
||||
if Part.dHeight < BeamData.MIN_DIM_HBEAM then
|
||||
dMaxMat = min( dMaxMat, BeamData.MAX_DIM_HTCUT)
|
||||
dMaxMatBladeSideSingle = dMaxMat
|
||||
dMaxMatBladeSideDouble = dMaxMat * 2
|
||||
else
|
||||
if BeamData.GetMaxMatReductionBladeCut then
|
||||
dMaxMatBladeSideSingle = min( max( dRadius - BeamData.GetMaxMatReductionBladeCut( sHead, Y_AX()), dRadius - BeamData.GetMaxMatReductionBladeCut( sHead, -Y_AX())),
|
||||
TOOLS[Machining[1].ToolInfo.nToolIndex].dMaxMaterial)
|
||||
dMaxMatBladeSideDouble = dRadius - BeamData.GetMaxMatReductionBladeCut( sHead, Y_AX()) + dRadius - BeamData.GetMaxMatReductionBladeCut( sHead, -Y_AX())
|
||||
else
|
||||
dMaxMatBladeSideSingle = abs( BeamData.MAX_DIM_HTCUT_HBEAM)
|
||||
dMaxMatBladeSideDouble = abs( BeamData.MAX_DIM_HTCUT_HBEAM) * 2
|
||||
end
|
||||
end
|
||||
-- se taglio orizzontale
|
||||
if BeamData.GetMaxMatReductionBladeCut then
|
||||
dMaxMatBladeHorizontalSingle = min( TOOLS[Machining[1].ToolInfo.nToolIndex].dMaxMaterial, dRadius - BeamData.GetMaxMatReductionBladeCut( TOOLS[Machining[1].ToolInfo.nToolIndex].sHead, -Z_AX()))
|
||||
else
|
||||
dMaxMatBladeHorizontalSingle = TOOLS[Machining[1].ToolInfo.nToolIndex].dMaxMaterial
|
||||
end
|
||||
end
|
||||
if Machining[2].bIsApplicable then
|
||||
local dRadius = TOOLS[Machining[2].ToolInfo.nToolIndex].dDiameter / 2
|
||||
dMaxMatBladeHorizontalDouble = min( TOOLS[Machining[2].ToolInfo.nToolIndex].dMaxMaterial, dRadius - BeamData.GetMaxMatReductionBladeCut( TOOLS[Machining[2].ToolInfo.nToolIndex].sHead, Z_AX()))
|
||||
end
|
||||
|
||||
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
|
||||
-- BladeSideSingle (taglio di lama singolo di fianco)
|
||||
if Machining[1].bIsApplicable and ( dMaxMatBladeSideSingle - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
|
||||
Machining.sTypeMachining = 'BladeSideSingle'
|
||||
Machining[2].bIsApplicable = false
|
||||
Machining[3].bIsApplicable = false
|
||||
Machining[4].bIsApplicable = false
|
||||
return Machining
|
||||
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
|
||||
-- BladeSideDouble (taglio di lama doppio di fianco)
|
||||
elseif Machining[1].bIsApplicable and ( dMaxMatBladeSideDouble - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
|
||||
Machining.sTypeMachining = 'BladeSideDouble'
|
||||
Machining[2].bIsApplicable = false
|
||||
Machining[3].bIsApplicable = false
|
||||
Machining[4].bIsApplicable = false
|
||||
return Machining
|
||||
-- BladeHorizontalSingle (taglio di lama singolo orizzontale)
|
||||
elseif Machining[1].bIsApplicable and ( dMaxMatBladeHorizontalSingle - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
|
||||
Machining.sTypeMachining = 'BladeHorizontalSingle'
|
||||
Machining[2].bIsApplicable = false
|
||||
Machining[3].bIsApplicable = false
|
||||
Machining[4].bIsApplicable = false
|
||||
return Machining
|
||||
-- BladeHorizontalDouble (taglio di lama doppio orizzontale)
|
||||
elseif Machining[1].bIsApplicable and Machining[2].bIsApplicable and
|
||||
( dMaxMatBladeHorizontalSingle + dMaxMatBladeHorizontalDouble - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
|
||||
Machining.sTypeMachining = 'BladeHorizontalDouble'
|
||||
Machining[3].bIsApplicable = false
|
||||
Machining[4].bIsApplicable = false
|
||||
return Machining
|
||||
|
||||
-- TODO : casi con motosega da completare
|
||||
-- ChainSawHorizontal (motosega)
|
||||
-- ChainSawSideSingle (motosega)
|
||||
-- ChainSawSideDouble (motosega)
|
||||
-- ChainSawPlusBlade (motosega più lama orizzontale)
|
||||
-- Mill (svuotatura)
|
||||
end
|
||||
|
||||
-- se non ho trovato neanche una lavorazione completa, non posso separare
|
||||
if Machining.sTypeMachining == 'None' then
|
||||
Strategy.Result.sStatus = 'Not-Applicable'
|
||||
Strategy.Result.nCompletionIndex = 0
|
||||
Strategy.Result.dMRR = 0
|
||||
Strategy.Result.nQuality = 0
|
||||
Strategy.Result.sInfo = 'Split not possible'
|
||||
end
|
||||
|
||||
return Machining
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function SPLITCUT.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy = LoadStrategyParameters( CustomParameters)
|
||||
local bAreAllMachiningsAdded = true
|
||||
local Splitting = {}
|
||||
local AuxiliaryData = {}
|
||||
|
||||
Strategy.sSplitStrategy = GetSplitStrategy( Proc, Part)
|
||||
if bAddMachining then
|
||||
-- inserimento smussi su spigoli del taglio
|
||||
if Strategy.Parameters.bMakeChamfer then
|
||||
MakeChamfer()
|
||||
end
|
||||
|
||||
local OptionalParameters = {}
|
||||
-- applico le lavorazioni
|
||||
if Strategy.sSplitStrategy.sTypeMachining == 'BladeSideSingle' then
|
||||
OptionalParameters.nToolIndex = Strategy.sSplitStrategy[1].ToolInfo.nToolIndex
|
||||
OptionalParameters.nFaceuse = MCH_MILL_FU.ORTHO_BACK
|
||||
OptionalParameters.sDepth = 0
|
||||
|
||||
-- TODO gestire lavorazione a cubetti
|
||||
|
||||
if Strategy.bSplit then
|
||||
OptionalParameters.sUserNotes = 'Split;'
|
||||
else
|
||||
OptionalParameters.sUserNotes = 'Cut;'
|
||||
end
|
||||
AuxiliaryData.bAddNewPhase = true
|
||||
|
||||
local EdgeToMachine = GetEdgeToMachine( Proc, -Y_AX())
|
||||
-- approccio e retrazione
|
||||
OptionalParameters.LeadIn, OptionalParameters.LeadOut = CalculateLeadInOut( Splitting, EdgeToMachine)
|
||||
Splitting = FaceByBlade.Make( Proc, Part, Proc.Faces[1].id, EdgeToMachine, OptionalParameters)
|
||||
MachiningLib.AddNewMachining( Proc, Splitting, AuxiliaryData)
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'BladeSideDouble' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'BladeHorizontalSingle' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'BladeHorizontalDouble' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'ChainSawHorizontal' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'ChainSawSideSingle' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'ChainSawSideDouble' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'ChainSawPlusBlade' then
|
||||
; -- TODO
|
||||
elseif Strategy.sSplitStrategy.sTypeMachining == 'Mill' then
|
||||
; -- TODO
|
||||
end
|
||||
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
else
|
||||
return nil, Strategy.Result
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
return SPLITCUT
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Parametri configurabili da cliente per strategia: SPLITCUT
|
||||
|
||||
local SPLITCUTData = {
|
||||
sStrategyId = 'SPLITCUT',
|
||||
Parameters = {
|
||||
{ sName = 'bMakeChamfer', sValue = 'false', sDescriptionShort = 'Execute Chamfer', sDescriptionLong = 'Use the V-Mill to execute chamfers on cut-edges', sType = 'b', sMessageId = '', sMinUserLevel = '1'},
|
||||
{ sName = 'bForceChainSaw', sValue = 'false', sDescriptionShort = 'Force to use chain saw', sDescriptionLong = 'Force to use chain saw', sType = 'b', sMessageId = '', sMinUserLevel = '1'},
|
||||
{ sName = 'bFinishWithMill', sValue = 'true', sDescriptionShort = 'Finish with mill', sDescriptionLong = 'Use a mill to finish the surface if splitted with chain saw', sType = 'b', sMessageId = '', sMinUserLevel = '1'}
|
||||
}
|
||||
}
|
||||
|
||||
return SPLITCUTData
|
||||
@@ -82,7 +82,7 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetBestPocketingStrategy( Proc)
|
||||
-- imposto paraemtri di ricerca utensile in base a topologia
|
||||
-- imposto parametri di ricerca utensile in base a topologia
|
||||
local Machining = {}
|
||||
local Milling = {}
|
||||
local ToolSearchParameters = {}
|
||||
@@ -509,7 +509,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
return false, Strategy.Result
|
||||
end
|
||||
|
||||
local bAreAllApplyOk = true
|
||||
local bAreAllMachiningsAdded = true
|
||||
local ToolInfo = {}
|
||||
local Pocketing = {}
|
||||
|
||||
@@ -541,7 +541,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- se ho una sola trimesh, sto lavorando la Proc direttamente e non ho spezzato. Applico direttamente alla geometria calcolata prima
|
||||
if #vAddId == 1 then
|
||||
Pocketing.Geometry = {{ Strategy.Machining[j].idProc, Strategy.Machining[j].idFaceToMachine}}
|
||||
bAreAllApplyOk = MachiningLib.AddNewMachining( Proc, Pocketing)
|
||||
bAreAllMachiningsAdded = MachiningLib.AddNewMachining( Proc, Pocketing)
|
||||
else
|
||||
-- TODO settare parametro per indicare qual è lo spezzone che deve essere fatto dopo il taglio di separazione
|
||||
for k = 1, Proc.nFct do
|
||||
@@ -550,7 +550,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
_, vtNSplitFace = EgtSurfTmFacetCenter( dIdTm, k - 1, GDB_ID.ROOT)
|
||||
if vtNSplitFace and AreSameVectorApprox( vtNSplitFace * EgtIf( Pocketing.bToolInvert, -1, 1), Strategy.Machining[j].vtFaceNormal) then
|
||||
Pocketing.Geometry = {{ dIdTm, k - 1}}
|
||||
bAreAllApplyOk = bAreAllApplyOk and MachiningLib.AddNewMachining( Proc, Pocketing)
|
||||
bAreAllMachiningsAdded = bAreAllMachiningsAdded and MachiningLib.AddNewMachining( Proc, Pocketing)
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -559,10 +559,10 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
end
|
||||
else
|
||||
bAreAllApplyOk = false
|
||||
bAreAllMachiningsAdded = false
|
||||
end
|
||||
|
||||
return bAreAllApplyOk, Strategy.Result
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -137,6 +137,10 @@ STR0003 = Topologia tipo LapJoint. Lama + motosega
|
||||
251,0,Feature,
|
||||
; Feature : Aperture
|
||||
252,0,Feature,
|
||||
; Feature : HEADCUT
|
||||
340,0,Feature,HEADCUT
|
||||
; Feature : SPLITCUT
|
||||
350,0,Feature,SPLITCUT
|
||||
; Feature : Variant
|
||||
900,0,Feature,
|
||||
; Feature Decor
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6d1'
|
||||
MIN_EXE = '2.6a1'
|
||||
MIN_EXE = '2.6g1'
|
||||
|
||||
Reference in New Issue
Block a user