Merge branch 'NewHeadTailCut' into develop
This commit is contained in:
@@ -69,17 +69,23 @@ local function GetStrategies_Essetre( Proc)
|
||||
local Strategies = {}
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut (1-340)
|
||||
-- Feature : Cut (1-10)
|
||||
if ID.IsHeadCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'HEADCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut (2-350)
|
||||
-- Feature : Cut (2-10)
|
||||
elseif ID.IsTailCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'TAILCUT'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut (1-10)
|
||||
elseif ID.IsCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
if Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'Bevel-1-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
elseif Proc.Topology.sName == 'HeadCut' then
|
||||
Strategies = { { sStrategyId = 'HEADCUT'}}
|
||||
elseif Proc.Topology.sName == 'TailCut' then
|
||||
Strategies = { { sStrategyId = 'TAILCUT'}}
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Longitudinal Cut (0-10)
|
||||
elseif ID.IsLongitudinalCut( Proc) then
|
||||
@@ -434,21 +440,17 @@ end
|
||||
local function GetParameters_Essetre( Proc, sStrategyIdToGet)
|
||||
local Parameters = {}
|
||||
--###---###---###---###---###---###---###---###---###---###---###---###---###--
|
||||
-- Feature : HeadCut (1-340)
|
||||
-- Feature : HeadCut
|
||||
if ID.IsHeadCut( Proc) then
|
||||
-- Per Essetre non esiste il taglio di testa, quindi si leggono le variabili Q sul processing che coincide con il taglio di testa
|
||||
if sStrategyIdToGet == 'HEADCUT' then
|
||||
-- eventuali informazioni da recuperare sulla feature sostituita
|
||||
if Proc.SlaveProcIndexes then
|
||||
local idSlaveProc = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nCurrentRotation][Proc.SlaveProcIndexes[1]].id
|
||||
local dDepthChamfer = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q06', 'd') or 0
|
||||
table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'})
|
||||
local dCuttingStrategy = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q05', 'd') or 0
|
||||
local bForceChainSaw = dCuttingStrategy > 0
|
||||
table.insert( Parameters, { sName = 'bForceChainSaw', sValue = bForceChainSaw, sType = 'b'})
|
||||
local bFinishWithMill = dCuttingStrategy == 2
|
||||
table.insert( Parameters, { sName = 'bFinishWithMill', sValue = bFinishWithMill, sType = 'b'})
|
||||
end
|
||||
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q06', 'd') or 0
|
||||
table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'})
|
||||
local dCuttingStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q05', 'd') or 0
|
||||
local bForceChainSaw = dCuttingStrategy > 0
|
||||
table.insert( Parameters, { sName = 'bForceChainSaw', sValue = bForceChainSaw, sType = 'b'})
|
||||
local bFinishWithMill = dCuttingStrategy == 2
|
||||
table.insert( Parameters, { sName = 'bFinishWithMill', sValue = bFinishWithMill, sType = 'b'})
|
||||
end
|
||||
--###---###---###---###---###---###---###---###---###---###---###---###---###--
|
||||
-- Feature : Cut (1-10)
|
||||
|
||||
+19
-41
@@ -586,24 +586,6 @@ local function GetFeatureForcedStrategy( Proc)
|
||||
return nil
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AdjustPrcGrp( Proc, bPartInCombiIsInverted)
|
||||
local nNewPrc = { nPrc = Proc.nPrc, nGrp = Proc.nGrp}
|
||||
|
||||
-- se pezzo invertito
|
||||
if bPartInCombiIsInverted then
|
||||
-- il taglio di testa diventa taglio di coda
|
||||
if ID.IsHeadCut( Proc) then
|
||||
_, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsTailCut( Proc)
|
||||
-- il taglio di coda diventa taglio di testa
|
||||
elseif ID.IsTailCut( Proc) then
|
||||
_, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsHeadCut( Proc)
|
||||
end
|
||||
end
|
||||
|
||||
return nNewPrc.nPrc, nNewPrc.nGrp
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( Part, dRotIndex)
|
||||
-- recupero le feature
|
||||
@@ -632,8 +614,6 @@ local function CollectFeatures( Part, dRotIndex)
|
||||
Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id
|
||||
Proc.nGrp = nGrp
|
||||
Proc.nPrc = nPrc
|
||||
-- aggiorno info feature in caso di pezzo invertito
|
||||
Proc.nPrc, Proc.nGrp = AdjustPrcGrp( Proc, dRotIndex > 4)
|
||||
Proc.nFlg = 1
|
||||
Proc.nFct = EgtSurfTmFacetCount( ProcId) or 0
|
||||
Proc.idCut = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0
|
||||
@@ -788,25 +768,23 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
local ProcB = vProcSingleRot[j]
|
||||
-- non si controlla la feature con se stessa o se feature disabilitata
|
||||
if i ~= j and ProcB.nFlg ~= 0 then
|
||||
-- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di testa
|
||||
if ID.IsHeadCut( Proc) and ProcB.Topology.sFamily == 'Cut' and
|
||||
AreSameVectorApprox( ProcB.Faces[1].vtN, X_AX()) and abs( ProcB.Faces[1].ptCenter:getX() - Part.b3Part:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
if not Proc.SlaveProcIndexes then
|
||||
Proc.SlaveProcIndexes = {}
|
||||
end
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
-- verifico se il taglio aggiunto manualmente può essere saltato perchè nella stessa posizione c'è un altro taglio di testa
|
||||
if ID.IsHeadCut( Proc) and ( ID.IsHeadCut( ProcB) and EgtGetName( ProcB.id) == 'StartCut') then
|
||||
if not Proc.SlaveProcIndexes then
|
||||
Proc.SlaveProcIndexes = {}
|
||||
end
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
end
|
||||
-- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di coda
|
||||
if ID.IsTailCut( Proc) and ProcB.Topology.sFamily == 'Cut' and
|
||||
AreSameVectorApprox( ProcB.Faces[1].vtN, -X_AX()) and abs( ProcB.Faces[1].ptCenter:getX() - Part.b3Part:getMin():getX()) < 10 * GEO.EPS_SMALL then
|
||||
if not Proc.SlaveProcIndexes then
|
||||
Proc.SlaveProcIndexes = {}
|
||||
end
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
-- verifico se il taglio aggiunto manualmente può essere saltato perchè nella stessa posizione c'è un altro taglio di coda
|
||||
if ID.IsTailCut( Proc) and ( ID.IsTailCut( ProcB) and EgtGetName( ProcB.id) == 'EndCut') then
|
||||
if not Proc.SlaveProcIndexes then
|
||||
Proc.SlaveProcIndexes = {}
|
||||
end
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
end
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
|
||||
if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and
|
||||
@@ -947,10 +925,10 @@ local function CalculateStrategies( vProcSingleRot, Part)
|
||||
-- si leggono allora eventuali parametri di default scritti come info sulla feature
|
||||
if Proc.AvailableStrategies.bIsBasicStrategy then
|
||||
-- si recuperano eventuali parametri custom
|
||||
for i = 1, #Proc.AvailableStrategies do
|
||||
for j = 1, #Proc.AvailableStrategies do
|
||||
-- essendo una strategia basic, la lista dei parametri custom dovrebbe essere sempre vuota. Si leggono ora
|
||||
if not Proc.AvailableStrategies[i].ParameterList then
|
||||
Proc.AvailableStrategies[i].ParameterList = BCS.GetParametersFromBasicCustomerStrategies( Proc, Proc.AvailableStrategies[i].sStrategyId)
|
||||
if not Proc.AvailableStrategies[j].ParameterList then
|
||||
Proc.AvailableStrategies[j].ParameterList = BCS.GetParametersFromBasicCustomerStrategies( Proc, Proc.AvailableStrategies[j].sStrategyId)
|
||||
end
|
||||
end
|
||||
-- si riprocessano le strategie dopo che sono stati letti i parametri
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ function BeamLib.AddPartStartFace( PartId, b3Solid)
|
||||
-- applico gli opportuni attributi di feature
|
||||
EgtSetName( nStmId, 'StartCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 1)
|
||||
EgtSetInfo( nStmId, 'PRC', 340)
|
||||
EgtSetInfo( nStmId, 'PRC', 10) -- ex 340
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -60,7 +60,7 @@ function BeamLib.AddPartEndFace( PartId, b3Solid)
|
||||
-- applico gli opportuni attributi di feature
|
||||
EgtSetName( nStmId, 'EndCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 2)
|
||||
EgtSetInfo( nStmId, 'PRC', 350)
|
||||
EgtSetInfo( nStmId, 'PRC', 10) -- ex 350
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
+17
-8
@@ -53,13 +53,8 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- recupero topologia della feature
|
||||
function FeatureLib.NeedTopologyFeature( Proc, Part)
|
||||
-- feature Egalware con calcolo topologia SEMPRE da geometria
|
||||
if ID.IsHeadCut( Proc) then -- (1-340)
|
||||
return true
|
||||
elseif ID.IsTailCut( Proc) then -- (2-350)
|
||||
return true
|
||||
-- feature BTL con calcolo topologia SEMPRE da geometria
|
||||
elseif ID.IsCut( Proc) then -- (1-10)
|
||||
if ID.IsCut( Proc) then -- (1-10)
|
||||
return true
|
||||
elseif ID.IsLongitudinalCut( Proc) then -- (0-10)
|
||||
return true
|
||||
@@ -178,7 +173,16 @@ function FeatureLib.ClassifyTopology( Proc, Part)
|
||||
|
||||
local sFamily
|
||||
local bIsThrough
|
||||
if Proc.nFct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
|
||||
|
||||
-- caso speciale taglio di testa
|
||||
if Proc.nFct == 1 and AreSameVectorApprox( Proc.Faces[1].vtN, X_AX()) and abs( Proc.Faces[1].ptCenter:getX() - Part.b3Part:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
sFamily = 'HeadCut'
|
||||
bIsThrough = true
|
||||
-- caso speciale taglio di coda
|
||||
elseif Proc.nFct == 1 and AreSameVectorApprox( Proc.Faces[1].vtN, -X_AX()) and abs( Proc.Faces[1].ptCenter:getX() - Part.b3Part:getMin():getX()) < 10 * GEO.EPS_SMALL then
|
||||
sFamily = 'TailCut'
|
||||
bIsThrough = true
|
||||
elseif Proc.nFct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
elseif Proc.nFct == 1 then
|
||||
@@ -229,7 +233,12 @@ function FeatureLib.ClassifyTopology( Proc, Part)
|
||||
FeatureTopology.sFamily = sFamily
|
||||
FeatureTopology.bIsThrough = bIsThrough
|
||||
FeatureTopology.bAllRightAngles = bAllRightAngles
|
||||
FeatureTopology.sName = GetTopologyName( sFamily, Proc.nFct, bIsThrough)
|
||||
-- caso speciale taglio testa e coda
|
||||
if FeatureTopology.sFamily == 'HeadCut' or FeatureTopology.sFamily == 'TailCut' then
|
||||
FeatureTopology.sName = FeatureTopology.sFamily
|
||||
else
|
||||
FeatureTopology.sName = GetTopologyName( sFamily, Proc.nFct, bIsThrough)
|
||||
end
|
||||
FeatureTopology.AdjacencyMatrix = vAdj
|
||||
-- feature che necessita di essere catalogata, ma non si capisce come
|
||||
else
|
||||
|
||||
@@ -6,22 +6,16 @@
|
||||
local Identity = {}
|
||||
|
||||
---------------------------------------------------------------------
|
||||
------------------------ EGALWARE FEATURES ------------------------
|
||||
------------------------ SPECIAL TOPOLOGY -------------------------
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Head Cut
|
||||
function Identity.IsHeadCut( Proc)
|
||||
local bIdentity = ( Proc.nGrp == 1 and Proc.nPrc == 340)
|
||||
local idPrc = 340
|
||||
local idGrp = 1
|
||||
return bIdentity, idPrc, idGrp
|
||||
return Identity.IsCut( Proc) and Proc.Topology.sName == 'HeadCut'
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Tail Cut
|
||||
function Identity.IsTailCut( Proc)
|
||||
local bIdentity = ( Proc.nGrp == 2 and Proc.nPrc == 350)
|
||||
local idPrc = 350
|
||||
local idGrp = 2
|
||||
return bIdentity, idPrc, idGrp
|
||||
return Identity.IsCut( Proc) and Proc.Topology.sName == 'TailCut'
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,17 @@
|
||||
"nPrc": 10,
|
||||
"nGrp": 1,
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
{ "sName": "Cut-1-Through",
|
||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||
},
|
||||
{ "sName": "Bevel-1-Through",
|
||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||
},
|
||||
{ "sName": "HeadCut",
|
||||
"StrategyList" : [ { "sStrategyId": "HEADCUT" } ]
|
||||
},
|
||||
{ "sName": "TailCut",
|
||||
"StrategyList" : [ { "sStrategyId": "TAILCUT" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -696,26 +705,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"sName":"HeadCut",
|
||||
"nPrc": 340,
|
||||
"nGrp": 1,
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
"StrategyList" : [ { "sStrategyId": "HEADCUT" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"sName":"TailCut",
|
||||
"nPrc": 350,
|
||||
"nGrp": 1,
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
"StrategyList" : [ { "sStrategyId": "TAILCUT" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"sName":"Variant",
|
||||
"nPrc": 900,
|
||||
|
||||
@@ -149,10 +149,6 @@ STR0015 = Profilo arcuato (Head Cambered Profile)
|
||||
251,0,Feature,
|
||||
; Feature : Aperture
|
||||
252,0,Feature,
|
||||
; Feature : HEADCUT
|
||||
340,0,Feature,HEADCUT
|
||||
; Feature : TAILCUT
|
||||
350,0,Feature,TAILCUT
|
||||
; Feature : Variant
|
||||
900,0,Feature,
|
||||
; Feature Decor
|
||||
|
||||
Reference in New Issue
Block a user