Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62aa67f46d | |||
| 8a8c5c6663 | |||
| 90e5e940c1 | |||
| 95cb76ff79 | |||
| 07fc10ddd6 | |||
| 28936ed686 | |||
| b00898728e | |||
| cbb285ece5 | |||
| d32e22993e | |||
| 22c66c9cfd | |||
| aeeaac3326 | |||
| c52a6ce2ae | |||
| 4fa9e9fce4 | |||
| 9a36037b4c | |||
| ece4972c28 | |||
| 1a5edcc34b | |||
| e4f54c9f19 | |||
| 9c94096fbd | |||
| 2095d0accf | |||
| 967519492c | |||
| f42a64eea8 | |||
| 5dd44069bc | |||
| 4546497a1e | |||
| 70c0991470 | |||
| 695422f484 | |||
| 44a93e8d8a | |||
| a72a2d9069 | |||
| f20a10fde6 | |||
| f6beff942c | |||
| 7fd27d867d | |||
| 28e38b0441 | |||
| 93e1a56e29 | |||
| 66869aa0d8 | |||
| 4a9bca5843 | |||
| fb87f53b7c | |||
| cc3ac6e186 | |||
| c988d0004a | |||
| cc8bc8fb8d | |||
| c807df355c | |||
| a47204dc6f | |||
| 1c00c1224b | |||
| 2209ad2415 | |||
| 51ac46ca73 | |||
| 7f9e7621f5 | |||
| 7d571bff39 | |||
| 9d493812d9 | |||
| d2cb941412 | |||
| e48dbe7268 | |||
| 60a258353c | |||
| 9a6bde56da | |||
| e6f7ffa94f | |||
| 90ffd17785 | |||
| 7e763c4f86 | |||
| 5912724a06 | |||
| ef71f77f99 | |||
| dbd9e4ac01 | |||
| 536c969471 | |||
| c831af6899 | |||
| 6c684e3068 | |||
| 05b8da0317 | |||
| 009f99f579 | |||
| 48c26500a4 | |||
| 92ef41dd6f | |||
| 701c8d77e5 | |||
| 1d6c02c9ae | |||
| d7390bfa44 | |||
| 17f97c21f2 | |||
| cb9bb33fa5 | |||
| 4c976f87cc |
Vendored
+37
-1
@@ -102,7 +102,43 @@
|
||||
"EgtOutLog",
|
||||
"EgtOutText",
|
||||
"EgtPause",
|
||||
"EgtRelocate"
|
||||
"EgtRelocate",
|
||||
"WDG",
|
||||
"EgtSplitString",
|
||||
"EgtFrame",
|
||||
"EgtReplaceString",
|
||||
"EgtCircle",
|
||||
"EgtArc2PV",
|
||||
"EgtTdbSetCurrTool",
|
||||
"EgtSurfTmSubtract",
|
||||
"EgtSurfTmIntersect",
|
||||
"GDB_IN",
|
||||
"GEO",
|
||||
"dist",
|
||||
"EgtSetMachiningParam",
|
||||
"EgtCreateMachining",
|
||||
"EgtSetMachiningGeometry",
|
||||
"EgtGetMachiningParam",
|
||||
"EgtGetLastMachMgrError",
|
||||
"EgtSetOperationMode",
|
||||
"EgtApplyMachining",
|
||||
"EgtSetCurrPhase",
|
||||
"EgtApplyAllMachinings",
|
||||
"EgtGetDebugLevel",
|
||||
"EgtTdbGetCurrToolParam",
|
||||
"EgtTdbGetCurrToolThDiam",
|
||||
"EgtTdbGetCurrToolMaxDepth",
|
||||
"EgtTdbGetCurrToolThLength",
|
||||
"EgtFindToolInCurrSetup",
|
||||
"EgtTdbGetFirstTool",
|
||||
"EgtTdbGetNextTool",
|
||||
"EgtMdbSave",
|
||||
"EgtMoveRawPart",
|
||||
"EgtCurveThickness",
|
||||
"EgtSetCurrMachining",
|
||||
"EgtCAvSetStdTool",
|
||||
"EgtCAvToolPosStm",
|
||||
"EgtCAvToolPosBox"
|
||||
],
|
||||
"Lua.diagnostics.disable": [
|
||||
"empty-block"
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
-- FeatureData.lua by Egalware s.r.l. 2024/06/18
|
||||
-- Libreria lettura o calcolo dati e proprietà della feature
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FeatureData = {}
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati foro
|
||||
function FeatureData.GetDrillingData( Proc)
|
||||
local bOk, ptCentre, vtDir, dRadius = EgtCurveIsACircle( Proc.id)
|
||||
|
||||
vtDir = EgtCurveExtrusion( Proc.id)
|
||||
local Frame = EgtGetGlobFrame( Proc.id)
|
||||
-- trasformo punti e vettori in globale
|
||||
ptCentre:toGlob( Frame)
|
||||
vtDir:toGlob( Frame)
|
||||
|
||||
Proc.dDiameter = dRadius * 2
|
||||
Proc.dLength = abs( EgtCurveThickness( Proc.id)) or 0
|
||||
Proc.ptCentre = ptCentre
|
||||
Proc.vtDir = vtDir
|
||||
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or nil
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati taglio
|
||||
function FeatureData.GetCuttingData( Proc)
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati svuotatura
|
||||
function FeatureData.GetPocketingData( Proc)
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati per fresatura
|
||||
function FeatureData.GetMillingData( Proc)
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Recupero dati profilatura
|
||||
function FeatureData.GetProfilingData( Proc)
|
||||
-- recupero utensili
|
||||
Proc.nToolsToUse = EgtGetInfo( Proc.id, 'NTOOLS', 'i') or 0
|
||||
Proc.sEntityName = EgtGetInfo( Proc.id, 'N', 's') or nil
|
||||
Proc.Tools = {}
|
||||
for t = 1, Proc.nToolsToUse do
|
||||
local Data = {}
|
||||
Data.sName = EgtGetInfo( Proc.id, 'TOOL_NAME_' .. tostring(t), 's') or 0
|
||||
Data.dRadialOffset = EgtGetInfo( Proc.id, 'OFFR_' .. tostring(t), 'd') or 0
|
||||
Data.dLongitudinalOffset = EgtGetInfo( Proc.id, 'OFFL_' .. tostring(t), 'd') or 0
|
||||
table.insert( Proc.Tools, Data)
|
||||
end
|
||||
|
||||
Proc.sProfileInfo = EgtGetInfo( Proc.id, 'PROFILE_INFO', 's') or nil
|
||||
|
||||
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or ''
|
||||
Proc.bHeadProfile = Proc.sReferenceSide == 'Head' or Proc.sEntityName == 'Left' or Proc.sEntityName == 'Right'
|
||||
Proc.bLongitudinalProfile = Proc.sReferenceSide == 'Longitudinal' or Proc.sEntityName == 'In' or Proc.sEntityName == 'Out'
|
||||
|
||||
return Proc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
return FeatureData
|
||||
@@ -0,0 +1,41 @@
|
||||
-- Identity.lua by Egalware s.r.l. 2024/06/18
|
||||
-- Libreria Riconoscimento della feature
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Identity = {}
|
||||
|
||||
---------------------------------------------------------------------
|
||||
------------------------ STANDARD FEATURES ------------------------
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Drilling
|
||||
function Identity.IsDrilling( Proc)
|
||||
return Proc.sType == 'Hole'
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cutting
|
||||
function Identity.IsCutting( Proc)
|
||||
return Proc.sType == 'Cut'
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Milling
|
||||
function Identity.IsMilling( Proc)
|
||||
return Proc.sType == 'Milling'
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Pocketing
|
||||
function Identity.IsPocketing( Proc)
|
||||
return Proc.sType == 'Pocket'
|
||||
end
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Profiling
|
||||
function Identity.IsProfiling( Proc)
|
||||
return Proc.sType == 'Profiling'
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
----------------------------- PIECES ------------------------------
|
||||
---------------------------------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return Identity
|
||||
@@ -0,0 +1,440 @@
|
||||
-- MachiningLib.lua by Egalware s.r.l. 2024/06/17
|
||||
-- Libreria ricerca lavorazioni per serramenti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local MachiningLib = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
local ID = require( 'Identity')
|
||||
|
||||
EgtOutLog( ' MachiningLib started', 1)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per cercare utensile tipo FRESA con certe caratteristiche
|
||||
function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
local ToolInfo = {}
|
||||
|
||||
local nBestToolIndex
|
||||
local dBestToolResidualDepth = 0
|
||||
for i = 1, #TOOLS do
|
||||
-- prima verifico che utensile sia compatibile
|
||||
local bIsToolCompatible = true
|
||||
if ToolSearchParameters.sName and ToolSearchParameters.sName ~= TOOLS[i].sName then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.dMaxToolDiameter and TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'STANDARD' and ( TOOLS[i].dSideAngle ~= 0 or TOOLS[i].bIsPen) then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'DOVETAIL' and not TOOLS[i].bIsDoveTail then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'TSHAPEMILL' and not TOOLS[i].bIsTMill then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.sMillShape and ToolSearchParameters.sMillShape == 'PEN' and not TOOLS[i].bIsPen then
|
||||
bIsToolCompatible = false
|
||||
elseif ToolSearchParameters.sType and TOOLS[i].sType ~= ToolSearchParameters.sType then
|
||||
-- se sto cercando una fresa che non può lavorare di testa, quelle che lavorano di testa sono comunque ammesse
|
||||
if TOOLS[i].sType == 'MILL_STD' and ToolSearchParameters.sType == 'MILL_NOTIP' then
|
||||
bIsToolCompatible = true
|
||||
else
|
||||
bIsToolCompatible = false
|
||||
end
|
||||
end
|
||||
|
||||
-- scelgo il migliore
|
||||
if bIsToolCompatible then
|
||||
local dCurrentMaxMatReduction = WinData.COLL_SIC or 5
|
||||
|
||||
-- dCurrMachReduction = negativo -> limitare, positivo -> mm extra disponibili
|
||||
local dCurrentResidualDepth = ToolSearchParameters.dElevation + dCurrentMaxMatReduction - TOOLS[i].dMaxDepth
|
||||
|
||||
-- se non ancora trovato, oppure se completo e il migliore fino ad ora non è completo: corrente è il migliore
|
||||
if not nBestToolIndex or ( dBestToolResidualDepth > 0 and dCurrentResidualDepth <= 0) then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
-- altrimenti scelgo il migliore
|
||||
else
|
||||
-- se entrambi completi
|
||||
if dBestToolResidualDepth <= 0 and dCurrentResidualDepth <= 0 then
|
||||
-- se il migliore era su aggregato e corrente montanto direttamente, prediligo utensile montato direttamente
|
||||
if not TOOLS[i].SetupInfo.bToolOnAggregate and TOOLS[i].SetupInfo.bToolOnAggregate then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
-- se hanno stesso montaggio
|
||||
elseif TOOLS[i].SetupInfo.bToolOnAggregate == TOOLS[nBestToolIndex].SetupInfo.bToolOnAggregate then
|
||||
-- scelgo utensile con indice di bontà utensile calcolato come: lunghezza / massimo materiale / diametro
|
||||
if ( TOOLS[i].dLength / TOOLS[i].dMaxMaterial) / TOOLS[i].dDiameter < ( TOOLS[nBestToolIndex].dLength / TOOLS[nBestToolIndex].dMaxMaterial) / TOOLS[nBestToolIndex].dDiameter then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
end
|
||||
-- se entrambi incompleti
|
||||
elseif dBestToolResidualDepth > 0 and dCurrentResidualDepth > 0 then
|
||||
--scelgo quello che lavora di più
|
||||
if dCurrentResidualDepth < dBestToolResidualDepth then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
ToolInfo.dResidualDepth = dBestToolResidualDepth
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
|
||||
-- TODO da completare
|
||||
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
local ToolInfo = {}
|
||||
|
||||
-- parametri opzionali
|
||||
ToolSearchParameters.dElevation = ToolSearchParameters.dElevation or 0
|
||||
ToolSearchParameters.bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
||||
|
||||
local nBestToolIndex
|
||||
for i = 1, #TOOLS do
|
||||
local bIsToolCompatible = false
|
||||
|
||||
-- TODO per il momento si prende la prima lama. Da completare
|
||||
if TOOLS[i].sFamily == 'SAWBLADE' then
|
||||
bIsToolCompatible = true
|
||||
end
|
||||
|
||||
if bIsToolCompatible then
|
||||
nBestToolIndex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per cercare utensile tipo PUNTA A FORARE con certe caratteristiche
|
||||
-- TODO da fare
|
||||
function MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
local ToolInfo = {}
|
||||
|
||||
if not ToolSearchParameters.dTolerance then
|
||||
ToolSearchParameters.dTolerance = 0
|
||||
end
|
||||
|
||||
local nBestToolIndex
|
||||
for i = 1, #TOOLS do
|
||||
local bIsToolCompatible = false
|
||||
|
||||
-- TODO per il momento si cercano solo le punte. Bisognerebbe valutare anche frese che possono lavorare di testa
|
||||
if TOOLS[i].sFamily == 'DRILLBIT' then
|
||||
bIsToolCompatible = true
|
||||
end
|
||||
if bIsToolCompatible then
|
||||
--TODO per il momento si prende il primo utensile con lo stesso diametro, senza considerare altri parametri tipo lunghezza ecc...
|
||||
if abs( TOOLS[i].dDiameter - ToolSearchParameters.dDiameter) < ToolSearchParameters.dTolerance + GEO.EPS_SMALL * 10 then
|
||||
if not nBestToolIndex then
|
||||
nBestToolIndex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione che ritorna fase di lavoro
|
||||
function MachiningLib.GetPhaseMach( Proc)
|
||||
local nPhase
|
||||
-- se info già calcolata
|
||||
if Proc.nPhase and Proc.nPhase ~= 0 then
|
||||
nPhase = Proc.nPhase
|
||||
-- altrimenti si calcola il comportamento standard
|
||||
else
|
||||
-- se macchina tipo LINEA
|
||||
if WinData.MACH_TYPE == 'LINE' then
|
||||
if Proc.AffectedFaces.bTop then
|
||||
nPhase = 1
|
||||
end
|
||||
if Proc.AffectedFaces.bFront or Proc.AffectedFaces.bLeft then
|
||||
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 1, 2)
|
||||
end
|
||||
if Proc.AffectedFaces.bBack or Proc.AffectedFaces.bRight then
|
||||
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 2, 1)
|
||||
end
|
||||
-- se macchina tipo PANTOGRAFO
|
||||
else
|
||||
if Proc.AffectedFaces.bTop or Proc.AffectedFaces.bLeft or Proc.AffectedFaces.bRight then
|
||||
nPhase = 1
|
||||
end
|
||||
if Proc.AffectedFaces.bFront then
|
||||
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 1, 2)
|
||||
end
|
||||
if Proc.AffectedFaces.bBack then
|
||||
nPhase = EgtIf( WinData.FIRST_PHASE_LOAD == 'PUSH', 2, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
return nPhase
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione che ritorna la distanza di sicurezza da aggiungere alla lavorazione di foratura per evitare colisioni in rapido
|
||||
function MachiningLib.GetDrillAdditionalSafeDistanceToRaw( Proc, Part, Machining)
|
||||
-- se non è foro esco subito
|
||||
if Proc.sType ~= 'Hole' then
|
||||
return 0
|
||||
end
|
||||
local bVirtualToolOk = EgtCAvSetStdTool( TOOLS[Machining.nToolIndex].dLength, TOOLS[Machining.nToolIndex].dDiameter, 0)
|
||||
local dStartSafetyLength = EgtCAvToolPosBox( Proc.ptCentre, Proc.vtDir, Part.b3RawPart, Proc.vtDir)
|
||||
-- si riporta valore calcolato sulla punta utensile
|
||||
dStartSafetyLength = dStartSafetyLength - TOOLS[Machining.nToolIndex].dLength
|
||||
return dStartSafetyLength + 5 -- si aggiungono 5mm di sicurezza extra
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- salva in lista globale la lavorazione appena calcolata
|
||||
function MachiningLib.AddNewMachining( ProcToAdd, MachiningToAdd, AuxiliaryDataToAdd)
|
||||
-- Controllo parametri obbligatori
|
||||
if not MachiningToAdd.nType or not MachiningToAdd.nToolIndex or not MachiningToAdd.Geometry or not ProcToAdd.id then
|
||||
return false
|
||||
end
|
||||
|
||||
-- Drilling
|
||||
if MachiningToAdd.nType == MCH_MY.DRILLING then
|
||||
MachiningToAdd.sTypeName = 'Drill_'
|
||||
-- Milling
|
||||
elseif MachiningToAdd.nType == MCH_MY.MILLING then
|
||||
-- se utensile lama
|
||||
if TOOLS[MachiningToAdd.nToolIndex].sFamily == 'SAWBLADE' then
|
||||
MachiningToAdd.sTypeName = 'Cut_'
|
||||
else
|
||||
MachiningToAdd.sTypeName = 'Mill_'
|
||||
end
|
||||
-- Pocketing
|
||||
elseif MachiningToAdd.nType == MCH_MY.POCKETING then
|
||||
MachiningToAdd.sTypeName = 'Pocket_'
|
||||
-- Mortising
|
||||
elseif MachiningToAdd.nType == MCH_MY.MORTISING then
|
||||
MachiningToAdd.sTypeName = 'ChSaw_'
|
||||
end
|
||||
-- se nome non definito, assegno alla lavorazioen un nome standard
|
||||
if not MachiningToAdd.sOperationName then
|
||||
MachiningToAdd.sOperationName = MachiningToAdd.sTypeName .. ( EgtGetName( ProcToAdd.id) or tostring( ProcToAdd.id)) -- TODO serve scrivere faccia? -->> .. '_' .. tostring( MachiningToAdd.Geometry[1][2])
|
||||
end
|
||||
if not MachiningToAdd.sToolName then
|
||||
MachiningToAdd.sToolName = TOOLS[MachiningToAdd.nToolIndex].sName
|
||||
end
|
||||
local Machining = {}
|
||||
Machining.Proc = ProcToAdd
|
||||
Machining.Machining = MachiningToAdd
|
||||
Machining.AuxiliaryData = AuxiliaryDataToAdd
|
||||
table.insert( MACHININGS, Machining)
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per aggiungere una nuova lavorazione
|
||||
function MachiningLib.AddOperation( OperationToInsert)
|
||||
local nErr
|
||||
local sErr = ''
|
||||
local bAreAllMachiningApplyOk = true
|
||||
|
||||
-- parametri generali lavorazione
|
||||
local MachiningParameters = {
|
||||
{ sName = 'sDepth', nMchParam = MCH_MP.DEPTH_STR},
|
||||
{ sName = 'bInvert', nMchParam = MCH_MP.INVERT},
|
||||
{ sName = 'nWorkside', nMchParam = MCH_MP.WORKSIDE},
|
||||
{ sName = 'nFaceuse', nMchParam = MCH_MP.FACEUSE},
|
||||
{ sName = 'nSCC', nMchParam = MCH_MP.SCC},
|
||||
{ sName = 'bToolInvert', nMchParam = MCH_MP.TOOLINVERT},
|
||||
{ sName = 'sBlockedAxis', nMchParam = MCH_MP.BLOCKEDAXIS},
|
||||
{ sName = 'sInitialAngles', nMchParam = MCH_MP.INITANGS},
|
||||
{ sName = 'nHeadSide', nMchParam = MCH_MP.HEADSIDE},
|
||||
{ sName = 'nSubType', nMchParam = MCH_MP.SUBTYPE},
|
||||
{ sName = 'dOverlap', nMchParam = MCH_MP.OVERL},
|
||||
{ sName = 'nStepType', nMchParam = MCH_MP.STEPTYPE},
|
||||
{ sName = 'dStartSafetyLength', nMchParam = MCH_MP.STARTPOS},
|
||||
{ sName = 'dReturnPos', nMchParam = MCH_MP.RETURNPOS},
|
||||
{ sName = 'dRadialOffset', nMchParam = MCH_MP.OFFSR},
|
||||
{ sName = 'dLongitudinalOffset', nMchParam = MCH_MP.OFFSL},
|
||||
{ sName = 'dStartSlowLen', nMchParam = MCH_MP.STARTSLOWLEN},
|
||||
{ sName = 'dEndSlowLen', nMchParam = MCH_MP.ENDSLOWLEN},
|
||||
{ sName = 'dThrouAddLen', nMchParam = MCH_MP.THROUADDLEN},
|
||||
{ sName = 'sSystemNotes', nMchParam = MCH_MP.SYSNOTES},
|
||||
{ sName = 'sUserNotes', nMchParam = MCH_MP.USERNOTES}
|
||||
}
|
||||
|
||||
-- parametri relativi allo step
|
||||
MachiningParameters.Steps = {
|
||||
{ sName = 'nStepType', nMchParam = MCH_MP.STEPTYPE},
|
||||
{ sName = 'dStep', nMchParam = MCH_MP.STEP},
|
||||
{ sName = 'dSideStep', nMchParam = MCH_MP.SIDESTEP}
|
||||
}
|
||||
|
||||
-- parametri relativi all'approccio
|
||||
MachiningParameters.LeadIn = {
|
||||
{ sName = 'nType', nMchParam = MCH_MP.LEADINTYPE},
|
||||
{ sName = 'dStartAddLength', nMchParam = MCH_MP.STARTADDLEN},
|
||||
{ sName = 'dTangentDistance', nMchParam = MCH_MP.LITANG},
|
||||
{ sName = 'dPerpDistance', nMchParam = MCH_MP.LIPERP},
|
||||
{ sName = 'dElevation', nMchParam = MCH_MP.LIELEV},
|
||||
{ sName = 'dCompLength', nMchParam = MCH_MP.LICOMPLEN}
|
||||
}
|
||||
|
||||
-- parametri relativi alla retrazione
|
||||
MachiningParameters.LeadOut = {
|
||||
{ sName = 'nType', nMchParam = MCH_MP.LEADOUTTYPE},
|
||||
{ sName = 'dEndAddLength', nMchParam = MCH_MP.ENDADDLEN},
|
||||
{ sName = 'dTangentDistance', nMchParam = MCH_MP.LOTANG},
|
||||
{ sName = 'dPerpDistance', nMchParam = MCH_MP.LOPERP},
|
||||
{ sName = 'dElevation', nMchParam = MCH_MP.LOELEV},
|
||||
{ sName = 'dCompLength', nMchParam = MCH_MP.LOCOMPLEN}
|
||||
}
|
||||
|
||||
-- parametri da scrivere nelle note utente
|
||||
local UserNotes = {
|
||||
{ sName = 'dMaxElev', sMchParam = 'MaxElev'}
|
||||
}
|
||||
|
||||
-- parametri da scrivere nelle note di sistema
|
||||
local SystemNotes = {
|
||||
}
|
||||
|
||||
local nClonesToAdd = 1
|
||||
if OperationToInsert.AuxiliaryData.Clones then
|
||||
nClonesToAdd = #OperationToInsert.AuxiliaryData.Clones
|
||||
end
|
||||
for j = 1, nClonesToAdd do
|
||||
-- creazione lavorazione
|
||||
local nOperationId = EgtCreateMachining( OperationToInsert.Machining.sOperationName, OperationToInsert.Machining.nType, OperationToInsert.Machining.sToolName)
|
||||
|
||||
if nOperationId then
|
||||
-- impostazione geometria
|
||||
EgtSetMachiningGeometry( OperationToInsert.Machining.Geometry)
|
||||
|
||||
-- impostazione parametri lavorazione
|
||||
-- TODO scrivere sempre Steps, LeadIn, LeadOut nelle tabelle in modo da non dover controllare ogni volta che ci siano
|
||||
for k = 1, #MachiningParameters do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][MachiningParameters[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j][MachiningParameters[k].sName]
|
||||
elseif OperationToInsert.Machining[MachiningParameters[k].sName] then
|
||||
sValue = OperationToInsert.Machining[MachiningParameters[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
EgtSetMachiningParam( MachiningParameters[k].nMchParam, sValue)
|
||||
end
|
||||
end
|
||||
for k = 1, #MachiningParameters.Steps do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].Steps and OperationToInsert.AuxiliaryData.Clones[j].Steps[MachiningParameters.Steps[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j].Steps[MachiningParameters.Steps[k].sName]
|
||||
elseif OperationToInsert.Machining.Steps and OperationToInsert.Machining.Steps[MachiningParameters.Steps[k].sName] then
|
||||
sValue = OperationToInsert.Machining.Steps[MachiningParameters.Steps[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
EgtSetMachiningParam( MachiningParameters.Steps[k].nMchParam, sValue)
|
||||
end
|
||||
end
|
||||
for k = 1, #MachiningParameters.LeadIn do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].LeadIn and OperationToInsert.AuxiliaryData.Clones[j].LeadIn[MachiningParameters.LeadIn[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j].LeadIn[MachiningParameters.LeadIn[k].sName]
|
||||
elseif OperationToInsert.Machining.LeadIn and OperationToInsert.Machining.LeadIn[MachiningParameters.LeadIn[k].sName] then
|
||||
sValue = OperationToInsert.Machining.LeadIn[MachiningParameters.LeadIn[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
EgtSetMachiningParam( MachiningParameters.LeadIn[k].nMchParam, sValue)
|
||||
end
|
||||
end
|
||||
for k = 1, #MachiningParameters.LeadOut do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j].LeadOut and OperationToInsert.AuxiliaryData.Clones[j].LeadOut[MachiningParameters.LeadOut[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j].LeadOut[MachiningParameters.LeadOut[k].sName]
|
||||
elseif OperationToInsert.Machining.LeadOut and OperationToInsert.Machining.LeadOut[MachiningParameters.LeadOut[k].sName] then
|
||||
sValue = OperationToInsert.Machining.LeadOut[MachiningParameters.LeadOut[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
EgtSetMachiningParam( MachiningParameters.LeadOut[k].nMchParam, sValue)
|
||||
end
|
||||
end
|
||||
for k = 1, #UserNotes do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][UserNotes[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j][UserNotes[k].sName]
|
||||
elseif OperationToInsert.Machining[UserNotes[k].sName] then
|
||||
sValue = OperationToInsert.Machining[UserNotes[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, UserNotes[k].sMchParam, sValue)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
end
|
||||
end
|
||||
-- parametri da settare nelle note di sistema
|
||||
-- TODO da decidere quali sono le note da salvare qui. Probabilmente tutte quelle relative all'ordine delle lavorazioni
|
||||
--if OperationToInsert.Machining.nMachiningOrder then
|
||||
-- sSystemNotes = EgtSetValInNotes( sSystemNotes, 'MachiningOrder', OperationToInsert.Machining.nMachiningOrder)
|
||||
--end
|
||||
for k = 1, #SystemNotes do
|
||||
local sValue
|
||||
if OperationToInsert.AuxiliaryData.Clones and OperationToInsert.AuxiliaryData.Clones[j][SystemNotes[k].sName] then
|
||||
sValue = OperationToInsert.AuxiliaryData.Clones[j][SystemNotes[k].sName]
|
||||
elseif OperationToInsert.Machining[SystemNotes[k].sName] then
|
||||
sValue = OperationToInsert.Machining[SystemNotes[k].sName]
|
||||
end
|
||||
if sValue then
|
||||
local sSystemNotes = ''
|
||||
sSystemNotes = EgtSetValInNotes( sSystemNotes, SystemNotes[k].sMchParam, sValue)
|
||||
EgtSetMachiningParam( MCH_MP.SYSNOTES, sSystemNotes)
|
||||
end
|
||||
end
|
||||
|
||||
local b3MachEncumbrance = nil
|
||||
local bIsApplyOk = MachiningLib.ApplyMachining( true, false)
|
||||
if not bIsApplyOk then
|
||||
bAreAllMachiningApplyOk = false
|
||||
nErr, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nOperationId, false)
|
||||
else
|
||||
local nClId = EgtGetFirstNameInGroup( nOperationId, 'CL')
|
||||
local ptMin = EgtGetInfo( nClId, 'MMIN', 'p')
|
||||
local ptMax = EgtGetInfo( nClId, 'MMAX', 'p')
|
||||
-- box percorso lavorazione
|
||||
if ptMin and ptMax then
|
||||
local dToolRadius = TOOLS[OperationToInsert.Machining.nToolIndex].dTotDiameter / 2
|
||||
if dToolRadius then
|
||||
ptMin = ptMin - Vector3d( dToolRadius, 0, 0)
|
||||
ptMax = ptMax + Vector3d( dToolRadius, 0, 0)
|
||||
end
|
||||
end
|
||||
b3MachEncumbrance = BBox3d( ptMin, ptMax)
|
||||
end
|
||||
|
||||
return bIsApplyOk, sErr, b3MachEncumbrance
|
||||
else
|
||||
return false, 'UNEXPECTED ERROR: Error on creating machining'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.ApplyMachining( bRecalc, bApplyPost)
|
||||
local bResult = EgtApplyMachining( bRecalc, bApplyPost)
|
||||
return bResult
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return MachiningLib
|
||||
@@ -0,0 +1,34 @@
|
||||
-- WinConst.lua libreria di costanti EgalWare per progetto serramenti 2024/10/07
|
||||
|
||||
-- Tavola per definizione modulo (serve ma non usata)
|
||||
local WinConst = {}
|
||||
|
||||
EgtOutLog( 'WinConst started', 1)
|
||||
|
||||
-- Funzione per rendere non modificabili le costanti
|
||||
local protect = function(tbl)
|
||||
return setmetatable({}, {
|
||||
__index = tbl,
|
||||
__newindex = function(t, key, value)
|
||||
error("attempting to change constant " ..
|
||||
tbl[1]..tostring(key) .. " to " .. tostring(value), 2)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-- Costanti fasi di lavorazione
|
||||
MACH_GROUP = {
|
||||
'MACH_GROUP.',
|
||||
HEAD_CUT = 1,
|
||||
FEATURE_BEFORE_PROFILE = 2,
|
||||
HEAD_PROFILE = 3,
|
||||
LONG_PROFILE = 4,
|
||||
MIXED_PROFILE = 5,
|
||||
FEATURE_AFTER_PROFILE = 6,
|
||||
STRIPCUT = 7,
|
||||
PAUSE = 8,
|
||||
MACH_AFTER_PAUSE = 9
|
||||
}
|
||||
MACH_GROUP = protect( MACH_GROUP)
|
||||
|
||||
return WinConst
|
||||
@@ -0,0 +1,557 @@
|
||||
-- WinExec.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WinExec = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
local WinLib = require( 'WinLib')
|
||||
local ID = require( 'Identity')
|
||||
local FeatureData = require( 'FeatureData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
|
||||
-- carico librerie di lavorazione
|
||||
_G.package.loaded.Drilling = nil
|
||||
_G.package.loaded.Cutting = nil
|
||||
_G.package.loaded.Pocketing = nil
|
||||
_G.package.loaded.Milling = nil
|
||||
_G.package.loaded.Profiling = nil
|
||||
local Drilling = require( 'Drilling')
|
||||
local Cutting = require( 'Cutting')
|
||||
local Pocketing = require( 'Pocketing')
|
||||
local Milling = require( 'Milling')
|
||||
local Profiling = require( 'Profiling')
|
||||
|
||||
|
||||
EgtOutLog( ' WinExec started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** variabili globali ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
TOOLS = nil
|
||||
MACHININGS = nil
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** COSTANTI *** TODO -> DA SPOSTARE IN WINDATA???
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
TH_DIAMETER_HSK63 = 63
|
||||
TH_LENGTH_HSK63 = 75
|
||||
SIDEANGLE_DOVETAIL = 15
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** funzioni di base ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetToolTypeNameFromToolTypeID( dToolTypeID)
|
||||
if dToolTypeID == MCH_TY.DRILL_STD then
|
||||
return 'DRILL_STD', 'DRILLBIT'
|
||||
elseif dToolTypeID == MCH_TY.DRILL_LONG then
|
||||
return 'DRILL_LONG', 'DRILLBIT'
|
||||
elseif dToolTypeID == MCH_TY.SAW_STD then
|
||||
return 'SAW_STD', 'SAWBLADE'
|
||||
elseif dToolTypeID == MCH_TY.SAW_FLAT then
|
||||
return 'SAW_FLAT', 'SAWBLADE'
|
||||
elseif dToolTypeID == MCH_TY.MILL_STD then
|
||||
return 'MILL_STD', 'MILL'
|
||||
elseif dToolTypeID == MCH_TY.MILL_NOTIP then
|
||||
return 'MILL_NOTIP', 'MILL'
|
||||
elseif dToolTypeID == MCH_TY.MORTISE_STD then
|
||||
return 'MORTISE_STD', 'MORTISE'
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function IsToolOk( Tool)
|
||||
-- controllo che i dati necessari siano impostati
|
||||
if Tool.dMaxMaterial and Tool.dDiameter and Tool.dLength and Tool.sHead and Tool.sUUID then
|
||||
-- se DRILLBIT non ho altri dati
|
||||
if Tool.sFamily == 'DRILLBIT' then
|
||||
return true
|
||||
-- altrimenti controllo dati aggiuntivi altre famiglie di utensili
|
||||
elseif Tool.sFamily == 'MORTISE' then
|
||||
if Tool.dCornerRadius then
|
||||
return true
|
||||
end
|
||||
else
|
||||
if Tool.dThickness then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinExec.GetToolsFromDB()
|
||||
|
||||
-- TODO gli utensili profilati devono essere messi in una lista a parte ad accesso diretto TOOLS['Prof1'] in modo da non dover scorrere la lista
|
||||
-- dato che saranno molti e l'applicazione sarà diretta. Non serve ciclarli
|
||||
|
||||
|
||||
-- creo lista globale utensili disponibili
|
||||
TOOLS = {}
|
||||
-- lista appoggio utensile
|
||||
local Tool = {}
|
||||
|
||||
-- recupero tutti gli utensili : punte a forare, lame, frese e motoseghe
|
||||
Tool.sName = EgtTdbGetFirstTool( MCH_TF.DRILLBIT + MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
while Tool.sName ~= '' do
|
||||
-- imposto utensile come corrente per recuperarne i dati
|
||||
EgtTdbSetCurrTool( Tool.sName)
|
||||
|
||||
-- verifico se utensile disponibile in attrezzaggio attuale e che abbia un tipo ben definito
|
||||
local bToolLoadedOnSetup, sToolTCPos = EgtFindToolInCurrSetup( Tool.sName)
|
||||
local nToolTypeId = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
local sToolType, sToolFamily = GetToolTypeNameFromToolTypeID( nToolTypeId)
|
||||
|
||||
-- se verifica condizioni minime, recupero tutti gli altri dati
|
||||
if bToolLoadedOnSetup and sToolType then
|
||||
Tool.sTcPos = sToolTCPos
|
||||
Tool.sFamily = sToolFamily
|
||||
Tool.sType = sToolType
|
||||
Tool.nTypeId = nToolTypeId
|
||||
Tool.dMaxMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
Tool.dDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
Tool.dTotDiameter = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
|
||||
Tool.dLength = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
Tool.dSpeed = EgtTdbGetCurrToolParam( MCH_TP.SPEED)
|
||||
Tool.bIsCCW = Tool.dSpeed < 0
|
||||
Tool.Feeds = {}
|
||||
Tool.Feeds.dFeed = EgtTdbGetCurrToolParam( MCH_TP.FEED)
|
||||
Tool.Feeds.dStartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED)
|
||||
Tool.Feeds.dEndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED)
|
||||
Tool.Feeds.dTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
Tool.sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
Tool.SetupInfo = {}
|
||||
Tool.SetupInfo = WinData.GetSetupInfo( {sHead = Tool.sHead, sTcPos = Tool.sTcPos})
|
||||
Tool.sUUID = EgtTdbGetCurrToolParam( MCH_TP.UUID)
|
||||
Tool.sUserNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
|
||||
Tool.dMaxDepth = EgtTdbGetCurrToolMaxDepth() or Tool.dMaxMaterial
|
||||
Tool.ToolHolder = {}
|
||||
Tool.ToolHolder.dDiameter = EgtTdbGetCurrToolThDiam() or TH_DIAMETER_HSK63 -- diametro standard HSK63
|
||||
Tool.ToolHolder.dLength = EgtTdbGetCurrToolThLength() or TH_LENGTH_HSK63 -- lunghezza standard HSK63
|
||||
-- parametri scritti nelle note
|
||||
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE')
|
||||
|
||||
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
|
||||
if sToolFamily ~= 'DRILLBIT' then
|
||||
Tool.dThickness = EgtTdbGetCurrToolParam( MCH_TP.THICK)
|
||||
Tool.dLongitudinalOffset = EgtTdbGetCurrToolParam( MCH_TP.LONOFFSET)
|
||||
Tool.dRadialOffset = EgtTdbGetCurrToolParam( MCH_TP.RADOFFSET)
|
||||
-- recupero parametri propri delle frese
|
||||
if sToolFamily == 'MILL' then
|
||||
Tool.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or Tool.ToolHolder.dDiameter -- se non settato, considero diametro come ToolHolder
|
||||
Tool.dSideAngle = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or 0
|
||||
-- verifico che parametri siano compatibili con una fresa a coda di rondine ( angolo di fianco standard Coda di rondine -> 15°)
|
||||
Tool.bIsDoveTail = Tool.Type == 'MILL_NOTIP' and abs( abs( Tool.dSideAngle) - SIDEANGLE_DOVETAIL) < 1
|
||||
-- verifico che sia una fresa tipo T-Mill o BlockHaus
|
||||
Tool.dSideDepth = EgtGetValInNotes( Tool.sUserNotes, 'SIDEDEPTH') or 0 -- se non settato nell'utensile, dico che non ha massimo affondamento laterale
|
||||
Tool.bIsTMill = Tool.dSideDepth > 0
|
||||
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or ( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero metà del tagliente
|
||||
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or floor( Tool.dDiameter / 3) -- se non settato nell'utensile, considero metà del diametro
|
||||
Tool.bIsPen = abs( Tool.dSpeed) < 5
|
||||
-- recupero parametri propri delle lame
|
||||
elseif sToolFamily == 'SAWBLADE' then
|
||||
Tool.bIsUsedForLongCut = EgtGetValInNotes( Tool.sUserNotes, 'LONGCUT') == 1 or false -- false coem valore di default
|
||||
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or Tool.dThickness -- se non settato nell'utensile, considero lo spessore lama
|
||||
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or Tool.dMaxMaterial -- se non settato nell'utensile, considero un quarto del diametro
|
||||
-- recupero parametri propri delle motoseghe
|
||||
elseif sToolFamily == 'MORTISE' then
|
||||
Tool.dDistance = EgtTdbGetCurrToolParam( MCH_TP.DIST) or 90 -- 90mm dimensione standard aggregato catena
|
||||
Tool.bIsMortise = EgtGetValInNotes( Tool.sUserNotes, 'MORTISE') == 1
|
||||
Tool.bIsChainSaw = not Tool.bIsMortise
|
||||
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or floor( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero un terzo della lunghezza
|
||||
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or ( Tool.dThickness - 1) -- se non settato nell'utensile, considero spessore catena meno 1mm di sicurezza
|
||||
Tool.dCornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD)
|
||||
Tool.dWidth = Tool.dDiameter
|
||||
end
|
||||
end
|
||||
|
||||
-- se tutti i dati necessari sono disponibili, inserisco utensile nella lista globale degli utensili disponibili
|
||||
if IsToolOk( Tool) then
|
||||
table.insert( TOOLS, Tool)
|
||||
-- altrimenti scrivo nel log che l'utensile non è conforme
|
||||
else
|
||||
EgtOutLog( '*** ' .. Tool.sName .. ' : NOT-COMPLIANT ***', 1)
|
||||
end
|
||||
|
||||
-- reset dati
|
||||
Tool = {}
|
||||
end
|
||||
|
||||
-- recupero utensile successivo ( punte a forare, lame, frese e motoseghe)
|
||||
Tool.sName = EgtTdbGetNextTool( MCH_TF.DRILLBIT + MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Inserimento delle lavorazioni nelle travi ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local function CollectFeatures( vProc, Part, nIndexPart)
|
||||
-- recupero le feature
|
||||
local LayerId = {}
|
||||
LayerId[1] = WinLib.GetAddGroup( Part.id)
|
||||
LayerId[2] = EgtGetFirstNameInGroup( Part.id or GDB_ID.NULL, 'Processings')
|
||||
for nInd = 1, 2 do
|
||||
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
|
||||
while ProcId do
|
||||
local nEntType = EgtGetType( ProcId)
|
||||
if nEntType == GDB_TY.SRF_MESH or nEntType == GDB_TY.EXT_TEXT or
|
||||
nEntType == GDB_TY.CRV_LINE or nEntType == GDB_TY.CRV_ARC or nEntType == GDB_TY.CRV_BEZ or nEntType == GDB_TY.CRV_COMPO then
|
||||
local sType = EgtGetInfo( ProcId, 'FEATURE_TYPE', 's')
|
||||
local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1
|
||||
if sType and nDo == 1 then
|
||||
local Proc = {}
|
||||
Proc.idPart = Part.id
|
||||
Proc.nIndexPart = nIndexPart
|
||||
Proc.id = ProcId
|
||||
Proc.nFlg = 1
|
||||
Proc.sType = sType
|
||||
Proc.b3Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||
Proc.nPhase = EgtGetInfo( ProcId, 'PHASE', 'i') or nil
|
||||
|
||||
-- se esiste la geometria
|
||||
if Proc.b3Box and not Proc.b3Box:isEmpty() then
|
||||
-- calcolo dati specifici per tipologia di feature / lavorazione
|
||||
-- se foro
|
||||
if ID.IsDrilling( Proc) then
|
||||
Proc = FeatureData.GetDrillingData( Proc)
|
||||
end
|
||||
-- se taglio
|
||||
if ID.IsCutting( Proc) then
|
||||
Proc = FeatureData.GetCuttingData( Proc)
|
||||
end
|
||||
-- se fresatura
|
||||
if ID.IsMilling( Proc) then
|
||||
Proc = FeatureData.GetMillingData( Proc)
|
||||
end
|
||||
-- se svuotatura
|
||||
if ID.IsPocketing( Proc) then
|
||||
Proc = FeatureData.GetPocketingData( Proc)
|
||||
end
|
||||
-- se profilatura
|
||||
if ID.IsProfiling( Proc) then
|
||||
Proc = FeatureData.GetProfilingData( Proc)
|
||||
end
|
||||
-- informazioni facce
|
||||
Proc.AffectedFaces = WinLib.GetAffectedFaces( Proc, Part)
|
||||
-- inserisco feature in lista
|
||||
table.insert( vProc, Proc)
|
||||
else
|
||||
Proc.nFlg = 0
|
||||
table.insert( vProc, Proc)
|
||||
EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' is empty (no geometry)')
|
||||
end
|
||||
end
|
||||
end
|
||||
ProcId = EgtGetNext( ProcId)
|
||||
end
|
||||
end
|
||||
return vProc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetFeatureInfoAndDependency( vProc, Part)
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
-- controllo la feature con tutte le altre per recuperare le dipendenze
|
||||
for j = 1, #vProc do
|
||||
-- non si controlla la feature con se stessa
|
||||
if i ~= j then
|
||||
local ProcB = vProc[j]
|
||||
-- TODO dipendenze da controllare :
|
||||
-- * gruppo di forature con aggregato 2/3 uscite
|
||||
-- * Se 'Left' e 'Out' hanno stesso profilo, vanno concatenati (anche 'Right' se consentito dalla macchina)
|
||||
end
|
||||
end
|
||||
end
|
||||
return vProc
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- ottimizza le lavorazioni, considerando di ridurre i cambi utensile
|
||||
local function SortByChangeToolOpt( MACHININGS)
|
||||
local vProcToSortToolOpt = {}
|
||||
vProcToSortToolOpt = MACHININGS
|
||||
|
||||
for i = 1, #vProcToSortToolOpt do
|
||||
for j = i + 1, #vProcToSortToolOpt do
|
||||
-- se sono su stessa fase
|
||||
if vProcToSortToolOpt[i].AuxiliaryData.nPhase == vProcToSortToolOpt[j].AuxiliaryData.nPhase then
|
||||
-- se stesso utensile
|
||||
if vProcToSortToolOpt[i].Machining.nToolIndex == vProcToSortToolOpt[j].Machining.nToolIndex then
|
||||
if i + 1 == j then
|
||||
-- il confronto riparte dall'ultimo spostato
|
||||
i = j
|
||||
else
|
||||
-- sposto lavorazione confrontata dopo la principale
|
||||
WinLib.ChangeElementPositionInTable( vProcToSortToolOpt, j, i+1)
|
||||
-- il confronto riparte dall'ultimo spostato
|
||||
i = j
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return vProcToSortToolOpt
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Ordina le feature in base a fase di lavorazione
|
||||
-- L'ordine è indicativamente:
|
||||
-- 1) Tagli di testa
|
||||
-- 2) Fori
|
||||
-- 3) Scassi serratura/maniglia
|
||||
-- 4) Profili testa / Minizinken
|
||||
-- 5) Fori per spine dopo profilo di testa
|
||||
-- 6) Profili longitudinali
|
||||
-- 7) Passate pulitura per cambio profilo
|
||||
-- 8) Incontri/scontri (encounter/clash)
|
||||
-- 9) Listello ferma-vetro
|
||||
-- 10) Pausa
|
||||
-- 11) Lavorazioni dopo rimozione ferma-vetro
|
||||
|
||||
-- TODO Verificare se assegnare le fasi già quando si mette la lavorazione e ordinare solo in base alla fase di lavoro.
|
||||
-- TODO il punto 11) deve essere diviso in altri punti in base alle lavorazioni. Per adesso è un gruppo generico.
|
||||
-- TODO Ridefinire le fasi, prevedere anche la fase di cambio pinzaggio
|
||||
|
||||
local function OrderMachining( MACHININGS)
|
||||
|
||||
local vProcToSort = MACHININGS
|
||||
-- funzione di confronto. TRUE = B1 prima di B2. FALSE = B2 prima di B1
|
||||
local function CompareFeatures( B1, B2)
|
||||
-- se secondo disabilitato, va lasciato dopo
|
||||
if B1.Proc.nFlg ~= 0 and B2.Proc.nFlg == 0 then
|
||||
return true
|
||||
elseif B1.AuxiliaryData.nPhase < B2.AuxiliaryData.nPhase then
|
||||
return true
|
||||
elseif B1.AuxiliaryData.nPhase > B2.AuxiliaryData.nPhase then
|
||||
return false
|
||||
elseif B1.Machining.Geometry == B2.Machining.Geometry then
|
||||
return B1.AuxiliaryData.nIndexMachining < B2.AuxiliaryData.nIndexMachining
|
||||
elseif B1.AuxiliaryData.bIsProfiling and B2.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bExecAfterProfile then
|
||||
return true
|
||||
elseif B1.AuxiliaryData.bIsDrilling and B1.AuxiliaryData.bExecAfterProfile and B2.AuxiliaryData.bIsProfiling then
|
||||
return false
|
||||
elseif B1.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bIsProfiling then
|
||||
return true
|
||||
elseif B2.AuxiliaryData.bIsDrilling and B1.AuxiliaryData.bIsProfiling then
|
||||
return false
|
||||
elseif B1.AuxiliaryData.bIsProfiling and B2.AuxiliaryData.bIsProfiling then
|
||||
-- profiling Generic sempre per ultimi
|
||||
if B1.Proc.sProfileInfo == 'Generic' and B2.Proc.sProfileInfo ~= 'Generic' then
|
||||
return false
|
||||
elseif B2.Proc.sProfileInfo == 'Generic' and B1.Proc.sProfileInfo ~= 'Generic' then
|
||||
return true
|
||||
-- profiling Mixed dopo le profilature standard
|
||||
elseif B1.Proc.sProfileInfo == 'Mixed' and B2.Proc.sProfileInfo ~= 'Mixed' then
|
||||
return false
|
||||
elseif B2.Proc.sProfileInfo == 'Mixed' and B1.Proc.sProfileInfo ~= 'Mixed' then
|
||||
return true
|
||||
-- negli altri casi si ordina solo in base alla posizione
|
||||
elseif B1.Proc.b3Box:getCenter():getX() - B2.Proc.b3Box:getCenter():getX() < 10 * GEO.EPS_SMALL then
|
||||
return EgtIf( B1.AuxiliaryData.nPhase == 1, true, false) -- se arrivati a questo controllo, la fase di lavorazione di entrambe è la stessa, quindi mi basta controllarne una
|
||||
else
|
||||
return EgtIf( B1.AuxiliaryData.nPhase == 1, false, true) -- se arrivati a questo controllo, la fase di lavorazione di entrambe è la stessa, quindi mi basta controllarne una
|
||||
end
|
||||
elseif B1.AuxiliaryData.bIsDrilling and B2.AuxiliaryData.bIsDrilling then
|
||||
if B1.Proc.b3Box:getMin():getX() < B2.Proc.b3Box:getMin():getX() then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- test della funzione di ordinamento
|
||||
if EgtGetDebugLevel() >= 3 then
|
||||
EgtOutLog( ' CompareFeatures Test ')
|
||||
local bCompTest = true
|
||||
for i = 1, #vProcToSort do
|
||||
for j = i + 1, #vProcToSort do
|
||||
local bComp1 = CompareFeatures( vProcToSort[i], vProcToSort[j])
|
||||
local bComp2 = CompareFeatures( vProcToSort[j], vProcToSort[i])
|
||||
if bComp1 == bComp2 then
|
||||
bCompTest = false
|
||||
EgtOutLog( string.format( ' ProcId : %d vs %d --> ERROR', vProcToSort[i].Proc.id, vProcToSort[j].Proc.id))
|
||||
end
|
||||
end
|
||||
end
|
||||
if bCompTest then
|
||||
EgtOutLog( ' ALL OK')
|
||||
end
|
||||
end
|
||||
|
||||
-- eseguo un primo ordinamento
|
||||
table.sort( vProcToSort, CompareFeatures)
|
||||
|
||||
-- ordino per ottimizzare cambio utensile
|
||||
-- MACHININGS = SortByChangeToolOpt( MACHININGS)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- applica le lavorazioni
|
||||
local function AddMachinings( vProc, PARTS)
|
||||
local bMachiningOk = true
|
||||
for nFeatureIndex = 1, #vProc do
|
||||
local Proc = vProc[nFeatureIndex]
|
||||
local Part = PARTS[vProc[nFeatureIndex].nIndexPart]
|
||||
if ID.IsDrilling( Proc) then
|
||||
bMachiningOk = Drilling.Make( Proc, Part)
|
||||
end
|
||||
-- se taglio
|
||||
if ID.IsCutting( Proc) then
|
||||
bMachiningOk = Cutting.Make( Proc, Part)
|
||||
end
|
||||
-- se fresatura
|
||||
if ID.IsMilling( Proc) then
|
||||
bMachiningOk = Milling.Make( Proc, Part)
|
||||
end
|
||||
-- se svuotatura
|
||||
if ID.IsPocketing( Proc) then
|
||||
bMachiningOk = Pocketing.Make( Proc, Part)
|
||||
end
|
||||
-- se profilatura
|
||||
if ID.IsProfiling( Proc) then
|
||||
bMachiningOk = Profiling.Make( Proc, Part)
|
||||
end
|
||||
end
|
||||
return bMachiningOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function PrintFeatures( vProc, PARTS)
|
||||
EgtOutLog( ' === PARTS ====')
|
||||
for i = 1, #PARTS do
|
||||
EgtOutLog( ' RawBox(' .. tostring( i) .. ') =' .. tostring( PARTS[i].RawBox))
|
||||
end
|
||||
EgtOutLog( ' === FEATURES ====')
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local sOut = string.format( 'Id=%3d Flg=%2d Type=%s', Proc.id, Proc.nFlg, Proc.sType)
|
||||
EgtOutLog( sOut)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function UpdateRawPosition( PARTS)
|
||||
for i = 1, #PARTS do
|
||||
PARTS[i].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
PARTS[i].b3RawPart = EgtGetRawPartBBox( PARTS[i].idRaw)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CheckAndMovePawPart( nIdRawToMove, vtMove)
|
||||
EgtMoveRawPart( nIdRawToMove, vtMove)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinExec.ProcessFeatures( PARTS)
|
||||
-- ciclo sui pezzi
|
||||
local nTotErr = 0
|
||||
local Stats = {}
|
||||
local vProc = {}
|
||||
MACHININGS = {}
|
||||
|
||||
-- aggiorno posizione grezzi dopo disposizione
|
||||
EgtSetCurrPhase( 1)
|
||||
UpdateRawPosition( PARTS)
|
||||
|
||||
-- si recuperano tutte le feature di tutti i pezzi in una lista unica
|
||||
for nPart = 1, #PARTS do
|
||||
-- recupero le feature di lavorazione della trave
|
||||
vProc = CollectFeatures( vProc, PARTS[nPart], nPart)
|
||||
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature dello stesso pezzo
|
||||
vProc = GetFeatureInfoAndDependency( vProc, PARTS[nPart])
|
||||
end
|
||||
|
||||
-- debug
|
||||
if EgtGetDebugLevel() >= 1 then
|
||||
PrintFeatures( vProc, PARTS)
|
||||
end
|
||||
|
||||
EgtOutLog( ' *** AddMachinings ***', 1)
|
||||
|
||||
-- esegue le lavorazioni e le salva in lista
|
||||
AddMachinings( vProc, PARTS)
|
||||
|
||||
-- ordina le lavorazioni
|
||||
OrderMachining( MACHININGS)
|
||||
|
||||
for i = 1, #MACHININGS do
|
||||
if MACHININGS[i].AuxiliaryData.nPhase == 1 then
|
||||
-- aggiunge effettivamente la lavorazione e restituisce gli ingombri
|
||||
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
|
||||
-- se feature di testa, sposto testa in base a ingombro lavorazione
|
||||
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
|
||||
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase1.dOffsetX = b3MachEncumbrance:getMax():getX() - PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMin():getX() + 5
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- TODO lo spostamento, oltre a controllare le collisioni con il profilo di testa, deve anche considerare il pinzaggio del pezzo nel suo insieme?
|
||||
-- Es.: basterebbe aggiungere un offset di 50mm per la testa, ma se metto 60mm, posso utilizzare una morsa in più che altrimenti avrei dovuto togliere per una collisione con una svuotatura
|
||||
|
||||
-- sposto pezzo per permettere pinzaggio migliore e non aver colisione in testa
|
||||
for i = 1, #PARTS do
|
||||
-- TODO controllare calcolo ingombro
|
||||
local vtMove = Vector3d( - PARTS[i].DispOffsets.Phase1.dOffsetX, 0, 0)
|
||||
if vtMove ~= V_NULL() then
|
||||
CheckAndMovePawPart( PARTS[i].idRaw, vtMove)
|
||||
end
|
||||
end
|
||||
|
||||
-- scrivo lavorazioni seconda fase
|
||||
EgtSetCurrPhase( 2)
|
||||
UpdateRawPosition( PARTS)
|
||||
for i = 1, #MACHININGS do
|
||||
if MACHININGS[i].AuxiliaryData.nPhase == 2 then
|
||||
-- aggiunge effettivamente la lavorazione
|
||||
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
|
||||
-- se feature di testa, sposto testa in base a ingombro lavorazione
|
||||
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
|
||||
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase2.dOffsetX = PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMax():getX() - b3MachEncumbrance:getMin():getX() + 5
|
||||
end
|
||||
end
|
||||
end
|
||||
-- sposto pezzo per permettere pinzaggio migliore e non aver colisione in testa
|
||||
for i = 1, #PARTS do
|
||||
-- TODO controllare calcolo ingombro
|
||||
local vtMove = Vector3d( PARTS[i].DispOffsets.Phase2.dOffsetX, 0, 0)
|
||||
if vtMove ~= V_NULL() then
|
||||
CheckAndMovePawPart( PARTS[i].idRaw, vtMove)
|
||||
end
|
||||
end
|
||||
|
||||
EgtOutLog( ' *** End AddMachinings ***', 1)
|
||||
|
||||
-- Aggiornamento finale di tutto
|
||||
EgtSetCurrPhase( 1)
|
||||
local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings()
|
||||
if not bApplOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {nErr = 1, sMsg=sApplErrors})
|
||||
end
|
||||
|
||||
return ( nTotErr == 0), Stats
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WinExec
|
||||
@@ -0,0 +1,142 @@
|
||||
-- WinLib.lua by Egalware s.r.l. 2024/06/14
|
||||
-- Libreria globale per Serramenti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WinLib = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
EgtOutLog( ' WinLib started', 1)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce le facce della parte interessate dalla feature Proc
|
||||
function WinLib.GetAffectedFaces( Proc, Part)
|
||||
local vtFacesAffected = { bTop = false, bBottom = false, bFront = false, bBack = false, bLeft = false, bRight = false}
|
||||
if Proc.b3Box and not Proc.b3Box:isEmpty() then
|
||||
-- caso speciale foro
|
||||
if Proc.sType == 'Hole' and Proc.sReferenceSide then
|
||||
if Proc.sReferenceSide == Part.SideNames.sLeft then
|
||||
vtFacesAffected.bLeft = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sRight then
|
||||
vtFacesAffected.bRight = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sFront then
|
||||
vtFacesAffected.bFront = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sBack then
|
||||
vtFacesAffected.bBack = true
|
||||
end
|
||||
-- caso speciale profili per pezzo con cambio-profilo
|
||||
elseif Proc.sType == 'Profiling' and Proc.sProfileInfo == 'Mixed' then
|
||||
if Proc.sReferenceSide == Part.SideNames.sLeft then
|
||||
vtFacesAffected.bLeft = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sRight then
|
||||
vtFacesAffected.bRight = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sFront then
|
||||
vtFacesAffected.bFront = true
|
||||
elseif Proc.sReferenceSide == Part.SideNames.sBack then
|
||||
vtFacesAffected.bBack = true
|
||||
end
|
||||
-- caso speciale profili
|
||||
elseif Proc.sType == 'Profiling' then
|
||||
if not Part.SideNames then
|
||||
Part.SideNames = {}
|
||||
end
|
||||
-- quando si settano i lati interessati, mi salvo anche il nome.
|
||||
-- se c'è una rotazione di 180°, potrebbe essere che il lato LEFT del pezzo corrisponda al lato RIGHT della lavorazione. Stesso per IN/OUT
|
||||
if Proc.b3Box:getMax():getX() < Part.b3Part:getCenter():getX() then
|
||||
vtFacesAffected.bLeft = true
|
||||
Part.SideNames.sLeft = Proc.sEntityName
|
||||
elseif Proc.b3Box:getMin():getX() > Part.b3Part:getCenter():getX() then
|
||||
vtFacesAffected.bRight = true
|
||||
Part.SideNames.sRight = Proc.sEntityName
|
||||
elseif Proc.b3Box:getMax():getY() < Part.b3Part:getCenter():getY() then
|
||||
vtFacesAffected.bFront = true
|
||||
Part.SideNames.sFront = Proc.sEntityName
|
||||
elseif Proc.b3Box:getMin():getY() > Part.b3Part:getCenter():getY() then
|
||||
vtFacesAffected.bBack = true
|
||||
Part.SideNames.sBack = Proc.sEntityName
|
||||
end
|
||||
-- caso standard
|
||||
else
|
||||
if Proc.b3Box:getMax():getZ() > Part.b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bTop = true
|
||||
end
|
||||
if Proc.b3Box:getMin():getZ() < Part.b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bBottom = true
|
||||
end
|
||||
if Proc.b3Box:getMin():getY() < Part.b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bFront = true
|
||||
end
|
||||
if Proc.b3Box:getMax():getY() > Part.b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bBack = true
|
||||
end
|
||||
if Proc.b3Box:getMin():getX() < Part.b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bLeft = true
|
||||
end
|
||||
if Proc.b3Box:getMax():getX() > Part.b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.bRight = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return vtFacesAffected
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinLib.SwapElements( Table, Pos1, Pos2)
|
||||
Table[Pos1], Table[Pos2] = Table[Pos2], Table[Pos1]
|
||||
return Table
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinLib.ChangeElementPositionInTable( Table, nCurrentPosition, nTargetPosition)
|
||||
-- se indici uguali esco subito
|
||||
if nTargetPosition == nCurrentPosition then
|
||||
return Table
|
||||
end
|
||||
|
||||
local Item = Table[nCurrentPosition]
|
||||
|
||||
if nTargetPosition > nCurrentPosition then
|
||||
nTargetPosition = nTargetPosition - 1
|
||||
end
|
||||
table.remove( Table, nCurrentPosition)
|
||||
table.insert( Table, nTargetPosition, Item)
|
||||
|
||||
return Table
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinLib.GetAddGroup( PartId)
|
||||
-- recupero il nome del gruppo di lavoro corrente
|
||||
local sMchGrp = EgtGetMachGroupName( EgtGetCurrMachGroup() or GDB_ID.NULL)
|
||||
if not sMchGrp then
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
-- cerco il gruppo aggiuntivo omonimo nel pezzo e se esiste lo restituisco
|
||||
local AddGrpId = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, sMchGrp)
|
||||
|
||||
-- restituisco Id e Nome
|
||||
return AddGrpId, sMchGrp
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WinLib.GetPathMinRadius( IdCurve)
|
||||
local dSmallRadius = 9999
|
||||
local InitIdEntity, LastIdEntity = EgtCurveDomain(IdCurve)
|
||||
for i = InitIdEntity, LastIdEntity do
|
||||
local dRadius = EgtCurveCompoRadius( IdCurve, i)
|
||||
-- se è un arco ed è più piccolo del minimo, lo salvo
|
||||
if dRadius and dRadius > 0 and dRadius < dSmallRadius then
|
||||
dSmallRadius = dRadius
|
||||
end
|
||||
end
|
||||
return dSmallRadius
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WinLib
|
||||
@@ -0,0 +1,328 @@
|
||||
-- Process.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Gestione calcolo disposizione e lavorazioni per serramenti
|
||||
-- Si opera sulla macchina corrente
|
||||
-- 2024/06/13 PRIMA VERSIONE
|
||||
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- TODO da cancellare quando verrà passato automaticamente da programma
|
||||
local WIN = {}
|
||||
WIN.BASEDIR = 'C:\\EgtData\\Window\\CAMAuto'
|
||||
|
||||
-- Imposto direttorio libreria specializzata per serramenti
|
||||
EgtAddToPackagePath( WIN.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||
-- Imposto direttorio strategie. N.B. Le strategie dovranno essere caricate con il nome del direttorio padre
|
||||
EgtAddToPackagePath( WIN.BASEDIR .. '\\Strategies\\?.lua')
|
||||
|
||||
-- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi
|
||||
local sMachDir = EgtGetCurrMachineDir()
|
||||
if not sMachDir then
|
||||
EgtOutBox( 'Errore nel caricamento della macchina corrente', 'Lavora Serramenti', 'ERROR')
|
||||
return
|
||||
end
|
||||
if not EgtExistsFile( sMachDir .. '\\Window\\WinData.lua') then
|
||||
EgtOutBox( 'La macchina corrente non è configurata per lavorare serramenti', 'Lavora Serramenti', 'ERROR')
|
||||
return
|
||||
end
|
||||
|
||||
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
|
||||
EgtRemoveBaseMachineDirFromPackagePath()
|
||||
EgtAddToPackagePath( sMachDir .. '\\Window\\?.lua')
|
||||
|
||||
-- Segnalazione avvio
|
||||
EgtOutLog( '*** Window Process Start ***', 1)
|
||||
|
||||
-- Carico le librerie
|
||||
_G.package.loaded.WinData = nil
|
||||
_G.package.loaded.WinExec = nil
|
||||
_G.package.loaded.WinLib = nil
|
||||
_G.package.loaded.FeatureData = nil
|
||||
_G.package.loaded.MachiningLib = nil
|
||||
|
||||
local WinExec = require( 'WinExec')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
-- Variabili globali
|
||||
PARTS = {}
|
||||
|
||||
-- Colore del grezzo
|
||||
local ColA = Color3d( 255, 165, 0, 30)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Recupero i pezzi da processare ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MyProcessInputData()
|
||||
-- Recupero le travi selezionate
|
||||
local nId = EgtGetFirstSelectedObj()
|
||||
while nId do
|
||||
local nPartId = EgtGetParent( EgtGetParent( nId or GDB_ID.NULL) or GDB_ID.NULL)
|
||||
if nPartId then
|
||||
local bFound = false
|
||||
for i = 1, #PARTS do
|
||||
if PARTS[i].id == nPartId then
|
||||
bFound = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not bFound then
|
||||
table.insert( PARTS, { nInd = #PARTS + 1, id = nPartId, sName = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))})
|
||||
end
|
||||
end
|
||||
nId = EgtGetNextSelectedObj()
|
||||
end
|
||||
if #PARTS == 0 then
|
||||
EgtOutBox( 'Non sono state selezionati pezzi', 'Lavora Pezzi', 'ERROR')
|
||||
return false
|
||||
else
|
||||
-- recupero tutte le dimensioni necessarie
|
||||
local sOut = ''
|
||||
for i = 1, #PARTS do
|
||||
PARTS[i].b3Raw = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
PARTS[i].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local idFrame = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PARTS[i].id, 'GeoRaw'), 'AuxFrame')
|
||||
PARTS[i].frame = EgtFR( idFrame)
|
||||
sOut = sOut .. PARTS[i].sName .. ', '
|
||||
end
|
||||
sOut = sOut:sub( 1, -3)
|
||||
EgtOutLog( 'Pezzi selezionati : ' .. sOut, 1)
|
||||
end
|
||||
|
||||
EgtDeselectAll()
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetDataConfig()
|
||||
-- recupero utensili dal magazzino
|
||||
WinExec.GetToolsFromDB()
|
||||
|
||||
-- TODO da gestire eventuali errori bloccanti
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetDispOffsetFromNotes( nPieceIndex)
|
||||
local bAllOffsetsAreOk = false
|
||||
|
||||
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
|
||||
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_1', 'd')
|
||||
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_1', 'd')
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetX = 0 -- dovrà essere calcolato in base alle lavorazioni
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFY_2', 'd')
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = EgtGetInfo( PARTS[nPieceIndex].id, 'OFFZ_2', 'd')
|
||||
|
||||
-- controllo se tutti gli offset siano settati
|
||||
if PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ and
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY and PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ then
|
||||
bAllOffsetsAreOk = true
|
||||
end
|
||||
|
||||
return bAllOffsetsAreOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetDispOffsetFromInput( nPieceIndex)
|
||||
-- assegno alle stringhe i valori letti, in modo che vengano proposti quelli nel dialogo
|
||||
local sOffYPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
|
||||
local sOffZPh1 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ), '0')
|
||||
local sOffYPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY), tostring( PARTS[nPieceIndex].dPartWidth / 2))
|
||||
local sOffZPh2 = EgtIf( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ, tostring( PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ), '0')
|
||||
|
||||
local vInp = EgtDialogBox( 'Dati di disposizione pezzo: ' .. PARTS[nPieceIndex].sName,
|
||||
{'Sporgenza laterale FASE1', sOffYPh1}, {'Posizione Z FASE1', sOffZPh1},
|
||||
{'Sporgenza laterale FASE2', sOffYPh2}, {'Posizione Z FASE2', sOffZPh2})
|
||||
if not vInp or #vInp == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
-- salvo input nei valori che utilizzerò dopo
|
||||
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetY = tonumber( vInp[1])
|
||||
PARTS[nPieceIndex].DispOffsets.Phase1.dOffsetZ = tonumber( vInp[2])
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetY = tonumber( vInp[3])
|
||||
PARTS[nPieceIndex].DispOffsets.Phase2.dOffsetZ = tonumber( vInp[4])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Crea il grezzo che verrà messo in macchina
|
||||
---------------------------------------------------------------------
|
||||
local function AddOverMaterialToRaw( PARTS)
|
||||
for i = 1, #PARTS do
|
||||
|
||||
-- prima di aggiungere sovramateriale al grezzo, calcolo dimensioni del finito
|
||||
local b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Geo') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
PARTS[i].b3Part = b3Part
|
||||
PARTS[i].dPartLength = PARTS[i].b3Part:getDimX()
|
||||
PARTS[i].dPartWidth = PARTS[i].b3Part:getDimY()
|
||||
PARTS[i].dPartHeight = PARTS[i].b3Part:getDimZ()
|
||||
|
||||
-- recupero sovramateriale
|
||||
PARTS[i].RawOffset = {}
|
||||
-- recupero info sovramateriale
|
||||
PARTS[i].RawOffset.dOverMatIn = EgtGetInfo( PARTS[i].id, 'OVERMAT_IN', 'd') or 5
|
||||
PARTS[i].RawOffset.dOverMatOut = EgtGetInfo( PARTS[i].id, 'OVERMAT_OUT', 'd') or 5
|
||||
PARTS[i].RawOffset.dOverMatLeft = EgtGetInfo( PARTS[i].id, 'OVERMAT_LEFT', 'd') or 5
|
||||
PARTS[i].RawOffset.dOverMatRight = EgtGetInfo( PARTS[i].id, 'OVERMAT_RIGHT', 'd') or 5
|
||||
|
||||
PARTS[i].dRawLength = PARTS[i].RawOffset.dOverMatLeft + PARTS[i].dPartLength + PARTS[i].RawOffset.dOverMatRight
|
||||
PARTS[i].dRawWidth = PARTS[i].RawOffset.dOverMatOut + PARTS[i].dPartWidth + PARTS[i].RawOffset.dOverMatIn
|
||||
PARTS[i].dRawHeight = PARTS[i].dPartHeight
|
||||
|
||||
EgtModifyRawPartSize( PARTS[i].idRaw, PARTS[i].dRawLength, PARTS[i].dRawWidth, PARTS[i].dPartHeight)
|
||||
|
||||
local vtMove = Vector3d( PARTS[i].RawOffset.dOverMatLeft, PARTS[i].RawOffset.dOverMatOut, 0)
|
||||
EgtMovePartInRawPart( PARTS[i].id, vtMove)
|
||||
|
||||
-- TODO da controllare, se ruotato di 180° bisognerebbe prendere dOverMatIn. Lo stesso per la X
|
||||
PARTS[i].OffsetPartToRaw = {}
|
||||
PARTS[i].OffsetPartToRaw.X = PARTS[i].RawOffset.dOverMatLeft
|
||||
PARTS[i].OffsetPartToRaw.Y = PARTS[i].RawOffset.dOverMatOut
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Crea il grezzo che verrà messo in macchina
|
||||
---------------------------------------------------------------------
|
||||
local function CreateRaws( PARTS)
|
||||
for i = 1, #PARTS do
|
||||
-- si crea un grezzo "finto" (un cubo da 100mm) nell'origine del pezzo, verrà poi dimensionato uan volta adeguato con i vari sovramateriali
|
||||
PARTS[i].idRaw = EgtAddRawPart( PARTS[i].frame:getOrigin(), 100, 100, 100, ColA)
|
||||
EgtAddPartToRawPart( PARTS[i].id, ORIG(), PARTS[i].idRaw)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Allinea i pezzi in base a come devono essere disposti sulla tavola
|
||||
---------------------------------------------------------------------
|
||||
-- TODO in questa fase bisogna già sapere qual è la prima fase e posizionare il pezzo di conseguenza
|
||||
-- TODO (bassa priorità) adesso allinea sempre in X, ma bisognerebbe farlo in base ad un parametro in WINDATA che dice come si dispongono in macchina
|
||||
local function AlignRawsToTable( PARTS)
|
||||
for i = 1, #PARTS do
|
||||
-- allineo il pezzo all'interno del grezzo
|
||||
local dRotX, dRotY, dRotZ = GetFixedAxesRotABCFromFrame( PARTS[i].frame)
|
||||
|
||||
-- se devo ruotare
|
||||
if abs( dRotZ) > GEO.EPS_ANG_SMALL then
|
||||
EgtRotatePartInRawPart( PARTS[i].id, Z_AX(), -dRotZ)
|
||||
-- sposto punto in basso a sinistra del pezzo sul punto in basso a sinistra del grezzo
|
||||
local b3Part = EgtGetBBoxGlob( PARTS[i].id, GDB_BB.ONLY_VISIBLE)
|
||||
local dPartPosX = b3Part:getMin():getX()
|
||||
local dPartPosY = b3Part:getMin():getY()
|
||||
local b3Raw = EgtGetRawPartBBox( PARTS[i].idRaw)
|
||||
local dRawPosX = b3Raw:getMin():getX()
|
||||
local dRawPosY = b3Raw:getMin():getY()
|
||||
local vtMove = Vector3d( dRawPosX - dPartPosX, dRawPosY - dPartPosY, 0)
|
||||
EgtMovePartInRawPart( PARTS[i].id, vtMove)
|
||||
end
|
||||
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Funzione per trovare nome MachGroup ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function NewMachGroupName()
|
||||
local nMachGroupId = EgtGetFirstMachGroup()
|
||||
if not nMachGroupId then return '1' end
|
||||
local nMaxMachGroup = 0
|
||||
while nMachGroupId do
|
||||
local sMachGroupName = EgtGetMachGroupName( nMachGroupId)
|
||||
local nMachGroupName = tonumber( sMachGroupName)
|
||||
if nMachGroupName > nMaxMachGroup then
|
||||
nMaxMachGroup = nMachGroupName
|
||||
end
|
||||
nMachGroupId = EgtGetNextMachGroup( nMachGroupId)
|
||||
end
|
||||
return tostring( nMaxMachGroup + 1)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Inserimento delle travi nel grezzo ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MyProcessPieces()
|
||||
|
||||
-- creo macchinata
|
||||
local MachGroupName = NewMachGroupName()
|
||||
local nMachGroup = EgtAddMachGroup( MachGroupName)
|
||||
|
||||
-- si crea il grezzo
|
||||
CreateRaws( PARTS)
|
||||
|
||||
-- allineo i pezzi come orientamento richiesto dalla macchina
|
||||
AlignRawsToTable( PARTS)
|
||||
|
||||
-- aggiungo sovramateriale ai grezzi
|
||||
AddOverMaterialToRaw( PARTS)
|
||||
|
||||
-- recupero offset per posizionamento
|
||||
for i = 1, #PARTS do
|
||||
PARTS[i].DispOffsets = {}
|
||||
PARTS[i].DispOffsets.Phase1 = {}
|
||||
PARTS[i].DispOffsets.Phase2 = {}
|
||||
|
||||
local bInsertedAllOffs = GetDispOffsetFromNotes( i)
|
||||
-- se non sono settati nelle note, li chiedo
|
||||
if not bInsertedAllOffs then
|
||||
bInsertedAllOffs = GetDispOffsetFromInput( i)
|
||||
end
|
||||
-- se non sono stati inseriti o c'è stato un errore esco subito
|
||||
if not bInsertedAllOffs then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- si dispongono i pezzi sulla tavola
|
||||
local bDispOk, sErr = WinData.ExecDisposition( PARTS)
|
||||
if not bDispOk then
|
||||
if not sErr then
|
||||
sErr = 'Errore non gestito in WinData.ExecDisposition'
|
||||
end
|
||||
EgtOutBox( sErr, 'ProcessWin', 'ERROR', 'OK')
|
||||
return false
|
||||
end
|
||||
|
||||
-- Impostazione dell'attrezzaggio di default
|
||||
local bOk = EgtImportSetup()
|
||||
if not bOk then
|
||||
EgtImportSetup( 'Default')
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Inserimento delle lavorazioni ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MyProcessFeatures()
|
||||
local bOk = WinExec.ProcessFeatures( PARTS)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- *** Esecuzione ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- nascondo geometrie varie
|
||||
local vAuxId = { EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Profile'), EgtGetFirstNameInGroup( GDB_ID.ROOT, 'Area*')}
|
||||
EgtSetStatus( vAuxId, GDB_ST.OFF)
|
||||
|
||||
if not MyProcessInputData() then return end
|
||||
|
||||
if not MyProcessPieces() then return end
|
||||
|
||||
if not GetDataConfig() then return end
|
||||
|
||||
-- Abilito Vmill
|
||||
EgtSetInfo( EgtGetCurrMachGroup(), 'Vm', '1')
|
||||
|
||||
if not MyProcessFeatures() then return end
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Cutting.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di taglio
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Cutting = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
EgtOutLog( ' Cutting started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Cutting.Make( Proc, Part)
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Cutting
|
||||
@@ -0,0 +1,85 @@
|
||||
-- Drilling.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di foratura
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Drilling = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
|
||||
EgtOutLog( ' Drilling started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione che decide se eseguire le forature dopo le profilature. Solo forature di testa inclinate. Altrimenti sempre prima.
|
||||
local function IsDrillToMachineAfterProfile( Proc)
|
||||
local bExecAfterProfile = false
|
||||
if ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and abs( Proc.vtDir:getX()) > 0.15 then
|
||||
bExecAfterProfile = true
|
||||
end
|
||||
return bExecAfterProfile
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Drilling.Make( Proc, Part)
|
||||
local ToolInfo = {}
|
||||
|
||||
local Machining = {}
|
||||
local AuxiliaryData = {}
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadOut = {}
|
||||
Machining.Steps = {}
|
||||
local ToolSearchParameters = {}
|
||||
|
||||
-- cerco utensile punta a forare
|
||||
ToolSearchParameters.dDiameter = Proc.dDiameter
|
||||
ToolSearchParameters.dLength = Proc.dLength
|
||||
ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_OY.DRILLING
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.sDepth = 'th'
|
||||
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
|
||||
Machining.Geometry = Proc.id
|
||||
AuxiliaryData.bExecAfterProfile = IsDrillToMachineAfterProfile( Proc)
|
||||
AuxiliaryData.bIsDrilling = true
|
||||
AuxiliaryData.nIndexMachining = 1
|
||||
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
|
||||
Machining.dStartSafetyLength = MachiningLib.GetDrillAdditionalSafeDistanceToRaw( Proc, Part, Machining)
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
|
||||
else
|
||||
-- provo a cercare una fresa che faccia una svuotatura
|
||||
ToolSearchParameters.dMaxToolDiameter = Proc.dDiameter
|
||||
ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_OY.POCKETING
|
||||
Machining.nSubType = MCH_POCK_SUB.SPIRALOUT
|
||||
Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Machining.Steps.dStep = TOOLS[ToolInfo.nToolIndex].dStep
|
||||
Machining.Steps.dSideStep = TOOLS[ToolInfo.nToolIndex].dSideStep
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.LeadIn.dTangentDistance = TOOLS[ToolInfo.nToolIndex].dDiameter/2
|
||||
Machining.LeadIn.dElevation = TOOLS[ToolInfo.nToolIndex].dDiameter/2
|
||||
Machining.sDepth = 0
|
||||
Machining.Geometry = Proc.id
|
||||
AuxiliaryData.bIsPocketingDrill = true
|
||||
AuxiliaryData.nIndexMachining = 1
|
||||
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Drilling
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Milling.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di fresatura
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Milling = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
EgtOutLog( ' Milling started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Milling.Make( Proc, Part)
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Milling
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Pocketing.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di svuotatura
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Pocketing = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
|
||||
EgtOutLog( ' Pocketing started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Pocketing.Make( Proc, Part)
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Pocketing
|
||||
@@ -0,0 +1,108 @@
|
||||
-- Profiling.lua by Egalware s.r.l. 2024/06/13
|
||||
-- Libreria esecuzione lavorazioni per Serramenti -> Lavorazione di profilatura
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Profiling = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WinData = require( 'WinData')
|
||||
local WinLib = require( 'WinLib')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
|
||||
EgtOutLog( ' Profiling started', 1)
|
||||
EgtMdbSave()
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Profiling.Make( Proc, Part)
|
||||
-- definizione liste
|
||||
local ToolInfo = {}
|
||||
local Machining = {}
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadOut = {}
|
||||
Machining.Steps = {}
|
||||
local AuxiliaryData = {}
|
||||
local ToolSearchParameters = {}
|
||||
|
||||
-- se so che utensili utilizzare, associazione diretta
|
||||
if Proc.nToolsToUse > 0 then
|
||||
for i = 1, Proc.nToolsToUse do
|
||||
ToolSearchParameters.sName = Proc.Tools[i].sName
|
||||
ToolSearchParameters.dElevation = 0
|
||||
ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_MY.MILLING
|
||||
Machining.nWorkside = MCH_MILL_WS.RIGHT
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.sDepth = 0
|
||||
Machining.dRadialOffset = Proc.Tools[i].dRadialOffset
|
||||
Machining.dLongitudinalOffset = Proc.Tools[i].dLongitudinalOffset
|
||||
-- se il pezzo ha cambio-profilo
|
||||
if Proc.sProfileInfo == 'Mixed' then
|
||||
Machining.LeadIn.nType = MCH_MILL_LI.LINEAR
|
||||
Machining.LeadOut.nType = MCH_MILL_LO.LINEAR
|
||||
Machining.LeadIn.dTangentDistance = 0
|
||||
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
|
||||
Machining.LeadOut.dTangentDistance = 0
|
||||
Machining.LeadOut.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
|
||||
else
|
||||
Machining.LeadIn.nType = MCH_MILL_LI.TANGENT
|
||||
Machining.LeadOut.nType = MCH_MILL_LO.TANGENT
|
||||
Machining.LeadIn.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
|
||||
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
|
||||
Machining.LeadOut.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2) + 30
|
||||
Machining.LeadOut.dPerpDistance = 0
|
||||
end
|
||||
Machining.Geometry = Proc.id
|
||||
AuxiliaryData.bIsProfiling = true
|
||||
AuxiliaryData.nIndexMachining = i
|
||||
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
|
||||
else
|
||||
return false, 'Associated tool not found'
|
||||
end
|
||||
end
|
||||
-- altrimenti cerco tra quelli disponibili
|
||||
else
|
||||
-- se profilatura generica, cerco fresa che possa lavorare la geometria considerando spessore e raggio
|
||||
if Proc.sProfileInfo == 'Generic' then
|
||||
ToolSearchParameters.dElevation = abs( EgtCurveThickness( Proc.id))
|
||||
ToolSearchParameters.dMaxToolDiameter = WinLib.GetPathMinRadius( Proc.id) * 2
|
||||
ToolSearchParameters.sType = 'MILL_STD'
|
||||
ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
-- se trovato utensile
|
||||
if ToolInfo.nToolIndex then
|
||||
Machining.nType = MCH_MY.MILLING
|
||||
Machining.nWorkside = MCH_MILL_WS.LEFT
|
||||
Machining.nToolIndex = ToolInfo.nToolIndex
|
||||
Machining.sDepth = ToolSearchParameters.dElevation
|
||||
Machining.dRadialOffset = EgtGetInfo( Proc.id, 'OFFR', 'd') or 0
|
||||
Machining.dLongitudinalOffset = EgtGetInfo( Proc.id, 'OFFL', 'd') or 0
|
||||
|
||||
Machining.LeadIn.nType = MCH_MILL_LI.TANGENT
|
||||
Machining.LeadOut.nType = MCH_MILL_LO.TANGENT
|
||||
Machining.LeadIn.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
|
||||
Machining.LeadIn.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
|
||||
Machining.LeadOut.dTangentDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
|
||||
Machining.LeadOut.dPerpDistance = (TOOLS[ToolInfo.nToolIndex].dTotDiameter / 2)
|
||||
|
||||
Machining.Geometry = Proc.id
|
||||
AuxiliaryData.bIsProfiling = true
|
||||
AuxiliaryData.nIndexMachining = 1
|
||||
AuxiliaryData.nPhase = MachiningLib.GetPhaseMach( Proc)
|
||||
MachiningLib.AddNewMachining( Proc, Machining, AuxiliaryData)
|
||||
else
|
||||
return false, 'Tool for generic profiling not found'
|
||||
end
|
||||
else
|
||||
return false, 'Tool for profiling not found'
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Profiling
|
||||
+239
-282
@@ -39,7 +39,7 @@ local DebugCode = false
|
||||
local HoleWidth = 1835
|
||||
local HoleHeight = 1516
|
||||
|
||||
local WindowWidth = 1800
|
||||
local WindowWidth = 900
|
||||
local WindowHeight = 1500
|
||||
|
||||
local WindowTree
|
||||
@@ -57,37 +57,45 @@ EgtNewFile()
|
||||
-- importo profilo prescelto
|
||||
WinCreate.ImportProfile( sProfilePath)
|
||||
|
||||
-- creo telaio rettangolare
|
||||
-- creo telaio generico
|
||||
local FrameJointType = WIN_JNT.FULL_H
|
||||
local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
|
||||
local vFrameJoints = { FrameJointType, FrameJointType, FrameJointType, FrameJointType}
|
||||
local SashJointType = WIN_JNT.FULL_V
|
||||
local vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType}
|
||||
|
||||
local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.RECT, vFrameJoints, WindowWidth, WindowHeight)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER_SIDE, vFrameJoints, WindowWidth, WindowHeight, WindowHeight + 500)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER_SIDE, vFrameJoints, WindowWidth, WindowHeight + 500, WindowHeight)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.ROUND_ARC, vFrameJoints, WindowWidth, WindowHeight)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.SEGMENTAL_ARC, vFrameJoints, WindowWidth, WindowHeight, WindowHeight + 100)
|
||||
|
||||
-- vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType, SashJointType}
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, WindowWidth, WindowHeight, WindowHeight + 500)
|
||||
|
||||
-- vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType, SashJointType}
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, WindowWidth, WindowHeight, WindowHeight + 600)
|
||||
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_H, WIN_JNT.FULL_H, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, WindowWidth)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_V, WIN_JNT.FULL_V, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, 0)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_V, WIN_JNT.FULL_H, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, WindowWidth - 100)
|
||||
|
||||
|
||||
-- -- creo telaio generico
|
||||
-- local nDrawFramePartId = EgtGroup( GDB_ID.ROOT)
|
||||
-- EgtSetName( nDrawFramePartId, 'DrawFrame')
|
||||
-- local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
|
||||
-- local nFrameBottomId = EgtLine( nDrawFrameLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
|
||||
-- local nFrameRightId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
|
||||
-- local nFrameTopId = EgtArc2PV( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( 0, 1, 0))
|
||||
-- --local nFrameTopId = EgtLine( nDrawFrameLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
|
||||
-- local nFrameLeftId = EgtLine( nDrawFrameLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
|
||||
-- local FrameJointType = WIN_JNT.ANGLED
|
||||
-- local nFrameId = WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, FrameJointType, FrameJointType, FrameJointType, FrameJointType)
|
||||
|
||||
------------------------ Finestra vetro fisso ------------------------
|
||||
|
||||
-- -- aggiungo zoccolo
|
||||
-- WinCreate.AddBottomRail( nFrameId)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
|
||||
-- aggiungo zoccolo
|
||||
WinCreate.AddBottomRail( nFrameId)
|
||||
-- aggiungo vetro
|
||||
local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra vetro fisso con divisione orizzontale ------------------------
|
||||
|
||||
-- -- aggiungo zoccolo
|
||||
-- WinCreate.AddBottomRail( nFrameId)
|
||||
|
||||
--
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
|
||||
@@ -96,10 +104,10 @@ local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointTyp
|
||||
|
||||
-- -- aggiungo zoccolo
|
||||
-- WinCreate.AddBottomRail( nFrameId)
|
||||
|
||||
--
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
|
||||
@@ -108,36 +116,34 @@ local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointTyp
|
||||
|
||||
-- -- aggiungo zoccolo
|
||||
-- WinCreate.AddBottomRail( nFrameId)
|
||||
|
||||
--
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill3Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill4Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- ------------------------ Finestra anta singola ------------------------
|
||||
------------------------ Finestra anta singola ------------------------
|
||||
|
||||
-- aggiungo anta
|
||||
local SashJointType = WIN_JNT.FULL_V
|
||||
local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- aggiungo vetro
|
||||
local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
-- -- aggiungo anta
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints)
|
||||
--
|
||||
-- -- aggiungo vetro
|
||||
-- local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra anta singola con divisione orizzontale ------------------------
|
||||
|
||||
-- -- aggiungo anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints)
|
||||
--
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
|
||||
@@ -145,12 +151,11 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
------------------------ Finestra anta singola con divisione verticale ------------------------
|
||||
|
||||
-- -- aggiungo anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints)
|
||||
--
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea1Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea2Id, WIN_FILLTYPES.GLASS)
|
||||
@@ -158,14 +163,13 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
------------------------ Finestra anta singola con divisione orizzontale e verticale ------------------------
|
||||
|
||||
-- -- aggiungo anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints)
|
||||
--
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nSashId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill1Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill2Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
|
||||
@@ -175,8 +179,7 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
------------------------ Finestra anta singola con divisione custom ------------------------
|
||||
|
||||
-- -- aggiungo anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSashId = WinCreate.AddSash( nFrameId, vSashJoints)
|
||||
|
||||
-- local nTempSplitLayerId = EgtGroup( nFrameId)
|
||||
-- EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT)
|
||||
@@ -198,17 +201,14 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
@@ -216,17 +216,14 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2, _, WIN_SPLITTYPES.FRENCH)
|
||||
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
@@ -234,165 +231,232 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta con montanti verticali ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta con montanti verticali(2) ------------------------
|
||||
|
||||
-- -- definisco divisioni
|
||||
-- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 3, WindowWidth / 3})
|
||||
-- -- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PROPORTIONAL, { 1, 1}, 3)
|
||||
-- -- local nAreaList = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, 1)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local nSash1Id = WinCreate.AddSash( nAreaList[1], vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nAreaList[2], vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nAreaList[3], vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta con montante verticale e ante battente e ricevente ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta con montanti orizzontali ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
|
||||
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 3)
|
||||
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, 2 / 3 * WindowHeight)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
---------------------- Finestra tripla anta con montante orizzontale e verticale ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta battente / ricevente / ricevente ------------------------
|
||||
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE_IN)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE_OUT)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tripla anta battente / battente / ricevente ------------------------
|
||||
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE_OUT)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE_IN)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra quattro ante battente / battente / ricevente / ricevente ------------------------
|
||||
|
||||
-- -- definisco divisioni
|
||||
-- local nArea1Id, nAreaTmpId = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea2Id, nAreaTmp1Id = WinCreate.AddSplit( nAreaTmpId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea3Id, nArea4Id = WinCreate.AddSplit( nAreaTmp1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 4, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints, WIN_SASHTYPES.ACTIVE_OUT)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.ACTIVE_IN)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE_IN)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
-- -- aggiungo quarta anta
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea4Id, vSashJoints, WIN_SASHTYPES.INACTIVE_OUT)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra sei ante con montanti verticali e orizzontale ------------------------
|
||||
|
||||
-- -- definisco divisione orizzontale
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
-- -- definisco divisioni verticali
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- local nArea11Id, nArea0Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea00Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea22Id, nArea23Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea11Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea12Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea13Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo quarta anta
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea21Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo quinta anta
|
||||
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash5Id = WinCreate.AddSash( nArea22Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo sesta anta
|
||||
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash6Id = WinCreate.AddSash( nArea23Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
@@ -400,71 +464,67 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- definisco divisione orizzontale
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
-- -- definisco divisioni verticali
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
|
||||
-- local nArea11Id, nArea0Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nArea21Id, nArea00Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea22Id, nArea23Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea11Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea12Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea13Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo quarta anta
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea21Id, vSashJoints)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo quinta anta
|
||||
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
-- local nSash5Id = WinCreate.AddSash( nArea22Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo sesta anta
|
||||
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash6Id = WinCreate.AddSash( nArea23Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra tre ante con montante verticale, ante battente ricevente e split di tutte le ante ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea0Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, vSashJoints)
|
||||
-- -- definisco divisione
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- definisco divisione
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- definisco divisione
|
||||
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
@@ -474,39 +534,33 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
------------------------ Finestra tre ante con montante orizzontale e verticale, ante battente ricevente e split di tutte le ante ------------------------
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight)
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- -- definisco seconda divisione
|
||||
-- local nArea2Id, nArea3Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
|
||||
-- local nArea1Id, nArea0Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, 2 * WindowHeight / 3)
|
||||
-- local nArea2Id, nArea00Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea3Id, nArea4Id = WinCreate.AddSplit( nArea00Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3, _, WIN_SPLITTYPES.FRENCH)
|
||||
--
|
||||
-- -- aggiungo anta sopra
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash0Id = WinCreate.AddSash( nArea0Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash0Id = WinCreate.AddSash( nArea0Id, vSashJoints)
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill0Id = WinCreate.AddFill( nSash0Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea2Id, vSashJoints)
|
||||
-- -- definisco divisione
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nSash1Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill11Id = WinCreate.AddFill( nArea11Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill12Id = WinCreate.AddFill( nArea12Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea2Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE)
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea3Id, vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- -- definisco divisione
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nSash2Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
-- local nFill21Id = WinCreate.AddFill( nArea21Id, WIN_FILLTYPES.GLASS)
|
||||
-- local nFill22Id = WinCreate.AddFill( nArea22Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
--
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea4Id, vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- -- definisco divisione
|
||||
-- local nArea31Id, nArea32Id = WinCreate.AddSplit( nSash3Id, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight * 2 / 5)
|
||||
-- -- aggiungo vetri
|
||||
@@ -516,115 +570,18 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- -- creo gruppo frame
|
||||
-- local nFrameLayerId = EgtGroup( GDB_ID.ROOT)
|
||||
-- EgtSetName( nFrameLayerId, WIN_FRAME)
|
||||
-- local nOutlineLayerId = EgtGroup( nFrameLayerId)
|
||||
-- EgtSetName( nOutlineLayerId, WIN_OUTLINE)
|
||||
|
||||
|
||||
-- -- disegno outline
|
||||
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
|
||||
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
|
||||
-- EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0), Vector3d( -1, 0.5, 0))
|
||||
-- EgtSetName( nFrameTopId, WIN_TOP)
|
||||
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
|
||||
-- EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
-- -- cerchio
|
||||
-- local nFrameBottomId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
|
||||
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
-- local nFrameRightId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, 0, 0), Point3d( WindowWidth, WindowHeight, 0))
|
||||
-- EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
-- local nFrameTopId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight, 0), Point3d( 0, WindowHeight, 0))
|
||||
-- EgtSetName( nFrameTopId, WIN_TOP)
|
||||
-- local nFrameLeftId = EgtArcC2P( nOutlineLayerId, Point3d( WindowHeight / 2, WindowHeight / 2, 0), Point3d( 0, WindowHeight, 0), Point3d( 0, 0, 0))
|
||||
-- EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
|
||||
|
||||
|
||||
-- -- disegno outline
|
||||
-- local nFrameBottomId = EgtLine( nOutlineLayerId, Point3d( 0, 0, 0), Point3d( WindowWidth, 0, 0))
|
||||
-- EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
-- local nFrameRightId = EgtLine( nOutlineLayerId, Point3d( WindowWidth, 0, 0), Point3d( WindowWidth+400, WindowHeight, 0))
|
||||
-- EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
-- local nFrameTopId = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0))
|
||||
-- --local nFrameTopId = EgtArc2PV( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( -200, WindowHeight-300, 0), Vector3d( -1, 0.5, 0))
|
||||
|
||||
-- --local nFirstArcId = EgtArc2PDEx(nOutlineLayerId,{-200,1220,0},{0,1700,0},GDB_PT.STD,-1,90,GDB_RT.GRID) -- Id=369
|
||||
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFirstArcId,true) -- Id=369
|
||||
-- --local nSecondArcId = EgtArc2PDEx(nOutlineLayerId,{0,1700,0},{1700,1900,0},GDB_PT.STD,-1,44.7603,GDB_RT.GRID) -- Id=370
|
||||
-- --EgtAddCurveCompoCurve(nFrameTopId,nSecondArcId,true,true) -- Ok=1
|
||||
-- --local nThirdArcId = EgtArc2PDEx(nOutlineLayerId,{1700,1900,0},{1930,1520,0},GDB_PT.STD,199,328.6594,GDB_RT.GRID) -- Id=370
|
||||
-- --EgtAddCurveCompoCurve(nFrameTopId,nThirdArcId,true,true) -- Ok=1
|
||||
-- --EgtInvertCurve( nFrameTopId)
|
||||
|
||||
-- --local nFrameTop1Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth+400, WindowHeight, 0), Point3d( WindowWidth / 2, WindowHeight+100, 0))
|
||||
-- --local nFrameTop2Id = EgtLine( nOutlineLayerId, Point3d( WindowWidth / 2, WindowHeight+100, 0), Point3d( -200, WindowHeight-300, 0))
|
||||
-- --local nFrameTopId = EgtCurveCompo(nOutlineLayerId,nFrameTop1Id,true) -- Id=369
|
||||
-- --EgtAddCurveCompoCurve(nFrameTopId,nFrameTop2Id,true,true) -- Ok=1
|
||||
|
||||
-- EgtSetName( nFrameTopId, WIN_TOP)
|
||||
-- local nFrameLeftId = EgtLine( nOutlineLayerId, Point3d( -200, WindowHeight-300, 0), Point3d( 0, 0, 0))
|
||||
-- EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
|
||||
|
||||
-- -- scelgo tipo di giunzioni
|
||||
-- local JointType = WIN_JNT.FULL_H
|
||||
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BL, JointType)
|
||||
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_BR, JointType)
|
||||
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TL, JointType)
|
||||
-- EgtSetInfo( nOutlineLayerId, WIN_JOINT_TR, JointType)
|
||||
|
||||
|
||||
-- -- funzione che assegna i profili serramento ai vari outline
|
||||
-- -- per il momento li assegno a mano
|
||||
-- EgtSetInfo( nFrameBottomId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
|
||||
-- EgtSetInfo( nFrameRightId, WIN_PROFILETYPE, WIN_SASH_TOP)
|
||||
-- EgtSetInfo( nFrameTopId, WIN_PROFILETYPE, WIN_SASH_TOP)
|
||||
-- EgtSetInfo( nFrameLeftId, WIN_PROFILETYPE, WIN_SASH_TOP)
|
||||
|
||||
|
||||
|
||||
-- -- definisco prima divisione
|
||||
-- WinLib.AddSplit( nHoleLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 2)
|
||||
|
||||
|
||||
-- WinLib.AddSplit( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
|
||||
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.VERTICAL, WIN_MEASURE.ABSOLUT, { WindowWidth / 5, WindowWidth / 3 * 2})
|
||||
--WinLib.AddSplits( nFrameLayerId, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, { 1.5, 3}, 4.5)
|
||||
-- local nSplitId = EgtLine( nOutlineLayerId, Point3d( 0, WindowHeight / 2, 0), Point3d( WindowWidth, WindowHeight / 4, 0))
|
||||
|
||||
-- local nArc1Id = EgtArc2PDEx( nOutlineLayerId, { 600, 1500, 0}, { 900, 800, 0}, GDB_PT.STD, -1, 270, GDB_RT.GRID) -- Id=301
|
||||
-- local nSplitId = EgtCurveCompo( nOutlineLayerId, nArc1Id, true) -- Id=301
|
||||
-- local nArc2Id = EgtArc2PDEx( nOutlineLayerId, { 900, 800, 0}, { 900, 0, 0}, GDB_PT.STD, -1, 316.3972, GDB_RT.GRID) -- Id=302
|
||||
-- EgtAddCurveCompoCurve( nSplitId, nArc2Id, true, true) -- Ok=1
|
||||
-- EgtInvertCurve( nSplitId)
|
||||
|
||||
-- WinLib.AddGenSplit( nFrameLayerId, nSplitId)
|
||||
|
||||
-- local nArea1Id = EgtGetFirstNameInGroup( nHoleLayerId, WIN_AREA1)
|
||||
-- WinLib.AddSplit( nArea1Id, WIN_SPLITTYPE.HORIZONTAL, WIN_MEASURE.PROPORTIONAL, 2, 3)
|
||||
|
||||
|
||||
-- creo pezzi per outline
|
||||
-- local nCurrOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
-- while nCurrOutlineId do
|
||||
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
|
||||
-- nCurrOutlineId = EgtGetNext( nCurrOutlineId)
|
||||
-- end
|
||||
-- local nCurrOutlineId = EgtGetFirstNameInGroup( nOutlineLayerId, WIN_SPLIT)
|
||||
-- WinLib.CreatePartFromOutline( nFrameLayerId, nCurrOutlineId)
|
||||
-- aggiungo ferramenta
|
||||
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'
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+124
-22
@@ -18,6 +18,17 @@ local WinConst = {}
|
||||
|
||||
------------------------------------------- PARAMETERS -------------------------------------------
|
||||
|
||||
-- tipi di telaio
|
||||
WIN_FRAME_TYPE = {
|
||||
RECT = 1,
|
||||
CHAMFER_SIDE = 2,
|
||||
CHAMFER = 3,
|
||||
ROUND_ARC = 4,
|
||||
SEGMENTAL_ARC = 5,
|
||||
POINTED_ARC = 6,
|
||||
TRG = 7,
|
||||
}
|
||||
|
||||
-- Tipi di giunzioni (joint)
|
||||
WIN_JNT = {
|
||||
ANGLED = 1,
|
||||
@@ -55,6 +66,7 @@ WIN_SPLITORIENTATION = {
|
||||
WIN_MEASURE = {
|
||||
ABSOLUT = 1,
|
||||
PROPORTIONAL = 2,
|
||||
PERCENTAGE = 3,
|
||||
}
|
||||
|
||||
-- tipo di Area
|
||||
@@ -69,10 +81,12 @@ WIN_AREATYPES = {
|
||||
-- tipo di split:
|
||||
-- mullion = montante
|
||||
-- french = battente / ricevente
|
||||
-- mixed = cambio profilo
|
||||
WIN_SPLITTYPES = {
|
||||
NULL = 0,
|
||||
MULLION = 1,
|
||||
FRENCH = 2,
|
||||
MIXED = 3,
|
||||
}
|
||||
|
||||
-- tipi di riempimento interno
|
||||
@@ -87,6 +101,17 @@ WIN_SASHTYPES = {
|
||||
NULL = 0,
|
||||
ACTIVE = 1,
|
||||
INACTIVE = 2,
|
||||
ACTIVE_IN = 3,
|
||||
ACTIVE_OUT = 4,
|
||||
INACTIVE_IN = 5,
|
||||
INACTIVE_OUT = 6,
|
||||
}
|
||||
|
||||
WIN_CHILDREN_TYPES = {
|
||||
NULL = 0,
|
||||
SASH = 1,
|
||||
FILL = 2,
|
||||
MIXED = 3,
|
||||
}
|
||||
|
||||
WIN_SURF_APPROX = 0.05
|
||||
@@ -97,6 +122,8 @@ WIN_PROFILEPATH = 'ProfilePath'
|
||||
WIN_FRAME = 'Frame'
|
||||
WIN_AREAOUTLINE = 'BaseOutline'
|
||||
WIN_OUTLINE = 'Outline'
|
||||
WIN_SELECTION = 'Selection'
|
||||
WIN_SPLITSELECTION = 'SplitSelection'
|
||||
WIN_ORIGOUTLINE = 'OrigOutline'
|
||||
WIN_GEO = 'Geo'
|
||||
WIN_SOLID = 'Solid'
|
||||
@@ -117,13 +144,12 @@ WIN_AREATYPE = 'AreaType'
|
||||
WIN_SASH = 'Sash'
|
||||
WIN_FILL = 'Fill'
|
||||
WIN_FILLTYPE = 'FillType'
|
||||
WIN_SIDE = 'Side'
|
||||
WIN_SPLITTYPE = 'SplitType'
|
||||
WIN_STARTJOINT = 'StartJoint'
|
||||
WIN_ENDJOINT = 'EndJoint'
|
||||
WIN_SASHTYPE = 'SashType'
|
||||
WIN_REF_OUTLINE = 'OutlineRef'
|
||||
WIN_REF_PART = 'PartRef'
|
||||
WIN_REF_BOTTOMRAIL_PART = 'BottomRailPartRef'
|
||||
|
||||
WIN_SASH_TOP = 'Sash_Top'
|
||||
WIN_SASH_BOTTOM = 'Sash_Bottom'
|
||||
@@ -136,8 +162,13 @@ WIN_FIXED_TOP = 'Fixed_Top'
|
||||
WIN_FIXED_BOTTOM = 'Fixed_Bottom'
|
||||
WIN_SASH_ACTIVE = 'Sash_Active'
|
||||
WIN_SASH_INACTIVE = 'Sash_Inactive'
|
||||
WIN_FRENCH_IN = 'French_In'
|
||||
WIN_FRENCH_OUT = 'French_Out'
|
||||
WIN_SASH_SPLIT = 'Sash_Split'
|
||||
WIN_FRAME_SPLIT = 'Frame_Split'
|
||||
WIN_MIXED_BOTTOM = 'Mixed_Bottom'
|
||||
WIN_MIXED_TOP = 'Mixed_Top'
|
||||
WIN_MIXED_SPLIT = 'Mixed_Split'
|
||||
|
||||
WIN_REF = 'Ref'
|
||||
WIN_SECTION = 'Section'
|
||||
@@ -145,17 +176,21 @@ WIN_STRIP = 'Strip'
|
||||
WIN_ALU = 'Alu'
|
||||
WIN_CTRIN = 'CtrIn'
|
||||
WIN_OUT = 'Out'
|
||||
WIN_IN = 'In'
|
||||
WIN_OUTOFST = 'OfstOut'
|
||||
WIN_CTRINOFST = 'OfstCtrIn'
|
||||
WIN_OFST = 'Ofst'
|
||||
WIN_SECTIONFRAME = 'SectionFrame'
|
||||
WIN_MIXED_COMMON = 'Common'
|
||||
WIN_SIMPLIFIED = 'Simplified'
|
||||
|
||||
WIN_MINIZINKEN = 'MiniZinken'
|
||||
|
||||
WIN_STARTCPDELTA = 'StartCPDelta'
|
||||
WIN_ENDCPDELTA = 'EndCPDelta'
|
||||
-- WIN_STARTCPDELTA = 'StartCPDelta'
|
||||
-- WIN_ENDCPDELTA = 'EndCPDelta'
|
||||
WIN_GEOWIDTH = 'GeoWidth'
|
||||
WIN_GLASSTHICKNESS = 'GlassThickness'
|
||||
WIN_SEMI_PROFILE = 'SemiProfileId'
|
||||
|
||||
WIN_GEOOUTLINEBOTTOM = 'GeoOutlineBottom'
|
||||
|
||||
@@ -165,6 +200,7 @@ WIN_JOINT_BDIV = 'JointBDiv'
|
||||
WIN_JOINT_TL = 'JointTL'
|
||||
WIN_JOINT_TR = 'JointTR'
|
||||
WIN_JOINT_TDIV = 'JointTDiv'
|
||||
WIN_JOINTS = 'Joints'
|
||||
|
||||
|
||||
WIN_GEO_IN = 'In'
|
||||
@@ -188,36 +224,102 @@ WIN_SOU = 'SOU'
|
||||
WIN_CHILD = 'CHILD'
|
||||
WIN_COPY = 'COPY'
|
||||
|
||||
WIN_OVERLAP = 'Overlap'
|
||||
WIN_SASH_TOP_OVERLAP = 'SashTopOverlap'
|
||||
WIN_SASH_BOTTOM_OVERLAP = 'SashBottomOverlap'
|
||||
WIN_DELTA = 'Delta'
|
||||
WIN_FILLOVERLAP = 'FillOverlap'
|
||||
WIN_FILLDELTA = 'FillDelta'
|
||||
WIN_GAPDELTA = 'GapDelta'
|
||||
WIN_GAPDELTAZ = 'GapDeltaZ'
|
||||
WIN_GAPDELTAIN = 'GapDeltaIn'
|
||||
WIN_GAPDELTAOUT = 'GapDeltaOut'
|
||||
WIN_FIXED_REF = 'FixedRef'
|
||||
WIN_SASH_REF = 'SashRef'
|
||||
WIN_SASH_DEPTH = 'SashDepth'
|
||||
WIN_RAD_REF = 'RefRad'
|
||||
WIN_EXTRA_DIST = 'ExtraDist'
|
||||
WIN_PRC_PHASE = 'PHASE'
|
||||
WIN_PRC_PROFILE_INFO = 'PROFILE_INFO'
|
||||
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_PRC_CLAMPV_1 = 'CLAMPV_1'
|
||||
WIN_PRC_CLAMPV_2 = 'CLAMPV_2'
|
||||
WIN_STRIP_DIST = 'StripDistance'
|
||||
|
||||
WIN_REF_SPLIT = 'RefSplit'
|
||||
WIN_CRV_ON_FRENCH_SPLIT = 'OutlineOnFrenchSplit'
|
||||
WIN_PREV_OUTLINES = 'PrevOutlines'
|
||||
WIN_NEXT_OUTLINES = 'NextOutlines'
|
||||
|
||||
WIN_PRF_CHANGE = 'ProfileChange'
|
||||
WIN_MIXED_OUTLINES = 'ProfileChangeOutlines'
|
||||
WIN_MIXED_INTERSECTIONS = 'ProfileChangeIntersections'
|
||||
WIN_SASH_CHILDREN = 'SashChildren'
|
||||
WIN_FILL_CHILDREN = 'FillChildren'
|
||||
WIN_MIXED_SPLIT_REF = 'MixedSplitRef'
|
||||
WIN_MIXED_INTERS_REF = 'MixedIntersRef'
|
||||
WIN_MIXED_REF_START = 'MixedRefEnd'
|
||||
WIN_MIXED_REF_END = 'MixedRefStart'
|
||||
|
||||
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_DOWEL = 'Dowel'
|
||||
WIN_DWL_TOPPERPSTART = 'TopPerpStart'
|
||||
WIN_DWL_TOPPERPEND = 'TopPerpEnd'
|
||||
WIN_DWL_TOPPARASTART = 'TopParaStart'
|
||||
WIN_DWL_TOPPARAEND = 'TopParaEnd'
|
||||
WIN_DWL_BOTTOMPERPSTART = 'BottomPerpStart'
|
||||
WIN_DWL_BOTTOMPERPEND = 'BottomPerpEnd'
|
||||
WIN_DWL_BOTTOMPARASTART = 'BottomParaStart'
|
||||
WIN_DWL_BOTTOMPARAEND = 'BottomParaEnd'
|
||||
WIN_DWL_RAILBOTTOMPERPSTART = 'RailBottomPerpStart'
|
||||
WIN_DWL_RAILBOTTOMPERPEND = 'RailBottomPerpEnd'
|
||||
WIN_DWL_RAILBOTTOMPARASTART = 'RailBottomParaStart'
|
||||
WIN_DWL_RAILBOTTOMPARAEND = 'RailBottomParaEnd'
|
||||
WIN_DWL_SPLITPERPSTART = 'SplitPerpStart'
|
||||
WIN_DWL_SPLITPERPEND = 'SplitPerpEnd'
|
||||
WIN_PRC = 'Processings'
|
||||
WIN_PRC_FRAME = 'AuxFrame'
|
||||
WIN_PRC_FEATURE_TYPE = 'FEATURE_TYPE'
|
||||
WIN_PRC_TYPE = {
|
||||
HOLE = 'Hole',
|
||||
PROFILING = 'Profiling',
|
||||
POCKET = 'Pocket',
|
||||
CUT = 'Cut',
|
||||
STRIP_CUT = 'StripCut'
|
||||
}
|
||||
WIN_PRC_PROFILE_TYPE = {
|
||||
HEAD = 'Head',
|
||||
LONGITUDINAL = 'Longitudinal',
|
||||
MIXED = 'Mixed',
|
||||
GENERIC = 'Generic'
|
||||
}
|
||||
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_PRC_SIDE = 'REFERENCE_SIDE'
|
||||
WIN_PRC_SIDETYPE = {
|
||||
OUT = 'Out',
|
||||
IN = 'In',
|
||||
LEFT = 'Left',
|
||||
RIGHT = 'Right'
|
||||
}
|
||||
|
||||
WIN_DOWEL = 'Dowel'
|
||||
WIN_DWL_TOP_PERP_LEN = 'TopPerpLen'
|
||||
WIN_DWL_TOP_PARA_LEN = 'TopParaLen'
|
||||
WIN_DWL_BOTTOM_PERP_LEN = 'BottomPerpLen'
|
||||
WIN_DWL_BOTTOM_PARA_LEN = 'BottomParaLen'
|
||||
WIN_DWL_RAILBOTTOM_PERP_LEN = 'RailBottomPerpLen'
|
||||
WIN_DWL_RAILBOTTOM_PARA_LEN = 'RailBottomParaLen'
|
||||
WIN_DWL_SPLIT_PERP_LEN = 'SplitPerpLen'
|
||||
WIN_DWL_SPLIT_PARA_LEN = 'SplitParaLen'
|
||||
|
||||
|
||||
WIN_PRJ_ORIGSPLIT = 'OrigSplit'
|
||||
|
||||
WIN_HARDWARE = 'Hardware'
|
||||
WIN_HDW_FAVOURITE = 'HdwFavourite'
|
||||
WIN_HDW_HANDLE = 'HdwHandle'
|
||||
WIN_HDW_FRAME = 'HdwFrame'
|
||||
---------------------------------------------------------------------
|
||||
return WinConst
|
||||
|
||||
+3246
-2359
File diff suppressed because it is too large
Load Diff
+397
-250
@@ -22,6 +22,12 @@ require( 'WinConst')
|
||||
|
||||
-- funzioni
|
||||
|
||||
local function AddInfo( nId, sInfo, nVal)
|
||||
local vInfo = EgtGetInfo( nId, sInfo, 'vi') or {}
|
||||
table.insert( vInfo, nVal)
|
||||
EgtSetInfo( nId, sInfo, vInfo)
|
||||
end
|
||||
|
||||
-- funzione che importa il profilo
|
||||
function WinCreate.ImportProfile( sProfilePath)
|
||||
-- verifico esistenza file
|
||||
@@ -53,74 +59,151 @@ function WinCreate.ImportProfile( sProfilePath)
|
||||
return true
|
||||
end
|
||||
|
||||
-- funzione che crea il buco rettangolare per la finestra
|
||||
function WinCreate.CreateFrame( dWidth, dHeight, nJointBL, nJointBR, nJointTR, nJointTL)
|
||||
----------------------------------------------------------------------------------
|
||||
------------------------------------- TELAIO -------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea il buco per la finestra a partire da curve generiche
|
||||
function WinCreate.CreateGenFrame( vFrameCrvs, vJoints)
|
||||
-- creo gruppo per telaio
|
||||
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
|
||||
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
|
||||
-- imposto il tipo
|
||||
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
|
||||
-- creo il gruppo con le curve di outline
|
||||
local nAreaOutlineLayerId = EgtGroup( nFrameAreaId)
|
||||
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
|
||||
-- disegno outline
|
||||
local nFrameBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
for i = 1, #vFrameCrvs do
|
||||
EgtRelocateGlob( vFrameCrvs[i], nAreaOutlineLayerId)
|
||||
end
|
||||
-- imposto tipo giunzioni
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
|
||||
return nFrameAreaId
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINTS, vJoints)
|
||||
|
||||
return nFrameAreaId
|
||||
end
|
||||
-- funzione che crea il buco per la finestra
|
||||
function WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, nJointBL, nJointBR, nJointTR, nJointTL)
|
||||
-- creo gruppo per telaio
|
||||
local nFrameAreaId = EgtGroup( GDB_ID.ROOT)
|
||||
EgtSetName( nFrameAreaId, WIN_AREA .. '(' .. WIN_FRAME .. ')')
|
||||
-- imposto il tipo
|
||||
EgtSetInfo( nFrameAreaId, WIN_AREATYPE, WIN_AREATYPES.FRAME)
|
||||
local nAreaOutlineLayerId = EgtGroup( nFrameAreaId)
|
||||
EgtSetName( nAreaOutlineLayerId, WIN_AREAOUTLINE)
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea le curve che definiscono il telaio in base alla geometria richiesta
|
||||
local function CreateFrameCurves( nLayerId, nType, dWidth, dHeight, dVal)
|
||||
|
||||
-- rettangolo
|
||||
if nType == WIN_FRAME_TYPE.RECT then
|
||||
-- telaio rettangolare
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTopId = EgtLine( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nTopId, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- lato top inclinato
|
||||
elseif nType == WIN_FRAME_TYPE.CHAMFER_SIDE then
|
||||
-- dHeight è l'altezza del lato sx, dVal è l'altezza del lato dx
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dVal, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTopId = EgtLine( nLayerId, Point3d( dWidth, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nTopId, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- triangular arch
|
||||
elseif nType == WIN_FRAME_TYPE.CHAMFER then
|
||||
-- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTop1Id = EgtLine( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( dWidth / 2, dVal, 0))
|
||||
local nTop2Id = EgtLine( nLayerId, Point3d( dWidth / 2, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nTop1Id, WIN_TOP)
|
||||
EgtSetName( nTop2Id, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- arco a tutto sesto
|
||||
elseif nType == WIN_FRAME_TYPE.ROUND_ARC then
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight - 0.5 * dWidth, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTopId = EgtArcCPA( nLayerId, Point3d( 0.5 * dWidth, dHeight - 0.5 * dWidth, 0), Point3d( dWidth, dHeight - 0.5 * dWidth, 0), 180, 0)
|
||||
EgtSetName( nTopId, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight - 0.5 * dWidth, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- arco ribassato
|
||||
elseif nType == WIN_FRAME_TYPE.SEGMENTAL_ARC then
|
||||
-- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTopId = EgtArc3P( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Point3d( 0, dHeight, 0))
|
||||
EgtSetName( nTopId, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- arco a tutto sesto
|
||||
elseif nType == WIN_FRAME_TYPE.POINTED_ARC then
|
||||
-- dHeight è l'altezza dei lati verticali, dVal è l'altezza complessiva della finestra
|
||||
-- verifico che le due altezze abbiano valori sensati per realizzare i due archi
|
||||
if dVal - dHeight < 0.5 * dWidth then
|
||||
return
|
||||
end
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nRightId = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
EgtSetName( nRightId, WIN_RIGHT)
|
||||
local nTop1Id = EgtArc2PV( nLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Y_AX())
|
||||
EgtSetName( nTop1Id, WIN_TOP)
|
||||
local nTop2Id = EgtArc2PV( nLayerId, Point3d( 0, dHeight, 0), Point3d( 0.5 * dWidth, dVal, 0), Y_AX())
|
||||
EgtInvertCurve( nTop2Id)
|
||||
EgtSetName( nTop2Id, WIN_TOP)
|
||||
local nLeftId = EgtLine( nLayerId, Point3d( 0, dHeight, 0), ORIG())
|
||||
EgtSetName( nLeftId, WIN_LEFT)
|
||||
|
||||
-- triangolo
|
||||
elseif nType == WIN_FRAME_TYPE.TRG then
|
||||
local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( dWidth, 0, 0))
|
||||
EgtSetName( nBottomId, WIN_BOTTOM)
|
||||
local nEdge1Id = EgtLine( nLayerId, Point3d( dWidth, 0, 0), Point3d( dVal, dHeight, 0))
|
||||
local nEdge2Id = EgtLine( nLayerId, Point3d( dVal, dHeight, 0), ORIG())
|
||||
-- un lato verticale è right/left, un lato inclinato è top
|
||||
if dVal < GEO.EPS_SMALL then
|
||||
EgtSetName( nEdge1Id, WIN_TOP)
|
||||
EgtSetName( nEdge2Id, WIN_LEFT)
|
||||
elseif abs( dVal - dWidth) < GEO.EPS_SMALL then
|
||||
EgtSetName( nEdge1Id, WIN_RIGHT)
|
||||
EgtSetName( nEdge2Id, WIN_TOP)
|
||||
else
|
||||
EgtSetName( nEdge1Id, WIN_TOP)
|
||||
EgtSetName( nEdge2Id, WIN_TOP)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea il telaio a partire da una specifica geometria ( rettangolo, chamfer...)
|
||||
function WinCreate.CreateFrame( nType, vJoints, dWidth, dHeight, dHeight2)
|
||||
|
||||
-- creo un gruppo temporaneo per le curve di outline
|
||||
local nTmpLay = EgtGroup( GDB_ID.ROOT)
|
||||
-- disegno outline
|
||||
EgtRelocateGlob( nFrameBottomId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
EgtRelocateGlob( nFrameRightId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
EgtRelocateGlob( nFrameTopId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
EgtRelocateGlob( nFrameLeftId, nAreaOutlineLayerId)
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
-- imposto tipo giunzioni
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
|
||||
CreateFrameCurves( nTmpLay, nType, dWidth, dHeight, dHeight2)
|
||||
local nFrameAreaId = WinCreate.CreateGenFrame( EgtGetAllInGroup( nTmpLay), vJoints)
|
||||
EgtErase( nTmpLay)
|
||||
|
||||
return nFrameAreaId
|
||||
end
|
||||
|
||||
-- -- funzione che crea il telaio a partire dal buco
|
||||
-- function WinCreate.CreateFrameOnHole( nHoleLayerId, dWidth, dHeight)
|
||||
-- local nAreaOutlineLayerId = EgtGroup( nHoleLayerId)
|
||||
-- EgtSetName( nAreaOutlineLayerId, WIN_OUTLINE)
|
||||
-- -- disegno outline
|
||||
-- local nHoleBottomId = EgtLine( nAreaOutlineLayerId, Point3d( 0, 0, 0), Point3d( dWidth, 0, 0))
|
||||
-- EgtSetName( nHoleBottomId, WIN_BOTTOM)
|
||||
-- local nHoleRightId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, 0, 0), Point3d( dWidth, dHeight, 0))
|
||||
-- EgtSetName( nHoleRightId, WIN_RIGHT)
|
||||
-- local nHoleTopId = EgtLine( nAreaOutlineLayerId, Point3d( dWidth, dHeight, 0), Point3d( 0, dHeight, 0))
|
||||
-- EgtSetName( nHoleTopId, WIN_TOP)
|
||||
-- local nHoleLeftId = EgtLine( nAreaOutlineLayerId, Point3d( 0, dHeight, 0), Point3d( 0, 0, 0))
|
||||
-- EgtSetName( nHoleLeftId, WIN_LEFT)
|
||||
-- end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-------------------------------------- ANTA --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge una anta
|
||||
function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSashType)
|
||||
function WinCreate.AddSash( nAreaId, vJoints, nSashType)
|
||||
-- creo nuova area
|
||||
local nSashAreaId = EgtGroup( nAreaId)
|
||||
EgtSetName( nSashAreaId, WIN_AREA .. '(' .. WIN_SASH .. ')')
|
||||
@@ -135,14 +218,12 @@ function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSa
|
||||
while nAreaOutlineId do
|
||||
local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId)
|
||||
EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId)
|
||||
EgtSetInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
|
||||
EgtRemoveInfo( nOutlineId, WIN_CHILD)
|
||||
AddInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
|
||||
nAreaOutlineId = EgtGetNext( nAreaOutlineId)
|
||||
end
|
||||
-- imposto tipo giunzioni
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BL, nJointBL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_BR, nJointBR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TL, nJointTL)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINT_TR, nJointTR)
|
||||
EgtSetInfo( nAreaOutlineLayerId, WIN_JOINTS, vJoints)
|
||||
-- imposto tipo di anta se presente
|
||||
if nSashType then
|
||||
EgtSetInfo( nSashAreaId, WIN_SASHTYPE, nSashType)
|
||||
@@ -150,6 +231,9 @@ function WinCreate.AddSash( nAreaId, nJointBL, nJointBR, nJointTR, nJointTL, nSa
|
||||
return nSashAreaId
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-------------------------------------- FILL --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge un riempimento
|
||||
function WinCreate.AddFill( nAreaId, FillType)
|
||||
-- creo nuova area
|
||||
@@ -166,33 +250,29 @@ function WinCreate.AddFill( nAreaId, FillType)
|
||||
while nAreaOutlineId do
|
||||
local nOutlineId = EgtCopy( nAreaOutlineId, nAreaOutlineLayerId)
|
||||
EgtSetInfo( nOutlineId, WIN_SOU, nAreaOutlineId)
|
||||
EgtSetInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BR)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TL)
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TR)
|
||||
EgtRemoveInfo( nOutlineId, WIN_CHILD)
|
||||
AddInfo( nAreaOutlineId, WIN_CHILD, nOutlineId)
|
||||
nAreaOutlineId = EgtGetNext( nAreaOutlineId)
|
||||
end
|
||||
-- rimuovo eventuali info di giunzioni
|
||||
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINTS)
|
||||
|
||||
-- imposto tipo di fill
|
||||
EgtSetInfo( nFillAreaId, WIN_FILLTYPE, FillType)
|
||||
return nFillAreaId
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
------------------------------------- SPLIT --------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea un taglio split
|
||||
function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType)
|
||||
function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, nProportion, nSplitType)
|
||||
-- creo layer temporaneo per split
|
||||
local nTempSplitLayerId = EgtGroup( nAreaLayerId)
|
||||
EgtSetName( nTempSplitLayerId, WIN_TEMPSPLIT)
|
||||
-- recupero contorno area precedente
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
|
||||
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
|
||||
local OutlineIds = {}
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
table.insert( OutlineIds, nOutlineId)
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
local nTotSplitId
|
||||
if SplitType == WIN_SPLITORIENTATION.VERTICAL then
|
||||
-- creo linea
|
||||
@@ -201,6 +281,8 @@ function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, n
|
||||
nCalcPosition = nPosition
|
||||
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
|
||||
nCalcPosition = b3OutlineLayer:getDimX() / nProportion * nPosition
|
||||
elseif MeasureType == WIN_MEASURE.PERCENTAGE then
|
||||
nCalcPosition = b3OutlineLayer:getDimX() * nPosition
|
||||
end
|
||||
nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + X_AX() * nCalcPosition, b3OutlineLayer:getMin() + X_AX() * nCalcPosition + Y_AX() * b3OutlineLayer:getDimY())
|
||||
elseif SplitType == WIN_SPLITORIENTATION.HORIZONTAL then
|
||||
@@ -210,6 +292,8 @@ function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, n
|
||||
nCalcPosition = nPosition
|
||||
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
|
||||
nCalcPosition = b3OutlineLayer:getDimY() / nProportion * nPosition
|
||||
elseif MeasureType == WIN_MEASURE.PERCENTAGE then
|
||||
nCalcPosition = b3OutlineLayer:getDimY() * nPosition
|
||||
end
|
||||
nTotSplitId = EgtLine( nTempSplitLayerId, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition, b3OutlineLayer:getMin() + Y_AX() * nCalcPosition + X_AX() * b3OutlineLayer:getDimX())
|
||||
end
|
||||
@@ -219,100 +303,88 @@ function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, n
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea tagli split multipli
|
||||
function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion)
|
||||
function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList, nProportion, nSplitType)
|
||||
local AreaList = {}
|
||||
if MeasureType == WIN_MEASURE.ABSOLUT then
|
||||
local nResArea1
|
||||
local nResArea2 = nAreaLayerId
|
||||
for nIndex = 1, #PositionList do
|
||||
WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
|
||||
if nIndex > 1 then
|
||||
EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId)
|
||||
end
|
||||
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, PositionList[nIndex], nProportion, nSplitType)
|
||||
table.insert( AreaList, nResArea1)
|
||||
if nIndex == #PositionList then
|
||||
table.insert( AreaList, nResArea2)
|
||||
end
|
||||
end
|
||||
elseif MeasureType == WIN_MEASURE.PROPORTIONAL then
|
||||
local nResArea1
|
||||
local nResArea2 = nAreaLayerId
|
||||
local dAddPosition = 0
|
||||
for nIndex = 1, #PositionList do
|
||||
WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, PositionList[nIndex], nProportion)
|
||||
if nIndex > 1 then
|
||||
EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId)
|
||||
end
|
||||
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, PositionList[nIndex], nProportion - dAddPosition, nSplitType)
|
||||
table.insert( AreaList, nResArea1)
|
||||
if nIndex == #PositionList then
|
||||
table.insert( AreaList, nResArea2)
|
||||
end
|
||||
dAddPosition = dAddPosition + PositionList[nIndex]
|
||||
end
|
||||
elseif MeasureType == WIN_MEASURE.PERCENTAGE then
|
||||
local nResArea1
|
||||
local nResArea2 = nAreaLayerId
|
||||
local dAddPosition = 0
|
||||
local sChildAreas = ''
|
||||
for nIndex = 1, #PositionList do
|
||||
if nIndex > 1 then
|
||||
EgtSetInfo( nResArea2, WIN_PRJ_ORIGSPLIT, nAreaLayerId)
|
||||
sChildAreas = sChildAreas .. nResArea2 .. EgtIf( nIndex < #PositionList, ',', '')
|
||||
end
|
||||
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, EgtIf( nIndex == 1, PositionList[nIndex], PositionList[nIndex] / ( 1 - dAddPosition)), nProportion, nSplitType)
|
||||
table.insert( AreaList, nResArea1)
|
||||
if nIndex == #PositionList then
|
||||
table.insert( AreaList, nResArea2)
|
||||
end
|
||||
dAddPosition = dAddPosition + PositionList[nIndex]
|
||||
end
|
||||
EgtSetInfo( nAreaLayerId, 'ChildSplit', sChildAreas)
|
||||
end
|
||||
return AreaList
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che assegna il nome alla curva di split nella sottoarea in base alla sua direzione
|
||||
local function SetSplitName( nSplitId)
|
||||
|
||||
local vtMedia = ( ( EgtEV( nSplitId) - EgtSV( nSplitId)) / 2)
|
||||
if not vtMedia:normalize() then
|
||||
vtMedia = EgtSV( nSplitId)
|
||||
end
|
||||
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
|
||||
if vtMedia:getX() > 0 then
|
||||
EgtSetName( nSplitId, WIN_BOTTOM)
|
||||
else
|
||||
EgtSetName( nSplitId, WIN_TOP)
|
||||
end
|
||||
else
|
||||
if vtMedia:getY() > 0 then
|
||||
EgtSetName( nSplitId, WIN_RIGHT)
|
||||
else
|
||||
EgtSetName( nSplitId, WIN_LEFT)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- funzione che crea un taglio split da una curva generica
|
||||
function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
-- se area nulla diventa di tipo split
|
||||
local nAreaType = EgtGetInfo( nAreaLayerId, WIN_AREATYPE, 'i')
|
||||
if nAreaType == WIN_AREATYPES.NULL then
|
||||
EgtSetInfo( nAreaLayerId, WIN_AREATYPE, WIN_AREATYPES.SPLIT)
|
||||
end
|
||||
-- creo layer per split
|
||||
local nSplitLayerId = EgtGroup( nAreaLayerId)
|
||||
EgtSetName( nSplitLayerId, WIN_BASESPLIT)
|
||||
-- sposto curva split nel layer
|
||||
EgtRelocateGlob( nSplitId, nSplitLayerId)
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
|
||||
local b3OutlineLayer = EgtGetBBox( nOutlineLayerId, GDB_BB.STANDARD)
|
||||
-- allungo curva split per cercare intersezioni
|
||||
EgtExtendCurveStartByLen( nSplitId, 10)
|
||||
EgtExtendCurveEndByLen( nSplitId, 10)
|
||||
-- recupero lista intersezioni
|
||||
local OutlineInters = {}
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
-- verifico se ci siano intersezioni con questo outline
|
||||
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
|
||||
if ptInters then
|
||||
table.insert( OutlineInters, { Id = nOutlineId, IntersPoint = ptInters})
|
||||
end
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
local ptStartSplit = EgtSP( nSplitId)
|
||||
local ptEndSplit = EgtEP( nSplitId)
|
||||
local StartInters
|
||||
local EndInters
|
||||
for nIndex = 1, #OutlineInters do
|
||||
local CurrOutInters = OutlineInters[nIndex]
|
||||
CurrOutInters.StartDistance = (CurrOutInters.IntersPoint - ptStartSplit):sqlen()
|
||||
CurrOutInters.EndDistance = (CurrOutInters.IntersPoint - ptEndSplit):sqlen()
|
||||
if not StartInters or CurrOutInters.StartDistance < StartInters.StartDistance then
|
||||
StartInters = CurrOutInters
|
||||
end
|
||||
if not EndInters or CurrOutInters.EndDistance < EndInters.EndDistance then
|
||||
EndInters = CurrOutInters
|
||||
end
|
||||
end
|
||||
-- accorcio la curva split su intersezione outline
|
||||
local dStartSplitInters = EgtCurveParamAtPoint( nSplitId, StartInters.IntersPoint)
|
||||
EgtTrimCurveStartAtParam( nSplitId, dStartSplitInters)
|
||||
local dEndSplitInters = EgtCurveParamAtPoint( nSplitId, EndInters.IntersPoint)
|
||||
EgtTrimCurveEndAtParam( nSplitId, dEndSplitInters)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, StartInters.Id)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, EndInters.Id)
|
||||
-- assegno nome profilo
|
||||
EgtSetName( nSplitId, WIN_SPLIT)
|
||||
-- creo aree
|
||||
local nArea1Id, nArea2Id = WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
-- verifico se discende da Frame
|
||||
local nParentAreaId = nAreaLayerId
|
||||
local nParentAreaType = nAreaType
|
||||
-- recupero parent fino a trovare frame o sash
|
||||
while nParentAreaType ~= WIN_AREATYPES.FRAME and nParentAreaType ~= WIN_AREATYPES.SASH do
|
||||
nParentAreaId = EgtGetParent( nParentAreaId)
|
||||
nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i')
|
||||
end
|
||||
if nParentAreaType == WIN_AREATYPES.FRAME and nSplitType then
|
||||
-- imposto tipo di split
|
||||
EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, nSplitType)
|
||||
-- EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, EgtIf( not nSplitType, WIN_SPLITTYPES.MULLION, nSplitType))
|
||||
end
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
-- funzione che crea tagli split da curve generiche
|
||||
function WinCreate.AddGenSplits( nAreaLayerId, SplitList)
|
||||
for nIndex = 1, #SplitList do
|
||||
WinCreate.AddSplit( nAreaLayerId, SplitList[nIndex])
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea le aree da un taglio split
|
||||
function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
-- creo layer per le due aree
|
||||
local function CreateAreaFromSplit( nAreaLayerId, nCompo, nSplitId, dPar1, dPar2, vOutlineCrvs)
|
||||
|
||||
-- creo layer per le due sottoaree
|
||||
local nArea1Id = EgtGroup( nAreaLayerId)
|
||||
EgtSetName( nArea1Id , WIN_AREA1)
|
||||
EgtSetInfo( nArea1Id, WIN_AREATYPE, WIN_AREATYPES.NULL)
|
||||
@@ -323,102 +395,52 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
EgtSetInfo( nArea2Id, WIN_AREATYPE, WIN_AREATYPES.NULL)
|
||||
local nArea2OutlineLayerId = EgtGroup( nArea2Id)
|
||||
EgtSetName( nArea2OutlineLayerId , WIN_AREAOUTLINE)
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
local nInters = 0
|
||||
while nOutlineId and nInters ~= 3 do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
-- calcolo intersezioni con questo outline
|
||||
local ptInters = EgtIP( nSplitId, nOutlineId, EgtSP( nSplitId))
|
||||
if ptInters then
|
||||
if nInters == 0 then
|
||||
-- trovato primo punto di intersezione - inizio area 2
|
||||
nInters = 1
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
|
||||
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
|
||||
elseif nInters == 1 then
|
||||
-- trovato secondo punto di intersezione - fine area 2
|
||||
nInters = 2
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
|
||||
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
|
||||
-- copio anche split
|
||||
local nSplitCopyId = EgtCopy( nSplitId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nSplitCopyId, WIN_SOU, nSplitId)
|
||||
EgtSetInfo( nSplitId, WIN_CHILD, nSplitCopyId)
|
||||
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
|
||||
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
|
||||
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
|
||||
EgtInvertCurve( nSplitCopyId)
|
||||
end
|
||||
-- verifico direzione per dare nome
|
||||
local vtMedia = ( ( EgtEV( nSplitCopyId) - EgtSV( nSplitCopyId)) / 2)
|
||||
if not vtMedia:normalize() then
|
||||
vtMedia = EgtSV( nSplitCopyId)
|
||||
end
|
||||
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
|
||||
EgtSetName( nSplitCopyId, WIN_BOTTOM)
|
||||
else
|
||||
EgtSetName( nSplitCopyId, WIN_LEFT)
|
||||
end
|
||||
-- inizio area 1
|
||||
nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
|
||||
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
|
||||
elseif nInters == 2 then
|
||||
-- trovato secondo punto di intersezione - fine area 1
|
||||
nInters = 3
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
local dEndIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
|
||||
EgtTrimCurveEndAtParam( nCopyId, dEndIntersParam)
|
||||
-- copio anche split
|
||||
local nSplitCopyId = EgtCopy( nSplitId, nArea1OutlineLayerId)
|
||||
EgtRemoveName( nSplitCopyId)
|
||||
EgtSetInfo( nSplitCopyId, WIN_SOU, nSplitId)
|
||||
EgtSetInfo( nSplitId, WIN_CHILD, nSplitCopyId)
|
||||
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
|
||||
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
|
||||
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
|
||||
EgtInvertCurve( nSplitCopyId)
|
||||
end
|
||||
-- verifico direzione per dare nome
|
||||
local vtMedia = ( ( EgtEV( nSplitCopyId) - EgtSV( nSplitCopyId)) / 2)
|
||||
if not vtMedia:normalize() then
|
||||
vtMedia = EgtSV( nSplitCopyId)
|
||||
end
|
||||
if abs( vtMedia:getX()) > abs( vtMedia:getY()) then
|
||||
EgtSetName( nSplitCopyId, WIN_TOP)
|
||||
else
|
||||
EgtSetName( nSplitCopyId, WIN_RIGHT)
|
||||
end
|
||||
|
||||
-- ad ogni sottoarea associo la porzione di curva composita corrispondente
|
||||
local nCrv1 = EgtCopyGlob( nCompo, nArea1OutlineLayerId)
|
||||
local nCrv2 = EgtCopyGlob( nCompo, nArea2OutlineLayerId)
|
||||
EgtTrimCurveStartEndAtParam( nCrv1, dPar2, dPar1)
|
||||
EgtTrimCurveStartEndAtParam( nCrv2, dPar1, dPar2)
|
||||
|
||||
-- copio curva di split
|
||||
local nSplitId1 = EgtCopyGlob( nSplitId, nArea1OutlineLayerId)
|
||||
local nSplitId2 = EgtCopyGlob( nSplitId, nArea2OutlineLayerId)
|
||||
-- verifico se necessaria inversione
|
||||
if AreSamePointApprox( EgtSP( nSplitId1), EgtSP( nCrv1)) then
|
||||
EgtInvertCurve( nSplitId1)
|
||||
end
|
||||
if AreSamePointApprox( EgtSP( nSplitId2), EgtSP( nCrv2)) then
|
||||
EgtInvertCurve( nSplitId2)
|
||||
end
|
||||
-- assegno il nome in base alla direzione
|
||||
SetSplitName( nSplitId1)
|
||||
SetSplitName( nSplitId2)
|
||||
-- assengo le info di source e child
|
||||
EgtSetInfo( nSplitId, WIN_CHILD, { nSplitId1, nSplitId2})
|
||||
EgtSetInfo( nSplitId1, WIN_SOU, nSplitId)
|
||||
EgtSetInfo( nSplitId2, WIN_SOU, nSplitId)
|
||||
|
||||
-- spezzo le curve composite per riottenere le curve originarie di partenza
|
||||
local nFirst1, nCnt1 = EgtExplodeCurveCompo( nCrv1)
|
||||
local nFirst2, nCnt2 = EgtExplodeCurveCompo( nCrv2)
|
||||
-- assegno nome e info
|
||||
local vCrvs = EgtTableFill( nFirst1, nCnt1)
|
||||
EgtTableAdd( vCrvs, nFirst2, nCnt2)
|
||||
for i = 1, #vCrvs do
|
||||
-- ricavo la curva di outline originale da cui deriva
|
||||
local ptM = EgtMP( vCrvs[i])
|
||||
for j = 1, #vOutlineCrvs do
|
||||
if EgtCurveParamAtPoint( vOutlineCrvs[j], ptM, 100 * GEO.EPS_SMALL) then
|
||||
-- ne prendo il nome
|
||||
EgtSetName( vCrvs[i], EgtGetName( vOutlineCrvs[j]))
|
||||
-- assegno le info di child e source
|
||||
EgtSetInfo( vCrvs[i], WIN_SOU, vOutlineCrvs[j])
|
||||
AddInfo( vOutlineCrvs[j], WIN_CHILD, vCrvs[i])
|
||||
break
|
||||
end
|
||||
elseif nInters == 1 then
|
||||
-- copio nel profilo 2
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
elseif nInters == 2 then
|
||||
-- copio nel profilo 1
|
||||
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
|
||||
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
|
||||
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
|
||||
end
|
||||
-- aggiorno indice
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
-- se arrivato alla fine riparto
|
||||
if not nOutlineId then
|
||||
nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
end
|
||||
end
|
||||
|
||||
-- scorro pezzi del primo e secondo outline per avere bottom come primo
|
||||
local nFirstInAreaId = EgtGetFirstInGroup( nArea1OutlineLayerId)
|
||||
local sFirstInAreaName = EgtGetName( nFirstInAreaId)
|
||||
@@ -434,20 +456,145 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
|
||||
nFirstInAreaId = EgtGetFirstInGroup( nArea2OutlineLayerId)
|
||||
sFirstInAreaName = EgtGetName( nFirstInAreaId)
|
||||
end
|
||||
-- error('qqq')
|
||||
|
||||
return nArea1Id, nArea2Id
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea un taglio split da una curva generica
|
||||
function WinCreate.AddGenSplit( nAreaLayerId, nSplitId, nSplitType)
|
||||
-- se area nulla diventa di tipo split
|
||||
local nAreaType = EgtGetInfo( nAreaLayerId, WIN_AREATYPE, 'i')
|
||||
if nAreaType == WIN_AREATYPES.NULL then
|
||||
EgtSetInfo( nAreaLayerId, WIN_AREATYPE, WIN_AREATYPES.SPLIT)
|
||||
end
|
||||
-- creo layer per split
|
||||
local nSplitLayerId = EgtGroup( nAreaLayerId)
|
||||
EgtSetName( nSplitLayerId, WIN_BASESPLIT)
|
||||
-- sposto curva split nel layer
|
||||
EgtRelocateGlob( nSplitId, nSplitLayerId)
|
||||
-- assegno nome profilo
|
||||
EgtSetName( nSplitId, WIN_SPLIT)
|
||||
|
||||
-- verifico se devo impostare tipo di split ( solo se deriva da tipo frame)
|
||||
if nSplitType then
|
||||
local nParentAreaId = nAreaLayerId
|
||||
local nParentAreaType = nAreaType
|
||||
-- recupero parent fino a trovare frame o sash
|
||||
while nParentAreaType ~= WIN_AREATYPES.FRAME and nParentAreaType ~= WIN_AREATYPES.SASH do
|
||||
nParentAreaId = EgtGetParent( nParentAreaId)
|
||||
nParentAreaType = EgtGetInfo( nParentAreaId, WIN_AREATYPE, 'i')
|
||||
end
|
||||
if nParentAreaType == WIN_AREATYPES.FRAME then
|
||||
-- imposto tipo di split
|
||||
EgtSetInfo( nSplitLayerId, WIN_SPLITTYPE, nSplitType)
|
||||
end
|
||||
end
|
||||
|
||||
-- Ricerca delle intersezioni :
|
||||
-- creo una curva composita a partire da tutte le curve di outline
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaLayerId, WIN_AREAOUTLINE)
|
||||
local vOutlineCrvs = EgtGetAllInGroup( nOutlineLayerId)
|
||||
local nCompo = EgtCurveCompo( nSplitLayerId, vOutlineCrvs, false)
|
||||
-- allungo curva split per cercare intersezioni
|
||||
EgtExtendCurveStartByLen( nSplitId, 10)
|
||||
EgtExtendCurveEndByLen( nSplitId, 10)
|
||||
-- trovo intersezioni tra composita e lo split
|
||||
local nFirst, nPntCnt, nCrvCnt = EgtCurveCurveInters( nCompo, nSplitId, nSplitLayerId)
|
||||
if nCrvCnt ~= 0 or nPntCnt ~= 2 then
|
||||
-- errore
|
||||
return
|
||||
end
|
||||
-- recupero i due punti di intersezione
|
||||
local pt1 = EgtSP( nFirst)
|
||||
local pt2 = EgtSP( nFirst + 1)
|
||||
EgtErase( { nFirst, nFirst + 1})
|
||||
|
||||
-- recupero i parametri di intersezione sulla curva di split
|
||||
local dSplitParS = EgtCurveParamAtPoint( nSplitId, pt1, 100 * GEO.EPS_SMALL)
|
||||
local dSplitParE = EgtCurveParamAtPoint( nSplitId, pt2, 100 * GEO.EPS_SMALL)
|
||||
-- recupero i parametri di intersezione sulla curva composita
|
||||
local dPar1 = EgtCurveParamAtPoint( nCompo, pt1, 100 * GEO.EPS_SMALL)
|
||||
local dPar2 = EgtCurveParamAtPoint( nCompo, pt2, 100 * GEO.EPS_SMALL)
|
||||
|
||||
-- ricavo i parametri di intersezione legati a start ed end dello split
|
||||
local dParCrvS = dPar1
|
||||
local dParCrvE = dPar2
|
||||
if dSplitParS > dSplitParE then
|
||||
dSplitParS, dSplitParE = dSplitParE, dSplitParS
|
||||
dParCrvS, dParCrvE = dParCrvE, dParCrvS
|
||||
end
|
||||
|
||||
-- taglio la curva di split nei punti di intersezione
|
||||
EgtTrimCurveStartEndAtParam( nSplitId, dSplitParS, dSplitParE)
|
||||
|
||||
-- setto info per intersezione start
|
||||
-- se il parametro è intero allora l'intersezione coinvolge due curve successive
|
||||
if abs( dParCrvS - ceil( dParCrvS)) < GEO.EPS_SMALL then
|
||||
local nCrv = vOutlineCrvs[ ceil( dParCrvS) + 1]
|
||||
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nOther, nCrv})
|
||||
elseif abs( dParCrvS - floor( dParCrvS)) < GEO.EPS_SMALL then
|
||||
local nCrv = vOutlineCrvs[ floor( dParCrvS) + 1]
|
||||
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nOther, nCrv})
|
||||
else
|
||||
-- se il parametro non è intero allora l'intersezione coinvolge una sola curva
|
||||
local nCrv = vOutlineCrvs[ floor( dParCrvS) + 1]
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_STARTINTERS, { nCrv})
|
||||
end
|
||||
|
||||
-- setto info per intersezione end
|
||||
if abs( dParCrvE - ceil( dParCrvE)) < GEO.EPS_SMALL then
|
||||
local nCrv = vOutlineCrvs[ ceil( dParCrvE) + 1]
|
||||
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nOther, nCrv})
|
||||
elseif abs( dParCrvE - floor( dParCrvE)) < GEO.EPS_SMALL then
|
||||
local nCrv = vOutlineCrvs[ floor( dParCrvE) + 1]
|
||||
local nOther = EgtGetPrev( nCrv) or EgtGetLastInGroup( nOutlineLayerId)
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nOther, nCrv})
|
||||
else
|
||||
local nCrv = vOutlineCrvs[ floor( dParCrvE) + 1]
|
||||
EgtSetInfo( nSplitId, WIN_SPLIT_ENDINTERS, { nCrv})
|
||||
end
|
||||
|
||||
-- creo sottoaree
|
||||
local nArea1, nArea2 = CreateAreaFromSplit( nAreaLayerId, nCompo, nSplitId, dPar1, dPar2, vOutlineCrvs)
|
||||
|
||||
EgtErase( nCompo)
|
||||
|
||||
return nArea1, nArea2
|
||||
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che crea tagli split da curve generiche
|
||||
function WinCreate.AddGenSplits( nAreaLayerId, SplitList)
|
||||
for nIndex = 1, #SplitList do
|
||||
WinCreate.AddSplit( nAreaLayerId, SplitList[nIndex])
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
---------------------------------- BOTTOMRAIL ------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
-- funzione che aggiunge uno zoccolo
|
||||
function WinCreate.AddBottomRail( nAreaId)
|
||||
local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
|
||||
if nAreaType == WIN_AREATYPES.FRAME then
|
||||
-- recupero l'outline bottom
|
||||
local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
|
||||
-- local nBottomOutlineId = EgtGetFirstNameInGroup( nBaseOutlineLayerId, WIN_BOTTOM)
|
||||
EgtSetInfo( nBaseOutlineLayerId, WIN_BOTTOMRAIL, 1)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
---------------------------------- FERRAMENTA ------------------------------------
|
||||
----------------------------------------------------------------------------------
|
||||
function WinCreate.AddHardware( nFrameId, sFavourite, sHandle)
|
||||
EgtSetInfo( nFrameId, WIN_HDW_FAVOURITE, sFavourite)
|
||||
EgtSetInfo( nFrameId, WIN_HDW_HANDLE, sHandle)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return WinCreate
|
||||
|
||||
@@ -160,19 +160,23 @@ local function ConvertTableToGeometry( AreaTable, nAreaId)
|
||||
ConvertCurveTableToEntity( nDrawFrameLayerId, CurrCurve)
|
||||
end
|
||||
local nFrameBottomId = EgtGetFirstInGroup(nDrawFrameLayerId)
|
||||
EgtSetName( nFrameBottomId, WIN_BOTTOM)
|
||||
local nFrameRightId = EgtGetNext(nFrameBottomId)
|
||||
EgtSetName( nFrameRightId, WIN_RIGHT)
|
||||
local nFrameTopId = EgtGetNext(nFrameRightId)
|
||||
EgtSetName( nFrameTopId, WIN_TOP)
|
||||
local nFrameLeftId = EgtGetNext(nFrameTopId)
|
||||
EgtSetName( nFrameLeftId, WIN_LEFT)
|
||||
-- creo frame
|
||||
nAreaId = WinCreate.CreateGenFrame( nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId, AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL])
|
||||
nAreaId = WinCreate.CreateGenFrame( {nFrameBottomId, nFrameRightId, nFrameTopId, nFrameLeftId}, {AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL]})
|
||||
-- elimino contorno frame
|
||||
EgtErase( nDrawFramePartId)
|
||||
-- se BottomRail
|
||||
if AreaTable[JWD_BOTTOM_RAIL] and AreaTable[JWD_BOTTOM_RAIL] == 1 then
|
||||
WinCreate.AddBottomRail( nAreaId)
|
||||
WinCreate.AddBottomRail( nAreaId)
|
||||
end
|
||||
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.SASH then
|
||||
nAreaId = WinCreate.AddSash( nAreaId, AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL], AreaTable[JWD_SASH_TYPE])
|
||||
nAreaId = WinCreate.AddSash( nAreaId, {AreaTable[JWD_JOINT][JWD_JOINT_BL], AreaTable[JWD_JOINT][JWD_JOINT_BR], AreaTable[JWD_JOINT][JWD_JOINT_TR], AreaTable[JWD_JOINT][JWD_JOINT_TL]}, AreaTable[JWD_SASH_TYPE])
|
||||
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.FILL then
|
||||
WinCreate.AddFill( nAreaId, AreaTable[JWD_FILL_TYPE])
|
||||
elseif AreaTable[JWD_AREA_TYPE] == WIN_AREATYPES.SPLIT then
|
||||
@@ -185,7 +189,8 @@ local function ConvertTableToGeometry( AreaTable, nAreaId)
|
||||
EgtSetName( nDrawFramePartId, 'DrawFrame')
|
||||
local nDrawFrameLayerId = EgtGroup( nDrawFramePartId)
|
||||
ConvertCurveTableToEntity( nDrawFrameLayerId, AreaTable[JWD_SPLIT][1])
|
||||
local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaId, EgtGetFirstInGroup(nDrawFrameLayerId)) --, nSplitType)
|
||||
local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaId, EgtGetFirstInGroup(nDrawFrameLayerId), AreaTable["SplitType"])
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddGenSplit( nAreaId, EgtGetFirstInGroup(nDrawFrameLayerId))
|
||||
EgtErase(nDrawFramePartId)
|
||||
ConvertTableToGeometry( AreaTable[JWD_AREA .. 1], nArea1Id)
|
||||
ConvertTableToGeometry( AreaTable[JWD_AREA .. 2], nArea2Id)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( true)
|
||||
-- EgtEnableDebug( false)
|
||||
--EgtEnableDebug( false)
|
||||
|
||||
-- Imposto direttorio per librerie
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
@@ -69,7 +69,17 @@ WinCalculate.SetCalcSolid( true)
|
||||
-- creo i pezzi
|
||||
local nFrameId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREAASTERISK)
|
||||
WinCalculate.CreatePartFromArea( nFrameId)
|
||||
WinCalculate.AddSplitDowelToParts( 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)
|
||||
if nProfileGroupId and nProfileGroupId ~= GDB_ID.NULL then
|
||||
EgtErase( nProfileGroupId)
|
||||
end
|
||||
end
|
||||
|
||||
EgtZoom( SCE_ZM.ALL)
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
--
|
||||
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
|
||||
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
|
||||
-- EEEE GGGG GGGG TTTT
|
||||
-- EEEE GGGG TTTT
|
||||
-- EEEEEEE GGGG GGGGGGG TTTT
|
||||
-- EEEEEEE GGGG GGGGGGG TTTT
|
||||
-- EEEE GGGG GGGG TTTT
|
||||
-- EEEE GGGG GGGG TTTT
|
||||
-- EEEEEEEEEE GGGGGGGGGG TTTT
|
||||
-- EEEEEEEEEE GGGGGG TTTT
|
||||
--
|
||||
-- by Egalware s.r.l.
|
||||
-- Window project software by Egalware s.r.l. 2023/05/02
|
||||
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
-- EgtEnableDebug( false)
|
||||
|
||||
-- Imposto direttorio per librerie
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
EgtOutLog("BaseDir=" .. sBaseDir)
|
||||
EgtAddToPackagePath( sBaseDir .. '?.lua')
|
||||
EgtAddToPackagePath( sBaseDir .. 'WinLib\\' .. '?.lua')
|
||||
|
||||
_G.package.loaded.WinConst = nil
|
||||
require( 'WinConst')
|
||||
_G.package.loaded.WinCreate = nil
|
||||
local WinCreate = require( 'WinCreate')
|
||||
_G.package.loaded.WinCalculate = nil
|
||||
local WinCalculate = require( 'WinCalculate')
|
||||
_G.package.loaded.WinManageProject = nil
|
||||
local WinManageProject = require( 'WinManageProject')
|
||||
|
||||
-- WDG
|
||||
|
||||
-- funzioni
|
||||
|
||||
local function WinCreate_ImportProfile()
|
||||
WinCreate.ImportProfile(WDG.PROFILE)
|
||||
end
|
||||
_G.WinCreate_ImportProfile = WinCreate_ImportProfile
|
||||
|
||||
local function WinCreate_CreateFrame()
|
||||
WDG.AREAID = WinCreate.CreateFrame( WDG.FRAMETYPE, {WDG.JOINTBL, WDG.JOINTBR, WDG.JOINTTR, WDG.JOINTTL, WDG.JOINTBL}, WDG.WIDTH, WDG.HEIGHT, WDG.HEIGHT2)
|
||||
end
|
||||
_G.WinCreate_CreateFrame = WinCreate_CreateFrame
|
||||
|
||||
local function WinCreate_AddSash()
|
||||
WDG.AREAID = WinCreate.AddSash( WDG.AREAID, {WDG.JOINTBL, WDG.JOINTBR, WDG.JOINTTR, WDG.JOINTTL, WDG.JOINTBL}, WDG.SASHTYPE)
|
||||
end
|
||||
_G.WinCreate_AddSash = WinCreate_AddSash
|
||||
|
||||
local function WinCreate_AddHardware()
|
||||
WinCreate.AddHardware(WDG.AREAID, WDG.FAVOURITE, WDG.HANDLE)
|
||||
end
|
||||
_G.WinCreate_AddHardware = WinCreate_AddHardware
|
||||
|
||||
local function WinCreate_AddFill()
|
||||
WDG.AREAID = WinCreate.AddFill(WDG.AREAID, WDG.FILLTYPE)
|
||||
end
|
||||
_G.WinCreate_AddFill = WinCreate_AddFill
|
||||
|
||||
local function WinCreate_AddBottomRail()
|
||||
WinCreate.AddBottomRail(WDG.AREAID)
|
||||
end
|
||||
_G.WinCreate_AddBottomRail = WinCreate_AddBottomRail
|
||||
|
||||
local function WinCreate_AddSplits()
|
||||
local AreaIndex = 1
|
||||
while WDG['AREAID' .. AreaIndex] do
|
||||
WDG['AREAID' .. AreaIndex] = nil
|
||||
AreaIndex = AreaIndex + 1
|
||||
end
|
||||
local PositionList = {}
|
||||
local PositionIndex = 1
|
||||
while WDG['POSITION' .. PositionIndex] do
|
||||
table.insert( PositionList, WDG['POSITION' .. PositionIndex])
|
||||
PositionIndex = PositionIndex + 1
|
||||
end
|
||||
local AreaList = WinCreate.AddSplits(WDG.AREAID, WDG.SPLITORIENTATION, WDG.MEASURETYPE, PositionList, WDG.PROPORTION, WDG.SPLITTYPE)
|
||||
for AreaIndex = 1, #AreaList do
|
||||
WDG['AREAID' .. AreaIndex] = AreaList[ AreaIndex]
|
||||
end
|
||||
PositionIndex = 1
|
||||
while WDG['POSITION' .. PositionIndex] do
|
||||
WDG['POSITION' .. PositionIndex] = nil
|
||||
PositionIndex = PositionIndex + 1
|
||||
end
|
||||
end
|
||||
_G.WinCreate_AddSplits = WinCreate_AddSplits
|
||||
|
||||
local function WinCalculate_SetCalcSolid()
|
||||
WinCalculate.SetCalcSolid(WDG.VALUE)
|
||||
end
|
||||
_G.WinCalculate_SetCalcSolid = WinCalculate_SetCalcSolid
|
||||
|
||||
local function WinCalculate_CreatePartFromArea()
|
||||
WinCalculate.CreatePartFromArea(WDG.FRAMEID)
|
||||
end
|
||||
_G.WinCalculate_CreatePartFromArea = WinCalculate_CreatePartFromArea
|
||||
|
||||
local function WinCalculate_AddHardware()
|
||||
WinCalculate.AddHardware(WDG.FRAMEID)
|
||||
end
|
||||
_G.WinCalculate_AddHardware = WinCalculate_AddHardware
|
||||
|
||||
local function WinCreate_GetHardwareOptionPath()
|
||||
WDG.HWDOPTPATH = WinCalculate.AddHardwareForSash(WDG.AREAID, true)
|
||||
end
|
||||
_G.WinCreate_GetHardwareOptionPath = WinCreate_GetHardwareOptionPath
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -365,51 +365,51 @@ local nFrameId = WinCreate.CreateFrame( WindowWidth, WindowHeight, FrameJointTyp
|
||||
|
||||
------------------------ Finestra sei ante con montanti verticali e orizzontale ------------------------
|
||||
|
||||
-- sFileName = sFileName .. 'SixSash_Vertical&HorizontalMullion'
|
||||
|
||||
-- -- definisco divisione orizzontale
|
||||
-- local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
|
||||
-- -- definisco divisioni verticali
|
||||
-- local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea23Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
-- local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea21Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
-- -- aggiungo prima anta
|
||||
-- local SashJointType = WIN_JNT.FULL_V
|
||||
-- local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- aggiungo seconda anta
|
||||
-- local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- aggiungo terza anta
|
||||
-- local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- aggiungo quarta anta
|
||||
-- local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- aggiungo quinta anta
|
||||
-- local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- -- aggiungo sesta anta
|
||||
-- local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
|
||||
--sFileName = sFileName .. 'SixSash_Horizontal&VerticalSplit_Mullion'
|
||||
--
|
||||
---- definisco divisione orizzontale
|
||||
--local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.ABSOLUT, WindowHeight / 2)
|
||||
--
|
||||
---- definisco divisioni verticali
|
||||
--local nArea11Id, nArea12Id = WinCreate.AddSplit( nArea1Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--local nArea12Id, nArea13Id = WinCreate.AddSplit( nArea12Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--local nArea21Id, nArea22Id = WinCreate.AddSplit( nArea2Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--local nArea22Id, nArea23Id = WinCreate.AddSplit( nArea22Id, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
--
|
||||
---- aggiungo prima anta
|
||||
--local SashJointType = WIN_JNT.FULL_V
|
||||
--local nSash1Id = WinCreate.AddSash( nArea11Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill1Id = WinCreate.AddFill( nSash1Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
---- aggiungo seconda anta
|
||||
--local nSash2Id = WinCreate.AddSash( nArea12Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
---- aggiungo terza anta
|
||||
--local nSash3Id = WinCreate.AddSash( nArea13Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
---- aggiungo quarta anta
|
||||
--local nSash4Id = WinCreate.AddSash( nArea21Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
---- aggiungo quinta anta
|
||||
--local nSash5Id = WinCreate.AddSash( nArea22Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill5Id = WinCreate.AddFill( nSash5Id, WIN_FILLTYPES.GLASS)
|
||||
--
|
||||
---- aggiungo sesta anta
|
||||
--local nSash6Id = WinCreate.AddSash( nArea23Id, SashJointType, SashJointType, SashJointType, SashJointType)
|
||||
---- aggiungo vetro
|
||||
--local nFill6Id = WinCreate.AddFill( nSash6Id, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra sei ante con montanti verticale e orizzontali ------------------------
|
||||
|
||||
sFileName = sFileName .. 'SixSash_Vertical&HorizontalMullion2'
|
||||
sFileName = sFileName .. 'SixSash_Vertical&HorizontalSplit_Mullion'
|
||||
|
||||
-- definisco divisioni verticali
|
||||
local nArea1Id, nArea2Id = WinCreate.AddSplit( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.ABSOLUT, WindowWidth / 3)
|
||||
|
||||
+16
-16
@@ -66,6 +66,22 @@
|
||||
},
|
||||
"Area2": {
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
"AreaType": 3,
|
||||
"FillType": 1
|
||||
},
|
||||
"AreaType": 2,
|
||||
"Joint": {
|
||||
"JointBL": 3,
|
||||
"JointBR": 3,
|
||||
"JointTL": 3,
|
||||
"JointTR": 3
|
||||
}
|
||||
},
|
||||
"AreaType": 0
|
||||
},
|
||||
"Area2": {
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
@@ -105,22 +121,6 @@
|
||||
"ptStart": [ 1200.0, 750.0, 0.0 ]
|
||||
} ]
|
||||
},
|
||||
"Area2": {
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
"AreaType": 3,
|
||||
"FillType": 1
|
||||
},
|
||||
"AreaType": 2,
|
||||
"Joint": {
|
||||
"JointBL": 3,
|
||||
"JointBR": 3,
|
||||
"JointTL": 3,
|
||||
"JointTR": 3
|
||||
}
|
||||
},
|
||||
"AreaType": 0
|
||||
},
|
||||
"AreaType": 4,
|
||||
"Split": [ {
|
||||
"CurveType": 256,
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"ProfilePath": "c:\\EgtData\\EgwWindowLua\\Profiles\\Profilo78 - Offset.nge",
|
||||
"Area1": {
|
||||
"Area1": {
|
||||
"Area1": null,
|
||||
"Area2": null,
|
||||
"AreaType": 3,
|
||||
"FillType": 1,
|
||||
"BottomRail": false,
|
||||
"Outline": null,
|
||||
"Joint": null
|
||||
},
|
||||
"Area2": null,
|
||||
"AreaType": 1,
|
||||
"FillType": 0,
|
||||
"BottomRail": true,
|
||||
"Outline": [
|
||||
{
|
||||
"CurveType": 256,
|
||||
"ptStart": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"ptEnd": {
|
||||
"x": 1800.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"CurveType": 256,
|
||||
"ptStart": {
|
||||
"x": 1800.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"ptEnd": {
|
||||
"x": 1800.0,
|
||||
"y": 1500.0,
|
||||
"z": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"CurveType": 256,
|
||||
"ptStart": {
|
||||
"x": 1800.0,
|
||||
"y": 1500.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"ptEnd": {
|
||||
"x": 0.0,
|
||||
"y": 1500.0,
|
||||
"z": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"CurveType": 256,
|
||||
"ptStart": {
|
||||
"x": 0.0,
|
||||
"y": 1500.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"ptEnd": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"Joint": [
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user