- aggiunta per corretta importazione in parcheggio
- pulizia codice - creazione funzione per aggiunta fori nei pezzi.
This commit is contained in:
+4
-132
@@ -41,6 +41,7 @@ CMP.V8 = 5
|
||||
|
||||
CMP.ResetView = false
|
||||
CMP.DrawSolid = true
|
||||
CMP.IsCabinet = true
|
||||
|
||||
CMP.Npar = 8
|
||||
CMP.Nome = 'TopChicken'
|
||||
@@ -154,133 +155,6 @@ function ImportLoop( PartId, tbLayer, sNameFileNGE)
|
||||
end
|
||||
--
|
||||
|
||||
-- Crea un contorno chiuso rettangolare come OutLoop (con diagonale da origine a ptEND)
|
||||
function CreateWaterfall( tbLayer, sNameLayer, ptEND, PrevAng, NextAng, bIsPrevWaterfall, bIsNextWaterfall)
|
||||
local OffseAng = 3
|
||||
local NAng = NextAng/2 + OffseAng
|
||||
local PAng = PrevAng/2 + OffseAng
|
||||
if not bIsNextWaterfall then
|
||||
if NAng >= 0 then
|
||||
NAng = -90 + NextAng
|
||||
else
|
||||
NAng = -90 - NextAng
|
||||
end
|
||||
end
|
||||
if not bIsPrevWaterfall then
|
||||
if PAng >= 0 then
|
||||
PAng = -90 + PrevAng
|
||||
else
|
||||
PAng = -90 - PrevAng
|
||||
end
|
||||
end
|
||||
local IdLoop = EgtRectangle2P(tbLayer[sNameLayer],{0,0,0}, ptEND,GDB_RT.GLOB)
|
||||
local tbIdLoop = ExplodeAndNameEdges( IdLoop)
|
||||
-- definizione SideAng
|
||||
-- bla bla bla---------------------------------------------------------------------------------------------------
|
||||
EgtSetInfo( tbIdLoop[2], 'OrigSideAng', -NAng)
|
||||
EgtSetInfo( tbIdLoop[2], 'SideAng', -NAng)
|
||||
EgtSetInfo( tbIdLoop[4], 'OrigSideAng', -PAng)
|
||||
EgtSetInfo( tbIdLoop[4], 'SideAng', -PAng)
|
||||
-- bla bla bla---------------------------------------------------------------------------------------------------
|
||||
return tbIdLoop
|
||||
end
|
||||
--
|
||||
-- Crea un contorno chiuso rettangolare come OutLoop (con diagonale da origine a ptEND)
|
||||
function CreateSplashtop( tbLayer, sNameLayer, ptEND, PrevAng, NextAng, bIsPrevSplashtop, bIsNextSplashtop)
|
||||
local OffseAng = 3
|
||||
local NAng = NextAng/2 + OffseAng
|
||||
local PAng = PrevAng/2 + OffseAng
|
||||
if not bIsNextWaterfall then
|
||||
if NAng >= 0 then
|
||||
NAng = 90 - NextAng
|
||||
else
|
||||
NAng = 90 + NextAng
|
||||
end
|
||||
end
|
||||
if not bIsPrevWaterfall then
|
||||
if PAng >= 0 then
|
||||
PAng = 90 - PrevAng
|
||||
else
|
||||
PAng = 90 + PrevAng
|
||||
end
|
||||
end
|
||||
EgtOutLog(PAng)
|
||||
EgtOutLog(NAng)
|
||||
local IdLoop = EgtRectangle2P(tbLayer[sNameLayer],{0,0,0}, ptEND,GDB_RT.GLOB)
|
||||
local tbIdLoop = ExplodeAndNameEdges( IdLoop)
|
||||
-- definizione SideAng
|
||||
-- bla bla bla---------------------------------------------------------------------------------------------------
|
||||
EgtSetInfo( tbIdLoop[2], 'OrigSideAng', -NAng)
|
||||
EgtSetInfo( tbIdLoop[2], 'SideAng', -NAng)
|
||||
EgtSetInfo( tbIdLoop[4], 'OrigSideAng', -PAng)
|
||||
EgtSetInfo( tbIdLoop[4], 'SideAng', -PAng)
|
||||
-- bla bla bla---------------------------------------------------------------------------------------------------
|
||||
return tbIdLoop, PAng, NAng
|
||||
end
|
||||
--
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
-- CREAZIONE/IMPORTAZIONE Loop FINE
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
-- METODI AUSILIARI LOCALI INIZIO
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
-- Restituisce l'angolo precedente e successivo dell'aentità passata
|
||||
local function GetPrevNextAng(IdEnt)
|
||||
local PrevAng = EgtGetInfo(IdEnt,'PrevAng','d') or 0
|
||||
local NextAng = EgtGetInfo(IdEnt,'NextAng','d') or 0
|
||||
return PrevAng, NextAng
|
||||
end
|
||||
--
|
||||
-- Verifica se esiste un Waterfall successivo a quallo corrente (i-esimo) della lista passata
|
||||
local function IsNextWaterfall(tbIdLoop, i)
|
||||
i = i+1
|
||||
if i > #tbIdLoop then i = 1 end
|
||||
local nVal = EgtGetInfo(tbIdLoop[i], 'AF', 'i') or 0
|
||||
if nVal == 2 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
--
|
||||
-- Verifica se esiste un Waterfall precedente a quallo corrente (i-esimo) della lista passata
|
||||
local function IsPrevWaterfall(tbIdLoop, i)
|
||||
i = i-1
|
||||
if i < 1 then i = #tbIdLoop end
|
||||
local nVal = EgtGetInfo(tbIdLoop[i], 'AF', 'i') or 0
|
||||
if nVal == 2 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
--
|
||||
-- Verifica se esiste un Splashtop successivo a quallo corrente (i-esimo) della lista passata
|
||||
local function IsNextSplashtop(tbIdLoop, i)
|
||||
i = i+1
|
||||
if i > #tbIdLoop then i = 1 end
|
||||
local nVal = EgtGetInfo(tbIdLoop[i], 'AF', 'i') or 0
|
||||
if nVal == 1 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
--
|
||||
-- Verifica se esiste un Splashtop precedente a quallo corrente (i-esimo) della lista passata
|
||||
local function IsPrevSplashtop(tbIdLoop, i)
|
||||
i = i-1
|
||||
if i < 1 then i = #tbIdLoop end
|
||||
local nVal = EgtGetInfo(tbIdLoop[i], 'AF', 'i') or 0
|
||||
if nVal == 1 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
-- METODI AUSILIARI LOCALI FINE
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local function WriteDataToChildPart(nParent, nPart, nEdge, dLen, dAngDx, dAngSx, dH, dTh)
|
||||
EgtSetInfo(nPart, 'Parent', nParent)
|
||||
EgtSetInfo(nPart, 'ParentEdge', nEdge)
|
||||
@@ -324,7 +198,7 @@ function CMP_Draw(bPreview)
|
||||
CMP.SB = CMP.V5 -- spessore bottom
|
||||
CMP.SSplash = CMP.V6 -- spessore alzatine
|
||||
CMP.SWater = CMP.V7 -- spessore frontalini
|
||||
--CMP.SBA = CMP.V8 -- spessore back
|
||||
CMP.DiamBore = CMP.V8 -- spessore back
|
||||
|
||||
-- PIANO POLLO
|
||||
local Pz_Top = TOOL.CreatePartLayer( 'TopChicken', sUNICode)
|
||||
@@ -501,11 +375,9 @@ function CMP_Draw(bPreview)
|
||||
TOOL.CreatePart(tbLayerBottom,tbPart.sName,tbIdLoop,tbPart.dTh,false)
|
||||
-- creo il foro
|
||||
local ptCenter = EgtGP( EgtGetFirstInGroup(tbLayerBottom['Region']), GDB_RT.GLOB)
|
||||
local nHoleLay = EgtGroup(Pz_Bottom)
|
||||
EgtSetName(nHoleLay, 'InLoop')
|
||||
local HoleId = EgtCircle( nHoleLay, ptCenter, CMP.V8, GDB_RT.GLOB)
|
||||
TOOL.SetMachiningInfo(nHoleLay, true)
|
||||
TOOL.CreateCircularHole( Pz_Bottom, ptCenter, CMP.DiamBore)
|
||||
TOOL.CreatePart(tbLayerBottom,tbPart.sName,{HoleId},tbPart.dTh,true)
|
||||
-- creo i riferimenti e salvo i parametri del part
|
||||
TOOL.CreateReference( sUNICode, 'InPartA4', 'OutLoop', 'A1', 'R1', tbPart.dTh, tbPart.sDestRefOff)
|
||||
TOOL.CreateReference(sUNICode, tbPart.sName, 'OutLoop', 'A4', 'R4', 0, tbPart.sRefOff)
|
||||
TOOL.SetPairInfo(sUNICode, tbPart.sName, 'R4', 'InPartA4', 'R1', -1, tbPart.dPairAng, 2)
|
||||
|
||||
Reference in New Issue
Block a user