- modifiche per automatismo lavorazioni
- creazione di un unico solido anche per strip - invertite curve CtrIn1 e OfstCtrIn1 nei profili di split.
This commit is contained in:
+4
-1
@@ -728,10 +728,13 @@ WinCreate.AddHardware( nFrameId, '000545')
|
||||
-- imposto se calcolare i solidi o meno
|
||||
WinCalculate.SetCalcSolid( true)
|
||||
|
||||
-- -- creo i pezzi
|
||||
-- creo i pezzi
|
||||
WinCalculate.CreatePartFromArea( nFrameId)
|
||||
WinCalculate.AddHardware( nFrameId)
|
||||
|
||||
-- preparo per automatismo lavorazioni
|
||||
-- WinCalculate.PrepareProject()
|
||||
|
||||
-- -- creo tabella per salvataggio
|
||||
-- local sSaveFilePath = 'c:\\Temp\\WindowTest1.txt'
|
||||
-- local WinTable = WinManageProject.WriteToFile( nFrameId, sSaveFilePath)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+10
-4
@@ -215,20 +215,22 @@ WIN_PRC_NTOOLS = 'NTOOLS'
|
||||
WIN_PRC_TOOL_NAME = 'TOOL_NAME'
|
||||
WIN_PRC_OFFL = 'OFFL'
|
||||
WIN_PRC_OFFR = 'OFFR'
|
||||
WIN_PRC_OFFY_1 = 'OFFY_1'
|
||||
WIN_PRC_OFFZ_1 = 'OFFZ_1'
|
||||
WIN_PRC_OFFY_2 = 'OFFY_2'
|
||||
WIN_PRC_OFFZ_2 = 'OFFZ_2'
|
||||
|
||||
WIN_CRV_ON_FRENCH_SPLIT = 'OutlineOnFrenchSplit'
|
||||
|
||||
WIN_MAINGUIDE = 'MainGuide'
|
||||
WIN_STARTGUIDE = 'StartGuide'
|
||||
WIN_ENDGUIDE = 'EndGuide'
|
||||
WIN_SRF_MAIN = 'MainSurface'
|
||||
WIN_SRF_ORIGMAIN = 'OrigMainSurface'
|
||||
WIN_SRF_START = 'StartSurface'
|
||||
WIN_SRF_END = 'EndSurface'
|
||||
WIN_SRF_STRIP = 'StripSurface'
|
||||
|
||||
WIN_BOTTOMRAIL = 'BottomRail'
|
||||
|
||||
WIN_PRC = 'Processings'
|
||||
WIN_PRC_FRAME = 'AuxFrame'
|
||||
WIN_PRC_FEATURE_TYPE = 'FEATURE_TYPE'
|
||||
WIN_PRC_TYPE = {
|
||||
HOLE = 'Hole',
|
||||
@@ -236,6 +238,10 @@ WIN_PRC_TYPE = {
|
||||
POCKET = 'Pocket',
|
||||
CUT = 'Cut'
|
||||
}
|
||||
WIN_PRC_OVERMAT_IN = 'OVERMAT_IN'
|
||||
WIN_PRC_OVERMAT_OUT = 'OVERMAT_OUT'
|
||||
WIN_PRC_OVERMAT_LEFT = 'OVERMAT_LEFT'
|
||||
WIN_PRC_OVERMAT_RIGHT = 'OVERMAT_RIGHT'
|
||||
|
||||
WIN_DOWEL = 'Dowel'
|
||||
WIN_DWL_TOPPERPSTART = 'TopPerpStart'
|
||||
|
||||
@@ -31,7 +31,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che copia la info di chiave sInfo da nSou a nDest
|
||||
local function CopyInfo( nDest, nSou, sInfo)
|
||||
local sVal = EgtGetInfo( nSou, sInfo)
|
||||
local sVal = EgtGetInfo( nSou, sInfo) or '0'
|
||||
EgtSetInfo( nDest, sInfo, sVal)
|
||||
end
|
||||
|
||||
@@ -468,7 +468,6 @@ local function CalculateOutlineFromAreaOutline( nAreaId)
|
||||
if sSouName == WIN_SPLIT then
|
||||
local sBaseName = EgtGetName( nBaseOutlineId)
|
||||
EgtSetName( nOutlineId, sBaseName)
|
||||
EgtSetStatus( nOutlineId, GDB_ST.OFF)
|
||||
end
|
||||
|
||||
-- sistemo le info
|
||||
@@ -849,6 +848,12 @@ local function CalcFrameProfiles( nPartId, nOutlineId, nPrevOutlineId, nNextOutl
|
||||
EgtSetInfo( nEndProfileId, WIN_PRF_TYPE, sEndProfileType)
|
||||
EgtSetName( nEndProfileId, WIN_PRF_END)
|
||||
|
||||
-- recupero le info di pinzaggio dal profilo di estrusione
|
||||
CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_1)
|
||||
CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_1)
|
||||
CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFY_2)
|
||||
CopyInfo( nPartId, nMainProfileId, WIN_PRC_OFFZ_2)
|
||||
|
||||
return nProfileLayerId
|
||||
end
|
||||
|
||||
@@ -1595,6 +1600,7 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
-- creo guida Main
|
||||
local nGuideId = EgtCopy( nOutlineId, nSolidLayerId)
|
||||
EgtSetName( nGuideId, WIN_MAINGUIDE)
|
||||
EgtSetStatus( nGuideId, GDB_ST.OFF)
|
||||
EgtExtendCurveStartByLen( nGuideId, 2 * dGeoWidth)
|
||||
EgtExtendCurveEndByLen( nGuideId, 2 * dGeoWidth)
|
||||
-- recupero frame del profilo
|
||||
@@ -1622,7 +1628,6 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
local dStartDelta = EgtGetInfo( nGeoLayerId, WIN_STARTCPDELTA, 'd') or 0
|
||||
-- creo guida per estrusione
|
||||
local nStartGuideId = EgtCopy( nPrevGeoId, nSolidLayerId)
|
||||
EgtSetName( nStartGuideId, WIN_STARTGUIDE)
|
||||
EgtExtendCurveStartByLen( nStartGuideId, 2 * dGeoWidth)
|
||||
EgtExtendCurveEndByLen( nStartGuideId, 2 * dGeoWidth)
|
||||
-- recupero frame del profilo
|
||||
@@ -1665,8 +1670,6 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
-- ruoto di 180 gradi il profilo
|
||||
local frStartProfileS = EgtFR( nStartProfileFrameId, GDB_ID.ROOT)
|
||||
EgtRotate( nStartProfileId, frStartProfileS:getOrigin(), frStartProfileS:getVersY(), 180, GDB_RT.GLOB)
|
||||
local nStartCntProfileId = EgtGetFirstNameInGroup( nStartProfileId, sStartProfileType)
|
||||
EgtInvertCurve( nStartCntProfileId)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1684,6 +1687,7 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
-- ( tagliare le due superfici con EgtSurfTmCut e poi unirle potrebbe creare piccoli buchi legati alle diverse approssimazioni)
|
||||
EgtSurfTmIntersect( nMainExtrusionId, nStartExtrusionId)
|
||||
EgtErase( nStartExtrusionId)
|
||||
EgtErase( nStartGuideId)
|
||||
|
||||
|
||||
-- c) END PROFILE
|
||||
@@ -1693,7 +1697,6 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
local dEndDelta = EgtGetInfo( nGeoLayerId, WIN_ENDCPDELTA, 'd') or 0
|
||||
-- creo guida per estrusione
|
||||
local nEndGuideId = EgtCopy( nNextGeoId, nSolidLayerId)
|
||||
EgtSetName( nEndGuideId, WIN_ENDGUIDE)
|
||||
EgtExtendCurveStartByLen( nEndGuideId, 2 * dGeoWidth)
|
||||
EgtExtendCurveEndByLen( nEndGuideId, 2 * dGeoWidth)
|
||||
-- recupero frame del profilo
|
||||
@@ -1728,8 +1731,6 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
-- ruoto di 180 gradi il profilo
|
||||
local frEndProfileS = EgtFR( nEndProfileFrameId, GDB_ID.ROOT)
|
||||
EgtRotate( nEndProfileId, frEndProfileS:getOrigin(), frEndProfileS:getVersY(), 180, GDB_RT.GLOB)
|
||||
local nEndCntProfileId = EgtGetFirstNameInGroup( nEndProfileId, sEndProfileType)
|
||||
EgtInvertCurve( nEndCntProfileId)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1746,6 +1747,7 @@ local function CalcFrameSolid( nPartId, nOutlineId, nGeoId, nProfileType)
|
||||
-- eseguo intersezione per ottenere un solido unico
|
||||
EgtSurfTmIntersect( nMainExtrusionId, nEndExtrusionId)
|
||||
EgtErase( nEndExtrusionId)
|
||||
EgtErase( nEndGuideId)
|
||||
|
||||
end
|
||||
|
||||
@@ -1788,6 +1790,12 @@ local function CreatePartFromOutline( nAreaLayerId, nOutlineId, bBottomRail)
|
||||
EgtSetColor( nPartId, Color3d( 255, 159, 57))
|
||||
end
|
||||
|
||||
-- setto le info di sovramateriale ( TO DO : capire da dove devono essere ricavate)
|
||||
EgtSetInfo( nPartId, WIN_PRC_OVERMAT_IN, 0)
|
||||
EgtSetInfo( nPartId, WIN_PRC_OVERMAT_OUT, 0)
|
||||
EgtSetInfo( nPartId, WIN_PRC_OVERMAT_LEFT, 0)
|
||||
EgtSetInfo( nPartId, WIN_PRC_OVERMAT_RIGHT, 0)
|
||||
|
||||
-- ricavo il tipo di profilo
|
||||
local nProfileType = GetOutlineProfileType( nOutlineId, bBottomRail)
|
||||
-- disegno ingombro
|
||||
@@ -1935,6 +1943,7 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
local nMainStripId = GetStripNearestToOutline( nMainProfileId, nPrevOutlineId)
|
||||
-- estrudo MainStrip
|
||||
local nMainStripExtrusionId = EgtSurfTmSwept( nSolidLayerId, nMainStripId, nGuideId, false, WIN_SURF_APPROX)
|
||||
EgtSetName( nMainStripExtrusionId, WIN_SRF_STRIP)
|
||||
|
||||
-- b) taglio con start
|
||||
-- recupero strip dello start piu' vicino ad outline
|
||||
@@ -1958,10 +1967,8 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
EgtInvertCurve( nStartStripProfileId)
|
||||
local nStartStripExtrusionId = EgtSurfTmSwept( nSolidLayerId, nStartStripProfileId, nStartStripGuideId, false, WIN_SURF_APPROX)
|
||||
|
||||
-- taglio con main
|
||||
local nStripExtrCopyId = EgtCopy( nMainStripExtrusionId, nSolidLayerId)
|
||||
EgtSurfTmCut( nMainStripExtrusionId, nStartStripExtrusionId, true, false)
|
||||
EgtSurfTmCut( nStartStripExtrusionId, nStripExtrCopyId, true, false)
|
||||
-- intersezione con main
|
||||
EgtSurfTmIntersect( nMainStripExtrusionId, nStartStripExtrusionId)
|
||||
|
||||
-- c) taglio con end
|
||||
-- recupero strip piu' vicino ad outline
|
||||
@@ -1974,7 +1981,7 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
local nEndStripGuideId = EgtLine( nSolidLayerId, ptStripMinEnd, ptStripMaxEnd)
|
||||
EgtExtendCurveStartByLen( nEndStripGuideId, 10)
|
||||
EgtExtendCurveEndByLen( nEndStripGuideId, 10)
|
||||
EgtInvertCurve(nEndStripGuideId)
|
||||
EgtInvertCurve( nEndStripGuideId)
|
||||
|
||||
-- estrudo Strip end
|
||||
local nEndProfileFrameId = EgtGetFirstNameInGroup( nEndProfileId, WIN_SECTIONFRAME)
|
||||
@@ -1985,11 +1992,14 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
EgtInvertCurve( nEndStripProfileId)
|
||||
local nEndStripExtrusionId = EgtSurfTmSwept( nSolidLayerId, nEndStripProfileId, nEndStripGuideId, false, WIN_SURF_APPROX)
|
||||
|
||||
-- taglio con main
|
||||
EgtSurfTmCut( nMainStripExtrusionId, nEndStripExtrusionId, true, false)
|
||||
EgtSurfTmCut( nEndStripExtrusionId, nStripExtrCopyId, true, false)
|
||||
-- intersezione con main
|
||||
EgtSurfTmIntersect( nMainStripExtrusionId, nEndStripExtrusionId)
|
||||
|
||||
-- cancello curve e superfici di costruzione
|
||||
EgtErase( { nMainStripMinOffsetId, nMainStripMaxOffsetId})
|
||||
EgtErase( { nStartStripMinOffsetId, nStartStripMaxOffsetId, nStartStripGuideId, nStartStripProfileId, nStartStripExtrusionId})
|
||||
EgtErase( { nEndStripMinOffsetId, nEndStripMaxOffsetId, nEndStripGuideId, nEndStripProfileId, nEndStripExtrusionId})
|
||||
|
||||
EgtErase( nStripExtrCopyId)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -2152,7 +2162,61 @@ function WinCalculate.AssembleFrame()
|
||||
--EgtChangeGroupFrame( nRightPartId, frRight)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che prepara il progetto per passarlo all'automatismo delle lavorazioni
|
||||
function WinCalculate.PrepareProject()
|
||||
|
||||
-- elimino il gruppo dei profili
|
||||
local nProfileLay = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
|
||||
EgtErase( nProfileLay)
|
||||
-- elimino il gruppo delle aree
|
||||
local nAreaLay = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREA .. '*')
|
||||
EgtErase( nAreaLay)
|
||||
-- elimino i pezzi di tipo fill
|
||||
local vFills = EgtGetNameInGroup( GDB_ID.ROOT, WIN_FILL)
|
||||
EgtErase( vFills)
|
||||
|
||||
-- in ogni pezzo
|
||||
local nPartId = EgtGetFirstInGroup( GDB_ID.ROOT)
|
||||
while nPartId do
|
||||
|
||||
-- cancello il gruppo dei profili
|
||||
local nProfileGrp = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE)
|
||||
EgtErase( nProfileGrp)
|
||||
|
||||
-- accendo gruppo delle lavorazioni
|
||||
local nProcLay = EgtGetFirstNameInGroup( nPartId, WIN_PRC)
|
||||
EgtSetStatus( nProcLay, GDB_ST.ON)
|
||||
|
||||
-- nel gruppo dei solidi conservo solo quello principale
|
||||
local nSolidGrp = EgtGetFirstNameInGroup( nPartId, WIN_SOLID)
|
||||
if nSolidGrp then
|
||||
local nMainSolid = EgtGetFirstNameInGroup( nSolidGrp, WIN_SRF_MAIN)
|
||||
local vIds = EgtGetAllInGroup( nSolidGrp)
|
||||
for i = 1, #vIds do
|
||||
if vIds[i] ~= nMainSolid then
|
||||
EgtErase( vIds[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- nel gruppo geo creo frame ausiliario
|
||||
local nGeoLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
|
||||
local nOutCrv = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_OUT)
|
||||
local vtS = EgtSV( nOutCrv)
|
||||
local frGeo = Frame3d( EgtSP( nOutCrv), vtS, Z_AX() ^ vtS, Z_AX())
|
||||
local nFrameId = EgtFrame( nGeoLayerId, frGeo)
|
||||
EgtSetName( nFrameId, WIN_PRC_FRAME)
|
||||
|
||||
-- passo al pezzo successivo
|
||||
nPartId = EgtGetNext( nPartId)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
------------------------ FERRAMENTA ---------------------------------
|
||||
---------------------------------------------------------------------
|
||||
local function SearchSash( nAreaId, SashList)
|
||||
-- verifico il tipo
|
||||
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
|
||||
|
||||
@@ -70,6 +70,9 @@ WinCalculate.SetCalcSolid( true)
|
||||
local nFrameId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREAASTERISK)
|
||||
WinCalculate.CreatePartFromArea( nFrameId)
|
||||
|
||||
-- preparo per automatismo lavorazioni
|
||||
-- WinCalculate.PrepareProject()
|
||||
|
||||
-- elimino profilo se in batch per test
|
||||
if WINDOW and WINDOW.TEST and WINDOW.TEST == 1 then
|
||||
local nProfileGroupId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
|
||||
|
||||
Reference in New Issue
Block a user