DataWall :
- in Is3EdgesApprox di FreeContour aggiunta cancellazione dei loop temporanei.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/09/12
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione calcolo profilo libero per Pareti
|
||||
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
||||
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
||||
@@ -23,6 +23,7 @@
|
||||
-- 2023/07/26 In MakeByCut migliorata la scelta della fresa secondaria nel caso non sia disponibile una fresa di lunghezza sufficiente.
|
||||
-- 2023/09/12 Modifiche a GetTunnelDimension (asse deve essere com Z globale) e MakeLocalSurf per gestire finestre con lati inclinati.
|
||||
-- 2023/09/21 In MakeByMill modificato SCC per correggere caso con lama su testa fresa.
|
||||
-- 2023/09/26 In Is3EdgesApprox aggiunta cancellazione dei loop temporanei.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPF = {}
|
||||
@@ -1210,26 +1211,28 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||
local function Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||
local bResult = false
|
||||
local nContourId = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
nAddGrpId = nAddGrpId or WL.GetAddGroup( Proc.PartId)
|
||||
-- recupero il contorno della faccia
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
if not nContourId then return false end
|
||||
EgtMergeCurvesInCurveCompo( nContourId)
|
||||
-- recupero il numero effettivo di lati
|
||||
-- recupero il numero di lati del contorno
|
||||
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||
if not nEntityCount then return false end
|
||||
-- se sono già tre, ho finito
|
||||
if nEntityCount == 3 then return true end
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
local nEdges = nEntityCount
|
||||
if nContourId then
|
||||
if nEntityCount and nEntityCount == 3 then
|
||||
bResult = true
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
elseif nEntityCount then
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
end
|
||||
if nEdges == 3 then bResult = true end
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
if bResult == true then
|
||||
EgtOutLog( 'FreeContour : Face with ' .. tointeger( nEntityCount) .. ' edges skipped (approx 3 edges)')
|
||||
-- verifico il numero significativo di lati
|
||||
local bResult = ( nEdges == 3)
|
||||
-- cancello tutti i contorni appena creati
|
||||
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||
if bResult then
|
||||
EgtOutLog( 'FreeContour : Face with ' .. tostring( nEntityCount) .. ' edges skipped (approx 3 edges)')
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user