Compare commits

..

10 Commits

Author SHA1 Message Date
luca.mazzoleni 7bbed3cb8a Merge branch 'release/2.5l2' 2023-12-21 10:38:15 +01:00
luca.mazzoleni 25f599a1fa -In FreeContour -> MakeByPocket corretto un bug che provocava la cancellazione della feature dopo averla lavorata 2023-12-21 10:37:10 +01:00
luca.mazzoleni c0970c52ff Merge branch 'master' into develop 2023-12-20 17:58:31 +01:00
luca.mazzoleni 61590f611d corretto problema mancata compilazione (file placeholder in bin non creato) 2023-12-20 17:57:32 +01:00
luca.mazzoleni f8011493f2 Merge tag '2.5l1' into develop
Finish Release: 2.5l1
2023-12-13 17:09:08 +01:00
luca.mazzoleni a76bd31fe4 Merge branch 'release/2.5l1' 2023-12-13 17:09:08 +01:00
luca.mazzoleni 07a80248dc update log e version 2023-12-13 17:07:52 +01:00
luca.mazzoleni 89838c6f28 -In FreeContour -> MakeByPocket aggiunta la possibilità di svuotare tasche passanti
-In FreeContour -> MakeByPocket in tasche speciali cliente 90480029 forzato step unico
2023-12-13 16:57:30 +01:00
luca.mazzoleni 764c80824a modifiche a WallExec, WallLib, FeatureTopology per allineamento Topology con Beam 2023-12-11 11:27:54 +01:00
luca.mazzoleni 37da3ba714 Merge branch 'master' into develop 2023-12-07 16:20:19 +01:00
8 changed files with 101 additions and 27 deletions
-1
View File
@@ -20,5 +20,4 @@
/bin/LuaLibs/*.lua
/bin/Images/*.png
.vscode/settings.json
bin/LuaLibs/.placeholder
bin/Images/.placeholder
+23 -5
View File
@@ -1,5 +1,6 @@
-- WFeatureTopology.lua by Egaltech s.r.l. 2023/06/23
-- Libreria per classificazione topologica feature pareti
-- 2023/12/11 Modifiche varie per allineamento con Beam.
-- Tabella per definizione modulo
local WFeatureTopology = {}
@@ -104,11 +105,11 @@ end
---------------------------------------------------------------------
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
local function GetFacesParallelToPart( Proc, sFamily)
local function GetFacesParallelToPart( Proc, sFamily, bIsThrough)
local vFacesParallelToPart = {}
for i = 0, Proc.Fct - 1 do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
if sFamily == 'Bevel' or sFamily == 'DoubleBevel' then
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' or sFamily == 'Tunnel' or ( sFamily == 'Groove' and bIsThrough) then
local vTriangularFaces = GetTriangularFaces( Proc)
local bIsTriangularFace = false
-- verifico se la faccia è triangolare
@@ -158,7 +159,13 @@ end
---------------------------------------------------------------------
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
function WFeatureTopology.Classify( Proc)
function WFeatureTopology.Classify( Proc, b3Raw)
if not Proc.AffectedFaces then Proc.AffectedFaces = WL.GetProcessAffectedFaces( Proc) end
if not Proc.Box or Proc.Box:isEmpty() then
return false
end
local bRecognized = false
local sFamily
local bIsThrough
@@ -172,23 +179,31 @@ function WFeatureTopology.Classify( Proc)
bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( Proc)
local vTriangularFaces = GetTriangularFaces( Proc)
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
local vFacesWithOneAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 1)
local vFacesWithTwoAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 2)
local vFacesWithThreeAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 3)
local vFacesWithFourAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 4)
local dRawW, dRawH, dRawL = b3Raw:getDimY(), b3Raw:getDimZ(), b3Raw:getDimX()
local bIsFeatureCuttingEntireSection = WL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH, dRawL)
if Proc.IsOutline then
sFamily = 'OUTLINE'
elseif Proc.Prc == 40 then
sFamily = 'DRILLING'
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
sFamily = 'Cut'
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
sFamily = 'Bevel'
bIsThrough = true
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
sFamily = 'Bevel'
bIsThrough = false
elseif Proc.Fct == 2 and bAllAnglesConcave then
elseif Proc.Fct == 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
sFamily = 'Groove'
bIsThrough = true
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
sFamily = 'DoubleBevel'
bIsThrough = true
@@ -207,11 +222,14 @@ function WFeatureTopology.Classify( Proc)
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
sFamily = 'Tunnel'
bIsThrough = true
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
sFamily = 'Strip'
bIsThrough = true
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
sFamily = 'Pocket'
bIsThrough = false
end
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily)
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
if sFamily == 'OUTLINE' or sFamily == 'DRILLING' then
+57 -15
View File
@@ -27,6 +27,7 @@
-- 2023/10/02 Correzione a MakeCustomPath per calcolare correttamente puliture spigoli di tipo 2 (Clean 30) e 3 (Gola di Scarico).
-- 2023/11/14 Spostamento di alcune funzioni in WallLib.
-- Aggiunta dei FreeContour in doppio.
-- 2023/12/13 In MakeByPocket aggiunta la possibilità di svuotare tasche passanti.
-- Tabella per definizione modulo
local WPF = {}
@@ -2100,7 +2101,7 @@ local function MakeByMill( Proc, nRawId, b3Raw)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- se lamatura affondata speciale, setto attacco e stacco al centro
-- se lamatura affondata speciale (cliente 90480029), setto attacco e stacco al centro
local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() + 10 * GEO.EPS_SMALL) and
( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID or 0) and
( EgtCurveIsACircle( AuxId))
@@ -2120,12 +2121,16 @@ local function MakeByMill( Proc, nRawId, b3Raw)
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
-- imposto step
local dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dDepth - dMaxMat) / dStep)
dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
EgtSetMachiningParam( MCH_MP.STEP, dStep)
--
-- su richiesta del cliente 90480029 si usa sempre step unico a prescindere dalla geometria
--
-- local dStep = EgtGetMachiningParam( MCH_MP.STEP)
-- if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
-- local nStep = ceil( ( dDepth - dMaxMat) / dStep)
-- dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0)
-- local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
EgtSetMachiningParam( MCH_MP.STEP, dMaxMat)
local dMaxElev = dMaxMat
-- imposto elevazione e forzo attacco dal lato aperto
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';OutRaw=3;')
end
@@ -2350,6 +2355,7 @@ end
---------------------------------------------------------------------
local function MakeByPocket( Proc, nRawId, b3Raw)
-- recupero e verifico l'entità curva
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
local bOpposite = false
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
local vtExtr
@@ -2382,11 +2388,48 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
break
end
end
-- se tasca verticale si permette la svuotatura anche se passante, lavorando la faccia di fondo aggiunta
local nProcTmWithAddedBottomSurfaceId
if not nFacet and not bPocketBotface and Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
local nFirstLoopId, nLoopsCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
local dMinZ = GEO.INFINITO
local nBottomLoopId = GDB_ID.NULL
for i = 1, nLoopsCount do
local nCurrentLoopId = nFirstLoopId + i - 1
local b3Loop = EgtGetBBoxGlob( nCurrentLoopId, GDB_BB.STANDARD)
local dCurrentZ = b3Loop:getMin():getZ()
if dCurrentZ < dMinZ then
dMinZ = dCurrentZ
nBottomLoopId = nCurrentLoopId
end
end
local nAddedBottomSurface = EgtSurfTmByFlatContour( nAddGrpId, nBottomLoopId)
local vtNAddedBottomSurface = EgtSurfTmFacetNormVersor( nAddedBottomSurface, 0)
if AreOppositeVectorApprox( vtNAddedBottomSurface, Z_AX()) then EgtInvertSurf( nAddedBottomSurface) end
nProcTmWithAddedBottomSurfaceId = EgtSurfTmBySewing( nAddGrpId, { nAddedBottomSurface, Proc.Id}, false)
if nProcTmWithAddedBottomSurfaceId then
-- ricerco la faccia di fondo della trimesh (gli id potrebbero essere cambiati)
for i = 1, Proc.Fct do
local vtN = EgtSurfTmFacetNormVersor( nProcTmWithAddedBottomSurfaceId, i-1, GDB_ID.ROOT)
if abs( vtN * vtExtr) > 0.99 then
nFacet = i - 1
break
end
end
end
-- elimino le geometrie che non servono più
for i = 1, nLoopsCount do
EgtErase( nFirstLoopId + i - 1)
end
EgtErase( nAddedBottomSurface)
end
if not nFacet then
return MakeByMill( Proc, nRawId, b3Raw)
end
-- se ho creato la faccia di fondo utilizzo quella
local nSurfId = nProcTmWithAddedBottomSurfaceId or Proc.Id
-- se la faccia di fondo ha confini aperti, devo lavorarla direttamente
local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1] or {}
local vAdj = EgtSurfTmFacetAdjacencies( nSurfId, nFacet)[1] or {}
for i = 1, #vAdj do
if vAdj[i] == - 1 then
bPocketBotface = true
@@ -2397,11 +2440,10 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
local dDepth = EgtIf( bPocketBotface, 0, abs( EgtCurveThickness( AuxId)))
local dOriDepth = dDepth
-- dati della faccia di fondo
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT)
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( nSurfId, nFacet, GDB_ID.ROOT)
local dDiam = min( dH, dV)
local dElev = WL.GetFaceElevation( Proc.Id, nFacet, nRawId)
local dElev = WL.GetFaceElevation( nSurfId, nFacet, nRawId)
-- gruppo ausiliario
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
local nNewProc, nNumFacet = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
-- se ho forma a L
local bIsL = ( nNumFacet == 2 or WL.TestElleShape3( nNewProc, nNumFacet) or WL.TestElleShape4( nNewProc, nNumFacet) == 2)
@@ -2440,7 +2482,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
end
end
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sName = 'Pock_' .. ( EgtGetName( nSurfId) or tostring( nSurfId))
local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
@@ -2450,7 +2492,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
-- aggiungo geometria
if bPocketBotface then
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
else
EgtSetMachiningGeometry( {{ AuxId, -1}})
end
@@ -2483,7 +2525,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
local bAppOk = EgtApplyMachining( true, false)
if not bAppOk and not bPocketBotface then
bPocketBotface = true
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
dDepth = 0
local dThElev = dThDiam / 2 * sqrt( vtExtr:getX() * vtExtr:getX() + vtExtr:getY() * vtExtr:getY())
if dElev + dThElev > dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -2515,7 +2557,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
else
EgtErase( nNewProc)
if nConeCut == 1 then
local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) ..
local sErr = 'Clean corner 60° not applied because thickness: ' .. EgtNumToString( dThick, 2) ..
' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2)
EgtOutLog( sErr)
elseif nConeCut == 2 then
+5 -3
View File
@@ -7,6 +7,7 @@
-- 2023/10/16 Aggiunta gestione Aree vietate (LockOut) per chiodature.
-- 2023/11/14 Modifiche sostanziali per l'aggiunta delle lavorazioni in doppio.
-- In Collect aggiunto il recupero preliminare di varie informazioni sulla feature.
-- 2023/12/11 In ClassifyTopology si passa ora anche l'Id del grezzo (allineamento Topology con Beam).
-- Tabella per definizione modulo
local WallExec = {}
@@ -309,11 +310,12 @@ local function ClassifyFeatures( vProc, b3Raw)
end
-------------------------------------------------------------------------------------------------------------
local function ClassifyTopology( vProc)
local function ClassifyTopology( vProc, nRawId)
local b3Raw = EgtGetRawPartBBox( nRawId)
local nRecognized = 0
for i = 1, #vProc do
local Proc = vProc[i]
if Topology.Classify( Proc) then
if Topology.Classify( Proc, b3Raw) then
nRecognized = nRecognized + 1
end
end
@@ -1085,7 +1087,7 @@ function WallExec.ProcessFeatures()
vProc = EgtJoinTables( vProc, vPartProc)
end
-- classifico topologicamente le feature
ClassifyTopology( vProc)
ClassifyTopology( vProc, nRawId)
-- classifico le feature
ClassifyFeatures( vProc, b3Raw)
-- recupero l'elenco delle aree vietate alle chiodature
+9 -1
View File
@@ -2,6 +2,7 @@
-- Libreria globale per Pareti
-- 2023/06/26 Spostata qui Is3EdgesApprox da FreeContour. Ora cerca autonomamente il gruppo se non viene passato.
-- 2023/11/14 Aggiunte funzioni GetProcessAffectedFaces, GetProcessDistanceToNearestParts, GetProcessDistanceToRawPart.
-- 2023/12/11 Aggiunta funzione IsFeatureCuttingEntireSection (allineamento Topology con Beam).
-- Tabella per definizione modulo
local WallLib = {}
@@ -534,7 +535,7 @@ function WallLib.GetNailLockOutAreas( vProc)
if AuxId then AuxId = AuxId + vProc[i].Id end
if AuxId then
local nAddGrpId = WallLib.GetAddGroup( vProc[i].PartId)
local nSfrId = EgtSurfFlatRegion( nAddGrpId, {AuxId})
local nSfrId = EgtSurfFlatRegion( nAddGrpId, {AuxId})
if nSfrId then
table.insert( vNLO, nSfrId)
end
@@ -544,5 +545,12 @@ function WallLib.GetNailLockOutAreas( vProc)
return vNLO
end
-------------------------------------------------------------------------------------------------------------
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della parete, rappresentata dalle sue dimensioni W, H e L
function WallLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH, dRawL)
return ( ( ( abs( b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) or ( abs( b3Proc:getDimX() - dRawL) < 10 * GEO.EPS_SMALL or b3Proc:getDimX() > dRawL)) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
end
-------------------------------------------------------------------------------------------------------------
return WallLib
+5
View File
@@ -1,5 +1,10 @@
==== Wall Update Log ====
Versione 2.5l1 (13/12/2023)
- Modif : modifiche a WallExec, WallLib, FeatureTopology per allineamento Topology con Beam
- Modif : In FreeContour -> MakeByPocket aggiunta la possibilità di svuotare tasche passanti
- Modif : In FreeContour -> MakeByPocket in tasche speciali cliente 90480029 forzato step unico
Versione 2.5k1 (14/11/2023)
- Added : aggiunte lavorazioni in doppio.
- Modif : miglioramenti vari alla lavorazione tasche, in particolare in presenza di pezzi vicini.
+2 -2
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egalware s.r.l. 2023/10/11
-- Version.lua by Egalware s.r.l. 2023/12/13
-- Gestione della versione di Wall
NAME = 'Wall'
VERSION = '2.5k1'
VERSION = '2.5l1'
MIN_EXE = '2.5b3'
View File