58 Commits

Author SHA1 Message Date
carlo.baronchelli 0464742a5e (Aggiornato messaggio versione) 2021-12-02 12:46:15 +01:00
carlo.baronchelli 8720604fb3 Modificato colore bordi e label angoli per frontalini (da verde a blu) 2021-12-02 12:45:33 +01:00
carlo.baronchelli 9527509c62 Aggiunta gestione (provvisoria?) spessore lastra 2021-12-01 17:11:04 +01:00
carlo.baronchelli 5149644550 Aggiunto caso b.r1r3, aggiornato b1.r1r2r3, aggiunte funzioni <Spostemento31> e <Spostamento 41> 2021-11-30 20:55:24 +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 190496769f Modificato commento '6/10/2021 .... ' 2021-10-06 14:39:16 +02:00
Carlo Baronchelli 58d2d9ce4d Ridenominazione file 2021-10-06 14:18:32 +02:00
Carlo Baronchelli 8341003175 Caricato file ... da Sara 00a 2021-10-06 14:13:38 +02:00
carlo.baronchelli 9d0d0b1e81 Appunti 2021-09-04 08:24:45 +02:00
carlo.baronchelli 9095e69345 Aggiunto caso [c] (solo messaggio di errore) 2021-09-03 08:47:12 +02:00
carlo.baronchelli ff6d52569a Correzioni, modifiche (componenti di spostamento es Lx1a, Lx1b ... calcolate sempre positive 2021-09-01 18:19:02 +02:00
carlo.baronchelli 1171fd6e6e Ridenominazione da caso [c] a caso [b] 2021-09-01 12:30:38 +02:00
carlo.baronchelli bc162bde61 Caso [c] = due angoli consecutivi acuti, tre frontalini consecutivi; test positivo 2021-08-30 19:13:12 +02:00
carlo.baronchelli d58de29aee Correzioni al termine aggiuntivo per gli spostamenti 2021-08-28 00:27:24 +02:00
carlo.baronchelli c5731a50fb Test e correzioni su inclinazione tagli 2021-08-27 22:56:55 +02:00
carlo.baronchelli 4d7a39f394 Correzioni 2021-08-25 20:35:03 +02:00
carlo.baronchelli ae8ce943aa Casi a.ls, a.lp 2021-08-25 18:24:43 +02:00
carlo.baronchelli 549ece03ae Punto di salvataggio funzionante 2021-08-25 17:14:12 +02:00
Carlo Baronchelli 805e964d96 Proseguo con spostamenti 2021-08-25 13:33:18 +02:00
carlo.baronchelli 265cda35d4 Aggiunto primi spostamenti 2021-08-25 10:54:31 +02:00
Carlo Baronchelli 826bbbff8b Iniziato inserimento spostamenti : caso 'a.r' = un solo angolo consecutivo 'a dx' 2021-08-24 19:35:06 +02:00
carlo.baronchelli d60c5f933c Correzioni 2021-08-24 14:49:50 +02:00
Carlo Baronchelli 7553f4c801 Correzioni 2021-08-23 19:46:14 +02:00
Carlo Baronchelli 89d218a7e6 Iniziato (nuovamente) calcolo degli spostamenti con trigonometria (caso ar) 2021-08-23 19:45:27 +02:00
carlo.baronchelli fed54cebf7 Solo commenti (classificazione casi per spostemento dei rettangoli) 2021-08-23 14:50:16 +02:00
Carlo Baronchelli 8963bf05c4 Eliminazione dei BBox e inzio del calcolo delle intersezione tra 'rette' dei lati dei rettangoli 2021-08-19 20:26:47 +02:00
carlo.baronchelli 57fbef427a BBoxGlob funzionanti. BBoxRef non funzionanti per ora 2021-08-18 20:35:00 +02:00
carlo.baronchelli c6539d750f Prove con Bbox 2021-08-18 16:07:41 +02:00
carlo.baronchelli 68b1e82266 Un po' d'ordine per l'approccio al calcolo di intersezioni tramite Bbox 2021-08-13 19:00:45 +02:00
carlo.baronchelli 5f987472e3 Ultimato modifiche dopo nuovi ref e dopo ridenominazione dei campi dei record 'SideRec' 2021-08-13 18:06:01 +02:00
Carlo Baronchelli de5e8bf8d1 Un po' d'ordine .... 2021-08-11 19:16:09 +02:00
Carlo Baronchelli 659a0e050c Introduz. nuovi istemi di riferimento, orientati secondo i lati del 'compo', per alzatine e frontalini: OK 2021-08-11 19:05:01 +02:00
Carlo Baronchelli b7b1de5375 fix commento 2021-08-10 20:00:27 +02:00
Carlo Baronchelli f214ebbee3 Merge branch 'Modifica_SideTab_-_Prova_'puntatori'' of https://gitlab.steamware.net/egalware/frontalini into NewMaster 2021-08-10 19:56:53 +02:00
Carlo Baronchelli 1d6996f39a Come precedente 2021-08-10 19:45:29 +02:00
Carlo Baronchelli 4e1b4d31fb Modifiche a seguito ridenominazione dei campi di TabSide - Prove con sistemi di riferimento locali 2021-08-10 19:43:21 +02:00
33 changed files with 4601 additions and 530 deletions
Binary file not shown.
+296
View File
@@ -0,0 +1,296 @@
-- EgtCompoMsg.lua by EgalTech s.r.l. 2018/07/24
-- Messaggi per componenti
-- Tavola per definizione modulo
local EgtCompoMsg = {}
print( 'EgtCompoMsg started')
if EgtGetLanguage() == 'ITA' then
EgtCompoMsg[1] = 'Ingombro = '
EgtCompoMsg[2] = 'Lunghezze / Dimensioni devono essere maggiori o uguali a '
EgtCompoMsg[3] = 'La lunghezza di un lato è troppo grande rispetto agli altri due'
EgtCompoMsg[4] = 'L\'angolo dato o evidenziato deve essere minore o uguale di %s°'
EgtCompoMsg[5] = 'L\'angolo dato deve essere maggiore di %s°'
EgtCompoMsg[6] = 'La lunghezza della base B1 deve essere maggiore o uguale a '
EgtCompoMsg[7] = 'La lunghezza della base B2 deve essere maggiore o uguale a '
EgtCompoMsg[8] = 'La misura dell\'altezza H deve essere maggiore o uguale a '
EgtCompoMsg[9] = 'Ogni angolo risultante deve essere maggiore di %s°'
EgtCompoMsg[11] = 'La lunghezza del lato L2 non può essere minore di H '
EgtCompoMsg[12] = 'la somma delle lunghezze L3 e L4 deve essere maggiore della lunghezza D1 '
EgtCompoMsg[13] = 'la differenza delle lunghezze L3 e L4 deve essere minore della lunghezza D1 '
EgtCompoMsg[14] = 'l lati L1 e L3 si intersecano o generano il lato L4 troppo piccolo'
EgtCompoMsg[15] = 'La lunghezza delle diagonali deve essere maggior di ' -- o uguale
EgtCompoMsg[16] = 'la lunghezza di D1 deve essere minore della somma di L2 e L3 '
EgtCompoMsg[17] = 'la lunghezza di D1 deve essere maggiore della differenza di L2 e L3 '
EgtCompoMsg[18] = 'la lunghezza di D2 deve essere minore della somma di L1 e L2 '
EgtCompoMsg[19] = 'la lunghezza di D2 deve essere maggiore della differenza di L1 e L2 '
EgtCompoMsg[20] = 'la lunghezza di D1 deve essere minore della somma di L4 e L1 '
EgtCompoMsg[21] = 'la lunghezza di D1 deve essere maggiore della differenza di L4 e L1 '
EgtCompoMsg[22] = 'la lunghezza di D2 deve essere minore della somma di L1 e L2 '
EgtCompoMsg[23] = 'la lunghezza di D2 deve essere maggiore della differenza di L1 e L2 '
EgtCompoMsg[24] = 'la lunghezza di D3 deve essere minore della somma di L3 e L4 '
EgtCompoMsg[25] = 'la lunghezza di D3 deve essere maggiore della differenza di L3 e L4 '
EgtCompoMsg[26] = 'Il raggio deve essere maggiore o uguale a '
--Soglia
EgtCompoMsg[50] = 'I lati L2 e L4 si intersecano '
EgtCompoMsg[51] = 'Il prolungamento di L5 interseca il lato L2 '
EgtCompoMsg[52] = 'I lati L5 e L1 non si incontrano . La figura non si chiude'
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 '
EgtCompoMsg[203] = '(provv.) : Lunghezza di A è troppo piccola (o G troppo grande) ' -- provv
EgtCompoMsg[204] = '(provv.) : Lunghezza di B è troppo piccola (o G troppo grande) ' -- prov
EgtCompoMsg[205] = 'La quota Z deve essere maggiore o guale a '
EgtCompoMsg[206] = 'Il raggio R deve essere maggiore o guale a '
EgtCompoMsg[207] = '(provv.) : Lunghezza D risulterebbe minore di '
EgtCompoMsg[208] = '(provv.) : Lunghezza E risulterebbe minore di '
EgtCompoMsg[209] = '(provv.) : Lunghezza F risulterebbe minore di '
EgtCompoMsg[210] = '(provv.) : Lunghezza D risulterebbe minore di '
EgtCompoMsg[211] = '(provv.) : Lunghezza C risulterebbe minore di '
EgtCompoMsg[220] = 'L\'angolo Alfa deve essere compreso tra '
EgtCompoMsg[221] = '(provv.) : figura impossibile : i lati non si chiudono '
EgtCompoMsg[222] = '(provv.) : Lunghezza LG eccessiva'
EgtCompoMsg[223] = '(provv.) : Un lato risulta troppo piccolo , minore di '
EgtCompoMsg[224] = 'R incompatibile con dimensioni dei lati, Lungh. min ' -- provv?
-- Piani bagno
EgtCompoMsg[229] = 'H2 deve essere minore o uguale ad H'
-- Ellisse
EgtCompoMsg[230] = "'ManPar' deve essere maggiore o uguale a "
EgtCompoMsg[231] = "'ManPar' deve essere minore o uguale a "
EgtCompoMsg[240] = 'Gli assi devono essere maggiori o uguali a '
-- Cerchio
EgtCompoMsg[241] = 'Il/i diametro/i devono essere maggiori o uguali a '
-- Curve
EgtCompoMsg[250] = "F deve essere maggiore o uguale a "
EgtCompoMsg[251] = "F non deve essere superiore a L1 / 2"
EgtCompoMsg[252] = "La larghezza H è eccessiva in relazione a L1 e/o F "
EgtCompoMsg[253] = "L1-L2 deve essere maggiore o uguale a "
EgtCompoMsg[254] = "L1, L2, H non compatibili "
-- Triangolo isoscele
EgtCompoMsg[255] = "Modificare il rapporto tra B e H in modo ottenere angoli maggiori di %s° "
-- Poligono
EgtCompoMsg[256] = "Il N° di lati deve essere maggiore o uguale a "
EgtCompoMsg[257] = "Il N° di lati deve essere minore o uguale a "
EgtCompoMsg[258] = "Il lato del poligono risulta troppo piccolo : il minimo è "
-- Componenti interni
EgtCompoMsg[300] = " Il componente esce dai contorni del piano"
EgtCompoMsg[301] = "Errore nella lettura del file Dxf"
EgtCompoMsg[302] = "Errore nella elaborazione della geometria Dxf"
EgtCompoMsg[310] = 'Interasse I deve essere maggiore del diamentro D' -- due fori
EgtCompoMsg[311] = 'Interasse I2 deve essere maggiore del diamentro D2' -- tre fori
EgtCompoMsg[312] = 'Interassi I1 e/o I2 troppo piccoli rispetto alla somma dei diametri D1 e D2' -- tre fori
-- Curve bis
EgtCompoMsg[313] = 'H deve essere minore o uguale a R' -- curva A5
-- Linee Ribasso/Ribasso
EgtCompoMsg[350] = 'Lunghezza L deve essere minore di '
EgtCompoMsg[351] = 'Interasse D1 e/o D2 deve essere minore di '
EgtCompoMsg[352] = 'Interasse D1 e/o D2 deve essere maggiore di '
EgtCompoMsg[353] = 'Numero linee N deve essere maggiore di 0'
EgtCompoMsg[354] = 'Lunghezza L deve essere maggiore di '
EgtCompoMsg[355] = "L'indice di riferimento non esiste"
EgtCompoMsg[356] = "Manca ribasso"
EgtCompoMsg[357] = "Incllinazione minore di "
-- Ribasso
EgtCompoMsg[360] = 'Raggio R deve essere minore di '
EgtCompoMsg[360] = 'Raggio R deve essere maggiore di '
elseif EgtGetLanguage() == 'DEU' then
EgtCompoMsg[1] = 'Box = '
EgtCompoMsg[2] = 'Sides / Dimensions must be greater than or equal to '
EgtCompoMsg[3] = 'One side is too long compared to the sum of the other two '
EgtCompoMsg[4] = 'The input or marked angle must be smaller than %s deg'
EgtCompoMsg[5] = 'The input angle must be greater or equal than %s deg'
EgtCompoMsg[6] = 'The base B1 must be greater or equal than '
EgtCompoMsg[7] = 'The base B2 must be greater or equal than '
EgtCompoMsg[8] = 'The height H must be greater or equal or equal than '
EgtCompoMsg[9] = 'Each resulting angle must be greater than %s deg'
--EgtCompoMsg[10] = 'Each resulting angle must be greater than %s deg'
EgtCompoMsg[11] = 'L2 length must be greater or equal then H '
EgtCompoMsg[12] = 'Sum of lengths L3 e L4 sum must be greater then D1 length '
EgtCompoMsg[13] = 'Length difference between L3 and L4 must be smaller then D1 length '
EgtCompoMsg[14] = 'L1 and L3 intersect or L4 length is too small'
EgtCompoMsg[15] = 'Diagonal length must be greater than ' -- or equal
EgtCompoMsg[16] = 'Diagonal length D1 must be smaller then sum of legths L2 and L3 '
EgtCompoMsg[17] = 'Diagonal length D1 must be greater then difference of sides L2 and L3 '
EgtCompoMsg[18] = 'Diagonal length D2 must be smaller then sum of legths L1 and L2 '
EgtCompoMsg[19] = 'Diagonal length D2 must be greater then difference of sides L1 and L2 '
EgtCompoMsg[20] = 'Diagonal length D1 must be smaller then sum of legths L4 and L1 '
EgtCompoMsg[21] = 'Diagonal length D1 must be greater then difference of sides L4 and L1 '
EgtCompoMsg[22] = 'Diagonal length D2 must be smaller then sum of legths L1 and L2 '
EgtCompoMsg[23] = 'Diagonal length D2 must be greater then difference of sides L1 and L2 '
EgtCompoMsg[24] = 'Diagonal length D3 must be smaller then sum of legths L3 and L4 '
EgtCompoMsg[25] = 'Diagonal length D3 must be greater then difference of sides L3 and L4 '
EgtCompoMsg[26] = 'Radius must be greater than or equal to '
--Soglia
EgtCompoMsg[50] = 'L4 and L2 intersect '
EgtCompoMsg[51] = 'Extension of L5 intersects L2 '
EgtCompoMsg[52] = "Sides L1 and L5 don't meet "
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 '
EgtCompoMsg[203] = '(provv.) : Lunghezza di A è troppo piccola (o G troppo grande) ' -- provv
EgtCompoMsg[204] = '(provv.) : Lunghezza di B è troppo piccola (o G troppo grande) ' -- prov
EgtCompoMsg[205] = '(provv.) : La quota Z deve essere maggiore o guale a ' --provv.
EgtCompoMsg[206] = '(provv.) : Il raggio R deve essere maggiore o guale a ' --provv
EgtCompoMsg[207] = '(provv.) : Differenza lunghezze A-C risulterebbe minore di ' --provv
EgtCompoMsg[208] = '(provv.) : Lunghezza lato E risulterebbe minore di ' --provv
EgtCompoMsg[209] = '(provv.) : Lunghezza lato F risulterebbe minore di ' --provv
EgtCompoMsg[210] = '(provv.) : Lunghezza D risulterebbe minore di ' --provv
EgtCompoMsg[211] = '(provv.) : Lunghezza C risulterebbe minore di ' --provv
EgtCompoMsg[220] = 'Alfa angle must lie between '
EgtCompoMsg[221] = '(provv.) : figura impossibile ' --provv
EgtCompoMsg[222] = '(provv.) : Lunghezza LG eccessiva' --provv
EgtCompoMsg[223] = '(provv.) : Un lato risulta troppo piccolo, minore di ' --provv
EgtCompoMsg[224] = '(provv.) : R incompatibile con dimensioni dei lati, Lungh. min ' -- provv
-- Piani bagno
EgtCompoMsg[229] = 'H2 must be smaller than or equal to H'
-- Ellisse
EgtCompoMsg[230] = "'ManPar' must be greater than or equal to "
EgtCompoMsg[231] = "'ManPar' must be smaller than or equal to "
EgtCompoMsg[240] = 'Axes lengths must be greater than or equal to '
-- Cerchio
EgtCompoMsg[241] = 'Diameter must be greater than or equal to '
-- Curva
EgtCompoMsg[250] = "F must be greater than or equal to "
EgtCompoMsg[251] = "F must not be greater than L1 / 2"
EgtCompoMsg[252] = "H is excessive in relation to L1 and/or F"
EgtCompoMsg[253] = "L1 - L2 must be greater then "
EgtCompoMsg[254] = "Length L1, L2, H not compatible"
-- Triangolo isoscele
EgtCompoMsg[255] = "Modificare il rapporto tra B e H in modo da ottenere angoli maggiori di %s deg" --provv
-- Poligono
EgtCompoMsg[256] = "The number of sides must be greater than or equal to "
EgtCompoMsg[257] = "The number of sides must be less than or equal to "
EgtCompoMsg[258] = "The side of the polygon is too small: the minimum is "
-- Componenti interni
EgtCompoMsg[300] = "The component goes beyond surface boundaries"
EgtCompoMsg[301] = "Error loading Dxf file"
EgtCompoMsg[302] = "Error processing Dxf geometry"
EgtCompoMsg[310] = 'Interaxis I must be greater than diameter D' -- due fori
EgtCompoMsg[311] = 'Interaxis I2 must be greater than diameter D2' -- tre fori
EgtCompoMsg[312] = 'Interaxis I1 and/or I2 too small with respect to the sum of diameters D1 and D2' -- tre fori
-- Curve bis
EgtCompoMsg[313] = 'H deve essere minore o uguale a R' -- curva A5, provv
-- Linee Ribasso
EgtCompoMsg[350] = 'Lunghezza L deve essere minore di '
EgtCompoMsg[351] = 'Interasse D1 e/o D2 deve essere minore di '
EgtCompoMsg[352] = 'Interasse D1 e/o D2 deve essere maggiore di '
EgtCompoMsg[353] = 'Numero linee N deve essere maggiore di 0'
EgtCompoMsg[354] = 'Lunghezza L deve essere maggiore di '
EgtCompoMsg[355] = "L'indice di riferimento non esiste"
EgtCompoMsg[356] = "Manca ribasso"
EgtCompoMsg[357] = "Slope must be less than "
-- Ribasso
EgtCompoMsg[360] = 'Raggio R deve essere minore di '
EgtCompoMsg[360] = 'Raggio R deve essere maggiore di '
else -- default 'ENG'
EgtCompoMsg[1] = 'Box = '
EgtCompoMsg[2] = 'Sides / Dimensions must be greater than or equal to '
EgtCompoMsg[3] = 'One side is too long compared to the sum of the other two '
EgtCompoMsg[4] = 'The input or marked angle must be smaller than %s deg'
EgtCompoMsg[5] = 'The input angle must be greater or equal than %s deg'
EgtCompoMsg[6] = 'The base B1 must be greater or equal than '
EgtCompoMsg[7] = 'The base B2 must be greater or equal than '
EgtCompoMsg[8] = 'The height H must be greater or equal or equal than '
EgtCompoMsg[9] = 'Each resulting angle must be greater than %s deg'
EgtCompoMsg[11] = 'L2 length must be greater or equal then H '
EgtCompoMsg[12] = 'Sum of lengths L3 e L4 sum must be greater then D1 length '
EgtCompoMsg[13] = 'Length difference between L3 and L4 must be smaller then D1 length '
EgtCompoMsg[14] = 'L1 and L3 intersect or L4 length is too small'
EgtCompoMsg[15] = 'Diagonal length must be greater than ' -- or equal
EgtCompoMsg[16] = 'Diagonal length D1 must be smaller then sum of legths L2 and L3 '
EgtCompoMsg[17] = 'Diagonal length D1 must be greater then difference of sides L2 and L3 '
EgtCompoMsg[18] = 'Diagonal length D2 must be smaller then sum of legths L1 and L2 '
EgtCompoMsg[19] = 'Diagonal length D2 must be greater then difference of sides L1 and L2 '
EgtCompoMsg[20] = 'Diagonal length D1 must be smaller then sum of legths L4 and L1 '
EgtCompoMsg[21] = 'Diagonal length D1 must be greater then difference of sides L4 and L1 '
EgtCompoMsg[22] = 'Diagonal length D2 must be smaller then sum of legths L1 and L2 '
EgtCompoMsg[23] = 'Diagonal length D2 must be greater then difference of sides L1 and L2 '
EgtCompoMsg[24] = 'Diagonal length D3 must be smaller then sum of legths L3 and L4 '
EgtCompoMsg[25] = 'Diagonal length D3 must be greater then difference of sides L3 and L4 '
EgtCompoMsg[26] = 'Radius must be greater than or equal to '
--Soglia
EgtCompoMsg[50] = 'L4 and L2 intersect '
EgtCompoMsg[51] = 'Extension of L5 intersects L2 '
EgtCompoMsg[52] = "Sides L1 and L5 don't meet "
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 '
EgtCompoMsg[203] = '(provv.) : Lunghezza di A è troppo piccola (o G troppo grande) ' -- provv
EgtCompoMsg[204] = '(provv.) : Lunghezza di B è troppo piccola (o G troppo grande) ' -- prov
EgtCompoMsg[205] = '(provv.) : La quota Z deve essere maggiore o guale a ' --provv.
EgtCompoMsg[206] = '(provv.) : Il raggio R deve essere maggiore o guale a ' --provv
EgtCompoMsg[207] = '(provv.) : Differenza lunghezze A-C risulterebbe minore di ' --provv
EgtCompoMsg[208] = '(provv.) : Lunghezza lato E risulterebbe minore di ' --provv
EgtCompoMsg[209] = '(provv.) : Lunghezza lato F risulterebbe minore di ' --provv
EgtCompoMsg[210] = '(provv.) : Lunghezza D risulterebbe minore di ' --provv
EgtCompoMsg[211] = '(provv.) : Lunghezza C risulterebbe minore di ' --provv
EgtCompoMsg[220] = 'Alfa angle must lie between '
EgtCompoMsg[221] = '(provv.) : figura impossibile ' --provv
EgtCompoMsg[222] = '(provv.) : Lunghezza LG eccessiva' --provv
EgtCompoMsg[223] = '(provv.) : Un lato risulta troppo piccolo, minore di ' --provv
EgtCompoMsg[224] = '(provv.) : R incompatibile con dimensioni dei lati, Lungh. min ' -- provv
-- Piani bagno
EgtCompoMsg[229] = 'H2 must be smaller than or equal to H'
EgtCompoMsg[230] = "'ManPar' must be greater than or equal to "
EgtCompoMsg[231] = "'ManPar' must be smaller than or equal to "
-- Ellisse
EgtCompoMsg[240] = 'Axes lengths must be greater than or equal to '
-- Cerchio
EgtCompoMsg[241] = 'Diameter must be greater than or equal to '
-- Curva
EgtCompoMsg[250] = "F must be greater than or equal to "
EgtCompoMsg[251] = "F must not be greater than L1 / 2"
EgtCompoMsg[252] = "H is excessive in relation to L1 and/or F"
EgtCompoMsg[253] = "L1 - L2 must be greater then "
EgtCompoMsg[254] = "Length L1, L2, H not compatible"
-- Triangolo isoscele
EgtCompoMsg[255] = "Modificare il rapporto tra B e H in modo da ottenere angoli maggiori di %s deg" --provv
-- Poligono
EgtCompoMsg[256] = "The number of sides must be greater than or equal to "
EgtCompoMsg[257] = "The number of sides must be less than or equal to "
EgtCompoMsg[258] = "The side of the polygon is too small: the minimum is "
-- Componenti interni
EgtCompoMsg[300] = "The component goes beyond surface boundaries"
EgtCompoMsg[301] = "Error loading Dxf file"
EgtCompoMsg[302] = "Error processing Dxf geometry"
EgtCompoMsg[310] = 'Interaxis I must be greater than diameter D' -- due fori
EgtCompoMsg[311] = 'Interaxis I2 must be greater than diameter D2' -- tre fori
EgtCompoMsg[312] = 'Interaxis I1 and/or I2 too small with respect to the sum of diameters D1 and D2' -- tre fori
-- Curve bis
EgtCompoMsg[313] = 'H deve essere minore o uguale a R' -- curva A5, provv
-- Linee Ribasso
EgtCompoMsg[350] = 'Lenght L must be less than '
EgtCompoMsg[351] = 'Interaxis D1 and/or D2 must be less than '
EgtCompoMsg[352] = 'Interaxis D1 and/or D2 must be bigger than '
EgtCompoMsg[353] = 'Line number N must be bigger than 0'
EgtCompoMsg[354] = 'Lenght L must be bigger than '
EgtCompoMsg[355] = "L'indice di riferimento non esiste"
EgtCompoMsg[356] = "Manca ribasso"
EgtCompoMsg[357] = "Slope must be less than "
-- Ribasso
EgtCompoMsg[360] = 'Radius R must be less than '
EgtCompoMsg[360] = 'Radius R must be bigger than '
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
+134 -45
View File
@@ -3,22 +3,29 @@
-- Tavola per definizione modulo (serve ma non usata)
local EgtCompo = {}
print( 'EgtCompo Carlo started')
print( 'EgtCompo 2.3l0 started')
-- 2021/07
-- Disegna un rattangolo dati layer, Punto, base, altezza e versore (direzione) della base
-- e con opzione per esploderlo o meno
function DrawRect (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")
--[[ 2021/08
-- Disegna i lati di un rattangolo dati layer, Punto, base, altezza;
-- 'allineato al sistema di riferimento' =: base parallela al sistema di riferimento dato
-- sarebbe superata dall'uso diretto della funzione di disegno Rettangolo
-- se non servissse distinguare i singoli lati
-- |funzione per ora trasferita all'interno di Alz&Front.lua|
function DrawRectangle (Lay, BaseL, HeightL, sName)
local Pt = Point3d(0,0,0)
local l1 = EgtLinePDL( Lay, Pt, 0, BaseL)
--EgtSetName( l1, sName.." l1")
local l2 = EgtLinePDL( Lay, EgtEP( l1), 90, HeightL)
--EgtSetName( l2, sName.." -l2")
local l3 = EgtLinePDL( Lay, EgtEP( l2), 180, BaseL)
--EgtSetName( l3, sName.." -l3")
local l4 = EgtLine( Lay, EgtEP( l3), EgtSP( l1))
--EgtSetName( l4,sName.." -l4")
return l1, l2, l3, l4
end
]]
-- Restituisce l'angolo interno di due lati consecutivi di un poligono
function GetAngIntPol (l1,l2)
@@ -55,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
@@ -72,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
@@ -80,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
@@ -362,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
Binary file not shown.
+182
View File
@@ -0,0 +1,182 @@
-- 2016/10/21
-- PBagnoRett 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 = 800.
CMP.N2 = 'H'
CMP.T2 = 3
CMP.V2 = 600.
CMP.Npar = 2
CMP.Nome = 'PBagnoRett'
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 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 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
+270
View File
@@ -0,0 +1,270 @@
-- 2015/09/__
-- PIANO CUCINA A 'L' AD ANGOLO RETTO
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
-- Valori limite
local LgMin = 10
local AngMin =15
local AngMax = 180 - 1
-- Parametri : dichiarazione e valori standard
--.T (tipo) : 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
local CMP = {}
CMP.N1 = 'A' -- lunghezza lungo lato muro 1
CMP.T1 = 3
CMP.V1 = 1800
CMP.N2 = 'B' -- lunghezza lungo lato muro 2
CMP.T2 = 3
CMP.V2 = 2000
CMP.N3 = 'C' -- profondità lato muro 1
CMP.T3 = 3
CMP.V3 = 600
CMP.N4 = 'D' -- profondità lato muro 2
CMP.T4 = 3
CMP.V4 = 650
CMP.N5 = '←→' -- Simmetria dx/sx (false = angolo a sx) )
CMP.T5 = 1
CMP.V5 = false
CMP.N6 = '↑↓' -- Ribaltamento su/giù (true = 'L' capovolta)
CMP.T6 = 1
CMP.V6 = false
CMP.Npar = 6
CMP.Nome = 'PCucinaA1'
CMP.WithInt = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L2 = CMP.V2
local L3 = CMP.V3
local L4 = CMP.V4
local Simm = CMP.V5
local Rib = CMP.V6
local L5 = L1 - L4
local L6 = L2- L3
local L5label = 'E' -- lato interno 1
local L6label = 'F' -- lato interno 2
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere maggiori di...
end
if L2 < LgMin then
L2 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere maggiori di...
end
end
if L3 < LgMin then
L3 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere maggiori di...
end
end
if L4 < LgMin then
L4 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere maggiori di...
end
end
if L5 < LgMin then
L5 = LgMin L1 = L4 + L5
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[201]..GetLenLimit(LgMin) -- Differenza L1-L4 troppo piccola
end
end
if L6 < LgMin then
L6= LgMin L2 = L3 + L6
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[202]..GetLenLimit(LgMin) -- Differenza L2-L3 troppo piccola
end
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 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
local l2 = EgtLinePDL(Ly,ORIG(),0,L2)
EgtSetName(l2,"A1")
local l4 = EgtLinePDL(Ly,EgtEP(l2),90,L4)
EgtSetName(l4,"A2")
local l6 = EgtLinePDL(Ly,EgtEP(l4),180,L6)
EgtSetName(l6,"A3")
local l5 = EgtLinePDL(Ly,EgtEP(l6),90,L5)
EgtSetName(l5,"A4")
local l3 = EgtLinePDL(Ly,EgtEP(l5),180,L3)
EgtSetName(l3,"A5")
local l1 = EgtLine(Ly,EgtEP(l3),EgtSP(l2))
EgtSetName(l1,"A6")
-- assi
local a1 = EgtLinePDL(La,EgtMP(l3),-90,L1-L4/2)
local a2 = EgtLinePDL(La,EgtMP(l4),180,L2-L3/2)
local a3 = EgtLine(La,EgtSP(l5),EgtSP(l2))
-- diagonale
local d1, D1
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtEP(l3),EgtEP(l2))
D1 = EgtCurveLength(d1)
end
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1 = EgtCurveCompo(Ly,{l1,l2,l4,l6,l5,l3},false)
local s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
-- Simmetria
if Simm then
-- 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)
GetAllRib( Ly, Lr, La, Le)
EgtInvertCurve({l1,l2,l4,l6,l5,l3})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
if CMP.ERR == 0 then
CMP.MSG = Msg[1] .. EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
end
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*3,0) -- (in questo caso rimane invariato)
else
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
end
-- Dimensioni sull'oggetto
local sDim = EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
local dDim = bbox:getRadius() * 0.1
local LbOn
if L1 > L2 then
LbOn = AddLabelPnt(Lr,EgtMP(a1,GDB_ID.ROOT),sDim,dDim,90,BLACK())
else
LbOn = AddLabelPnt(Lr,EgtMP(a2,GDB_ID.ROOT),sDim,dDim,0,BLACK())
end
EgtSetStatus(LbOn,GDB_ST.OFF)
-- Etichette sulla figura
local stdoffset = 1
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)
local LblL3 = AddLabel(Le,l3,stdoffset,CMP.N3,dim,-90,RED())
EgtSetInfo(LblL3,"Var",3)
local LblL4 = AddLabel(Le,l4,stdoffset,CMP.N4,dim,-90,RED())
EgtSetInfo(LblL4,"Var",4)
local LblL5 = AddLabel(Le,l5,stdoffset,L5label,dim,-90,GREEN())
local LblL6 = AddLabel(Le,l6,stdoffset,L6label,dim,-90,GREEN())
local LblD1
if CMP.ERR == 0 then
LblD1 = AddLabelAl(La,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
local lLenL5 = EgtToUiUnits(L5)
local sLenL5 = EgtNumToString(lLenL5,1)
local ValL5 = EgtTextAdv(Le,pVal,0,L5label..'='..sLenL5,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL5,GREEN())
EgtSetStatus(ValL5,GDB_ST.SEL)
local ValL5Len = (EgtEP(ValL5,GDB_RT.GLOB)-EgtSP(ValL5,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL5Len,0,0)
local lLenL6 = EgtToUiUnits(L6)
local sLenL6 = EgtNumToString(lLenL6,1)
local ValL6 = EgtTextAdv(Le,pVal,0,L6label..'='..sLenL6,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL6,GREEN())
EgtSetStatus(ValL6,GDB_ST.SEL)
local ValL6Len = (EgtEP(ValL6,GDB_RT.GLOB)-EgtSP(ValL6,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL6Len,0,0)
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le})
-- 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
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
+655
View File
@@ -0,0 +1,655 @@
-- 2015/10/__
-- PIANO CUCINA A 'L' AD ANGOLO RETTO CON SMUSSO o RACCORDO
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
local Nome = 'PCucinaA23'
-- Valori limite
local LgMin = 10 -- lati
--local AlfaMin = 60
--local AlfaMax = 150
local RMin = 10
-- Parametri : dichiarazione e valori standard
--.T (tipo) : 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
local CMP = {}
CMP.N1 = 'A' -- lato lungo muro 'obliquo'
CMP.T1 = 3
CMP.V1 = 1800
CMP.N2 = 'B' -- lato lungo muro 'orizzontale'
CMP.T2 = 3
CMP.V2 = 2000
CMP.N3 = 'C' -- profondità lato 'obliquo'
CMP.T3 = 3
CMP.V3 = 600
CMP.N4 = 'D' -- profondità lato 'orizzontale'
CMP.T4 = 3
CMP.V4 = 500
CMP.N5 = '\\(' --'Ch/Fill' -- opzione smusso interno a 45° / raccordo (true = raccordo)
CMP.T5 = 1
CMP.V5 = false
CMP.N6 = 'G/R' -- lunghezza 'smusso' interno a 45° o raggio di raccordo
CMP.T6 = 3
CMP.V6 = 100
CMP.N7 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T7 = 1
CMP.V7 = false
CMP.N8 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T8 = 1
CMP.V8 = false
CMP.Npar = 8
CMP.Nome = Nome
CMP.WithInt = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
local function CMP_DrawA2(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L2 = CMP.V2
local L3 = CMP.V3
local L4 = CMP.V4
local Alfa = 90
local L6 = CMP.V6
local Simm = CMP.V7
local Rib = CMP.V8
CMP.N6='G' -- smusso
local L5label = 'E' -- lato 'obliquo' interno
local L7label = 'F' -- lato 'orizzontale' interno
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a ...
end
if L2 < LgMin then
L2 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L3 < LgMin then
L3 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L4 < LgMin then
L4 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
--[[if Alfa < AlfaMin then
Alfa = AlfaMin
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
end
if Alfa > AlfaMax then
Alfa = AlfaMax
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
end --]]
if L6 < LgMin then
L6 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 7
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
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 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
local vAlfa = Vector3d (cos(Alfa),sin(Alfa),0)
local l1 = EgtLinePVL(Ly,ORIG(),vAlfa,L1) EgtInvertCurve(l1)
EgtSetName(l1,"A7")
local l2 = EgtLinePDL(Ly,ORIG(),0,L2)
EgtSetName(l2,"A1")
local l3 = EgtLinePVL(Ly,EgtSP(l1),VRotated(vAlfa,-90),L3) EgtInvertCurve(l3)
EgtSetName(l3,"A6")
local l4 = EgtLinePDL(Ly,EgtEP(l2),90,L4)
EgtSetName(l4,"A2")
-- linea di estensione angolo
--local arcAlfa , rrefAlfa
--rrefAlfa = min(L1,L2)/5
--arcAlfa = EgtArcC2P(La,EgtSP(l2),EgtSP(l2)+EgtEV(l2)*rrefAlfa,EgtSP(l1))
-- chiusura dei lati l5 e l7 se possibile
local l5 = EgtLinePVL(Ly,EgtSP(l3),VRotated(vAlfa,180),L1)
EgtInvertCurve(l5)
EgtSetName(l5,"A5")
local l7 = EgtLinePDL(Ly,EgtEP(l4),180,L2)
EgtSetName(l7,"A3")
local Beta, Dist, l6
--if EgtIP(l5,l7,EgtSP(l3)) then
EgtModifyCurveStartPoint(l5,EgtIP(l5,l7,EgtSP(l3)))
EgtModifyCurveEndPoint(l7,EgtIP(l5,l7,EgtEP(l4)))
L5 = EgtCurveLength(l5)
L7 = EgtCurveLength(l7)
-- inserimentp dello smusso se possibile
Beta = (180 - Alfa ) / 2
Dist = L6/2/cos(Beta)
if Dist >= L5 or Dist >= L7 then
Dist = min(L5,L7) - LgMin
if CMP.ERR == 0 then
CMP.ERR = 9
CMP.MSG = Msg[222] -- lo smusso non ci sta : L6 troppo grande
end
end
if Dist > L5-LgMin or Dist > L7-LgMin then
Dist = min(L5,L7) - LgMin
if CMP.ERR == 0 then
CMP.ERR = 10
CMP.MSG = Msg[223]..GetLenLimit(LgMin) -- un lato risulta troppo piccolo (minore di ..)
end
end
--if L7 < LgMin then
-- if CMP.ERR == 0 then
-- CMP.ERR = 11
-- CMP.MSG = Msg[223]..GetLenLimit(LgMin) -- un lato risulta troppo piccolo (minore di ..)
-- end
-- end
l6 = EgtCurveChamfer (Ly,l7,EgtSP(l7),l5,EgtEP(l5),Dist,true)
EgtSetName(l6,"A4")
L5 = EgtCurveLength(l5)
L7 = EgtCurveLength(l7)
--else
-- if CMP.ERR == 0 then
--CMP.ERR = 8
--CMP.MSG = Msg[221] -- figura impossibile: i lati L5 e L7 non si chiudono
--end
--end
-- diagonali e assi di simmetria
local d1, D1, a1, a2
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtSP(l1),EgtEP(l2))
D1 = EgtCurveLength(d1)
a1 = EgtLinePVL(La,EgtMP(l3),VRotated(vAlfa,180),L1)
a2 = EgtLinePDL(La,EgtMP(l4),180,L2)
EgtModifyCurveEndPoint(a1,EgtIP(a1,a2,EgtMP(l6)))
EgtModifyCurveEndPoint(a2,EgtIP(a1,a2,EgtMP(l6)))
end
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1, s1
if CMP.ERR ~= 8 then
e1 = EgtCurveCompo(Ly,{l1,l2,l4,l7,l6,l5,l3},false)
s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
end
-- Simmetria orizzontale
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
-- 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,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
if CMP.ERR == 0 then
CMP.MSG = Msg[1] .. EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
end
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*3,0) -- uguali, se non ci sono linee di quotatura sotto la fiura
else
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
end
-- Dimensioni sull'oggetto
local LbOn
if CMP.ERR == 0 then
local sDim = EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
local dDim = bbox:getRadius() * 0.1
if L1 > L2 then
LbOn = AddLabelPnt(Lr,EgtMP(a1,GDB_ID.ROOT),sDim,dDim,90,BLACK())
else
LbOn = AddLabelPnt(Lr,EgtMP(a2,GDB_ID.ROOT),sDim,dDim,0,BLACK())
end
EgtSetStatus(LbOn,GDB_ST.OFF)
end
-- Etichette sulla figura
local stdoffset = 1
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)
local LblL3 = AddLabel(Le,l3,stdoffset,CMP.N3,dim,-90,RED())
EgtSetInfo(LblL3,"Var",3)
local LblL4 = AddLabel(Le,l4,stdoffset,CMP.N4,dim,-90,RED())
EgtSetInfo(LblL4,"Var",4)
--[[local LblAlfa = AddLabel(Le,arcAlfa,stdoffset*.5,CMP.N5,dim*.8,-90,RED())
EgtSetInfo(LblAlfa,"Var",5) --]]
if CMP.ERR ~= 8 then
local LblL6 = AddLabel(Le,l6,stdoffset,CMP.N6,dim,-90,RED())
EgtSetInfo(LblL6,"Var",6)
end
if CMP.ERR == 0 then
local LblL5 = AddLabel(Le,l5,stdoffset,L5label,dim*.75,-90,GREEN())
local LblL7 = AddLabel(Le,l7,stdoffset,L7label,dim*.75,-90,GREEN())
local LblD1 = AddLabelAl(La,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
if CMP.ERR == 0 then
local lLenL5 = EgtToUiUnits(L5)
local sLenL5 = EgtNumToString(lLenL5,1)
local ValL5 = EgtTextAdv(Le,pVal,0,L5label..'='..sLenL5,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL5,GREEN())
EgtSetStatus(ValL5,GDB_ST.SEL)
local ValL5Len = (EgtEP(ValL5,GDB_RT.GLOB)-EgtSP(ValL5,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL5Len,0,0)
local lLenL7 = EgtToUiUnits(L7)
local sLenL7 = EgtNumToString(lLenL7,1)
local ValL7 = EgtTextAdv(Le,pVal,0,L7label..'='..sLenL7,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL7,GREEN())
EgtSetStatus(ValL7,GDB_ST.SEL)
local ValL7Len = (EgtEP(ValL7,GDB_RT.GLOB)-EgtSP(ValL7,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL7Len,0,0)
end
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le,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
end
function CMP_DrawA3(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L2 = CMP.V2
local L3 = CMP.V3
local L4 = CMP.V4
local Alfa = 90
local R = CMP.V6 -- -- raggio di raccordo tra i lati interni
local Simm = CMP.V7
local Rib = CMP.V8
CMP.N6 = 'R'
local L5label = 'E' -- lato 'obliquo' interno
local L7label = 'F' -- lato 'orizzontale' interno
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a ...
end
if L2 < LgMin then
L2 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L3 < LgMin then
L3 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L4 < LgMin then
L4 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
--[[if Alfa < AlfaMin then
Alfa = AlfaMin
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
end
if Alfa > AlfaMax then
Alfa = AlfaMax
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
end --]]
if R < RMin then
R = RMin
if CMP.ERR == 0 then
CMP.ERR = 7
CMP.MSG = Msg[26]..GetLenLimit(RMin) --Il raggio deve essere maggiore o uguale a ..
end
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 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
local vAlfa = Vector3d (cos(Alfa),sin(Alfa),0)
local l1 = EgtLinePVL(Ly,ORIG(),vAlfa,L1) EgtInvertCurve(l1)
EgtSetName(l1,"A7")
local l2 = EgtLinePDL(Ly,ORIG(),0,L2)
EgtSetName(l2,"A1")
local l3 = EgtLinePVL(Ly,EgtSP(l1),VRotated(vAlfa,-90),L3) EgtInvertCurve(l3)
EgtSetName(l3,"A6")
local l4 = EgtLinePDL(Ly,EgtEP(l2),90,L4)
EgtSetName(l4,"A2")
--[[ linea di estensione angolo
local arcAlfa , rrefAlfa
rrefAlfa = min(L1,L2)/5
arcAlfa = EgtArcC2P(La,EgtSP(l2),EgtSP(l2)+EgtEV(l2)*rrefAlfa,EgtSP(l1)) --]]
-- chiusura dei lati l5 e l7 se possibile
local l5 = EgtLinePVL(Ly,EgtSP(l3),VRotated(vAlfa,180),L1)
EgtInvertCurve(l5)
EgtSetName(l5,"A5")
local l7 = EgtLinePDL(Ly,EgtEP(l4),180,L2)
EgtSetName(l7,"A3")
local Dist, l6arc, L5, L7
--if EgtIP(l5,l7,EgtSP(l3)) then
EgtModifyCurveStartPoint(l5,EgtIP(l5,l7,EgtSP(l3)))
EgtModifyCurveEndPoint(l7,EgtIP(l5,l7,EgtEP(l4)))
L5 = EgtCurveLength(l5) -- L5'
L7 = EgtCurveLength(l7) -- L7'
-- inserimentp del raccordo se possibile
Dist = R --/tan(Alfa/2)
--if Dist >= L5 or Dist >= L7 then
--Dist = min(L5,L7) - LgMin
--if CMP.ERR == 0 then
--CMP.ERR = 9
--CMP.MSG = Msg[222] -- il raccordo non ci sta : L6 troppo grande
--end
--end --
if Dist > L5-LgMin or Dist > L7-LgMin then
Dist = min(L5-LgMin, L7-LgMin)
R = Dist -- *tan(Alfa/2)
if CMP.ERR == 0 then
CMP.ERR = 10
CMP.MSG = Msg[223]..GetLenLimit(LgMin) -- un lato risulta troppo piccolo (minore di ..)
end
end
l6arc = EgtCurveFillet (Ly,l7,EgtSP(l7),l5,EgtEP(l5),R,true)
EgtSetName(l6arc,"A4")
L5 = EgtCurveLength(l5)
L7 = EgtCurveLength(l7)
--else
-- if CMP.ERR == 0 then
--CMP.ERR = 8
--CMP.MSG = Msg[221] -- figura impossibile: i lati L5 e L7 non si chiudono
--end
--end
-- diagonali e assi di simmetria
local d1, D1, a1, a2
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtSP(l1),EgtEP(l2))
D1 = EgtCurveLength(d1)
a1 = EgtLinePVL(La,EgtMP(l3),VRotated(vAlfa,180),L1)
a2 = EgtLinePDL(La,EgtMP(l4),180,L2)
EgtModifyCurveEndPoint(a1,EgtIP(a1,a2,EgtMP(l6arc)))
EgtModifyCurveEndPoint(a2,EgtIP(a1,a2,EgtMP(l6arc)))
end
-- linee di quota - raggio
local dim = EgtGetBBoxGlob(Ly,GDB_BB.STANDARD):getRadius() * 0.1
local pt = EgtMP(l6arc) local vr = EgtMV(l6arc,Lq) --vr = VRotaded(EgtMV(l3,Lq),90) non può funzionare?
local DimLineR = EgtLine(Lq,pt+VRotated(vr,-90)*dim,pt)
pt = EgtEP(DimLineR) vr = EgtEV(DimLineR)
EgtLinePVL(Lq,pt,VRotated(-vr,-15),dim*.4) -- freccia di quotatura
EgtLinePVL(Lq,pt,VRotated(-vr, 15),dim*.4)
pt = EgtSP(DimLineR)-vr*dim/2 -- linea aux per quotatura
local DimLineRAux = EgtLine(Lq,EgtSP(DimLineR),pt)
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1, s1
if CMP.ERR ~= 8 then
e1 = EgtCurveCompo(Ly,{l1,l2,l4,l7,l6arc,l5,l3},false)
s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
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 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,l6arc,l7,arcAlfa})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*3,0) -- uguali, se non ci sono linee di quotatura sotto la fiura
else
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
end
-- Dimensioni sull'oggetto
local LbOn
if CMP.ERR == 0 then
local sDim = EgtNumToString(dimX,2) .. ' X ' .. EgtNumToString(dimY,2)
local dDim = bbox:getRadius() * 0.1
if L1 > L2 then
LbOn = AddLabelPnt(Lr,EgtMP(a1,GDB_ID.ROOT),sDim,dDim,90,BLACK())
else
LbOn = AddLabelPnt(Lr,EgtMP(a2,GDB_ID.ROOT),sDim,dDim,0,BLACK())
end
EgtSetStatus(LbOn,GDB_ST.OFF)
end
-- Etichette sulla figura
local stdoffset = 1
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)
local LblL3 = AddLabel(Le,l3,stdoffset,CMP.N3,dim,-90,RED())
EgtSetInfo(LblL3,"Var",3)
local LblL4 = AddLabel(Le,l4,stdoffset,CMP.N4,dim,-90,RED())
EgtSetInfo(LblL4,"Var",4)
--[[local LblAlfa = AddLabelU(Le,arcAlfa,1/4,stdoffset*.5,CMP.N5,dim*.8,-90,RED())
EgtSetInfo(LblAlfa,"Var",5) --]]
if CMP.ERR ~= 8 then
local LblLR = AddLabelAl(Le,DimLineRAux,stdoffset*.2,CMP.N6,dim*.8,45,RED())
EgtSetInfo(LblLR,"Var",6)
EgtErase(DimLineRAux)
end
if CMP.ERR == 0 then
local LblL5 = AddLabel(Le,l5,stdoffset,L5label,dim*.75,-90,GREEN())
local LblL7 = AddLabel(Le,l7,stdoffset,L7label,dim*.75,-90,GREEN())
local LblD1 = AddLabelAl(La,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
if CMP.ERR == 0 then
local lLenL5 = EgtToUiUnits(L5)
local sLenL5 = EgtNumToString(lLenL5,1)
local ValL5 = EgtTextAdv(Le,pVal,0,L5label..'='..sLenL5,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL5,GREEN())
EgtSetStatus(ValL5,GDB_ST.SEL)
local ValL5Len = (EgtEP(ValL5,GDB_RT.GLOB)-EgtSP(ValL5,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL5Len,0,0)
local lLenL7 = EgtToUiUnits(L7)
local sLenL7 = EgtNumToString(lLenL7,1)
local ValL7 = EgtTextAdv(Le,pVal,0,L7label..'='..sLenL7,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL7,GREEN())
EgtSetStatus(ValL7,GDB_ST.SEL)
local ValL7Len = (EgtEP(ValL7,GDB_RT.GLOB)-EgtSP(ValL7,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL7Len,0,0)
end
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le,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
end
function CMP_Draw( bPreview)
local OpzRaccordo = CMP.V5
if OpzRaccordo then
CMP_DrawA3( bPreview)
else
CMP_DrawA2( bPreview)
end
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
+337
View File
@@ -0,0 +1,337 @@
-- 2015/09/__0
-- PIANO CUCINA CON LAVORAZIONE A RIENTRAARE PER ANGOLO
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
local Nome = 'PCucinaB1'
-- Valori limite
local LgMin = 10 -- lati
local Q1Min = 10 -- profondità di sagomatura del profilo
local RdMin = 10 -- raggio
local AngMin =15
local AngMax = 180 - 1
-- Parametri : dichiarazione e valori standard
--.T (tipo) : 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
local CMP = {}
CMP.N1 = 'A' -- lato esterno // muro
CMP.T1 = 3
CMP.V1 = 1000
CMP.N2 = 'B' -- profondità
CMP.T2 = 3
CMP.V2 = 500
CMP.N3 = 'C' -- profondità pezzo PCucinaB2
CMP.T3 = 3
CMP.V3 = 500
CMP.N4 = 'Z' -- profondità sagomatura bordo
CMP.T4 = 3
CMP.V4 = 30
CMP.N5 = 'R' -- raggio di raccordo
CMP.T5 = 3
CMP.V5 = 50
CMP.N6 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T6 = 1
CMP.V6 = false
CMP.N7 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T7 = 1
CMP.V7 = true
CMP.Npar = 7
CMP.Nome = Nome
CMP.WithInt = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L2 = CMP.V2
local LC = CMP.V3
local LZ = CMP.V4
local LR = CMP.V5
local Simm = CMP.V6
local Rib = CMP.V7
local K1 = sqrt(2)/2
local Kx = LR*K1
local Ky = LR - LR*K1
local L3 = L1 - LC
local L4 = LZ / K1
local L6 = LC - LZ- Kx
local L7 = L2 -Ky -LZ
local L3label = 'D' -- lato interno // muro
local L6label = 'E' -- lato vs. pezzo PCucinaB2
local L7label = 'F' --
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a ...
end
if L2 < LgMin then
L2 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if LC < LgMin then
LC = LgMin
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if LZ < Q1Min then
LZ = Q1Min
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[205]..GetLenLimit(Q1Min) --La quota Z deve essere > = di...
end
end
if LR < RdMin then
LR = RdMin
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[206]..GetLenLimit(RMin) -- Il raggio R deve essere > = RMin
end
end
if L3 < LgMin then
L3 = LgMin L1 = L3 + LC
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[207]..GetLenLimit(LgMin) -- Differenza L1-LC troppo piccola
end
end
if L6 < LgMin then
L6 = LgMin LC = L6 + Kx + LZ L1 = LC + L3
if CMP.ERR == 0 then
CMP.ERR = 7
CMP.MSG = Msg[208]..GetLenLimit(LgMin) -- Differenza LC-(Kx+LZ) troppo piccola
end
end
if L7 < LgMin then
L7 = LgMin L2 = L7 + Ky + LZ
if CMP.ERR == 0 then
CMP.ERR = 8
CMP.MSG = Msg[209]..GetLenLimit(LgMin) -- Differenza LC-(Ky+LZ) troppo piccola
end
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 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
local l1 = EgtLinePDL(Ly,ORIG(),0,L1)
EgtSetName(l1,"A1")
local l2 = EgtLinePDL(Ly,EgtEP(l1),90,L2)
EgtSetName(l2,"A2")
local l3 = EgtLinePDL(Ly,EgtEP(l2),180,L3)
EgtSetName(l3,"A3")
local l4 = EgtLinePDL(Ly,EgtEP(l3),-135,L4)
local pC = EgtEP(l4) + Vector3d(-1,1,0)*K1*LR -- centro dell'arco di raccordo
local arc = EgtArc(Ly,pC,LR,-45,-45,0) -- arco di raccordo
local l6 = EgtLinePDL(Ly,EgtEP(arc),180,L6)
local l7 = EgtLine(Ly,EgtEP(l6),EgtSP(l1))
EgtSetName(l7,"A4")
-- assi
local a1 = EgtLinePDL(La,EgtMP(l2),180,L1)
local a2 = EgtLine(La,Point3d(LC/2,0,0),Point3d(LC/2,L7,0))
-- diagonale
local d1, D1
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtEP(l7),EgtEP(l2))
D1 = EgtCurveLength(d1)
end
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1 = EgtCurveCompo(Ly,{l1,l2,l3,l4,arc,l6,l7},false)
local s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
local dim = EgtGetBBoxGlob(Ly,GDB_BB.STANDARD):getRadius() * 0.1
-- linee di quotatura
local pt local vr -- generici punto e vettore per costruzione
pt = EgtEP(l2,Lq) + EgtEV(l2,Lq)*dim
local DimLineL3 = EgtLinePDL(Lq,pt,180,L3)
EgtLinePDL(Lq,EgtSP(DimLineL3)-Vector3d(0,dim*.25,0),90,dim*.5) -- trattino di estensione
EgtLinePDL(Lq,EgtEP(DimLineL3)-Vector3d(0,dim*.25,0),90,dim*.5) -- " "
local DimLineLC = EgtLinePDL(Lq,EgtEP(DimLineL3),180,LC)
EgtLinePDL(Lq,EgtSP(DimLineLC)-Vector3d(0,dim*.25,0),90,dim*.5) -- trattino di estensione
EgtLinePDL(Lq,EgtEP(DimLineLC)-Vector3d(0,dim*.25,0),90,dim*.5) -- " "
pt = EgtEP(l3,Lq) + EgtEV(l6,Lq)*(LC+dim)
local DimLineLZ = EgtLinePDL(Lq,pt,-90,LZ)
EgtLinePDL(Lq,EgtSP(DimLineLZ)-Vector3d(dim*.25,0,0),0,dim*.5) -- trattino di estensione
EgtLinePDL(Lq,EgtEP(DimLineLZ)-Vector3d(dim*.25,0,0),0,dim*.5) -- " "
pt = EgtMP(DimLineLZ,Lq)+Vector3d(-dim*.25,0,0)
local lnZ1 = EgtLinePDL(Lq,pt,135,dim*.5) -- trattino per direttrice
local lnZ2 = EgtLinePDL(Lq,EgtEP(lnZ1),90,dim*.5) -- " " "
local DimLineL7 = EgtLinePDL(Lq,EgtEP(DimLineLZ)+Vector3d(0,-Ky,0),-90,L7)
EgtLinePDL(Lq,EgtSP(DimLineL7)-Vector3d(dim*.25,0,0),0,dim*.5) -- trattino di estensione
EgtLinePDL(Lq,EgtEP(DimLineL7)-Vector3d(dim*.25,0,0),0,dim*.5) -- " "
-- raggio
vr = EgtMV(arc,Lq) --vr:rotate(Z_AX(),-90)
local DimLineR1 = EgtLine(Lq,EgtMP(arc)-VRotated(vr,-90)*2*dim,EgtMP(arc))
local DimLineR2 = EgtLine(Lq,EgtMP(arc),EgtMP(arc)+VRotated(vr,-90)*dim)
vr = EgtEV(DimLineR1,Lq) pt = EgtSP(DimLineR1)+vr*dim/2
local DimLineR3 = EgtLinePVL(Lq,pt,VRotated(-vr,90),dim)
--vr:rotate(Z_AX(),-15) EgtLinePVL(Lq,EgtEP(DimLineR1),-vr,10) -- freccia di quotatura
--vr:rotate(Z_AX(), 30) EgtLinePVL(Lq,EgtEP(DimLineR1),-vr,10)
EgtLinePVL(Lq,EgtEP(DimLineR1),VRotated(-vr,-15),dim*.4) -- freccia di quotatura
EgtLinePVL(Lq,EgtEP(DimLineR1),VRotated(-vr, 15),dim*.4)
-- Simmetria orizzontale
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,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)
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")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*5,0)
else
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
end
-- Dimensioni sull'oggetto
local ptP = 0.5 * ( bbox:getMin() + bbox:getMax())
local 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)
EgtSetStatus(LbOn,GDB_ST.OFF)
-- Etichette sulla figura
local stdoffset = 1
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)
local LblL3 = AddLabel(Le,DimLineL3,stdoffset,L3label,dim*.75,-90,GREEN())
local LblL6 = AddLabel(Le,l6,stdoffset*.75,L6label,dim*.75,-90,GREEN())
local LblLC = AddLabel(Le,DimLineLC,stdoffset,CMP.N3,dim,-90,RED())
EgtSetInfo(LblLC,"Var",3)
local LblLZ = AddLabel(Le,lnZ2,stdoffset*.5,CMP.N4,dim,90,RED())
EgtSetInfo(LblLZ,"Var",4)
EgtErase(lnZ2)
local LblL7 = AddLabel(Le,DimLineL7,stdoffset,L7label,dim*.75,-90,GREEN())
local LblLR = AddLabelAl(Le,DimLineR3,stdoffset*.0,CMP.N5,dim*.8,90,RED())
EgtSetInfo(LblLR,"Var",5)
EgtErase(DimLineR3)
if CMP.ERR == 0 then
LblD1 = AddLabelAl(La,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
local lLenL3 = EgtToUiUnits(L3)
local sLenL3 = EgtNumToString(lLenL3,1)
local ValL3 = EgtTextAdv(Le,pVal,0,L3label..'='..sLenL3,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL3,GREEN())
EgtSetStatus(ValL3,GDB_ST.SEL)
local ValL3Len = (EgtEP(ValL3,GDB_RT.GLOB)-EgtSP(ValL3,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL3Len,0,0)
local lLenL7 = EgtToUiUnits(L7)
local sLenL7 = EgtNumToString(lLenL7,1)
local ValL7 = EgtTextAdv(Le,pVal,0,L7label..'='..sLenL7,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL7,GREEN())
EgtSetStatus(ValL7,GDB_ST.SEL)
local ValL7Len = (EgtEP(ValL7,GDB_RT.GLOB)-EgtSP(ValL7,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL7Len,0,0)
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le,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
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
+294
View File
@@ -0,0 +1,294 @@
-- 2015/10/__
-- PIANO CUCINA CON LAVORAZIONE A A SPORGERE PER ANGOLO
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
local Nome = 'PCucinaB2'
-- Valori limite
local LgMin = 10 -- lati
local Q1Min = 10 -- profondità di sagomatura del profilo
local RdMin = 10 -- raggio
local AngMin =15
local AngMax = 180 - 1
-- Parametri : dichiarazione e valori standard
--.T (tipo) : 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
local CMP = {}
CMP.N1 = 'A' -- lato lungo muro
CMP.T1 = 3
CMP.V1 = 800
CMP.N2 = 'B' -- profondità lato muro
CMP.T2 = 3
CMP.V2 = 500
CMP.N3 = 'Z' -- profondità sagomatura bordo
CMP.T3 = 3
CMP.V3 = 30
CMP.N4 = 'R' -- raggio di raccordo
CMP.T4 = 3
CMP.V4 = 50
CMP.N5 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T5 = 1
CMP.V5 = false
CMP.N6 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T6 = 1
CMP.V6 = false
CMP.Npar = 6
CMP.Nome = Nome
CMP.WithInt = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L6 = CMP.V2
local LR = CMP.V4
local LZ = CMP.V3
local Simm = CMP.V5
local Rib = CMP.V6
local K1 = sqrt(2)/2
local Kx = LR*K1
local Ky = LR - LR*K1
local L4 = LZ / K1
local L2 = L6 - Kx - LZ
local L5 = L1 - Ky - LZ
local L2label = 'D' -- lato verso pezzo PCucinaB1
local L5label = 'C' -- lunghezza interna lato muro
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a ...
end
if L6 < LgMin then
L6 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if LZ < Q1Min then
LZ = Q1Min
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[205]..GetLenLimit(Q1Min) --La quota Z deve essere > = di...
end
end
if LR < RdMin then
LR = RdMin
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[206]..GetLenLimit(RMin) -- Il raggio R deve essere > = RMin
end
end
if L2 < LgMin then
L2 = LgMin L6 = L2 + Kx + LZ
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[210]..GetLenLimit(LgMin) -- L2 risulterebbe minore di ..0
end
end
if L5 < LgMin then
L5 = LgMin L1 = L5 + Ky + LZ
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[211]..GetLenLimit(LgMin) -- L5 risulterebbe troppo piccola
end
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 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
local l1 = EgtLinePDL(Ly,ORIG()+Vector3d(0,L1,0),-90,L1)
EgtSetName(l1,"A1")
local l2 = EgtLinePDL(Ly,EgtEP(l1),0,L2)
local pC = EgtEP(l2) + Vector3d(0,1,0)*LR -- centro dell'arco di raccordo
local l3 = EgtArc(Ly,pC,LR,-90,45,0) -- arco di raccordo
local l4 = EgtLinePDL(Ly,EgtEP(l3),45,L4)
local l5 = EgtLinePDL(Ly,EgtEP(l4),90,L5)
EgtSetName(l5,"A3")
local l6 = EgtLine(Ly,EgtEP(l5),EgtSP(l1))
EgtSetName(l6,"A2")
-- diagonali e assi di simmetria
local d1, D1, a1
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtEP(l1),EgtSP(l6))
D1 = EgtCurveLength(d1)
a1 = EgtLinePDL(La,EgtMP(l6),-90,L1)
end
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1 = EgtCurveCompo(Ly,{l1,l2,l3,l4,l5,l6},false)
local s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
local dim = EgtGetBBoxGlob(Ly,GDB_BB.STANDARD):getRadius() * 0.1
-- linee di quotatura
local pt local vr -- punto e vettore per costruzioni
pt = EgtEP(l2,Lq) + Vector3d(Kx,-dim,0)
local DimLineLZ = EgtLinePDL(Lq,pt,0,LZ)
EgtLinePDL(Lq,EgtSP(DimLineLZ)-Vector3d(0,dim*.25,0),90,dim/2) -- trattino di estensione
EgtLinePDL(Lq,EgtEP(DimLineLZ)-Vector3d(0,dim*.25,0),90,dim/2) -- trattino di estensione
pt = EgtMP(DimLineLZ,Lq)+Vector3d(0,-dim*.25,0)
local lnZ1 = EgtLinePDL(Lq,pt,-60,dim/2) -- trattino per direttrice
local lnZ2 = EgtLinePDL(Lq,EgtEP(lnZ1),-90,dim/2) -- " " "
-- raggio
pt = EgtMP(l3) vr = EgtMV(l3,Lq) --vr = VRotaded(EgtMV(l3,Lq),90) non può funzionare?
local DimLineR1 =EgtLine(Lq,pt+VRotated(-vr,-90)*2*dim,pt)
--local DimLineR2 =EgtLine(Lq,pt,pt+VRotated(-vr,90)*dim/2)
vr = EgtSV(DimLineR1,Lq) pt = EgtSP(DimLineR1)+vr*dim/2
local DimLineR3 = EgtLine(Lq,pt-VRotated(vr,90)*dim,pt)
pt = EgtEP(DimLineR1) vr = EgtEV(DimLineR1)
EgtLinePVL(Lq,pt,VRotated(-vr,-15),dim*.4) -- freccia di quotatura
EgtLinePVL(Lq,pt,VRotated(-vr, 15),dim*.4)
-- Simmetria orizzontale
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,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)
GetAllRib( Ly,Lr,La,Le,Lq)
EgtInvertCurve({l1,l2,l3,l4,l5,l6})
EgtInvertCurve({DimLineLZ,lnZ2})
EgtSetInfo(La,"RIB","1")
end
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
else
pVal= bbox:getMin() - Vector3d(0,dim*4,0)
end
-- Dimensioni sull'oggetto
local ptP = 0.5 * ( bbox:getMin() + bbox:getMax())
local 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 LblL1 = AddLabel(Le,l1,stdoffset,CMP.N1,dim,-90,RED()) EgtSetInfo(LblL1,"Var",1)
local LblL6 = AddLabel(Le,l6,stdoffset*.75,CMP.N2,dim,-90,RED()) EgtSetInfo(LblL6,"Var",2)
local LblLR = AddLabelAl(Le,DimLineR3,stdoffset*.0,CMP.N4,dim*.8,90,RED()) EgtSetInfo(LblLR,"Var",3)
EgtErase(DimLineR3)
local LblLZ = AddLabel(Le,lnZ2,stdoffset*.5,CMP.N3,dim,90,RED()) EgtSetInfo(LblLZ,"Var",4)
EgtErase(lnZ2)
local LblL2 = AddLabel(Le,l2,stdoffset,L2label,dim*.75,-90,GREEN())
local LblL5 = AddLabel(Le,l5,stdoffset,L5label,dim*.75,-90,GREEN())
if CMP.ERR == 0 then
LblD1 = AddLabelAl(La,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
local lLenL2 = EgtToUiUnits(L2)
local sLenL2 = EgtNumToString(lLenL2,1)
local ValL2 = EgtTextAdv(Le,pVal,0,L2label..'='..sLenL2,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL2,GREEN())
EgtSetStatus(ValL2,GDB_ST.SEL)
local ValL2Len = (EgtEP(ValL2,GDB_RT.GLOB)-EgtSP(ValL2,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL2Len,0,0)
local lLenL5 = EgtToUiUnits(L5)
local sLenL5 = EgtNumToString(lLenL5,1)
local ValL5 = EgtTextAdv(Le,pVal,0,L5label..'='..sLenL5,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL5,GREEN())
EgtSetStatus(ValL5,GDB_ST.SEL)
local ValL5Len = (EgtEP(ValL5,GDB_RT.GLOB)-EgtSP(ValL5,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL5Len,0,0)
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(La,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le,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
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
+318
View File
@@ -0,0 +1,318 @@
-- 2015/10/__
-- PIANO CUCINA CON LAVORAZIONE A L CON ANGOLO ANCHE NON RETTO
-- Intestazioni
require('EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
EgtAddToPackagePath(EgtGetSourceDir() .. 'LuaLibs\\?.lua')
require( 'EgtCompo')
local Nome = 'PCucinaC1'
-- Valori limite
local LgMin = 10 -- lati
local AlfaMin = 60
local AlfaMax = 150
-- Parametri : dichiarazione e valori standard
--.T (tipo) : 0=null, 1=bool, 2=int, 3=len, 4=num, 5=string
local CMP = {}
CMP.N1 = 'A' -- lato lungo muro 'obliquo'
CMP.T1 = 3
CMP.V1 = 1800
CMP.N2 = 'B' -- lato lungo muro 'orizzontale'
CMP.T2 = 3
CMP.V2 = 2000
CMP.N3 = 'C' -- profondità lato 'obliquo'
CMP.T3 = 3
CMP.V3 = 600
CMP.N4 = 'D' -- profondità lato 'orizzontale'
CMP.T4 = 3
CMP.V4 = 500
CMP.N5 = 'a' -- angolo Alfa tra i muri (compreso tra AlfaMin e AlfaMax)
CMP.T5 = 4
CMP.V5 = 85
CMP.N6 = '←→' -- Simmetria dx/sx (true = svuotamento a dx)
CMP.T6 = 1
CMP.V6 = false
CMP.N7 = '↑↓' -- Simmetria su/giù ('ribaltamento') (true = 'L' capovolta)
CMP.T7 = 1
CMP.V7 = false
CMP.Npar = 7
CMP.Nome = Nome
CMP.WithInt = true
_G.CMP = CMP
-- Aggiorno con ultimi valori salvati (se presenti)
CMP.DATA = EgtGetSourceDir() .. CMP.Nome ..'.dat'
LoadCompoData()
function CMP_Draw(bPreview)
-- Carico i messaggi
local Msg = require('EgtCompoMsg')
-- Assegnazioni
local L1 = CMP.V1
local L2 = CMP.V2
local L3 = CMP.V3
local L4 = CMP.V4
local Alfa = CMP.V5
local Simm = CMP.V6
local Rib = CMP.V7
local L5label = 'E' -- lato 'obliquo' interno
local L6label = 'F' -- lato 'orizzontale' interno
local D1label = 'd' -- diagonale
CMP.ERR = 0
CMP.MSG = ''
--Verifica di compatibilità dei dati di input
if L1 < LgMin then
L1 = LgMin
CMP.ERR = 1
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a ...
end
if L2 < LgMin then
L2 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 2
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L3 < LgMin then
L3 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 3
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if L4 < LgMin then
L4 = LgMin
if CMP.ERR == 0 then
CMP.ERR = 4
CMP.MSG = Msg[2]..GetLenLimit(LgMin) --Le dimensioni dei lati devono essere > = a...
end
end
if Alfa < AlfaMin then
Alfa = AlfaMin
if CMP.ERR == 0 then
CMP.ERR = 5
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
end
if Alfa > AlfaMax then
Alfa = AlfaMax
if CMP.ERR == 0 then
CMP.ERR = 6
CMP.MSG = Msg[220]..AlfaMin..' e '..AlfaMax -- L'angolo Alfa deve essere compreso tra ... e ...
end
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 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
local vAlfa = Vector3d (cos(Alfa),sin(Alfa),0)
local l1 = EgtLinePVL(Ly,ORIG(),vAlfa,L1) EgtInvertCurve(l1)
EgtSetName(l1,"A6")
local l2 = EgtLinePDL(Ly,ORIG(),0,L2)
EgtSetName(l2,"A1")
local l3 = EgtLinePVL(Ly,EgtSP(l1),VRotated(vAlfa,-90),L3) EgtInvertCurve(l3)
EgtSetName(l3,"A5")
local l4 = EgtLinePDL(Ly,EgtEP(l2),90,L4)
EgtSetName(l4,"A2")
local arcAlfa , rrefAlfa
rrefAlfa = min(L1,L2)/5
arcAlfa = EgtArcC2P(La,EgtSP(l2),EgtSP(l2)+EgtEV(l2)*rrefAlfa,EgtSP(l1))
-- chiusura dei lati l5 e l6 se possibile
local l5 = EgtLinePVL(Ly,EgtSP(l3),VRotated(vAlfa,180),L1)
EgtInvertCurve(l5)
EgtSetName(l5,"A4")
local l6 = EgtLinePDL(Ly,EgtEP(l4),180,L2)
EgtSetName(l6,"A3")
if EgtIP(l5,l6,EgtSP(l3)) then
EgtModifyCurveStartPoint(l5,EgtIP(l5,l6,EgtSP(l3)))
EgtModifyCurveEndPoint(l6,EgtIP(l5,l6,EgtSP(l3)))
L5 = EgtCurveLength(l5)
L6 = EgtCurveLength(l6)
if L5 < LgMin then
if CMP.ERR == 0 then
CMP.ERR = 8
CMP.MSG = Msg[223]..GetLenLimit(LgMin) -- un lato risulta troppo piccolo (minore di ..)
end
end
if L6 < LgMin then
if CMP.ERR == 0 then
CMP.ERR = 9
CMP.MSG = Msg[223]..GetLenLimit(LgMin) -- un lato risulta troppo piccolo (minore di ..)
end
end
else
-- if CMP.ERR == 0 then
CMP.ERR = 7
CMP.MSG = Msg[221] -- figura impossibile
--end
end
-- diagonali e assi di simmetria
local d1, D1, a1, a2
if CMP.ERR == 0 then
d1 = EgtLine(La,EgtSP(l1),EgtEP(l2))
D1 = EgtCurveLength(d1)
a1 = EgtLinePVL(La,EgtMP(l3),VRotated(vAlfa,180),L1)
a2 = EgtLinePDL(La,EgtMP(l4),180,L2)
EgtModifyCurveEndPoint(a1,EgtIP(a1,a2,EgtEP(l6)))
EgtModifyCurveEndPoint(a2,EgtIP(a1,a2,EgtEP(l6)))
end
if Lc then
EgtErase(Lc)
end
-- Riempimento della figura
local e1, s1
if CMP.ERR ~= 7 then
e1 = EgtCurveCompo(Ly,{l1,l2,l4,l6,l5,l3},false)
s1 = EgtSurfFlatRegion(Lr,e1)
if CMP.ERR == 0 then
EgtSetColor(s1,AQUA())
else
EgtSetColor(s1,ORANGE())
end
EgtSetAlpha(s1,25)
EgtErase(e1)
end
-- Simmetria orizzontale
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,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
EgtReorderCurvesInGroup(Ly,ORIG())
-- 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
if CMP.ERR == 0 then
CMP.MSG = Msg[1] .. EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
end
local pVal
if Rib then
pVal= bbox:getMin() - Vector3d(0,dim*3,0) -- uguali, se non ci sono linee di quotatura sotto la fiura
else
pVal= bbox:getMin() - Vector3d(0,dim*3,0)
end
-- Dimensioni sull'oggetto
local LbOn
if CMP.ERR == 0 then
local sDim = EgtNumToString(dimX,2) .. ' x ' .. EgtNumToString(dimY,2)
local dDim = bbox:getRadius() * 0.1
if L1 > L2 then
LbOn = AddLabelPnt(Lr,EgtMP(a1,GDB_ID.ROOT),sDim,dDim,90,BLACK())
else
LbOn = AddLabelPnt(Lr,EgtMP(a2,GDB_ID.ROOT),sDim,dDim,0,BLACK())
end
EgtSetStatus(LbOn,GDB_ST.OFF)
end
-- Etichette sulla figura
local stdoffset = 1
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)
local LblL3 = AddLabel(Le,l3,stdoffset,CMP.N3,dim,-90,RED())
EgtSetInfo(LblL3,"Var",3)
local LblL4 = AddLabel(Le,l4,stdoffset,CMP.N4,dim,-90,RED())
EgtSetInfo(LblL4,"Var",4)
local LblAlfa = AddLabel(Le,arcAlfa,stdoffset*.5,CMP.N5,dim*.8,-90,RED())
EgtSetInfo(LblAlfa,"Var",5)
if CMP.ERR == 0 then
local LblL5 = AddLabel(Le,l5,stdoffset,L5label,dim*.75,-90,GREEN())
local LblL6 = AddLabel(Le,l6,stdoffset,L6label,dim*.75,-90,GREEN())
local LblD1 = AddLabelAl(Le,d1,stdoffset*.75,D1label,dim/2,90,GREEN())
end
-- Etichette sotto la figura
if CMP.ERR == 0 then
local lLenL5 = EgtToUiUnits(L5)
local sLenL5 = EgtNumToString(lLenL5,1)
local ValL5 = EgtTextAdv(Le,pVal,0,L5label..'='..sLenL5,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL5,GREEN())
EgtSetStatus(ValL5,GDB_ST.SEL)
local ValL5Len = (EgtEP(ValL5,GDB_RT.GLOB)-EgtSP(ValL5,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL5Len,0,0)
local lLenL6 = EgtToUiUnits(L6)
local sLenL6 = EgtNumToString(lLenL6,1)
local ValL6 = EgtTextAdv(Le,pVal,0,L6label..'='..sLenL6,'',100,'S',dim*.75,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValL6,GREEN())
EgtSetStatus(ValL6,GDB_ST.SEL)
local ValL6Len = (EgtEP(ValL6,GDB_RT.GLOB)-EgtSP(ValL6,GDB_RT.GLOB)):getX() + dim/2
pVal = pVal + Vector3d(ValL6Len,0,0)
end
if CMP.ERR == 0 then
local lLenD1 = EgtToUiUnits(D1)
local sLenD1 = EgtNumToString(lLenD1,1)
local ValD1 = EgtTextAdv(Le,pVal,0,D1label..'='..sLenD1,'',100,'S',dim*.5,1,0,GDB_TI.BL,GDB_RT.GLOB)
EgtSetColor(ValD1,GREEN())
EgtSetStatus(ValD1,GDB_ST.SEL)
end
-- Se non Preview
if not bPreview then
-- cancello etichette e parti ausiliarie (es.: altezze, diagonali )
EgtErase({La,Le,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
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
-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
+30 -20
View File
@@ -1,4 +1,5 @@
-- 2015/10/__
-- 2015/10/__
-- PIANO CUCINA CON LAVORAZIONE A L CON ANGOLO ANCHE NON RETTO , SMUSSO o RACCORDO
-- Intestazioni
@@ -43,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
@@ -56,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')
@@ -237,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
@@ -344,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
@@ -531,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
@@ -639,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)
+16 -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())
@@ -324,3 +326,5 @@ function CMP_Draw(bPreview)
end
end
_G.CMP_Draw = CMP_Draw
CMP_Draw(true)
EgtZoom(SCE_ZM.ALL)
-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.
Binary file not shown.
Binary file not shown.
+7 -1
View File
@@ -37,12 +37,18 @@ local Ang = atan2((v1^v2)*Z_AX(),v1*v2)
-- ***************************************************************************
EgtText(GDB_ID.CL,{0,0,0}, Ang ,50,GDB_RT.GRID)
]]
--[[
l1 = EgtLinePDL( 2, {0,100,0}, 0, 1000)
l2 = EgtLinePDL( 2, {0.,500,0}, -45, 1000)
Pt = EgtIP( l1, l2, {0,500,0})
if Pt then
EgtLine( 2, Pt, {0,0,0})
end
end ]]
Point = Point3d( 100, 100, 0)
--EgtLine( GDB_ID.ROOT, Point3d( 100, 100, 0), Point3d( 300, 300, 0) )
--EgtFrame( GDB_ID.ROOT, Frame3d( Point3d(100,100,0), Vector3d(1,-1,0), Vector3d(1,1,0),Vector3d(0,0,1)),GDB_RT.GLOB)
EgtFrame( GDB_ID.ROOT, Frame3d( Point, Vector3d(1,-1,0), Vector3d(1,1,0),Vector3d(0,0,1)),GDB_RT.GLOB)
--G.CMP_Draw = CMP_Draw
EgtZoom(SCE_ZM.ALL)
+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)
Binary file not shown.