DataWindow :

- nel gruppo geo aggiunte curve che rappresentano parte interna della lavorazione per left e right.
This commit is contained in:
SaraP
2026-07-24 09:06:10 +02:00
parent dfa1cc5ddc
commit 00ee47e5dd
2 changed files with 122 additions and 24 deletions
+2
View File
@@ -379,6 +379,8 @@ WIN_GEO_IN = 'In'
WIN_GEO_OUT = 'Out'
WIN_GEO_LEFT = 'Left'
WIN_GEO_RIGHT = 'Right'
WIN_GEO_INNER_LEFT = 'InnerLeft'
WIN_GEO_INNER_RIGHT = 'InnerRight'
WIN_PRC_FRAME = 'AuxFrame'
WIN_GEOWIDTH = 'GeoWidth'
WIN_GEOHEIGHT = 'GeoHeight'
+120 -24
View File
@@ -4645,7 +4645,7 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vSta
EgtSetInfo( nOtherOut, WIN_TANG_START, true)
EgtSetInfo( nOtherOut, WIN_TANG_END, true)
end
else
local nPrevCurveId = EgtCopy( abs( vPrevOutlineId[i]), nGeoLayerId)
if vPrevOutlineId[i] < 0 then
@@ -4717,9 +4717,6 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vSta
else
nBisector = CalcParabolicBisector( nOutId, nOtherOut, b3Profile:getDimX(), nGeoLayerId)
end
EgtSetName( nBisector, WIN_GEO_RIGHT)
EgtSetInfo( nBisector, WIN_REF_OUTLINE, vNextOutlineId[i])
EgtRelocateGlob( nBisector, nInId, GDB_IN.BEFORE)
-- gestione per profili diversi
local sCurrProfile = EgtGetInfo( nCurrProfileId, WIN_PROFILETYPE)
@@ -4739,6 +4736,10 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vSta
EgtSetInfo( nOtherOut, WIN_TANG_END, true)
end
EgtSetName( nBisector, WIN_GEO_RIGHT)
EgtSetInfo( nBisector, WIN_REF_OUTLINE, vNextOutlineId[i])
EgtRelocateGlob( nBisector, nInId, GDB_IN.BEFORE)
else
local nNextCurveId = EgtCopy( abs( vNextOutlineId[i]), nGeoLayerId)
if vNextOutlineId[i] < 0 then
@@ -4797,12 +4798,10 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vSta
EgtSetName( nAreaId, WIN_GEO_SURF)
EgtSetStatus( nAreaId, GDB_ST.OFF)
-- elimino curve aux
-- taglio solo le curve non ausiliarie
local vCrvs = {}
for i = 1, #vIds do
if EgtGetName( vIds[i]) == WIN_AUX then
EgtErase( vIds[i])
else
if EgtGetName( vIds[i]) ~= WIN_AUX then
table.insert( vCrvs, vIds[i])
end
end
@@ -4831,6 +4830,96 @@ local function CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vSta
return true
end
---------------------------------------------------------------------
-- funzione che calcola le curve left e right sull'interno del semiprofilo ( per fase di lavorazione)
local function CalcGeoInnerCurves( nGeoLayerId)
local nGrpTmp = EgtGroup( EgtGetParent( nGeoLayerId))
local vGeo = EgtGetAllInGroup( nGeoLayerId)
vGeo[#vGeo] = nil
local vNames = {}
for i = 1, #vGeo do
vNames[i] = EgtGetName( vGeo[i])
end
-- le curve left e right in catena di tangenze con l'out vengono trattate come se fossero out
local i = 2
while vNames[i] == WIN_GEO_RIGHT and AreSameVectorApprox( EgtEV( vGeo[i-1]), EgtSV( vGeo[i])) do
vNames[i] = WIN_OUT
i = i + 1
end
i = #vGeo
while vNames[i] == WIN_GEO_LEFT and AreSameVectorApprox( EgtEV( vGeo[i]), EgtSV( vGeo[i+1] or vGeo[1])) do
vNames[i] = WIN_OUT
i = i - 1
end
for i = 1, #vGeo do
local nCrvId
local nSemiProfileId = EgtGetInfo( vGeo[i], WIN_SEMI_PROFILE, 'i')
if not nSemiProfileId then
-- è la curva del geo
nCrvId = EgtCopyGlob( vGeo[i], nGrpTmp)
else
-- calcolo la curva partendo dall'outline
local nRefOutlineId = EgtGetInfo( vGeo[i], WIN_REF_OUTLINE, 'i')
nCrvId = EgtCopyGlob( abs( nRefOutlineId), nGrpTmp)
if nRefOutlineId < 0 then
EgtInvertCurve( nCrvId)
end
-- per curve left/right calcolo l'offset per arrivare sull'interno del semiprofilo, per le altre sull'esterno ( come nel geo)
local dOffs = EgtGetInfo( vGeo[i], WIN_GEO_OFFS, 'd')
if vNames[i] == WIN_LEFT or vNames[i] == WIN_RIGHT then
local nProfileId = EgtGetParent( nSemiProfileId)
local nFrameId = EgtGetFirstNameInGroup( nProfileId, WIN_SECTIONFRAME)
local frFrame = EgtFR( nFrameId, GDB_ID.ROOT)
local b3SemiProfile = EgtGetBBoxRef( nSemiProfileId, GDB_BB.STANDARD, frFrame)
dOffs = dOffs - b3SemiProfile:getDimX()
end
EgtOffsetCurve( nCrvId, dOffs)
-- recupero nomi e info di estensione dal geo
EgtSetName( nCrvId, vNames[i])
CopyInfo( nCrvId, vGeo[i], WIN_TANG_START, false)
CopyInfo( nCrvId, vGeo[i], WIN_TANG_END, false)
end
end
-- trim delle curve
local vCrvs = EgtGetAllInGroup( nGrpTmp)
local nGeoRegion = CalcGeoRegion( vCrvs, nGrpTmp)
if nGeoRegion then
-- nel trim devo ignorare le curve aux
for j = #vCrvs, 1, -1 do
if EgtGetName( vCrvs[j]) == WIN_AUX then
table.remove( vCrvs, j)
end
end
TrimOrderedCurves( vCrvs, true, nGeoRegion)
-- recupero le curve left/right e le concateno
local dGeoH = EgtGetInfo( nGeoLayerId, WIN_GEOHEIGHT, 'd')
local vLeft = EgtGetNameInGroup( nGrpTmp, WIN_GEO_LEFT)
if #vLeft > 0 then
local nInnerLeft = EgtCurveCompo( nGeoLayerId, vLeft)
EgtSetName( nInnerLeft, WIN_GEO_INNER_LEFT)
EgtModifyCurveThickness( nInnerLeft, - dGeoH)
end
local vRight = EgtGetNameInGroup( nGrpTmp, WIN_GEO_RIGHT)
if #vRight > 0 then
local nInnerRight = EgtCurveCompo( nGeoLayerId, vRight)
EgtSetName( nInnerRight, WIN_GEO_INNER_RIGHT)
EgtModifyCurveThickness( nInnerRight, - dGeoH)
end
end
EgtErase( nGrpTmp)
end
---------------------------------------------------------------------
-- funzione che calcola l'ingombro dei pezzi del telaio
local function CalcGeo( nPartId, nOutlineId)
@@ -4859,9 +4948,13 @@ local function CalcGeo( nPartId, nOutlineId)
-- creo lati dell'outline
local bOk = CreateGeoCurves( nOutlineId, vPrevOutlineId, vNextOutlineId, vStartJoints, vEndJoints, nGeoLayerId, nProfileLayerId)
-- TODO verificare la validità del pezzo ( si è creata geo region, la curva out non è extra, ...)
CalcGeoInnerCurves( nGeoLayerId)
-- elimino le curve aux
local vAuxCrvs = EgtGetNameInGroup( nGeoLayerId, WIN_AUX) or {}
EgtErase( vAuxCrvs)
-- TODO verificare la validità del pezzo ( si è creata geo region, la curva out non è extra, ...)
end
---------------------------------------------------------------------
@@ -6045,7 +6138,7 @@ local function CalcProfilingProcessings( nPartId, nOutlineId)
-- recupero il geo e la superficie associata per limitare le lavorazioni
local nGeoLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
local nGeoSurfId = EgtGetLastInGroup( nGeoLayerId)
local nGeoSurfId = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_SURF)
-- recupero il gruppo dei profili
local nProfileLayerId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE)
@@ -6137,8 +6230,7 @@ local function CalcGeoRaw( nPartId, nOutlineId)
end
local nGeoLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
local nGeoRawLayerId = EgtCopyGlob( nGeoLayerId, nPartId)
EgtErase( EgtGetLastInGroup( nGeoRawLayerId)) -- elimino la regione
local nGeoRawLayerId = EgtGroup( nPartId)
EgtSetName( nGeoRawLayerId, WIN_GEO_RAW)
EgtSetStatus( nGeoRawLayerId, GDB_ST.OFF)
@@ -6149,24 +6241,28 @@ local function CalcGeoRaw( nPartId, nOutlineId)
local dOvermatLeft = EgtGetInfo( nPartId, WIN_PRC_OVERMAT_LEFT, 'd')
-- recupero le curve del raw e applico i sovramateriali
local nOut = EgtGetFirstNameInGroup( nGeoRawLayerId, WIN_GEO_OUT)
local nGeoOut = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_OUT)
local nOut = EgtCopyGlob( nGeoOut, nGeoRawLayerId)
if not EgtOffsetCurve( nOut, dOvermatOut) then
EgtErase( nOut)
end
local nIn = EgtGetFirstNameInGroup( nGeoRawLayerId, WIN_GEO_IN)
local nGeoIn = EgtGetFirstNameInGroup( nGeoLayerId, WIN_GEO_IN)
local nIn = EgtCopyGlob( nGeoIn, nGeoRawLayerId)
if not EgtOffsetCurve( nIn, dOvermatIn) then
EgtErase( nIn)
end
local vRight = EgtGetNameInGroup( nGeoRawLayerId, WIN_GEO_RIGHT)
for i = 1, #vRight do
if not EgtOffsetCurve( vRight[i], dOvermatRight) then
EgtErase( vRight[i])
local vGeoRight = EgtGetNameInGroup( nGeoLayerId, WIN_GEO_RIGHT)
for i = 1, #vGeoRight do
local nRight = EgtCopyGlob( vGeoRight[i], nGeoRawLayerId)
if not EgtOffsetCurve( nRight, dOvermatRight) then
EgtErase( nRight)
end
end
local vLeft = EgtGetNameInGroup( nGeoRawLayerId, WIN_GEO_LEFT)
for i = 1, #vLeft do
if not EgtOffsetCurve( vLeft[i], dOvermatLeft) then
EgtErase( vLeft[i])
local vGeoLeft = EgtGetNameInGroup( nGeoLayerId, WIN_GEO_LEFT)
for i = 1, #vGeoLeft do
local nLeft = EgtCopyGlob( vGeoLeft[i], nGeoRawLayerId)
if not EgtOffsetCurve( nLeft, dOvermatLeft) then
EgtErase( nLeft)
end
end