DataWindow :
- spostato calcolo del GeoRaw per pezzi ad arco nel calcolo tronchetti - correzione nel calcolo fill outline per cambio profilo.
This commit is contained in:
@@ -196,6 +196,9 @@ local function CalcIntersectionRegion( vCrvs, nGrp)
|
||||
local vArcs = EgtTableFill( nCrv, nCnt)
|
||||
for j = nCrv, nCrv + nCnt - 1 do
|
||||
local nInters, nPntCnt, nCrvCnt = EgtCurveCurveInters( j, nCrvBorder, nGrpTmp)
|
||||
if nCnt == 1 then
|
||||
EgtChangeClosedCurveStartPoint( j, EgtSP( nInters))
|
||||
end
|
||||
local nCurrCrv = j
|
||||
for nPntId = nInters, nInters + nPntCnt - 1 do
|
||||
local dPar = EgtCurveParamAtPoint( nCurrCrv, EgtSP( nPntId))
|
||||
@@ -383,8 +386,8 @@ local function TrimOrderedCurves( vCrvs, nExtraCurvesMode)
|
||||
nC = ( nC + 1) % #vCrvs
|
||||
until nC == nFirstIdxCrv
|
||||
|
||||
EgtErase( nGrpTmp)
|
||||
return vResultCurves
|
||||
EgtErase( nGrpTmp)
|
||||
return vResultCurves
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -1048,8 +1051,8 @@ local function CalculateFillOutline( nAreaId, nAreaLayerId, nOutlineLayerId)
|
||||
|
||||
-- 1) calcolo l'area complessiva di fill definita dal suo parent
|
||||
local nParentOutlineLayer = EgtGetFirstNameInGroup( nParentArea, WIN_OUTLINE)
|
||||
local vAdjustZ = {}
|
||||
local nRefZ
|
||||
local vAdjustIds = {}
|
||||
local dRefOffs, dRefDelta
|
||||
local nParentOutlineId = EgtGetFirstInGroup( nParentOutlineLayer)
|
||||
while nParentOutlineId do
|
||||
-- copio la curva di outline del parent
|
||||
@@ -1059,33 +1062,35 @@ local function CalculateFillOutline( nAreaId, nAreaLayerId, nOutlineLayerId)
|
||||
-- recupero il suo profilo per calcolare l'offset perpendicolare
|
||||
local nParentProfileId = GetOutlineProfileId( nParentOutlineId, true)
|
||||
local b3FrameProfile = GetProfileLocalBox( nParentProfileId)
|
||||
local dOverlap = EgtGetInfo( nParentProfileId, WIN_FILLOVERLAP, 'd') or 0
|
||||
local dDimRef = b3FrameProfile:getMin():getX()
|
||||
local dFillPerpOffset = abs( dDimRef) - dOverlap
|
||||
if EgtGetName( nParentProfileId) == WIN_FILL_RAIL then
|
||||
-- se bottom rail considero la distanza necessaria per il numero di bottomrail richiesti
|
||||
local nBottomRails = EgtGetInfo( nParentOutlineId, WIN_BOTTOMRAIL, 'i')
|
||||
local dRailDelta1 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '1', 'd')
|
||||
local dRailDelta2 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '2', 'd')
|
||||
dFillPerpOffset = dFillPerpOffset + dRailDelta1 + ( nBottomRails - 1) * dRailDelta2
|
||||
end
|
||||
EgtOffsetCurve( nOutlineId, - dFillPerpOffset)
|
||||
|
||||
-- movimento in z : se non è definito ( come nel caso di alcuni pezzi di telaio con cambio profilo) salvo la curva per correggere la sua z in seguito, se è definito salvo
|
||||
-- una curva come riferimento per le curve da correggere
|
||||
local dFillZOffset = EgtGetInfo( nParentProfileId, WIN_FILLDELTA, 'd')
|
||||
if not dFillZOffset then
|
||||
table.insert( vAdjustZ, nOutlineId)
|
||||
else
|
||||
nRefZ = nOutlineId
|
||||
local dOverlap = EgtGetInfo( nParentProfileId, WIN_FILLOVERLAP, 'd')
|
||||
if dOverlap then
|
||||
local dDimRef = b3FrameProfile:getMin():getX()
|
||||
local dFillPerpOffset = abs( dDimRef) - dOverlap
|
||||
if EgtGetName( nParentProfileId) == WIN_FILL_RAIL then
|
||||
-- se bottom rail considero la distanza necessaria per il numero di bottomrail richiesti
|
||||
local nBottomRails = EgtGetInfo( nParentOutlineId, WIN_BOTTOMRAIL, 'i')
|
||||
local dRailDelta1 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '1', 'd')
|
||||
local dRailDelta2 = EgtGetInfo( nParentProfileId, WIN_RAILDELTA .. '2', 'd')
|
||||
dFillPerpOffset = dFillPerpOffset + dRailDelta1 + ( nBottomRails - 1) * dRailDelta2
|
||||
end
|
||||
EgtOffsetCurve( nOutlineId, - dFillPerpOffset)
|
||||
-- movimento in z
|
||||
local dFillZOffset = EgtGetInfo( nParentProfileId, WIN_FILLDELTA, 'd')
|
||||
EgtMove( nOutlineId, Z_AX() * dFillZOffset)
|
||||
-- salvo valori come riferimenti per eventuali correzioni
|
||||
dRefOffs = - dFillPerpOffset
|
||||
dRefDelta = dFillZOffset
|
||||
else
|
||||
-- se fill overlap non è definito ( come nel caso di alcuni pezzi di telaio con cambio profilo) salvo la curva per correggerla in seguito
|
||||
table.insert( vAdjustIds, nOutlineId)
|
||||
end
|
||||
|
||||
nParentOutlineId = EgtGetNext( nParentOutlineId)
|
||||
end
|
||||
-- sistemo quote per tratti che non avevano movimento in z definito nel profilo
|
||||
for i = 1, #vAdjustZ do
|
||||
EgtMove( vAdjustZ[i], ( EgtSP( nRefZ):getZ() - EgtSP( vAdjustZ[i]):getZ()) * Z_AX())
|
||||
-- sistemo tratti che non avevano valori definiti nel profilo
|
||||
for i = 1, #vAdjustIds do
|
||||
EgtOffsetCurve(vAdjustIds[i], dRefOffs)
|
||||
EgtMove( vAdjustIds[i], dRefDelta * Z_AX())
|
||||
end
|
||||
-- accorcio gli offset
|
||||
local vCrvs = TrimOrderedCurves( EgtGetAllInGroup( nOutlineLayerId), 1)
|
||||
@@ -2624,8 +2629,13 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che calcola gli elementi ausiliari per la creazione del grezzo nell'automatismo delle lavorazioni
|
||||
local function CalcGeoRaw( nPartId)
|
||||
local function CalcGeoRaw( nPartId, nOutlineId)
|
||||
|
||||
-- se pezzo ad arco il geo raw sarà calcolato tramite i tronchetti
|
||||
if EgtGetType( nOutlineId) == GDB_TY.CRV_ARC then
|
||||
return
|
||||
end
|
||||
|
||||
local nGeoLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO)
|
||||
local nGeoRawLayerId = EgtCopyGlob( nGeoLayerId, nPartId)
|
||||
EgtErase( EgtGetLastInGroup( nGeoRawLayerId)) -- elimino la regione
|
||||
@@ -2637,7 +2647,7 @@ local function CalcGeoRaw( nPartId)
|
||||
local dOvermatRight = EgtGetInfo( nPartId, WIN_PRC_OVERMAT_RIGHT, 'd')
|
||||
local dOvermatIn = EgtGetInfo( nPartId, WIN_PRC_OVERMAT_IN, 'd')
|
||||
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)
|
||||
if not EgtOffsetCurve( nOut, dOvermatOut) then
|
||||
@@ -4169,7 +4179,7 @@ local function CreatePartFromOutline( nAreaLayerId, sName, nOutlineId, nOutlineC
|
||||
-- calcolo le lavorazioni associate ai profili
|
||||
CalcProfilingProcessings( nPartId, nOutlineId)
|
||||
-- calcolo il georaw per automatismo lavorazioni
|
||||
CalcGeoRaw( nPartId)
|
||||
CalcGeoRaw( nPartId, nOutlineId)
|
||||
-- disegno solido
|
||||
if s_bCalcSolid then
|
||||
CalcSolid( nPartId, nOutlineId)
|
||||
@@ -4805,9 +4815,10 @@ end
|
||||
-- funzione che crea gli elementi ausiliari per la creazione del grezzo nell'automatismo delle lavorazioni
|
||||
local function CalcGeoRawFromLogs( nPartId)
|
||||
|
||||
-- svuoto il GeoRaw per ricalcolarlo
|
||||
local nGeoRawLayerId = EgtGetFirstNameInGroup( nPartId, WIN_GEO_RAW)
|
||||
EgtEmptyGroup( nGeoRawLayerId)
|
||||
-- creo il GeoRaw per il pezzo ad arco
|
||||
local nGeoRawLayerId = EgtGroup( nPartId)
|
||||
EgtSetName( nGeoRawLayerId, WIN_GEO_RAW)
|
||||
EgtSetStatus( nGeoRawLayerId, GDB_ST.OFF)
|
||||
|
||||
-- recupero i vari tronchetti
|
||||
local nLogGrp = EgtGetFirstNameInGroup( nPartId, WIN_LOGS)
|
||||
|
||||
Reference in New Issue
Block a user