3dPrinting :

- riorganizzazione layer per nuova interfaccia.
This commit is contained in:
SaraP
2022-08-05 10:02:10 +02:00
parent 5ccbfd54ec
commit ffd86bd009
5 changed files with 43 additions and 21 deletions
+29 -14
View File
@@ -35,7 +35,7 @@ function RunPartPositioning.Exec()
return
end
local sLayer = EgtGetName( nLayerId)
if sLayer == LAY_RIBS then
if sLayer == LAY_RIBS or sLayer == LAY_AUX_SOLIDS or sLayer == LAY_SHELL_NBR then
EgtOutBox( 'No selected solid. Please select a solid before moving it on the table.', 'Warning', 'WARNING')
return
end
@@ -55,22 +55,21 @@ function RunPartPositioning.Exec()
nPartIndex = nPartIndex + 1
end
EgtSetName( nPartId, PART .. nPartIndex)
EgtSetName( nLayerId, ORIGINAL_SOLID)
EgtSetName( nLayerId, PRINT_SOLID)
end
-- Recupero o creo layer ausiliario
local nAuxId = EgtGetFirstNameInGroup( nPartId, LAY_AUX)
if not nAuxId then
nAuxId = EgtGroup( nPartId)
EgtSetName( nAuxId, LAY_AUX)
else
EgtEmptyGroup( nAuxId)
end
-- Rimuovo eventuale gruppo di lavoro
local nMchGrpId = EgtGetMachGroupId( '3dPrint')
EgtRemoveMachGroup( nMchGrpId or GDB_ID.NULL)
-- Rimuovo eventuale frame
local nFrameId = EgtGetFirstNameInGroup( nAuxId, FRAME_PART)
if nFrameId then EgtErase( nFrameId) end
EgtRemoveMachGroup( nMchGrpId or GDB_ID.NULL)
-- Recupero dati tavola (creando gruppo di lavoro temporaneo)
local nQqqId = EgtAddMachGroup( 'qqq')
EgtSetTable( 'Tab')
@@ -145,8 +144,18 @@ function RunPartPositioning.Exec()
elseif nRefY == 3 then
ptOrig = ptOrig + b3Solid:getDimY() * Y_AX()
end
-- Svuoto o creo layer per il frame
local nFrameLay = EgtGetFirstNameInGroup( nPartId, LAY_FRAME)
if not nFrameLay then
nFrameLay = EgtGroup( nPartId)
EgtSetName( nFrameLay, LAY_FRAME)
else
EgtEmptyGroup( nFrameLay)
end
local frPart = Frame3d( ptOrig, Z_AX())
nFrameId = EgtFrame( nAuxId, frPart, GDB_RT.GLOB)
nFrameId = EgtFrame( nFrameLay, frPart, GDB_RT.GLOB)
if nFrameId then
EgtSetName( nFrameId, FRAME_PART)
EgtSetMode( nFrameId, GDB_MD.LOCKED)
@@ -161,19 +170,25 @@ function RunPartPositioning.Exec()
EgtResetCurrMachGroup()
-- Porto punti/curve di inizio nel gruppo aux
-- Recupero/creo gruppo per punti e curve di partenza
local nMachStartId = EgtGetFirstNameInGroup( nPartId, LAY_MACH_START)
if not nMachStartId then
nMachStartId = EgtGroup( nPartId)
EgtSetName( nMachStartId, LAY_MACH_START)
end
local vStartId = EgtGetNameInGroup( nLayerId, START_GEOM)
if vStartId then
for j = 1, #vStartId do
EgtRelocateGlob( vStartId[j], nAuxId)
EgtRelocateGlob( vStartId[j], nMachStartId)
EgtSetColor( vStartId[j], EgtStdColor( "RED"))
end
else
-- se non ci sono punti/curve di inizio definiti e non ve ne sono nemmeno in aux, creo un punto
local vOldStart = EgtGetNameInGroup( nAuxId, START_GEOM)
-- se non ci sono punti/curve di inizio definiti e non ve ne sono nemmeno nel gruppo, creo un punto
local vOldStart = EgtGetNameInGroup( nMachStartId, START_GEOM)
if not vOldStart then
local ptStart = b3Solid:getCenter() - 0.6 * b3Solid:getDimY() * Y_AX() - 0.5 * b3Solid:getDimZ() * Z_AX()
nPtStartId = EgtPoint( nAuxId, ptStart, GDB_RT.GLOB)
nPtStartId = EgtPoint( nMachStartId, ptStart, GDB_RT.GLOB)
EgtSetName( nPtStartId, START_GEOM)
EgtSetColor( nPtStartId, EgtStdColor( "RED"))
end