3dPrinting :
- riorganizzazione layer per nuova interfaccia.
This commit is contained in:
@@ -134,8 +134,13 @@ LEAD_TYPE = {
|
||||
TABLE = "Table"
|
||||
PART = "Part"
|
||||
ORIGINAL_SOLID = "OriginalSolid"
|
||||
LAY_AUX = "Aux"
|
||||
PRINT_SOLID = "PrintSolid"
|
||||
LAY_MACH_START = "MachStart"
|
||||
LAY_RIBS = "Ribs"
|
||||
LAY_AUX_SOLIDS = "AuxSolids"
|
||||
LAY_SHELL_NBR = "ShellNumber"
|
||||
LAY_AUX = "Aux"
|
||||
LAY_FRAME = "Frame"
|
||||
VIEWPARAMS = 'ViewParams'
|
||||
IMPORTED_SOLID = 'ImportedSolid'
|
||||
RESULT_READ_PROG = 'ResultReadProg'
|
||||
|
||||
@@ -42,9 +42,9 @@ local function GetLayerStartPoint( nLayId, vtSlicing)
|
||||
local nGrpTmp = EgtGroup( nLayId)
|
||||
|
||||
local vPtStart = {}
|
||||
local nAuxGrp = EgtGetFirstNameInGroup( s_nPartId, LAY_AUX)
|
||||
local nStartId = EgtGetFirstNameInGroup( nAuxGrp, START_GEOM)
|
||||
while nStartId do
|
||||
local nMachStartGrp = EgtGetFirstNameInGroup( s_nPartId, LAY_MACH_START)
|
||||
local nStartId = EgtGetFirstInGroup( nMachStartGrp)
|
||||
while nStartId do
|
||||
local nType = EgtGetType( nStartId)
|
||||
-- se punto
|
||||
if nType == GDB_TY.GEO_POINT then
|
||||
@@ -58,7 +58,7 @@ local function GetLayerStartPoint( nLayId, vtSlicing)
|
||||
end
|
||||
end
|
||||
end
|
||||
nStartId = EgtGetNextName( nStartId, START_GEOM)
|
||||
nStartId = EgtGetNext( nStartId)
|
||||
end
|
||||
|
||||
EgtErase( nGrpTmp)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@ local AMD = require( 'AddManData')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ShowImportedSolid( nPartId, bShow)
|
||||
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, ORIGINAL_SOLID)
|
||||
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
|
||||
EgtSetStatus( nSolidLayId or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
|
||||
local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS)
|
||||
EgtSetStatus( nRibsLayId or GDB_ID.NULL, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
|
||||
|
||||
@@ -189,13 +189,14 @@ function RunSlicing.Exec()
|
||||
EgtOutBox( 'Position part on the machine table before slicing it!', 'Error', 'ERROR')
|
||||
return
|
||||
end
|
||||
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, ORIGINAL_SOLID)
|
||||
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
|
||||
local nStmId = EgtGetFirstInGroup( nSolidLayId or GDB_ID.NULL)
|
||||
if not nStmId or EgtGetType( nStmId) ~= GDB_TY.SRF_MESH then
|
||||
EgtOutBox( "Part without surface!", 'Warning', 'WARNING')
|
||||
return
|
||||
end
|
||||
local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS)
|
||||
local nStartLayId = EgtGetFirstNameInGroup( nPartId, LAY_MACH_START)
|
||||
|
||||
-- Scelta del file dei parametri
|
||||
local sPrevParamFile = EgtGetInfo( nPartId, KEY_PARAMS)
|
||||
@@ -249,6 +250,7 @@ function RunSlicing.Exec()
|
||||
CSOLIDS.Exec( nPartId)
|
||||
EgtSetStatus( nSolidLayId, GDB_ST.OFF)
|
||||
EgtSetStatus( nRibsLayId or GDB_ID.NULL, GDB_ST.OFF)
|
||||
EgtSetStatus( nStartLayId or GDB_ID.NULL, GDB_ST.OFF)
|
||||
EgtDraw()
|
||||
|
||||
-- Aggiorno impostazioni di visibilita' per ShowManager
|
||||
|
||||
Reference in New Issue
Block a user