- in BeamExec di default si attiva la modalità di rotazione avanzata
- in tutte le funzioni GetMinNz, GetMaxNz, GetMinNzDefault, GetMaxNzDefault si passa anche Tool (per discriminare il tipo utensile in macchina) - in FaceData si settano le MainFaces e i MainEdges anche per DoubleBevel - in STR0001 (TenonDT) si controlla la ResidualDepth - in BLADEKEEPWASTE escluso il caso di Rabbet passante lungo X
This commit is contained in:
+33
-12
@@ -204,6 +204,30 @@ function FaceData.GetFacesInfo( Proc, Part)
|
||||
return Faces
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CompareEdges( EdgeA, EdgeB)
|
||||
-- prima i lati con facce adiacenti
|
||||
if EdgeA.idAdjacentFace and not ( EdgeB.idAdjacentFace) then
|
||||
return true
|
||||
elseif not ( EdgeA.idAdjacentFace) and EdgeB.idAdjacentFace then
|
||||
return false
|
||||
-- se entrambi con facce adiacenti, si sceglie quello convesso (non chiuso)
|
||||
else
|
||||
if EdgeA.bIsOpen and not ( EdgeB.bIsOpen) then
|
||||
return true
|
||||
elseif not ( EdgeA.bIsOpen) and EdgeB.bIsOpen then
|
||||
return false
|
||||
-- se entrambi aperti o entrambi chiusi, si sceglie quello più lungo
|
||||
else
|
||||
if EdgeA.dLength > EdgeB.dLength then
|
||||
return true
|
||||
elseif EdgeA.dLength < EdgeB.dLength then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO valutare refactoring per mettere i calcoli del tunnel in una funzione
|
||||
-- TODO creare le facce tunnel solo se non ci sono già. Verirficare all'inizio se già presente in AddGrpId e nel caso riferire all'id di quella esistente e ricalcolare solo le informazioni della faccia.
|
||||
@@ -302,18 +326,18 @@ local function GetBottomFaces( Proc)
|
||||
BottomFaces[1].MainEdges.LongEdges = {}
|
||||
BottomFaces[1].MainEdges.SideEdges = {}
|
||||
|
||||
local ClosedEdgesSortedByGreatestLength = {}
|
||||
local EdgesSorted = {}
|
||||
for i = 1, #BottomFaces[1].Edges do
|
||||
if not BottomFaces[1].Edges[i].bIsOpen then
|
||||
table.insert( ClosedEdgesSortedByGreatestLength, {})
|
||||
ClosedEdgesSortedByGreatestLength[#ClosedEdgesSortedByGreatestLength].nIndex = i
|
||||
ClosedEdgesSortedByGreatestLength[#ClosedEdgesSortedByGreatestLength].dLength = BottomFaces[1].Edges[i].dLength
|
||||
table.insert( EdgesSorted, {})
|
||||
EdgesSorted[#EdgesSorted].nIndex = i
|
||||
EdgesSorted[#EdgesSorted].dLength = BottomFaces[1].Edges[i].dLength
|
||||
end
|
||||
end
|
||||
table.sort( ClosedEdgesSortedByGreatestLength, function (a, b) return a.dLength > b.dLength end)
|
||||
table.sort( EdgesSorted, CompareEdges)
|
||||
local nFirstLongEdgeIndex
|
||||
if #ClosedEdgesSortedByGreatestLength > 0 then
|
||||
nFirstLongEdgeIndex = ClosedEdgesSortedByGreatestLength[1].nIndex
|
||||
if #EdgesSorted > 0 then
|
||||
nFirstLongEdgeIndex = EdgesSorted[1].nIndex
|
||||
end
|
||||
|
||||
for i = 1, #BottomFaces[1].Edges do
|
||||
@@ -335,7 +359,6 @@ local function GetBottomFaces( Proc)
|
||||
CurrentEdge.bIsStartOpen = BottomFaces[1].Edges[i].bIsStartOpen
|
||||
CurrentEdge.bIsEndOpen = BottomFaces[1].Edges[i].bIsEndOpen
|
||||
|
||||
-- se non c'è un LongEdge significa che non ci sono lati chiusi (facce convesse): i MainEdges non si calcolano
|
||||
if nFirstLongEdgeIndex then
|
||||
if i == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.LongEdges[1] = CurrentEdge
|
||||
@@ -362,8 +385,7 @@ local function GetLongFaces( Proc, MainFaces)
|
||||
|
||||
if Proc.nFct > 5 then
|
||||
error( 'GetLongFaces : Topology not implemented')
|
||||
elseif Proc.nFct == 1
|
||||
or Proc.Topology.sFamily == 'DoubleBevel' then
|
||||
elseif Proc.nFct == 1 then
|
||||
return {}
|
||||
end
|
||||
|
||||
@@ -461,8 +483,7 @@ local function GetSideFaces( Proc, MainFaces)
|
||||
|
||||
if Proc.nFct > 5 then
|
||||
error( 'GetSideFaces : Topology not implemented')
|
||||
elseif Proc.nFct == 1
|
||||
or Proc.Topology.sFamily == 'DoubleBevel' then
|
||||
elseif Proc.nFct == 1 then
|
||||
return {}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user