25 Commits

Author SHA1 Message Date
Carlo Baronchelli 8729cb5c33 Merge branch 'develop2' 2021-11-29 18:24:36 +01:00
Carlo Baronchelli f16baf745a Correzione in funct. SideSetInfoC 2021-11-29 18:05:28 +01:00
Carlo Baronchelli 336f52cf8e Introdotto funzioni <Spostamento30 > e <Spostamento40> 2021-11-29 16:32:50 +01:00
carlo.baronchelli 7782aaab76 Aggiunto casi, corretto un errore 2021-11-29 10:34:23 +01:00
carlo.baronchelli 60e91064ed Aggiunto casi [b1.r1r2], [b1.r2r3]; + Tarature parametri di offset vari; + funzioni per spostamenti 2021-11-23 21:31:04 +01:00
carlo.baronchelli 975d6acd19 taratura e sistemazione 'definitiva' delle etichettature dei lati con indicazione degli angoli di taglio 2021-11-17 17:40:32 +01:00
carlo.baronchelli 997df4745d Correzione errore spostamento retangolo 2 in [a.r1r2] ('<0' anziché '>0') 2021-11-16 23:10:19 +01:00
carlo.baronchelli 778eca1aaa da buttare via ? modiifcato alcune variabili, sembra non venga eseguito, no debug ... 2021-11-10 19:34:23 +01:00
carlo.baronchelli 2ae9613f2b Riorganizzato caso [a] degli 'spostamenti' 2021-11-09 19:57:00 +01:00
carlo.baronchelli ec6208f1a8 Correzione e paini vari con funzione di simmetria e ribaltamento aggiornate 2021-11-08 11:35:29 +01:00
carlo.baronchelli f77bd1fee3 Aggiunto etichettatura (prizzontale) lati compo con eventuali angoli di taglio 2021-11-07 20:38:56 +01:00
carlo.baronchelli 700137c6d1 Prove varie per dimensioni etichette 2021-11-05 22:23:22 +01:00
carlo.baronchelli 6c0bcb1173 Modifiche per inseimento dimensioni A/F 2021-11-04 23:16:26 +01:00
carlo.baronchelli e160ec0558 Introduzione in EgtCompo delle funzioni per Mirror del componente 2021-10-29 11:11:47 +02:00
carlo.baronchelli a796a64db4 Sistemazioni varie 2021-10-28 13:10:41 +02:00
carlo.baronchelli 6405bb0a45 Inserimento etichietta 'dimensioni dell'oggetto' su ciascun elemento A/F 2021-10-27 21:43:03 +02:00
carlo.baronchelli 1bc8c6c273 Modifiche per Indicazione dimensioni su ciascun pezzo A/F 2021-10-27 21:41:22 +02:00
Carlo Baronchelli e5a366ced1 Come precedente 2021-10-19 16:53:22 +02:00
Carlo Baronchelli c2a4e995f4 Correzioni per etichette e altro 2021-10-19 16:52:09 +02:00
Carlo Baronchelli ddda3debaa Aggiunti file .txt (VisualBasic) per consultazione 2021-10-18 17:10:48 +02:00
Carlo Baronchelli 4ef934c7d8 Corretto due commenti 2021-10-18 16:57:51 +02:00
Carlo Baronchelli 2bd6c22fbf Modificato file di configurazione per OmagCut 2021-10-18 16:54:38 +02:00
Carlo Baronchelli 2a885f9bff Corretto PcucinaC23.lua per riballtamento e simmetria 2021-10-18 16:53:03 +02:00
carlo.baronchelli 8b8fd31eba Predisposizione per modifica ribaltamento e simmetria 2021-10-16 07:51:24 +02:00
Carlo Baronchelli a634b5640c Merge branch 'develop' 2021-08-10 20:24:45 +02:00
31 changed files with 1916 additions and 526 deletions
+10 -6
View File
@@ -39,6 +39,9 @@ if EgtGetLanguage() == 'ITA' then
EgtCompoMsg[53] = 'I lati L1 e L5 non si incontrano e L5 tende a intersecare L2 ' --non usato
EgtCompoMsg[101] = 'La differenza tra B e S deve essere maggiore o uguale a '
EgtCompoMsg[102] = 'La differenza tra A e D + E deve essere maggiore o uguale a '
-- Alzatine/Frontalini
EgtCompoMsg[150] = 'Un layer non è stato trovato' -- da tradurre
EgtCompoMsg[160] = 'caso non previsto' -- da tradurre
-- Piani cucina
EgtCompoMsg[201] = 'Differenza lunghezze A-D troppo piccola: deve essere maggiore o uguale a '
EgtCompoMsg[202] = 'Differenza LC-LB troppo piccola: deve essere maggiore o uguale a '
@@ -97,8 +100,6 @@ if EgtGetLanguage() == 'ITA' then
-- Ribasso
EgtCompoMsg[360] = 'Raggio R deve essere minore di '
EgtCompoMsg[360] = 'Raggio R deve essere maggiore di '
-- Alzatine/Frontalini
EgtCompoMsg[370] = 'non previsto'
elseif EgtGetLanguage() == 'DEU' then
EgtCompoMsg[1] = 'Box = '
@@ -134,6 +135,9 @@ elseif EgtGetLanguage() == 'DEU' then
EgtCompoMsg[53] = 'I lati L1 e L5 non si incontrano e L5 tende a intersecare L2 ' -- not used
EgtCompoMsg[101] = 'B - S must be greater than or equal to '
EgtCompoMsg[101] = 'A - D - E must be greater than or equal to '
-- Alzatine/Frontalini
EgtCompoMsg[150] = 'Un layer non è stato trovato' -- da tradurre
EgtCompoMsg[160] = 'caso non previsto' -- da tradurre
-- Piani cucina
EgtCompoMsg[201] = 'LA - LD must be greater than or equal to '
EgtCompoMsg[202] = 'LC - LB must be greater than or equal to '
@@ -192,8 +196,7 @@ elseif EgtGetLanguage() == 'DEU' then
-- Ribasso
EgtCompoMsg[360] = 'Raggio R deve essere minore di '
EgtCompoMsg[360] = 'Raggio R deve essere maggiore di '
-- Alzatine/Frontalini
EgtCompoMsg[370] = 'non previsto' -- da tradurre
else -- default 'ENG'
EgtCompoMsg[1] = 'Box = '
EgtCompoMsg[2] = 'Sides / Dimensions must be greater than or equal to '
@@ -227,6 +230,9 @@ else -- default 'ENG'
EgtCompoMsg[53] = 'I lati L1 e L5 non si incontrano e L5 tende a intersecare L2 ' -- not used
EgtCompoMsg[101] = 'B - S must be greater than or equal to '
EgtCompoMsg[101] = 'A - D - E must be greater than or equal to '
-- Alzatine/Frontalini
EgtCompoMsg[150] = 'Un layer non è stato trovato' -- da tradurre
EgtCompoMsg[160] = 'caso non previsto' -- da tradurre
-- Piani cucina
EgtCompoMsg[201] = 'LA - LD must be greater than or equal to '
EgtCompoMsg[202] = 'LC - LB must be greater than or equal to '
@@ -285,8 +291,6 @@ else -- default 'ENG'
-- Ribasso
EgtCompoMsg[360] = 'Radius R must be less than '
EgtCompoMsg[360] = 'Radius R must be bigger than '
-- Alzatine/Frontalini
EgtCompoMsg[370] = 'non previsto' -- da tradurre
end
return EgtCompoMsg
@@ -0,0 +1,209 @@
' permette di inserire più di un part
Private Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean
Dim InsertColor As Color3d = New Color3d(89, 210, 210)
CompoColor(InsertColor, m_MainWindow.GetIniFile())
' Imposto il contesto corrente
EgtSetCurrentContext(DrawScene.GetCtx())
Dim Pz As Integer = -1
Dim NxtPz As Integer = -1
' Cancello layer regioni per selezione buchi
Pz = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
While Pz <> -1
' imposto il contesto corrente
EgtSetCurrentContext(DrawScene.GetCtx())
' salvo il file temporaneo per studio delle alzatine
EgtSaveFile("c:\EgtData\OmagCUT\Temp\TempAlzatine.nge", NGE.CMPTEXT)
' cerco un altro pezzo nell'elenco
NxtPz = EgtGetNextPart(Pz)
Dim SelectRegion As Integer = EgtGetFirstNameInGroup(Pz, "SelectRegion")
EgtErase(SelectRegion)
' Cancello layer etichette, quotatura,ausiliario e box
EgtErase(EgtGetFirstNameInGroup(Pz, "LayAux"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Etichette"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Quotature"))
EgtErase(EgtGetFirstNameInGroup(Pz, "Box"))
' Cancello layer etichette dei componenti interni (buchi)
Dim nHLId As Integer = EgtGetFirstNameInGroup(Pz, "HoleLabels")
While nHLId <> GDB_ID.NULL
EgtErase(nHLId)
nHLId = EgtGetFirstNameInGroup(Pz, "HoleLabels")
End While
' Attivo visualizzazione misura
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(Pz, NAME_REGION)
Dim nId As Integer = EgtGetFirstInGroup(nRegLayId)
While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetStatus(nId, GDB_ST.ON_)
End If
nId = EgtGetNext(nId)
End While
' Calcolo dimensione ingombro Pezzo tramite OutLoop
Dim nOutLoopLayer = EgtGetFirstNameInGroup(Pz, NAME_OUTLOOP)
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, b3Part)
' Muovo la regione in Z per evitare problemi in visualizzazione
EgtMove(nRegLayId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB)
' Se pezzo con dati TRF
If m_bTrfData Then
' Nome da dati Trf
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = m_TrfOrderCode & "-" & m_TrfOrderDesc
Dim sText2 As String = m_TrfMatCode & "-" & m_TrfSurfCode
Dim sText3 As String = LenToString(b3Part.DimX(), 0) & " x " & LenToString(b3Part.DimY(), 0) & " x " & LenToString(m_TrfThickness, 0)
Dim dRatio As Double = Math.Max(b3Part.DimX(), b3Part.DimY()) / Math.Min(b3Part.DimX(), b3Part.DimY())
If dRatio < 5 Then
sText = sText & "<br/>" & sText2 & "<br/>" & sText3
Else
sText = sText & " " & sText2 & " " & sText3
End If
EgtModifyText(nTextId, sText)
Dim ptCen As Point3d
EgtCenterPoint(nTextId, ptCen)
Dim b3Text As New BBox3d
EgtGetBBoxGlob(nTextId, GDB_BB.STANDARD, b3Text)
Dim dCoeff As Double = Math.Min(b3Part.DimX() / b3Text.DimX(), b3Part.DimY() / b3Text.DimY()) / 1.25
If dCoeff < 1 Then EgtScale(nTextId, New Frame3d(ptCen), dCoeff, dCoeff, dCoeff)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
' Info di pezzo da dati Trf
EgtSetInfo(Pz, "OC", m_TrfOrderCode)
EgtSetInfo(Pz, "OD", m_TrfOrderDesc)
EgtSetInfo(Pz, "PC", m_TrfPartCode)
EgtSetInfo(Pz, "MT", m_TrfMatCode)
EgtSetInfo(Pz, "SRF", m_TrfSurfCode)
EgtSetInfo(Pz, "L", DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, "W", DoubleToString(b3Part.DimY(), 1))
EgtSetInfo(Pz, "T", m_TrfThickness)
EgtSetInfo(Pz, "V1", DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, "V2", DoubleToString(b3Part.DimY(), 1))
' Se altrimenti pezzo con dati Csv
ElseIf m_bCsvData Then
' Nome del pezzo
EgtSetName(Pz, m_sCsvName)
' Dati Csv
EgtSetInfo(Pz, INFO_CSV_PART, m_sCsvName)
EgtSetInfo(Pz, INFO_CSV_ORD, m_sCsvOrder)
EgtSetInfo(Pz, INFO_CSV_DIST, m_sCsvList)
EgtSetInfo(Pz, INFO_CSV_MAT, m_MainWindow.m_CurrentMachine.CurrMat.sName)
EgtSetInfo(Pz, INFO_CSV_V1, DoubleToString(b3Part.DimX(), 1))
EgtSetInfo(Pz, INFO_CSV_V2, DoubleToString(b3Part.DimY(), 1))
' Se definito nome lo inserisco nel testo
If Not String.IsNullOrWhiteSpace(m_sCsvName) Then
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = String.Empty
EgtTextGetContent(nTextId, sText)
Dim sNewText = m_sCsvName & "<br/>" & sText
EgtModifyText(nTextId, sNewText)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
End If
' Altrimenti pezzo con dati normali
Else
' Se definito nome lo inserisco nel testo
If Not String.IsNullOrWhiteSpace(sName) Then
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
While nTextId <> GDB_ID.NULL
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
Dim sText As String = String.Empty
EgtTextGetContent(nTextId, sText)
Dim sNewText = sName & "<br/>" & sText
EgtModifyText(nTextId, sNewText)
Exit While
End If
nTextId = EgtGetNext(nTextId)
End While
End If
End If
' Eventuale testo per indicare il sopra (solo nel caso di rettangolo)
If TopChBx.IsVisible() And TopChBx.IsChecked() Then
Utility.AddTopToPartRegion(nRegLayId)
End If
' Scrivo testi per nesting
SideAngle.WriteSideAngleForNest(DrawScene.GetCtx())
' Imposto colore testi
Utility.SetTextColor(nRegLayId)
' Imposto il colore del pezzo inserito nel progetto
Dim nPartInRegion As Integer = EgtGetFirstInGroup(nRegLayId)
EgtSetColor(nPartInRegion, InsertColor)
' Esporto il pezzo in un file temporaneo
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPartCompo.Nge"
If Not EgtSaveObjToFile(Pz, sTmpFile, NGE.BIN) Then
Return False
End If
' Passo al contesto principale
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Recupero flag per inserimento diretto in grezzo (altrimenti in parcheggio)
Dim bDirect As Boolean = (GetPrivateProfileInt(S_NEST, K_DIRECT, 0, m_MainWindow.GetIniFile()) <> 0)
' Elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' Area dei nuovi pezzi
Dim dNewArea As Double = 0
' Se esiste il file del pezzo
If My.Computer.FileSystem.FileExists(sTmpFile) Then
' eseguo inserimento
For i As Integer = 1 To nNbr
' Inserisco il pezzo
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Aggiusto per lavorazioni
EgtAdjustFlatPart(nId2)
' Se dati Trf assegno nome univoco
If m_bTrfData Then EgtSetInfo(nId2, "CsvPart", m_TrfOrderCode & "-" & nId2.ToString())
' Aggiorno l'area dei nuovi pezzi
dNewArea += GeomCalc.GetPartArea(nId2)
' Inserisco in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
' verifico che il pezzo sia un Piano Cucina o un Piano Bagno o un'Aletta
Dim sCMP As String = String.Empty
EgtGetInfo(nId2, "CMP", sCMP)
If sCMP.StartsWith("PCucina") Or sCMP.StartsWith("PBagno") Or sCMP.StartsWith("AlzFront") Then
' Aggiungo riferimento e lo inserisco in VeinMatching
VeinMatching.SetRefOnPart(nId2)
VeinMatching.AddPartFromDraw(nId2)
' Se richiesto posizionamento diretto, lo eseguo
If bDirect Then
If m_MainWindow.m_CadCutPageUC.m_NestPage.InsertOnePart(nId2) Then
' Eventuale notifica al VeinMatching
VeinMatching.OnInsertPartInRaw(nId2)
End If
End If
End If
' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
Next
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
End If
' Aggiorno Aree totale
m_MainWindow.m_CurrentProjectPageUC.UpdateTotalArea(dNewArea)
' passo al pezzo successivo
Pz = NxtPz
End While
' Aggiorno Aree da lavorare dei pezzi
m_MainWindow.m_CurrentProjectPageUC.UpdateToProduceArea()
m_MainWindow.m_CurrentProjectPageUC.ShowAreas()
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
Return True
End Function
+61 -22
View File
@@ -1,7 +1,7 @@
; Commento per evitare BOM con UTF-8
[General]
Debug=0
Licence=OmagCUT-Key335-InternaBaronchelli.lic
Licence=OmagCUT-Key149-InternaBaronchelli.lic
MessagesDir=c:\ProgramData\EgalTech\OmagCUT\Messages
Messages=Italiano
;WinPlace=0,1366,0,1280,1024
@@ -9,12 +9,12 @@ WinPlace=0,77,0,1304,768
;WinPlace=0,1366,0,1366,768
MmUnits=1
MaxProj=99
LastProj=8
LastProj=10
AutoLoadLastProj=1
SaveDir=C:\ProgramData\Egaltech\OmagCUT\Data
ImageDir=C:\ProgramData\Egaltech\OmagCUT\Images
SaveNameDir=C:\ProgramData\Egaltech\OmagCut\MyProjects
LastNameProj=
LastNameProj=P11_PcucinaC23
LastProjToView=0056
DateTimeToView=31.05.2018 00:08:40
CameraLink=1
@@ -24,7 +24,7 @@ ShowTipAxes=1
ContourFromCamera=0
Registration=1
SiemensPc=1
VirtualKeyboard=1
VirtualKeyboard=0
Support=support@egaltech.com
Theme=0
@@ -84,16 +84,27 @@ MajLnColor=160,160,160
[Compo]
TrfData=0
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
CompoDir=C:\Users\Utente\repos\frontalini-1\Frontalini_ecc\CompoAF\
Count=12
LastColor=5
Color1=255,0,0,60
Color2=0,255,0,60
Color3=0,0,255,60
Color4=0,190,255,60
Color5=190,255,0,60
Color6=190,0,255,60
Color7=255,190,0,60
Color8=255,0,190,60
Color9=0,255,190,60
[Compo1]
Name=1 ;Triangolo
Count=3
Count=5
Image=Triangolo.png
Compo1=10,Triangolo2L.lua,Triangolo2L.png
Compo2=11,Triangolo3L.lua,Triangolo3L.png
Compo3=12,TriangoloIs.lua,TriangoloIs.png
Compo4=10,Triangolo2LC2.lua,Triangolo2LC2.png
Compo5=10,Triangolo2LC1.lua,Triangolo2LC1.png
[Compo2]
Name=2 ;Rettangolo
Count=1
@@ -101,12 +112,13 @@ Image=Rettangolo.png
Compo1=2,Rettangolo.lua,Rettangolo.png
[Compo3]
Name=3 ;Trapezio
Count=4
Count=5
Image=Trapezio.png
Compo1=12,TrapezioIs.lua,TrapezioIs.png
Compo2=13,TrapezioRt.lua,TrapezioRt.png
Compo3=14,TrapezioScA.lua,TrapezioScA.png
Compo4=15,TrapezioScB.lua,TrapezioScB.png
Compo3=13,TrapezioRtA.lua,TrapezioRtA.png
Compo4=14,TrapezioScA.lua,TrapezioScA.png
Compo5=15,TrapezioScB.lua,TrapezioScB.png
[Compo4]
Name=4 ;Quadrilatero
Count=4
@@ -124,9 +136,10 @@ Compo2=21,PiedocaB1.lua,PiedocaB1.png
Compo3=22,PiedocaB2.lua,PiedocaB2.png
[Compo6]
Name=6 ;Soglia
Count=1
Count=2
Image=Soglia.png
Compo1=6,SogliaA.lua,Soglia.png
Compo2=6,SogliaL.lua,SogliaL.png
[Compo7]
Name=7 ;Piano Cucina
Count=9
@@ -172,13 +185,12 @@ Compo1=43,Poligono.lua
[InternalCompo]
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
Count=8
CompoDir=C:\Users\Utente\repos\frontalini-1\Frontalini_ecc\CompoAF\
Count=11
[InternalCompo1]
InternalCompo1=2,IntRectangle.lua,Rettangolo.png
[InternalCompo2]
InternalCompo2=2,Fr_Alz.lua
InternalCompo2=37,IntRectangleF.lua,RettangoloArrot.png
;[InternalCompo2]
;InternalCompo2=37,IntRectangleF.lua,RettangoloArrot.png
;[InternalCompo3]
@@ -200,12 +212,11 @@ InternalCompo2=2,Fr_Alz.lua
[Alz&Front]
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
CompoDir=C:\Users\Utente\repos\frontalini-1\Frontalini_ecc\CompoAF\
Alz&Front=72,Alz&Front.lua,Alz&Front.png
A_Height=45
A_Height=30
A_DeltaAng=1
F_Height=60
F_Height=35
F_DeltaAng=1
[FlatParts]
@@ -214,6 +225,7 @@ Tolerance=0.1
[Sides]
MaxSideAngle=75
SizeAlwaysOnTop=1
ParSideAsTrf=0
SideAngle=45
DripOffset=20
@@ -278,11 +290,11 @@ CurrSlab=1
[RawPart]
RawColor=128,192,255,40
KerfColor=255,0,0,100
Length=1500
Length=3137.76
Width=2035.82
Height=25
OffsX=100
OffsY=100
OffsX=217.97
OffsY=113.88
Kerf=100
[RawMove]
@@ -438,3 +450,30 @@ Tolerance=0
[Alz&Front]
A_Height=15
A_DeltaAng=1
[InternalCompo3]
InternalCompo3=31,IntEllipse.lua,IntEllisse.png
[InternalCompo4]
InternalCompo4=45,IntDxf.lua,IntDxf.png
[InternalCompo5]
InternalCompo5=39,Int1Hole.lua,Int1Hole.png
[InternalCompo6]
InternalCompo6=40,Int2Holes.lua,Int2Holes.png
[InternalCompo7]
InternalCompo7=41,Int3Holes.lua,Int3Holes.png
[InternalCompo8]
InternalCompo8=44,IntDownHole.lua,IntDownHole.png
[InternalCompo9]
InternalCompo9=46,Ribasso.lua,Ribasso.png
[InternalCompo10]
InternalCompo10=70,LineeRibasso.lua,LineeRibasso.png
[InternalCompo11]
InternalCompo11=71,LineeLibere.lua,LineeLibere.png
[MruFiles]
File1=C:\ProgramData\Egaltech\OmagCUT\Data\0010.nge
File2=C:\ProgramData\Egaltech\OmagCut\MyProjects\P11__PcucinaC23.nge
File3=C:\ProgramData\Egaltech\OmagCUT\Data\0009.nge
File4=
File5=
File6=
File7=
File8=
@@ -0,0 +1,454 @@
; Commento per evitare BOM con UTF-8
[General]
Debug=0
Licence=OmagCUT-Key335-InternaBaronchelli.lic
MessagesDir=c:\ProgramData\EgalTech\OmagCUT\Messages
Messages=Italiano
;WinPlace=0,1366,0,1280,1024
WinPlace=0,77,0,1304,768
;WinPlace=0,1366,0,1366,768
MmUnits=1
MaxProj=99
LastProj=8
AutoLoadLastProj=1
SaveDir=C:\ProgramData\Egaltech\OmagCUT\Data
ImageDir=C:\ProgramData\Egaltech\OmagCUT\Images
SaveNameDir=C:\ProgramData\Egaltech\OmagCut\MyProjects
LastNameProj=P11_PcucinaC23
LastProjToView=0056
DateTimeToView=31.05.2018 00:08:40
CameraLink=1
CNLink=0
TestingPage=1
ShowTipAxes=1
ContourFromCamera=0
Registration=1
SiemensPc=1
VirtualKeyboard=0
Support=support@egaltech.com
Theme=0
[Languages]
Count=7
Language1=Italiano,EgalTechIta.txt
Language2=English,EgalTechEng.txt
Language3=Francais,EgalTechFra.txt
Language4=Deutsch,EgalTechDeu.txt
Language5=Espagnol,EgalTechEsp.txt
Language6=Portugues,EgalTechPor.txt
Language7=Turk,EgalTechTur.txt
[Lua]
LibsDir=C:\ProgramData\Egaltech\OmagCUT\LuaLibs
BaseLib=EgtBase
[OpenGL]
DoubleBuffer=1
ColorBits=32
DepthBits=24
Driver=3
[GeomDB]
DefaultFont=ModernPropS.Nfe
NfeFontDir=C:\ProgramData\Egaltech\OmagCUT\Fonts
DefaultColor=128,64,0
SaveType=2
[Scene]
BackTop=192,192,192
BackBottom=192,192,192
ShowGFrame=1
Mark=255,255,0
SelSurf=255,255,192
ShowMode=2
CurveDir=0
ShowTriaAdv=1
ShowZmap=9 ; +1=surf, +2=lines, +4=normals, +8=più colori
TextureMaxLinPixels=2048
ZoomWin=0,255,255,255,30
DistLine=255,0,0
BackTop1=96,96,96
BackBottom1=160,160,160
[Grid]
ShowGrid=1
ShowFrame=1
SnapStep=10
SnapStepInch=12.7
MinLineSStep=1
MajLineSStep=10
ExtSStep=200
MinLnColor=160,160,160
MajLnColor=160,160,160
[Compo]
TrfData=0
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
Count=12
LastColor=9
Color1=255,0,0,60
Color2=0,255,0,60
Color3=0,0,255,60
Color4=0,190,255,60
Color5=190,255,0,60
Color6=190,0,255,60
Color7=255,190,0,60
Color8=255,0,190,60
Color9=0,255,190,60
[Compo1]
Name=1 ;Triangolo
Count=3
Image=Triangolo.png
Compo1=10,Triangolo2L.lua,Triangolo2L.png
Compo2=11,Triangolo3L.lua,Triangolo3L.png
Compo3=12,TriangoloIs.lua,TriangoloIs.png
[Compo2]
Name=2 ;Rettangolo
Count=1
Image=Rettangolo.png
Compo1=2,Rettangolo.lua,Rettangolo.png
[Compo3]
Name=3 ;Trapezio
Count=4
Image=Trapezio.png
Compo1=12,TrapezioIs.lua,TrapezioIs.png
Compo2=13,TrapezioRt.lua,TrapezioRt.png
Compo3=14,TrapezioScA.lua,TrapezioScA.png
Compo4=15,TrapezioScB.lua,TrapezioScB.png
[Compo4]
Name=4 ;Quadrilatero
Count=4
Image=Quadrilatero.png
Compo1=16,QuadrilateroA.lua,QuadrilateroA.png
Compo2=19,QuadrilateroD.lua,QuadrilateroD.png
Compo3=17,QuadrilateroB.lua,QuadrilateroB.png
Compo4=18,QuadrilateroC.lua,QuadrilateroC.png
[Compo5]
Name=5 ;Piedoca
Count=3
Image=Piedoca.png
Compo1=20,PiedocaA1.lua,PiedocaA1.png
Compo2=21,PiedocaB1.lua,PiedocaB1.png
Compo3=22,PiedocaB2.lua,PiedocaB2.png
[Compo6]
Name=6 ;Soglia
Count=1
Image=Soglia.png
Compo1=6,SogliaA.lua,Soglia.png
[Compo7]
Name=7 ;Piano Cucina
Count=9
Image=PianoCucina.png
Compo1=2,PCucinaRett.lua
Compo2=23,PCucinaA1.lua
Compo3=24,PCucinaA23.lua
Compo4=25,PCucinaC1.lua
Compo5=26,PCucinaC23.lua
Compo6=29,PCucinaD1.lua
Compo7=30,PCucinaD23.lua
Compo8=27,PCucinaB1.lua
Compo9=28,PCucinaB2.lua
[Compo8]
Name=8 ;Piano Bagno
Count=2
Image=PianoBagno.png
Compo1=2,PBagnoRett.lua
Compo2=38,PBagnoBomb.lua
[Compo9]
Name=31 ;Ellisse
Count=1
Image=Ellisse.png
Compo1=31,Ellisse.lua
[Compo10]
Name=32 ;Ovale
Count=1
Image=Ovale.png
Compo1=32,Ovale.lua
[Compo11]
Name=33 ;Arco
Count=4
Image=Arco.png
Compo1=42,CurvaA5.lua
Compo2=34,CurvaA1.lua
Compo3=35,CurvaA2.lua
Compo4=36,CurvaA3.lua
[Compo12]
Name=43 ;Poligono
Count=1
Image=Poligono.png
Compo1=43,Poligono.lua
[InternalCompo]
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
Count=8
[InternalCompo1]
InternalCompo1=2,IntRectangle.lua,Rettangolo.png
[InternalCompo2]
InternalCompo2=2,Fr_Alz.lua
;[InternalCompo2]
;InternalCompo2=37,IntRectangleF.lua,RettangoloArrot.png
;[InternalCompo3]
;InternalCompo3=31,IntEllipse.lua,IntEllisse.png
;[InternalCompo4]
;InternalCompo4=45,IntDxf.lua,IntDxf.png
;[InternalCompo5]
;InternalCompo5=39,Int1Hole.lua,Int1Hole.png
;[InternalCompo6]
;InternalCompo6=40,Int2Holes.lua,Int2Holes.png
;[InternalCompo7]
;InternalCompo7=41,Int3Holes.lua,Int3Holes.png
;[InternalCompo8]
;InternalCompo8=44,IntDownHole.lua,IntDownHole.png
;[InternalCompo9]
;InternalCompo9=46,Ribasso.lua,Ribasso.png
;[InternalCompo10]
;InternalCompo10=70,LineeRibasso.lua,LineeRibasso.png
[Alz&Front]
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\Compo
;CompoDir=C:\ProgramData\Egaltech\OmagCUT\CompoAF
CompoDir=C:\EgtDev\frontalini\Frontalini_ecc\CompoAF
Alz&Front=72,Alz&Front.lua,Alz&Front.png
A_Height=30
A_DeltaAng=1
F_Height=35
F_DeltaAng=1
[FlatParts]
CurrDir=C:\ProgramData\Egaltech\OmagCUT\Examples
Tolerance=0.1
[Sides]
MaxSideAngle=75
SizeAlwaysOnTop=1
ParSideAsTrf=0
SideAngle=45
DripOffset=20
DripDepth=16
DripShort=0
UnderDrillDepth=12
DripOffset2=30
[Nest]
Direct=0
Step=100
AngStep=30
RestRadius=5
SnapDist=200
TrfThickTolerance=2
TextColor=0,0,0
[CSV]
Full=1
MaxDimOnX=0
Reader=CsvRead.lua
RuinedPartsDir=c:\ProgramData\EgalTech\OmagCUT\Ruined
ProducedPartsDir=c:\ProgramData\EgalTech\OmagCUT\Produced
CurrDir=C:\EgtData\Varie\CsvHenraux.new
LastFile=C:\EgtData\Varie\CsvHenraux.new\csv_fin.epl
[SlabDxf]
ImportSlabDxf=0
SlabLayer=SlabBoundary
PartsLayer=Counters
ScrapLayer=ReservedAreaBoundary
StdThick=25.4
[ColorToSideAng]
Enable=1
Tolerance=25
CTSA1=255,0,255,-45,0,1
CTSA2=153,102,204,-46,0,1
[Frame]
OffsZ=5
OffsXY=0
OffsYY=0
StartTrim=0
EndTrim=0.1
EnableArc=0
ArcRad=210
ArcAng=90
[FastGrid]
FgEnable=0
1=300,300,300 300
2=400,400,400 400
3=500,500,500 500
4=600,600,600 600
5=3000,600,3000 600
FGActive=1
PieceType=2
Order=Ord004
CurrSlab=1
[RawPart]
RawColor=128,192,255,40
KerfColor=255,0,0,100
Length=3137.76
Width=2035.82
Height=25
OffsX=217.97
OffsY=113.88
Kerf=100
[RawMove]
Step=100
Rotation=90
Perpendicular=0
[Reg]
Step=10
AngStep=2
[Camera]
Count=1
ExePath=C:\Program Files (x86)\Egaltech\CameraMng\CameraMng.exe
Image=C:\ProgramData\Egaltech\CameraMng\data\FinalImage.jpg
Info=C:\ProgramData\Egaltech\CameraMng\data\FinalImage.txt
Result=C:\ProgramData\Egaltech\CameraMng\data\click.txt
Contour=C:\ProgramData\Egaltech\CameraMng\data\FinalImage.dxf
ExePath2=C:\Program Files (x86)\Egaltech\CameraMng2\CameraMng2.exe
Image2=C:\ProgramData\Egaltech\CameraMng2\data\FinalImage.jpg
Info2=C:\ProgramData\Egaltech\CameraMng2\data\FinalImage.txt
Result2=C:\ProgramData\Egaltech\CameraMng2\data\click.txt
Contour2=C:\ProgramData\Egaltech\CameraMng2\data\FinalImage.dxf
Threshold=40
Timeout=30
Tolerance=5
[Mach]
MachinesDir=c:\EgtData\Machines
ToolMakersDir=C:\ProgramData\Egaltech\OmagCUT\ToolMakers
CurrMach=Omag-Area5
[Machines]
01.Mach=Omag-Area5
01.Proj=7
02.Mach=Omag-Area5_2Tsp-S
02.Proj=6
03.Mach=Omag-AreaCut
03.Proj=5
04.Mach=Omag-AreaCut-S
04.Proj=2
05.Mach=Omag-AreaCutUcd
05.Proj=2
06.Mach=Omag-AreaCutUcd-S
06.Proj=1
07.Mach=Omag-Blade5_2Tab-S
07.Proj=2
08.Mach=Omag-Blade5AR
08.Proj=7
09.Mach=Omag-Blade5ARnc
09.Proj=4
10.Mach=Omag-Blade5ARnc-S
10.Proj=2
11.Mach=Omag-Blade5AR-S
11.Proj=3
12.Mach=Omag-Blade5Ho4
12.Proj=10
13.Mach=Omag-Blade5-S
13.Proj=1
14.Mach=Omag-Digitale5
14.Proj=15
15.Mach=Omag-Digitale5Hsm
15.Proj=10
16.Mach=Omag-Digitale5HsmSV
16.Proj=3
17.Mach=Omag-Digitale5SV
17.Proj=3
18.Mach=Omag-MultiCut
18.Proj=0
19.Mach=Omag-MultiCutNC-S
19.Proj=0
20.Mach=Omag-MultiCutRT-S
20.Proj=2
21.Mach=Omag-Profiler
21.Proj=0
22.Mach=Omag-Water5&Saw
22.Proj=88
[Simul]
SliderX=0.5
SliderVal=61.4
[CopyTemplate]
CurrDir=C:\ProgramData\Egaltech\OmagCut\CopyTemplate
[VeinMatching]
Enable=1
WinPlace=0,378,35,682,747
[DirectCuts]
SingDepth=15
SingLength=1668.26
SingAngH=0
SingAngV=0
SingOffset=30
SingPosX=1143.74
SingPosY=1989.25
MultDepth=15
MultLength=100
MultAngH=0
MultAngV=0
MultNum1=2
MultDim1=20
MultNum2=3
MultDim2=40
MultNum3=3
MultDim3=50
MultNum4=0
MultDim4=0
MultNum5=0
MultDim5=0
MultNum6=0
MultDim6=0
MultNum7=0
MultDim7=0
MultNum8=0
MultDim8=0
MultNum9=0
MultDim9=0
MultNum10=0
MultDim10=0
MultHeadSide=0
MultPosX=1063.82
MultPosY=1739.07
GridDepth=25
GridAngH=270
GridAngV=0
GridNumX=2
GridDimX=100
GridNumY=2
GridDimY=100
GridHeadSide=0
GridPosX=1105.52
GridPosY=1885.01
FlattDepth=10
FlattAngH=0
FlattLength=1414.21
FlattWidth=500
FlattOverlap=1
FlattHeadSide=0
FlattMachType=1
FlattRotLock=0
FlattPosX=1000
FlattPosY=1000
TestDepth=5
TestLength=1078.98
TestAngH=259.45
TestOffset=0
[Cad2d]
Name=EgtCAM5R32
ExePath=C:\Program Files (x86)\Egaltech\EgtCAM5\EgtCAM5R32.exe
[ColorToEngrave]
Tolerance=0
[Alz&Front]
A_Height=15
A_DeltaAng=1
@@ -0,0 +1,27 @@
Friend Sub WriteSideAngleForNest(nCtx As Integer)
' Imposto contesto corrente
EgtSetCurrentContext(nCtx)
Dim PartId As Integer = EgtGetFirstPart()
While PartId <> GDB_ID.NULL
' Se richiesti lati paralleli con misura sul top come in TRF e non già misure sul top, verifico e aggiusto
If GetPrivateProfileInt( S_SIDES, K_PARSIDE_AS_TRF, 0, m_MainWindow.GetIniFile()) <> 0 AndAlso
GetPrivateProfileInt( S_SIDES, K_SIZEALWAYSONTOP, 0, m_MainWindow.GetIniFile()) = 0 Then
AdjustAsTrfParSides( PartId)
End If
' Elimino eventuale precedente layer per testi
EgtErase(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
' Creo layer per testi nesting
Dim TextLayId As Integer = EgtCreateGroup(PartId)
EgtSetName(TextLayId, SIDE_ANGLE_LAYER)
EgtSetColor(TextLayId, New Color3d(0, 0, 128))
' Opero su geometria esterna pezzo
WriteSideAngleOnLoop(EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP), TextLayId)
' Ciclo su geometria interna pezzo
Dim LoopId As Integer = EgtGetFirstNameInGroup(PartId, NAME_INLOOP)
While LoopId <> GDB_ID.NULL
WriteSideAngleOnLoop(LoopId, TextLayId)
LoopId = EgtGetNextName(LoopId, NAME_INLOOP)
End While
PartId = EgtGetNextPart(PartId)
End While
End Sub
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
CMP.V1=1000.0
CMP.V2=200.0
CMP.V3=1600.0
CMP.V4=200.0
CMP.V5=0.0
+114 -48
View File
@@ -5,22 +5,6 @@ local EgtCompo = {}
print( 'EgtCompo Carlo started')
--[[
-- 2021/07
-- Disegna i lati di un rattangolo 'allineato' dati layer, Punto, base, altezza e versore (direzione) della base
function DrawRectAll (Lay, Pt, BaseL, HeightL, Vect, sName)
local l1 = EgtLinePVL( Lay,Pt,VRotated( Vect,-90),HeightL)
EgtSetName( l1,sName.."l1")
local l2 = EgtLinePVL( Lay,EgtEP( l1),Vect,BaseL)
EgtSetName( l2,sName.."l2")
local l3 = EgtLinePVL( Lay,EgtEP( l2),VRotated( Vect,90),HeightL)
EgtSetName( l3,sName.."l3")
local l4 = EgtLine( Lay,EgtEP( l3),EgtSP( l1))
EgtSetName( l4,sName.."l4")
return l1, l2, l3, l4
end
]]
--[[ 2021/08
-- Disegna i lati di un rattangolo dati layer, Punto, base, altezza;
@@ -78,7 +62,7 @@ function AddLineDashes( Lq, LineId, dLen)
end
-- Aggiunge un simbolo circolare all'angolo dati due lati
function CircleIntPol (Layer,l1,l2,Ang,cnv) -- cnv = true se angolo dato acuto
function CircleIntPol ( Layer,l1,l2,Ang,cnv) -- cnv = true se angolo dato acuto
--ErrArc = EgtArcC2P(La,EgtSP(l2),Point3d(20,0,0),EgtSP(l1))
local vtBis, dLen, ptAngErr, crAngErr, sfAngErr
if cnv then
@@ -95,7 +79,7 @@ function CircleIntPol (Layer,l1,l2,Ang,cnv) -- cnv = true se angolo dato acuto
end
-- Restituisce la stringa del valore limite con le unità di misura UI
function GetLenLimit(Lim)
function GetLenLimit( Lim)
if EgtUiUnitsAreMM() then
return EgtNumToString(Lim,2)..' mm'
else
@@ -103,56 +87,82 @@ function GetLenLimit(Lim)
end
end
-- Inserisce una etichetta orizzontale centrata nel punto indicato
function AddLabelPnt(Lay,pt,sText,dH,Rot,col)
-- Inserisce una etichetta centrata nel punto indicato **in coord. globali**
function AddLabelPnt( Lay, pt, sText, dH, Rot, col)
local v = EgtTextAdv(Lay,pt,Rot,sText,'',100,'S',dH,1,0,GDB_TI.MC,GDB_RT.GLOB)
EgtSetColor(v,col)
return v
end
-- Inserisce una etichetta orizzontale vicino al punto medio di un elemento
function AddLabel(Lay,nEdge,offset,sText,dH,rot,col)
local vt = EgtMV(nEdge,GDB_ID.ROOT)
vt:rotate(Z_AX(),rot) -- rot=rotazione del versore di offset
local pt = EgtMP(nEdge,GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv(Lay,pt,0,sText,'',100,'S',dH,1,0,GDB_TI.MC,GDB_RT.GLOB)
-- Inserisce una etichetta centrata nel punto indicato **in coord. locali**
function AddLabelPntLOC( Lay, pt, sText, dH, Rot, col)
local v = EgtTextAdv( Lay, pt, Rot, sText,'', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.LOC)
EgtSetColor(v,col)
return v
end
-- Inserisce una **etichetta orizzontale** vicino al punto medio di un elemento
function AddLabel( Lay, nEdge, offset, sText, dH, rot, col)
local vt = EgtMV( nEdge, GDB_ID.ROOT)
vt:rotate(Z_AX(),rot) -- rotazione del versore di offset
local pt = EgtMP( nEdge,GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv( Lay, pt, 0, sText, '', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.GLOB)
EgtSetColor(v,col)
EgtSetStatus(v,GDB_ST.SEL)
return v
end
-- Inserisce una etichetta allineata vicino al punto medio di un elemento
function AddLabelAl(Lay,nEdge,offset,sText,dH,rot,col)
local vt = EgtMV(nEdge,GDB_ID.ROOT)
local vtAng = atan2(vt:getY(),vt:getX())
vt:rotate(Z_AX(),rot) -- rot=rotazione del versore di offset
local pt = EgtMP(nEdge,GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv(Lay,pt,vtAng,sText,'',100,'S',dH,1,0,GDB_TI.MC,GDB_RT.GLOB)
EgtSetColor(v,col)
EgtSetStatus(v,GDB_ST.SEL)
-- Inserisce una **etichetta allineata** vicino al punto medio di un elemento
function AddLabelAl( Lay, nEdge, offset, sText, dH, rot, col)
local vt = EgtMV( nEdge, GDB_ID.ROOT)
local vtAng = atan2(vt:getY(), vt:getX())
vt:rotate( Z_AX(), rot) -- rotazione del versore di offset
local pt = EgtMP( nEdge, GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv( Lay, pt, vtAng, sText,'', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.GLOB)
EgtSetColor( v,col)
EgtSetStatus( v,GDB_ST.SEL)
return v
end
-- Inserisce una **etichetta allineata ed eventualmente ruotata** vicino al punto medio di un elemento
function AddLabelAl2( Lay, nEdge, offset, sText, dH, rot, col, bInv)
local vt = EgtMV( nEdge, GDB_ID.ROOT)
local vtAng = atan2( vt:getY(), vt:getX())
local vtAng2
if vtAng >= -75 and vtAng <= 115 then
vtAng2 = vtAng
else
vtAng2 = vtAng + 180
end
vt:rotate( Z_AX(),rot) -- rotazione del versore di offset
--local pt = EgtMP( nEdge, GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local pt = EgtMP( nEdge, GDB_ID.ROOT) + vt * (offset + dH/2) + Vector3d(0,0,10)
local v = EgtTextAdv( Lay, pt, vtAng2, sText,'', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.GLOB)
EgtSetColor( v, col)
EgtSetStatus( v, GDB_ST.SEL)
return v
end
-- Inserisce una etichetta orizzontale vicino alla posizione data (param. "U" da sx) di un elemento
function AddLabelU(Lay,nEdge,U,offset,sText,dH,rot,col)
function AddLabelU( Lay,nEdge,U,offset,sText,dH,rot,col)
--local vt = EgtMV(nEdge-1,GDB_ID.ROOT)
local vt = EgtMV(nEdge,GDB_ID.ROOT)
vt:rotate(Z_AX(),rot) -- rot=rotazione del versore di offset
local pt = EgtUP(nEdge,U,GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv(Lay,pt,0,sText,'',100,'S',dH,1,0,GDB_TI.MC,GDB_RT.GLOB)
EgtSetColor(v,col)
EgtSetStatus(v,GDB_ST.SEL)
local vt = EgtMV( nEdge, GDB_ID.ROOT)
vt:rotate(Z_AX(), rot) -- rot=rotazione del versore di offset
local pt = EgtUP( nEdge, U, GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv(Lay, pt, 0, sText, '', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.GLOB)
EgtSetColor( v, col)
EgtSetStatus( v, GDB_ST.SEL)
return v
end
-- Inserisce una etichetta allineata vicino alla posizione data (para. "U" da sx) di un elemento
function AddLabelUAl(Lay,nEdge,U,offset,sText,dH,rot,col)
local vt = EgtMV(nEdge,GDB_ID.ROOT)
function AddLabelUAl( Lay, nEdge, U, offset, sText, dH, rot, col)
local vt = EgtMV( nEdge, GDB_ID.ROOT)
--local vt = EgtMV(nEdge,GDB_ID.ROOT)
local vtAng = atan2(vt:getY(),vt:getX())
vt:rotate(Z_AX(),rot) -- rot=rotazione del versore di offset
local pt = EgtUP(nEdge,U,GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv(Lay,pt,vtAng,sText,'',100,'S',dH,1,0,GDB_TI.MC,GDB_RT.GLOB)
local vtAng = atan2( vt:getY(), vt:getX())
vt:rotate( Z_AX(),rot) -- rot=rotazione del versore di offset
local pt = EgtUP( nEdge, U, GDB_ID.ROOT) + vt * offset * dH + Vector3d(0,0,10)
local v = EgtTextAdv( Lay, pt, vtAng, sText, '', 100, 'S', dH, 1, 0, GDB_TI.MC, GDB_RT.GLOB)
EgtSetColor(v,col)
EgtSetStatus(v,GDB_ST.SEL)
return v
@@ -385,4 +395,60 @@ function CreateTopSurf( Lw, Lo, Ly, Ls)
return true
end -- di CreateTopSurf(Lw,Lo,Ly,Ls)
-- Mirror rispetto all'asse Y (SIMMETRIA)
function GetAllSimm( Lay1, Lay2, Lay3, Lay4, Lay5, Lay6, Lay7, Lay8)
if Lay1 then
EgtMirror( EgtGetAllInGroup( Lay1), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay2 then
EgtMirror( EgtGetAllInGroup( Lay2), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay3 then
EgtMirror( EgtGetAllInGroup( Lay3), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay4 then
EgtMirror( EgtGetAllInGroup( Lay4), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay5 then
EgtMirror( EgtGetAllInGroup( Lay5), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay6 then
EgtMirror( EgtGetAllInGroup( Lay6), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay7 then
EgtMirror( EgtGetAllInGroup( Lay7), ORIG(), X_AX(), GDB_RT.GLOB)
end
if Lay8 then
EgtMirror( EgtGetAllInGroup( Lay8), ORIG(), X_AX(), GDB_RT.GLOB)
end
end
-- Mirror rispetto all'asse X (RIBALTAMENTO)
function GetAllRib( Lay1, Lay2, Lay3, Lay4, Lay5, Lay6, Lay7, Lay8)
if Lay1 then
EgtMirror( EgtGetAllInGroup( Lay1), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay2 then
EgtMirror( EgtGetAllInGroup( Lay2), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay3 then
EgtMirror( EgtGetAllInGroup( Lay3), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay4 then
EgtMirror( EgtGetAllInGroup( Lay4), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay5 then
EgtMirror( EgtGetAllInGroup( Lay5), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay6 then
EgtMirror( EgtGetAllInGroup( Lay6), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay7 then
EgtMirror( EgtGetAllInGroup( Lay7), ORIG(), Y_AX(), GDB_RT.GLOB)
end
if Lay8 then
EgtMirror( EgtGetAllInGroup( Lay8), ORIG(), Y_AX(), GDB_RT.GLOB)
end
end
return EgtCompo
-6
View File
@@ -1,6 +0,0 @@
CMP.V1=1800
CMP.V2=2000
CMP.V3=600
CMP.V4=650
CMP.V5=false
CMP.V6=false
+8 -6
View File
@@ -168,16 +168,18 @@ function CMP_Draw(bPreview)
-- Simmetria
if Simm then
EgtMirror({Ly,Lr,La},ORIG(),X_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l4,l6,l5,l3,d1})
EgtSetInfo(La,"SIMM","1")
-- EgtMirror({Ly,Lr,La},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La)
EgtInvertCurve({l1,l2,l4,l6,l5,l3,d1})
EgtSetInfo(La,"SIMM","1")
end
-- Ribaltamento della figura
if Rib then
EgtMirror({Ly,Lr,La,Le},ORIG(),Y_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l4,l6,l5,l3})
EgtSetInfo(La,"RIB","1")
--EgtMirror({Ly,Lr,La,Le},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le)
EgtInvertCurve({l1,l2,l4,l6,l5,l3})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-8
View File
@@ -1,8 +0,0 @@
CMP.V1=1800
CMP.V2=2000
CMP.V3=600
CMP.V4=500
CMP.V5=false
CMP.V6=100
CMP.V7=false
CMP.V8=false
+11 -9
View File
@@ -235,18 +235,20 @@ local function CMP_DrawA2(bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
EgtSetInfo(La,"SIMM","1")
end
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
EgtSetInfo(La,"SIMM","1")
end
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-7
View File
@@ -1,7 +0,0 @@
CMP.V1=1000
CMP.V2=500
CMP.V3=500
CMP.V4=30
CMP.V5=50
CMP.V6=false
CMP.V7=false
+7 -3
View File
@@ -41,7 +41,7 @@ CMP.N6 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.V6 = false
CMP.N7 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T7 = 1
CMP.V7 = false
CMP.V7 = true
CMP.Npar = 7
CMP.Nome = Nome
CMP.WithInt = true
@@ -227,14 +227,16 @@ function CMP_Draw(bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,arc,l6,l7,d1})
EgtInvertCurve({DimLineL3,DimLineLC,DimLineLZ,DimLineL7,lnZ2,DimLineR1,DimLineR2,DimLineR3})
EgtSetInfo(La,"SIMM","1")
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly,Lr,La,Le,Lq)
EgtInvertCurve({l1,l2,l3,l4,arc,l6,l7})
EgtInvertCurve({DimLineL3,DimLineLC,DimLineLZ,DimLineL7,lnZ2,DimLineR1,DimLineR2})
EgtSetInfo(La,"RIB","1")
@@ -331,3 +333,5 @@ function CMP_Draw(bPreview)
end
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
-6
View File
@@ -1,6 +0,0 @@
CMP.V1=800
CMP.V2=500
CMP.V3=30
CMP.V4=50
CMP.V5=false
CMP.V6=false
+6 -2
View File
@@ -193,14 +193,16 @@ function CMP_Draw(bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,d1})
EgtInvertCurve({DimLineLZ,lnZ2,DimLineR3})
EgtSetInfo(La,"SIMM","1")
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly,Lr,La,Le,Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6})
EgtInvertCurve({DimLineLZ,lnZ2})
EgtSetInfo(La,"RIB","1")
@@ -288,3 +290,5 @@ function CMP_Draw(bPreview)
end
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
-7
View File
@@ -1,7 +0,0 @@
CMP.V1=1800
CMP.V2=2000
CMP.V3=600
CMP.V4=500
CMP.V5=110
CMP.V6=false
CMP.V7=false
+5 -3
View File
@@ -33,7 +33,7 @@ CMP.N4 = 'D' -- profondità lato 'orizzontale'
CMP.V4 = 500
CMP.N5 = 'a' -- angolo Alfa tra i muri (compreso tra AlfaMin e AlfaMax)
CMP.T5 = 4
CMP.V5 = 110
CMP.V5 = 85
CMP.N6 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T6 = 1
@@ -207,7 +207,8 @@ function CMP_Draw(bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
@@ -216,7 +217,8 @@ function CMP_Draw(bPreview)
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly,Lr,La,Le,Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
-9
View File
@@ -1,9 +0,0 @@
CMP.V1=1800.0
CMP.V2=2000.0
CMP.V3=600.0
CMP.V4=500.0
CMP.V5=75.0
CMP.V6=false
CMP.V7=100.0
CMP.V8=false
CMP.V9=false
+28 -19
View File
@@ -44,10 +44,10 @@ CMP.N7 = 'G/R' -- lunghezza 'smusso' interno a 45° o raggio di raccordo
CMP.V7 = 100
CMP.N8 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T8 = 1
CMP.V8 = false
CMP.V8 = true
CMP.N9 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T9 = 1
CMP.V9 = false
CMP.V9 = true
CMP.Npar = 9
CMP.Nome = Nome
CMP.WithInt = true
@@ -57,6 +57,7 @@ _G.CMP = CMP
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
-- FIGURA CON RACCORDO
local function CMP_DrawC2(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
@@ -238,17 +239,20 @@ local function CMP_DrawC2(bPreview)
end
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
if Simm then
--EgtMirror( { Ly, Lr, La, Le, Lq}, ORIG(), X_AX(), GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
EgtSetInfo(La,"SIMM","1")
end
end
EgtSetInfo(La,"SIMM","1")
end
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
--EgtMirror( { Ly, Lr, La, Le, Lq}, ORIG(), Y_AX(), GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
@@ -345,9 +349,10 @@ local function CMP_DrawC2(bPreview)
-- salvo i parametri come nuovo default
SaveCompoData(CMP.Npar)
end
end
end -- CMP_DrawC2 FIGURA CON RACCORDO
function CMP_DrawC3(bPreview)
-- FIGURA CON SMUSSO
local function CMP_DrawC3(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
@@ -532,20 +537,24 @@ function CMP_DrawC3(bPreview)
end
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6arc,l7,arcAlfa})
if Simm then
--EgtMirror( { Ly, Lr, La, Le, Lq}, ORIG(), X_AX(), GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
EgtSetInfo(La,"SIMM","1")
end
end
EgtSetInfo(La,"SIMM","1")
end
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6arc,l7,arcAlfa})
--EgtMirror( { Ly, Lr, La, Le, Lq}, ORIG(), Y_AX(), GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- Dimensioni dell'oggetto
@@ -640,7 +649,7 @@ function CMP_DrawC3(bPreview)
-- salvo i parametri come nuovo default
SaveCompoData(CMP.Npar)
end
end
end -- CMP_DrawC3 FIGURA CON SMUSSO
function CMP_Draw( bPreview)
-8
View File
@@ -1,8 +0,0 @@
CMP.V1=1800
CMP.V2=2000
CMP.V3=600
CMP.V4=500
CMP.V5=86
CMP.V6=2
CMP.V7=false
CMP.V8=false
+14 -12
View File
@@ -219,19 +219,21 @@ function CMP_Draw(bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
end
EgtSetInfo(La,"SIMM","1")
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
end
EgtSetInfo(La,"SIMM","1")
end
-- Simmetria verticale ('ribaltamento')
if Rib then
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-10
View File
@@ -1,10 +0,0 @@
CMP.V1=1799.9989
CMP.V2=2000.0011
CMP.V3=600.0
CMP.V4=600.0
CMP.V5=87.0
CMP.V6=false
CMP.V7=150.0
CMP.V8=1
CMP.V9=false
CMP.V10=false
+15 -13
View File
@@ -5,7 +5,7 @@
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
@@ -251,19 +251,21 @@ function CMP_DrawD2( bPreview)
-- Simmetria orizzontale
if Simm then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
end
EgtSetInfo(La,"SIMM","1")
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),X_AX(),GDB_RT.GLOB)
GetAllSimm( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
if CMP.ERR == 0 then
EgtInvertCurve(d1)
end
EgtSetInfo(La,"SIMM","1")
end
-- Simmetria verticale ('ribaltamento')
if Rib then
EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
if Rib then
--EgtMirror({Ly,Lr,La,Le,Lq},ORIG(),Y_AX(),GDB_RT.GLOB)
GetAllRib( Ly, Lr, La, Le, Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
@@ -600,7 +602,7 @@ function CMP_DrawD3( bPreview)
-- Etichette sulla figura
local stdoffset = 1
local LblL1 = AddLabel(Le,l1,stdoffset,CMP.N1.."-"..l1.tostring,dim,-90,RED())
local LblL1 = AddLabel(Le,l1,stdoffset,CMP.N1,dim,-90,RED())
EgtSetInfo(LblL1,"Var",1)
local LblL2 = AddLabel(Le,l2,stdoffset,CMP.N2,dim,-90,RED())
EgtSetInfo(LblL2,"Var",2)
+334
View File
@@ -0,0 +1,334 @@
-- 2020/02/08
-- Piano cucina 'E' : quadrangolare, da uno a tre lati fuori squadra
-- rel.03e 13/07/2020 : riposizionamento del paragrafo "Dimesioni sull'oggetto"
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
-- Valori limite
local LgMin = 10
local LgMinDeltaA = 5 -- ?
-- Parametri : dichiarazione e valori standard
local CMP = {}
-- 0=null, 1=bool, 2=int, 3=len, 4=num, 5=stringlocal CMP = {}
CMP.N1 = 'A' -- lato libero (frontale)
CMP.T1 = 3
CMP.V1 = 800
CMP.N2 = 'H1' -- perpendicolare a LA, a sx
CMP.T2 = 3
CMP.V2 = 600
CMP.N3 = 'H2' -- perpendicolare a LA, a dx
CMP.T3 = 3
CMP.V3 = 650
CMP.N4 = 'A1' -- 'prolungamento' fuori squadro ; se>0 angolo 'aperto', se <0 angolo 'chiuso'
CMP.T4 = 3
CMP.V4 = 10
CMP.N5 = 'A2' -- come A1
CMP.T5 = 3
CMP.V5 = 10
CMP.N6 = '↑↓' -- Ribaltamento su/giù
CMP.T6 = 1
CMP.V6 = true
--
CMP.Npar = 6
CMP.Nome = 'PCucinaRett'
CMP.INFO = nil
CMP.WithInt = true
--
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
--
-- Funzione di disegno
local function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegno le dimensioni
local LA = CMP.V1
local H1 = CMP.V2
local H2 = CMP.V3
local A1 = CMP.V4
local A2 = CMP.V5
local Rib = CMP.V6
--
local sLBLabel = 'B' -- lato sx
local sLCLabel = 'C' -- lato dx
local sLDLabel = 'D' -- lato dx
local sLD1Label = 'd1' -- diagonale
local sLD2Label = 'd2' -- diagonale
--
CMP.ERR = 0
CMP.MSG = ''
-- Verifica della dimensioni
if LA < LgMin then
LA = 800 --LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit( LgMin) -- La lunghezza dei lati deve essere maggiore di
elseif H1 < LgMin then
H1 = 600 --LgMin
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit( LgMin) -- La lunghezza dei lati deve essere maggiore di
elseif H2 < LgMin then
H2 = 600 --LgMin
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit( LgMin) -- La lunghezza dei lati deve essere maggiore di
elseif A1 > 0 and A1 < LgMinDeltaA then
A1 = LgMinDeltaA
CMP.ERR = 2
CMP.MSG = Msg[225]..GetLenLimit( LgMinDeltaA) -- | A1|, | A2| se diversi da zero devono essere maggiorni di
elseif A1 < 0 and abs( A1) < LgMinDeltaA then
A1 = -LgMinDeltaA
CMP.ERR = 2
CMP.MSG = Msg[225]..GetLenLimit( LgMinDeltaA) -- | A1|, | A2| se diversi da zero devono essere maggiorni di
elseif A2 > 0 and A2 < LgMinDeltaA then
A2 = LgMinDeltaA
CMP.ERR = 2
CMP.MSG = Msg[225]..GetLenLimit( LgMinDeltaA) -- | A1|, | A2| se diversi da zero devono essere maggiorni di
elseif A2 < 0 and abs( A2) < LgMinDeltaA then
A2 = -LgMinDeltaA
CMP.ERR = 2
CMP.MSG = Msg[225]..GetLenLimit( LgMinDeltaA) -- | A1|, | A2| se diversi da zero devono essere maggiorni di
end
if not bPreview and CMP.ERR ~= 0 then
return
end
--
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
--
-- Pezzo e Layer
local Pz = EgtGroup( GDB_ID.ROOT, GDB_RT.LOC) -- pezzo
local Ly = EgtGroup( Pz, GDB_RT.LOC) -- layer della figura principale
EgtSetName( Ly, 'OutLoop')
local Lr = EgtGroup( Pz, GDB_RT.LOC) -- layer regione
EgtSetName( Lr, 'Region')
local Lc = EgtGroup( Pz, GDB_RT.LOC) -- layer di costruzione
local La = EgtGroup( Pz, GDB_RT.LOC) -- layer ausiliario (diagonali ausiliarie e relative etichette, assi)
EgtSetName( La, "LayAux")
local Le = EgtGroup( Pz, GDB_RT.LOC) -- layer di quotatura e delle etichette pezzo
EgtSetName( Le, "Etichette")
local Lq = EgtGroup( Pz, GDB_RT.LOC) -- layer delle linee di quotatura
EgtSetName( Lq, "Quotature")
EgtSetCurrPartLayer(Pz, Ly)
--
-- Costruzione della figura: lati
local lA = EgtLine( Ly, Point3d( 0,0,0), Point3d( LA,0,0))
EgtSetName( lA, "A1")
local ptH1 = EgtSP( lA)
local ptH2 = EgtEP( lA)
if A1 > 0 then
ptH1 = ptH1 + Vector3d( A1, 0, 0)
end
if A2 > 0 then
ptH2 = ptH2 - Vector3d( A2, 0, 0)
end
-- altezze H1, H2
local lH1 = EgtLinePDL( Lq, ptH1, 90, H1)
local lH2 = EgtLinePDL( Lq, ptH2, 90, H2)
--
local lC = EgtLine( Ly, EgtEP( lH2), EgtEP( lH1))
EgtSetName( lC, "A3")
if A2 < 0 then
EgtExtendCurveStartByLen( lC, -A2)
end
if A1 < 0 then
EgtExtendCurveEndByLen( lC, -A1)
end
local lB = EgtLine( Ly, EgtEP( lA), EgtSP( lC))
EgtSetName( lB, "A2")
local lD = EgtLine( Ly, EgtEP( lC), EgtSP( lA))
EgtSetName( lD, "A4")
--
-- Riempimento della figura
local e1 = EgtCurveCompo( Ly, {lA,lB,lC,lD}, false)
local s1 = EgtSurfFlatRegion( Lr, e1)
if CMP.ERR == 0 then
EgtSetColor( s1, AQUA())
else
EgtSetColor( s1, ORANGE())
end
EgtSetAlpha( s1, 25)
EgtErase( e1)
--
-- **Linee di quotatura**
local dim = EgtGetBBoxGlob(Ly,GDB_BB.STANDARD):getRadius() * 0.1
local dim1 = dim * 1 ; local dim2 = dim * 2 ; local dim3 = dim * 3
local DimLineA1, DimLineA2
-- Linee di quotatura **lato 'esterno'**
local ptQ
if A1 > 0 or A2 > 0 then
ptQ = EgtSP( lA, Lq) - Vector3d( 0, dim * 3, 0)
else
ptQ = EgtSP( lA, Lq) - Vector3d( 0, dim * 2, 0)
end
local DimLineLA = EgtLinePDL( Lq, ptQ, 0, LA)
AddLineDashes( Lq, DimLineLA, dim/2)
--local DimLineA1
if A1 > 0 then
ptQ = EgtSP( lA, Lq) - Vector3d( 0, dim * 1.5, 0)
DimLineA1 = EgtLinePDL( Lq, ptQ, 0, A1)
AddLineDashes( Lq, DimLineA1, dim/2)
end
--local DimLineA2
if A2 > 0 then
ptQ = EgtEP( lA, Lq) - Vector3d( A2, dim * 1.5, 0)
DimLineA2 = EgtLinePDL( Lq, ptQ, 0, A2)
AddLineDashes( Lq, DimLineA2, dim/2)
end
-- Linee di quotatura **lato 'interno'**
if A1 < 0 or A2 < 0 then
ptQ = EgtSP( lC, Lq) + VRotated( EgtSV( lC) * dim * 3, -90)
else
ptQ = EgtSP( lC, Lq) + VRotated( EgtSV( lC) * dim * 2, -90)
end
local DimLineLC = EgtLinePVL( Lq, ptQ, EgtSV( lC), EgtCurveLength( lC))
AddLineDashes( Lq, DimLineLC, dim/2)
if A1 < 0 then
ptQ = EgtEP( lC, Lq) + VRotated( EgtSV( lC) * dim * 1.5, -90)
DimLineA1 = EgtLinePVL( Lq, ptQ, - EgtSV( lC), -A1)
AddLineDashes( Lq, DimLineA1, dim/2)
end
if A2 < 0 then
ptQ = EgtSP( lC, Lq) + VRotated( EgtSV( lC) * dim * 1.5, -90)
DimLineA2 = EgtLinePVL( Lq, ptQ, EgtSV( lC), -A2)
EgtInvertCurve( DimLineA2)
AddLineDashes( Lq, DimLineA2, dim/2)
end
--
-- Simmetria verticale ('ribaltamento')
if Rib then
--EgtMirror( { Ly, Lr, La, Le, Lq}, ORIG(), Y_AX(), GDB_RT.GLOB)
EgtMirror( EgtGetAllInGroup( Ly), ORIG(), Y_AX(), GDB_RT.GLOB)
EgtMirror( EgtGetAllInGroup( Lr), ORIG(), Y_AX(), GDB_RT.GLOB)
EgtMirror( EgtGetAllInGroup( La), ORIG(), Y_AX(), GDB_RT.GLOB)
EgtMirror( EgtGetAllInGroup( Le), ORIG(), Y_AX(), GDB_RT.GLOB)
EgtMirror( EgtGetAllInGroup( Lq), ORIG(), Y_AX(), GDB_RT.GLOB)
EgtInvertCurve( {lA,lB,lD,lC,lH1,lH2})
EgtInvertCurve({DimLineLA,DimLineA1 or GDB_ID.NULL,DimLineA2 or GDB_ID.NULL,DimLineLC,})
EgtSetInfo( La, "RIB", "1")
lB, lD = lD, lB
end
--
-- **Dimensioni dell'oggetto**
local bbox = EgtGetBBoxGlob( Ly, GDB_BB.STANDARD)
local dimX = EgtToUiUnits( bbox:getDimX())
local dimY = EgtToUiUnits( bbox:getDimY())
dim = bbox:getRadius() * 0.1
if CMP.ERR == 0 then
CMP.MSG = Msg[1] .. EgtNumToString( dimX,2) .. ' x ' .. EgtNumToString( dimY,2)
end
--
-- **Dimensioni sull'oggetto**
local ptP = 0.5 * ( bbox:getMin() + bbox:getMax())
local sDim = ''
if CMP.INFO then
sDim = sDim .. CMP.INFO
if ( min( dimX, dimY) / max( dimX, dimY)) > 0.3 then
sDim = sDim .. '<br/>'
else
sDim = sDim .. ' '
end
end
sDim = sDim .. EgtNumToString( dimX,2) .. ' x ' .. EgtNumToString( dimY,2)
local dDim = bbox:getRadius() * 0.1
local dRot = 0
if dimY > dimX then
dRot = 90
end
local LbOn = AddLabelPnt( Lr, ptP, sDim, dDim, dRot, BLACK())
EgtSetStatus( LbOn, GDB_ST.OFF)
-- **Etichette sulla figura**
local stdoffset = 1
local sA = CMP.N1
local vA = AddLabel( Le, DimLineLA, stdoffset*.8, sA, dim, 90, RED())
EgtSetInfo( vA, "Var", 1)
local sH1 = CMP.N2
local vH1 = AddLabel( Le, lH1, stdoffset*1.2, sH1, dim, -90, RED())
EgtSetInfo( vH1, "Var", 2)
local sH2 = CMP.N3
local vH2 = AddLabel( Le, lH2, stdoffset*1.2, sH2, dim, 90, RED())
EgtSetInfo( vH2, "Var", 3)
if A1 ~= 0 then
local sA1 = CMP.N4
local vA1 = AddLabel( Le, DimLineA1, stdoffset*.8, sA1, dim*.75, 90, RED())
EgtSetInfo( vA1, "Var", 4)
end
if A2 ~= 0 then
local sA2 = CMP.N5
local vA2 = AddLabel( Le, DimLineA2, stdoffset*.8, sA2, dim*.75, 90, RED())
EgtSetInfo( vA2, "Var", 5)
end
--
local LblLB, LblLC, LblLD
if CMP.ERR == 0 then
LblLB = AddLabel( Le, lB, stdoffset, sLBLabel, dim, -90, GREEN())
LblLC = AddLabel( Le, DimLineLC, stdoffset, sLCLabel, dim, -90, GREEN())
LblLD = AddLabel( Le, lD, stdoffset, sLDLabel, dim, -90, GREEN())
end
--
-- **Etichette sotto la figura**
if CMP.ERR == 0 then
bbox = EgtGetBBoxGlob( Lq,GDB_BB.STANDARD)
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d( 0,dim*2,0)
else
pVal= bbox:getMin() - Vector3d( 0,dim*2,0)
end
local dLenLB = EgtToUiUnits( EgtCurveLength(lB))
local sLenLB = EgtNumToString( dLenLB,1)
local tValLB = EgtTextAdv( Le,pVal,0,sLBLabel..'='..sLenLB,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor( tValLB,GREEN())
EgtSetStatus( tValLB,GDB_ST.SEL)
local dLengthValLB = ( EgtEP( tValLB,GDB_RT.GLOB)-EgtSP( tValLB,GDB_RT.GLOB)):getX() + dim*1
pVal = pVal + Vector3d( dLengthValLB,0,0)
local dLenLC = EgtToUiUnits( EgtCurveLength(lC))
local sLenLC = EgtNumToString( dLenLC,1)
local tValLC = EgtTextAdv( Le,pVal,0,sLCLabel..'='..sLenLC,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor( tValLC,GREEN())
EgtSetStatus( tValLC,GDB_ST.SEL)
local dLengthValLC = ( EgtEP( tValLC,GDB_RT.GLOB)-EgtSP( tValLC,GDB_RT.GLOB)):getX() + dim*1
pVal = pVal + Vector3d( dLengthValLC,0,0)
local dLenLD = EgtToUiUnits( EgtCurveLength( lD))
local sLenLD = EgtNumToString( dLenLD,1)
local tValLD = EgtTextAdv( Le,pVal,0, sLDLabel..'='..sLenLD,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor( tValLD,GREEN())
EgtSetStatus( tValLD,GDB_ST.SEL)
local dLengthValLD = ( EgtEP( tValLD,GDB_RT.GLOB)-EgtSP( tValLD,GDB_RT.GLOB)):getX() + dim*1
pVal = pVal + Vector3d( dLengthValLD,0,0)
end
-- Se non Preview
if not bPreview then
-- cancello le parti ausiliarie
EgtErase({La,Le,Lc,Lq})
-- rendo visibile label sul pezzo
EgtSetStatus(LbOn,GDB_ST.ON)
end
-- Se ok
if CMP.ERR == 0 then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart( Pz, CMP.Nome, CMP.Npar)
-- salvo i parametri come nuovo default
SaveCompoData( CMP.Npar)
end
return
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+183
View File
@@ -0,0 +1,183 @@
-- 2015/07/__
-- Rettangolo dati base e altezza
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
-- Valori limite
local LgMin = 10
-- Parametri : dichiarazione e valori standard
local CMP = {}
CMP.N1 = 'L'
CMP.T1 = 3 -- 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
CMP.V1 = 300.
CMP.N2 = 'H'
CMP.T2 = 3
CMP.V2 = 400.
CMP.Npar = 2
CMP.Nome = 'Rettangolo'
CMP.INFO = nil
CMP.WithTop = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
-- Funzione di disegno
local function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegno le dimensioni
local L = CMP.V1
local H = CMP.V2
CMP.ERR = 0
CMP.MSG = ''
-- Verifica della dimensioni
if L < LgMin then
L = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) -- La lunghezza dei lati deve essere maggiore di
elseif H < LgMin then
H = LgMin
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) -- La lunghezza dei lati deve essere maggiore di
end
if not bPreview and CMP.ERR ~= 0 then
return
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- pezzo
local Ly = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Ly,'OutLoop')
local Lr = EgtGroup(Pz,GDB_RT.LOC) -- layer regione
EgtSetName(Lr,'Region')
local Lc = EgtGroup(Pz,GDB_RT.LOC) -- layer di costruzione
local La = EgtGroup(Pz,GDB_RT.LOC) -- layer ausiliario (diagonali ausiliarie e relative etichette, assi)
EgtSetName(La,"LayAux")
local Le = EgtGroup(Pz,GDB_RT.LOC) -- layer delle etichette pezzo
EgtSetName(Le,"Etichette")
local Lq = EgtGroup(Pz,GDB_RT.LOC) -- layer delle linee di quotatura
EgtSetName(Lq,"Quotature")
EgtSetCurrPartLayer(Pz,Ly)
-- Costruzione della figura: lati
local l1 = EgtLine(Ly,Point3d(0,0,0),Point3d(L,0,0))
EgtSetName(l1,"A1")
local l2 = EgtLine(Ly,EgtEP(l1),Point3d(L,H,0))
EgtSetName(l2,"A2")
local l3 = EgtLine(Ly,EgtEP(l2),Point3d(0,H,0))
EgtSetName(l3,"A3")
local l4 = EgtLine(Ly,EgtEP(l3),EgtSP(l1))
EgtSetName(l4,"A4")
-- assi
local a1 = EgtLinePDL(La,EgtMP(l2),180,L)
local a2 = EgtLinePDL(La,EgtMP(l3),-90,H)
local d1, D1
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtSP(l1),EgtSP(l3))
D1 = (EgtCurveLength(d1))
end
-- Riempimento del rettangolo
local e1 = EgtCurveCompo(Ly,{l1,l2,l3,l4},false)
local s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
-- Dimensioni dell'oggetto
local bbox = EgtGetBBoxGlob(Ly,GDB_BB.STANDARD)
local dimX = EgtToUiUnits(bbox:getDimX())
local dimY = EgtToUiUnits(bbox:getDimY())
local dim = bbox:getRadius() * 0.1
local pVal= bbox:getMin() - Vector3d(0,dim*2.8,0)
if CMP.ERR == 0 then
CMP.MSG = Msg[1] .. EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
end
-- Dimensioni sull'oggetto
local ptP = 0.5 * ( bbox:getMin() + bbox:getMax())
local sDim = ''
if CMP.INFO then
sDim = sDim .. CMP.INFO
if ( min( dimX, dimY) / max( dimX, dimY)) > 0.3 then
sDim = sDim .. '<br/>'
else
sDim = sDim .. ' '
end
end
sDim = sDim .. EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
local dDim = bbox:getRadius() * 0.1
local dRot = 0
if dimY > dimX then
dRot = 90
end
local LbOn = AddLabelPnt(Lr,ptP,sDim,dDim,dRot,BLACK())
EgtSetStatus(LbOn,GDB_ST.OFF)
-- Etichette sulla fgure
local stdoffset = 1.2
--local sL = CMP.N1 .. '=' .. EgtNumToString(EgtToUiUnits(L),2)
local sL = CMP.N1
local v1 = AddLabel(Le,l1,stdoffset,sL,dim,-90,RED())
EgtSetInfo(v1,"Var",1)
--local sH = CMP.N2 .. '=' .. EgtNumToString(EgtToUiUnits(H),2)
local sH = CMP.N2
local v2 = AddLabel(Le,l2,stdoffset,sH,dim,-90,RED())
EgtSetInfo(v2,"Var",2)
if CMP.ERR == 0 then
local LblD1 = AddLabelAl(La,d1,stdoffset*.75,'D',dim*.5,90,GREEN())
end
-- Etichette sotto la figura
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,'D='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
local dD1Len = (EgtEP(ValD1)-EgtSP(ValD1)):getX() + dim/2
pVal = pVal + Vector3d(dD1Len,0,0)
end
-- Se non Preview
if not bPreview then
-- cancello le parti ausiliarie
EgtErase({La,Le,Lc,Lq})
-- rendo visibile label sul pezzo
EgtSetStatus(LbOn,GDB_ST.ON)
end
-- Se non ci sono errori
if CMP.ERR == 0 then
-- Scrivo i parametri nelle info del pezzo
WriteCompoDataToPart( Pz, CMP.Nome, CMP.Npar)
-- Salvo i parametri come nuovo default
SaveCompoData( CMP.Npar)
end
return
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)