Aggiunta gestione squadratura. Default disabilitata da WallData

This commit is contained in:
andrea.villa
2024-11-18 16:18:51 +01:00
parent b49b456e1e
commit 5d3964238f
4 changed files with 51 additions and 17 deletions
+2 -2
View File
@@ -11,8 +11,8 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6i1'
PP_NVER = '2.6.9.1'
PP_VER = '2.6k1'
PP_NVER = '2.6.11.1'
-- Parametri macchina
NumericalControl = 'NUM' -- NUM o TPA
+39 -15
View File
@@ -500,7 +500,7 @@ function ExecScrapRemove()
b3PartExp:Add( b3PartExp:getMin() - Vector3d( 10, 10, 0))
b3PartExp:Add( b3PartExp:getMax() + Vector3d( 10, 10, 0))
-- salvo i dati
table.insert( vPart, { Box = b3Part, BoxExp = b3PartExp, Area = dPartArea})
table.insert( vPart, { Box = b3Part, BoxExp = b3PartExp, Area = dPartArea, Outline = nOlEntId})
-- passo al successivo
nPartId = EgtGetNextPartInRawPart( nPartId)
end
@@ -517,6 +517,27 @@ function ExecScrapRemove()
-- salvo i dati
table.insert( vVmPart, { Box = b3VmPart, BoxExp = b3VmPartExp, Area = dVmPartArea})
end
-- se presente squadratura, tengo tutti i pezzi all'interno
local nRawId = EgtGetFirstRawPart()
local SquaringEntities = {}
SquaringEntities = EgtGetNameInGroup( nRawId, 'SquaringGeometry')
local b3SquaringBox = nil
if SquaringEntities then
for i = 1, #SquaringEntities do
if i == 1 then
b3SquaringBox = EgtGetBBoxGlob( SquaringEntities[i], GDB_BB.STANDARD)
else
if b3SquaringBox then
b3SquaringBox:Add( EgtGetBBoxGlob( SquaringEntities[i], GDB_BB.STANDARD))
end
end
end
if b3SquaringBox then
b3SquaringBox:expand( 50)
end
end
-- Tengo solo le parti del Vmill che contengono almeno un box di un pezzo o che interferiscono e sono abbastanza grandi
local nValidCnt = 0
for i = #vVmPart, 1, -1 do
@@ -524,21 +545,24 @@ function ExecScrapRemove()
local bToRemove = true
-- se area abbastanza grande, allora da verificare
if vVmPart[i].Area > 1e4 then
-- verifico se sono sicuramente valide (i due box si equivalgono entro la tolleranza)
for j = 1, #vPart do
-- verifico se ad ogni VM corrisponde esattamente un Part
if EnclosesXY( vVmPart[i].BoxExp, vPart[j].Box) and EnclosesXY( vPart[j].BoxExp, vVmPart[i].Box) then
bToRemove = false
vVmPart[i].Part = j
nValidCnt = nValidCnt + 1
break
-- se presente squadratura, verifico che il VMILL sia all'interno del BOX squadratura
if not b3SquaringBox or EnclosesXY( b3SquaringBox, vVmPart[i].Box) then
-- verifico se sono sicuramente valide (i due box si equivalgono entro la tolleranza)
for j = 1, #vPart do
if ( vPart[j].Outline and vVmPart[i].Area > 0.95 * vPart[j].Area and vVmPart[i].Area < 1.05 * vPart[j].Area) or
( EnclosesXY( vVmPart[i].BoxExp, vPart[j].Box) and EnclosesXY( vPart[j].BoxExp, vVmPart[i].Box)) then
bToRemove = false
vVmPart[i].Part = j
nValidCnt = nValidCnt + 1
break
end
end
end
-- verifico se sono molto probabilmente valide
for j = 1, #vPart do
if bToRemove and ( OverlapsXY( vVmPart[i].Box, vPart[j].Box) and vVmPart[i].Area > 0.49 * vPart[j].Area) then
bToRemove = false
break
-- verifico se sono molto probabilmente valide
for j = 1, #vPart do
if bToRemove and ( OverlapsXY( vVmPart[i].Box, vPart[j].Box) and vVmPart[i].Area > 0.25 * vPart[j].Area) then
bToRemove = false
break
end
end
end
end
+3
View File
@@ -0,0 +1,3 @@
[WALL]
Kerf=10
Offset=25
+7
View File
@@ -40,6 +40,13 @@ local WallData = {
RAWPART_ROT = 180, -- rotazione del pannello grezzo rispetto alla descrizione BTL
CUT_WITH_OUTLINE = true, -- taglio delle feature con l'outline del pezzo
DEFAULT_RAW_NO_EXTRA_WIDTH = true, -- in vista si ha grezzo delle stesse dimensioni della parete finita
SQUARING_TYPE = 0, -- master panel squaring: 0 = disabled, 1 = on rawpart, 2 = shrink to parts
SQUARING_TOOL = 0, -- 0 = auto, 1 = double diskmill, 2 = double diskmill+blade, 3 = double blade, 4 = diskmill, 5 = blade, 6 = double mill, 7 = mill
SQUARING_USE_ZIGZAG = true, -- false = oneway, true = zigzag. For mill only
SQUARING_STARTS_ON_REFERENCE = false, -- false = squaring starts near machine parking, true = squaring starts on reference edge
SQUARING_OFFSET_XY = 0, -- > 0 = larger rectangle, < 0 = smaller rectangle. Only with squaring on rawpart
SQUARING_EXTEND_Z = 0, -- > 0 = squaring extends below Z0, < 0 = squaring stops above Z0
SQUARING_MAX_OVERMATERIAL = 40, -- max overmaterial before squaring
}
-- Aggiornamento con dati da TechnoEssetre7