Merge remote-tracking branch 'origin/main' into CAM_Auto

This commit is contained in:
andrea.villa
2024-06-20 08:38:22 +02:00
8 changed files with 833 additions and 600 deletions
+6 -1
View File
@@ -109,7 +109,12 @@
"EgtReplaceString",
"EgtCircle",
"EgtArc2PV",
"EgtTdbSetCurrTool"
"EgtTdbSetCurrTool",
"EgtSurfTmSubtract",
"EgtSurfTmIntersect",
"GDB_IN",
"GEO",
"dist"
],
"Lua.diagnostics.disable": [
"empty-block"
+74
View File
@@ -382,6 +382,80 @@ local nFillId = WinCreate.AddFill( nSashId, WIN_FILLTYPES.GLASS)
-- -- 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 SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE)
-- -- 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_IN)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
--
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, 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 SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE_OUT)
-- -- 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_IN)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
--
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, 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 SashJointType = WIN_JNT.FULL_V
-- local nSash1Id = WinCreate.AddSash( nArea1Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.ACTIVE_OUT)
-- -- 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_IN)
-- -- aggiungo vetro
-- local nFill2Id = WinCreate.AddFill( nSash2Id, WIN_FILLTYPES.GLASS)
--
-- -- aggiungo terza anta
-- local nSash3Id = WinCreate.AddSash( nArea3Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE_IN)
-- -- aggiungo vetro
-- local nFill3Id = WinCreate.AddFill( nSash3Id, WIN_FILLTYPES.GLASS)
--
-- -- aggiungo quarta anta
-- local nSash4Id = WinCreate.AddSash( nArea4Id, SashJointType, SashJointType, SashJointType, SashJointType, WIN_SASHTYPES.INACTIVE_OUT)
-- -- aggiungo vetro
-- local nFill4Id = WinCreate.AddFill( nSash4Id, WIN_FILLTYPES.GLASS)
------------------------ Finestra sei ante con montanti verticali e orizzontale ------------------------
Binary file not shown.
Binary file not shown.
+11
View File
@@ -88,6 +88,10 @@ WIN_SASHTYPES = {
NULL = 0,
ACTIVE = 1,
INACTIVE = 2,
ACTIVE_IN = 3,
ACTIVE_OUT = 4,
INACTIVE_IN = 5,
INACTIVE_OUT = 6,
}
WIN_SURF_APPROX = 0.05
@@ -99,6 +103,7 @@ WIN_FRAME = 'Frame'
WIN_AREAOUTLINE = 'BaseOutline'
WIN_OUTLINE = 'Outline'
WIN_SELECTION = 'Selection'
WIN_SPLITSELECTION = 'SplitSelection'
WIN_ORIGOUTLINE = 'OrigOutline'
WIN_GEO = 'Geo'
WIN_SOLID = 'Solid'
@@ -139,6 +144,8 @@ 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'
@@ -209,6 +216,8 @@ WIN_PRC_TOOL_NAME = 'TOOL_NAME'
WIN_PRC_OFFL = 'OFFL'
WIN_PRC_OFFR = 'OFFR'
WIN_CRV_ON_FRENCH_SPLIT = 'OutlineOnFrenchSplit'
WIN_MAINGUIDE = 'MainGuide'
WIN_STARTGUIDE = 'StartGuide'
WIN_ENDGUIDE = 'EndGuide'
@@ -256,6 +265,8 @@ WIN_DWL_BOTTOMHORIZONTALSPLITPARAEND = 'BottomHorizontalSplitParaEnd'
WIN_DWL_HORIZONTALSPLITPERPSTART = 'HorizontalSplitPerpStart'
WIN_DWL_HORIZONTALSPLITPERPEND = 'HorizontalSplitPerpEnd'
WIN_PRJ_ORIGSPLIT = 'OrigSplit'
WIN_HARDWARE = 'Hardware'
WIN_HDW_FAVOURITE = 'HdwFavourite'
WIN_HDW_FRAME = 'HdwFrame'
File diff suppressed because it is too large Load Diff
+42 -14
View File
@@ -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
@@ -136,7 +142,8 @@ 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
@@ -167,7 +174,8 @@ function WinCreate.AddFill( nAreaId, FillType)
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)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BL)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_BR)
EgtRemoveInfo( nAreaOutlineLayerId, WIN_JOINT_TL)
@@ -225,13 +233,16 @@ function WinCreate.AddSplit( nAreaLayerId, SplitType, MeasureType, nPosition, n
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
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, 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)
@@ -242,7 +253,10 @@ function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList
local nResArea2 = nAreaLayerId
local dAddPosition = 0
for nIndex = 1, #PositionList do
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, PositionList[nIndex], nProportion - dAddPosition)
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)
@@ -253,14 +267,20 @@ function WinCreate.AddSplits( nAreaLayerId, SplitType, MeasureType, PositionList
local nResArea1
local nResArea2 = nAreaLayerId
local dAddPosition = 0
local sChildAreas = ''
for nIndex = 1, #PositionList do
nResArea1, nResArea2 = WinCreate.AddSplit( nResArea2, SplitType, MeasureType, EgtIf( nIndex == 1, PositionList[nIndex], PositionList[nIndex] / ( 1 - dAddPosition)), nProportion)
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
@@ -369,7 +389,8 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
nInters = 1
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( nOutlineId, WIN_CHILD, nCopyId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 1 then
@@ -377,13 +398,15 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
nInters = 2
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( 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_CHILD)
AddInfo( nSplitId, WIN_CHILD, nSplitCopyId)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
@@ -402,7 +425,8 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
-- inizio area 1
nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( nOutlineId, WIN_CHILD, nCopyId)
local dStartIntersParam = EgtCurveParamAtPoint( nCopyId, ptInters)
EgtTrimCurveStartAtParam( nCopyId, dStartIntersParam)
elseif nInters == 2 then
@@ -410,14 +434,16 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
nInters = 3
local nCopyId = EgtCopy( nOutlineId, nArea1OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( 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_CHILD)
AddInfo( nSplitId, WIN_CHILD, nSplitCopyId)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_STARTINTERS)
EgtRemoveInfo( nSplitCopyId, WIN_SPLIT_ENDINTERS)
if not AreSamePointExact( EgtEP( nCopyId), EgtSP( nSplitCopyId)) then
@@ -438,12 +464,14 @@ function WinCreate.CreateAreaFromSplit( nAreaLayerId, nSplitId)
-- copio nel profilo 2
local nCopyId = EgtCopy( nOutlineId, nArea2OutlineLayerId)
EgtSetInfo( nCopyId, WIN_SOU, nOutlineId)
EgtSetInfo( nOutlineId, WIN_CHILD, nCopyId)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( 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)
EgtRemoveInfo( nCopyId, WIN_CHILD)
AddInfo( nOutlineId, WIN_CHILD, nCopyId)
end
-- aggiorno indice
nOutlineId = EgtGetNext( nOutlineId)
+11 -1
View File
@@ -63,16 +63,26 @@ 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.SPLITTYPE, WDG.MEASURETYPE, PositionList, WDG.PROPORTION)
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