Modifica nomi variabili secondo nuovo standard
This commit is contained in:
+32
-32
@@ -48,11 +48,11 @@ function FeatureData.NeedTopologyFeature( Proc)
|
||||
return true
|
||||
-- calcolo topologia SOLO se non raggiata
|
||||
-- TODO oppure riconoscerla come feature speciale; valutare se controllare il numero di facce è un metodo efficace
|
||||
elseif ID.IsMortise( Proc) and Proc.Fct < 6 then
|
||||
elseif ID.IsMortise( Proc) and Proc.nFct < 6 then
|
||||
return true
|
||||
-- calcolo topologia SOLO se non raggiata
|
||||
-- TODO oppure riconoscerla come feature speciale; valutare se controllare il numero di facce è un metodo efficace
|
||||
elseif ID.IsFrontMortise( Proc) and Proc.Fct < 6 then
|
||||
elseif ID.IsFrontMortise( Proc) and Proc.nFct < 6 then
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -96,12 +96,12 @@ end
|
||||
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
|
||||
local function IsAnyDimensionLongAsPart( Proc)
|
||||
local bResult = false
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.idPart or GDB_ID.NULL, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||
if Proc.b3Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.b3Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.b3Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||
bResult = true
|
||||
end
|
||||
|
||||
@@ -111,14 +111,14 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
local function IsFeatureCuttingEntireSection( b3Proc, Part)
|
||||
return ( b3Proc:getDimY() > ( Part.RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.RawBox:getDimZ() - 500 * GEO.EPS_SMALL))
|
||||
return ( b3Proc:getDimY() > ( Part.b3RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3RawBox:getDimZ() - 500 * GEO.EPS_SMALL))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera lunghezza della barra, rappresentata dalle sue dimensioni W e L oppure H e L
|
||||
local function IsFeatureCuttingEntireLength( b3Proc, Part)
|
||||
return ( ( b3Proc:getDimY() > ( Part.RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.RawBox:getDimX() - 500 * GEO.EPS_SMALL)) or
|
||||
( b3Proc:getDimZ() > ( Part.RawBox:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.RawBox:getDimX() - 500 * GEO.EPS_SMALL)))
|
||||
return ( ( b3Proc:getDimY() > ( Part.b3RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3RawBox:getDimX() - 500 * GEO.EPS_SMALL)) or
|
||||
( b3Proc:getDimZ() > ( Part.b3RawBox:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3RawBox:getDimX() - 500 * GEO.EPS_SMALL)))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -135,8 +135,8 @@ function FeatureData.ClassifyTopology( Proc, Part)
|
||||
|
||||
if not Proc.AffectedFaces then Proc.AffectedFaces = BeamLib.GetAffectedFaces( Proc) end
|
||||
|
||||
local bIsFeatureCuttingEntireSection = IsFeatureCuttingEntireSection( Proc.Box, Part)
|
||||
local bIsFeatureCuttingEntireLength = IsFeatureCuttingEntireLength( Proc.Box, Part)
|
||||
local bIsFeatureCuttingEntireSection = IsFeatureCuttingEntireSection( Proc.b3Box, Part)
|
||||
local bIsFeatureCuttingEntireLength = IsFeatureCuttingEntireLength( Proc.b3Box, Part)
|
||||
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||
local vAdj = Proc.AdjacencyMatrix
|
||||
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
|
||||
@@ -145,63 +145,63 @@ function FeatureData.ClassifyTopology( Proc, Part)
|
||||
|
||||
local sFamily
|
||||
local bIsThrough
|
||||
if Proc.Fct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
|
||||
if Proc.nFct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 1 then
|
||||
elseif Proc.nFct == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||
elseif Proc.nFct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then
|
||||
elseif Proc.nFct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then
|
||||
sFamily = 'Rabbet'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave then
|
||||
elseif Proc.nFct == 2 and bAllAnglesConcave then
|
||||
sFamily = 'VGroove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||
elseif Proc.nFct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 1 and #vTriangularFaces == 2 then
|
||||
elseif Proc.nFct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 1 and #vTriangularFaces == 2 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 1 and bIsAnyDimensionLongAsPart then
|
||||
elseif Proc.nFct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 3 then
|
||||
elseif Proc.nFct == 3 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 3 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and #vFacesByAdjNumber[2] == 4 and #vTriangularFaces == 2 then
|
||||
elseif Proc.nFct == 4 and #vFacesByAdjNumber[2] == 4 and #vTriangularFaces == 2 then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesByAdjNumber[3] == 2 then
|
||||
elseif Proc.nFct == 4 and bAllAnglesConcave and #vFacesByAdjNumber[3] == 2 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 4 and bIsAnyDimensionLongAsPart then
|
||||
elseif Proc.nFct == 4 and bAllAnglesConcave and #vFacesByAdjNumber[2] == 4 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Tunnel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct >= 4 and #vFacesByAdjNumber[1] == 2 and bIsAnyDimensionLongAsPart then
|
||||
elseif Proc.nFct >= 4 and #vFacesByAdjNumber[1] == 2 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Strip'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesByAdjNumber[4] == 1 then
|
||||
elseif Proc.nFct == 5 and bAllAnglesConcave and #vFacesByAdjNumber[4] == 1 then
|
||||
sFamily = 'Pocket'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 6 and #vFacesByAdjNumber[2] == 4 and #vFacesByAdjNumber[3] == 2 and #vTriangularFaces == 4 then
|
||||
elseif Proc.nFct == 6 and #vFacesByAdjNumber[2] == 4 and #vFacesByAdjNumber[3] == 2 and #vTriangularFaces == 4 then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = false
|
||||
end
|
||||
|
||||
if sFamily then
|
||||
FeatureTopology.Family = sFamily
|
||||
FeatureTopology.IsThrough = bIsThrough
|
||||
FeatureTopology.AllRightAngles = bAllRightAngles
|
||||
FeatureTopology.Name = GetTopologyName( sFamily, Proc.Fct, bIsThrough)
|
||||
FeatureTopology.sFamily = sFamily
|
||||
FeatureTopology.bIsThrough = bIsThrough
|
||||
FeatureTopology.bAllRightAngles = bAllRightAngles
|
||||
FeatureTopology.sName = GetTopologyName( sFamily, Proc.nFct, bIsThrough)
|
||||
FeatureTopology.AdjacencyMatrix = vAdj
|
||||
-- feature che necessita di essere catalogata, ma non si capisce come
|
||||
else
|
||||
FeatureTopology.Family = 'NOT_IMPLEMENTED'
|
||||
FeatureTopology.Name = FeatureTopology.Family
|
||||
FeatureTopology.sFamily = 'NOT_IMPLEMENTED'
|
||||
FeatureTopology.sName = FeatureTopology.sFamily
|
||||
end
|
||||
|
||||
return FeatureTopology
|
||||
|
||||
Reference in New Issue
Block a user