diff --git a/Frontalini_ecc/Altri files/EgtCompoMsg.lua b/Frontalini_ecc/Altri files/EgtCompoMsg.lua new file mode 100644 index 0000000..136c173 --- /dev/null +++ b/Frontalini_ecc/Altri files/EgtCompoMsg.lua @@ -0,0 +1,292 @@ +-- 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 ' + -- 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 ' + -- Alzatine/Frontalini + EgtCompoMsg[370] = 'non previsto' + +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 ' + -- 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 ' + -- Alzatine/Frontalini + EgtCompoMsg[370] = 'non previsto' -- da tradurre +else -- default 'ENG' + EgtCompoMsg[1] = 'Box = ' + EgtCompoMsg[2] = 'Sides / Dimensions must be greater than or equal to ' + 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 ' + -- 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 ' + -- Alzatine/Frontalini + EgtCompoMsg[370] = 'non previsto' -- da tradurre +end + +return EgtCompoMsg diff --git a/Frontalini_ecc/CompoAF/Alz&Front.lua b/Frontalini_ecc/CompoAF/Alz&Front.lua index fdaf0eb..22ed05d 100644 --- a/Frontalini_ecc/CompoAF/Alz&Front.lua +++ b/Frontalini_ecc/CompoAF/Alz&Front.lua @@ -78,6 +78,9 @@ end local function CMP_Draw(bPreview) -- Carico i messaggi local Msg = require('EgtCompoMsg') + CMP.ERR = 0 + CMP.MSG = '' + -- Assegno l'angolo di incremento per i tagli inclinati local F_Delta = CMP.F_DeltaAng local A_Delta = CMP.A_DeltaAng @@ -89,8 +92,8 @@ local function CMP_Draw(bPreview) local dDim = CMP.BBoxRad*0.1 local dHLbl = CMP.HeightText*0.15 local dStdOffs = dDim*.5 -- vedi etichettatura lati inclinati - local dOffs1 = dDim*.4 -- distanziamento dei rettangoli dai lati del componente - local dOffs2 = dDim*.25 -- costante aggiuntiva per spostamenti + local dOffsR = dDim*.4 -- distanziamento dei rettangoli dai lati del componente + local dOffsC = dDim*.25 -- 'costante' aggiuntiva per spostamenti -- CMP.ERR = 0 CMP.MSG = '' @@ -254,7 +257,7 @@ local function CMP_Draw(bPreview) local BaseL; local HeightL local sName --local Pt = EgtSP( Side) + VRotated( SVect*dDim, -90) - local Pt = EgtEP( Side) + VRotated( EVect*dOffs1, -90) + local Pt = EgtEP( Side) + VRotated( EVect*dOffsR, -90) local Frame = Frame3d( Pt, -EVect, VRotated(EVect,-90), Vector3d(0,0,1)) local Pz = EgtGroup(GDB_ID.ROOT, Frame, GDB_RT.GLOB) -- nuova parte per alzatina o frontalino EgtSetName(Pz,"Alz-Front") @@ -474,7 +477,9 @@ local function CMP_Draw(bPreview) -- |Ipotesi 1|: Non più di due angoli 'a destra' consecutivi -- |Ipotesi 2|: Nel caso di cui sopra, un solo angolo 'chiuso' -- |ATTENZIONE| un rettangolo già mosso o che non si può muovere 'indietro' deve essere identificato ??! - for SideNum = 1 , #SideTab do --#SideTab do + SideNum = 1 + -- for SideNum = 1 , #SideTab do --#SideTab do + while SideNum <= #SideTab do -- |ripeti LEGENDA 1: campi di SideTab)| -- |.IdSd = Side_Id; .IdPz = Pz_Id; .Frame = Ref_Id; .InfoSd = SideInfo(Alz/Front);| -- |.l1---.l4 = Rectangle sides|; |.RContour = contorno del rettengolo| @@ -493,62 +498,62 @@ local function CMP_Draw(bPreview) -- b.r1) rN interseca il lato N+2 -- b.r3) rN+2 nterseca il lato N -- c) come (b) ma con anche il rettangolo rN+1 - -- (rN+1 resta fermo a mano che |alpha1 | o |alpha2 |>90° <= |si ammette questo caso ?????????| - -- bisogna verificare alpha1 e alpha2 se acuti = caso (a) per rN+1, quindi 'sfilare' rN da RN+1 e rN+2 da rN+1 - + -- (rN+1 resta fermo a mano che |alpha1 | o |alpha2 |>90° <= | se si ammette questo caso ?????????| + -- bisogna verificare alpha1 e alpha2 se acuti => caso (a) per rN+1; quindi 'sfilare' rN da RN+1 e rN+2 da rN+1 local Tab = SideTab local N = SideNum local epsilon = 0.1 -- costante - --local dOffs1 = CMP.BBoxRad*0.1 -- distanza dei rettangoli dal lato corrispondente + --local dOffsR = CMP.BBoxRad*0.1 -- distanza dei rettangoli dal lato corrispondente local dsp1x -- spostamento (nel verso x+ del proprio sist. di rif.) del rettangolo - local dH1; local dH2 -- altezze dei rettangoli N e N+1 rispettivamente a seconda se alzatine o frontalini + local dH1, dH2, dH3 -- altezze dei rettangoli N, N+1, N+2 rispettivamente a seconda se alzatine o frontalini + if Tab[N].InfoSd == 1 then dH1 = AH else dH1 = FH end + if Tab[Tab[N].RecNxt].InfoSd == 1 then dH2 = AH else dH2 = FH end + if Tab[Tab[Tab[N].RecNxt].RecNxt].InfoSd == 1 then dH3 = AH else dH3 = FH end local Alpha1 = Tab[N].zNxtAng local Beta1 = 180 + Alpha1 local Alpha2 = Tab[Tab[N].RecNxt].zNxtAng + local Beta2 = 180 + Alpha2 -- **[a]: un solo angolo consecutivo a dx** if Alpha1 < 0 and Alpha2 > 0 then local dSp1xa, dSp1xb, dSP2xa, dSp2xb local dSp1x, dSp2x - if Tab[N].InfoSd == 1 then dH1 = AH else dH1 = FH end - if Tab[Tab[N].RecNxt].InfoSd == 1 then dH2 = AH else dH2 = FH end - -- **[a.r1r2]**: entrambi i lati N e N+1 iunteressati da A/F if Tab[N].InfoSd > 0 and Tab[Tab[N].RecNxt].InfoSd > 0 then --calcolo degli spostamenti per rettangolo 1 (lato N) - dSp1xa = -(dOffs1+dH2)/sin(Alpha1) + dSp1xa = -(dOffsR+dH2)/sin(Alpha1) if abs( Alpha1) >= 90 then - --dSP1xb = -(dOffs1+dH1)*tan(90+Alpha1) + dOffs2*tan(90+Alpha1) - dSP1xb = -(dOffs1+dH1)*tan(90+Alpha1) -- - dOffs2*tan(90+Alpha1) + --dSP1xb = -(dOffsR+dH1)*tan(90+Alpha1) + dOffsC*tan(90+Alpha1) + dSP1xb = -(dOffsR+dH1)*tan(90+Alpha1) -- - dOffsC*tan(90+Alpha1) else - dSP1xb = dOffs1*tan(90+Alpha1) -- + dOffs2*tan(90+Alpha1) + dSP1xb = dOffsR*tan(90+Alpha1) -- + dOffsC*tan(90+Alpha1) end if abs( Alpha1) >= 90 then - dSp1x = dSp1xa + dSP1xb + dOffs2 + dSp1x = dSp1xa + dSP1xb + dOffsC else - dSp1x = dSp1xa - dSP1xb + dOffs2 + dSp1x = dSp1xa - dSP1xb + dOffsC end -- calcolo degli spostamenti per rettangolo 2 (lato N+1) - dSp2xb = -(dOffs1+dH1)/sin(Beta1) -- - dOffs1/sin(Beta1) + dSp2xb = -(dOffsR+dH1)/sin(Beta1) -- - dOffsR/sin(Beta1) if abs( Alpha1) >= 90 then - dSp2xa = (dOffs1+dH2)*tan(90+Alpha1) -- + dOffs2*tan(90+Alpha1) + dSp2xa = (dOffsR+dH2)*tan(90+Alpha1) -- + dOffsC*tan(90+Alpha1) else - dSp2xa = -dOffs1*tan(90+Alpha1) -- - dOffs2*tan(90+Alpha1) + dSp2xa = -dOffsR*tan(90+Alpha1) -- - dOffsC*tan(90+Alpha1) end local Opz = 1 -- <<<<<<<<<<<<<< OPZIONE PROVA <<<<<<<<<<<<<<<<<<< -- opzione 1 (massima) per spostamento R2 if Opz == 1 then if abs( Alpha1) >= 90 then - dSp2x = (dSp2xb + dSp2xa) - dOffs2 + dSp2x = (dSp2xb + dSp2xa) - dOffsC else - dSp2x = (dSp2xb - dSp2xa) - dOffs2 + dSp2x = (dSp2xb - dSp2xa) - dOffsC end -- opzione 2 (minima) per spostamento R2 else if abs( Alpha1) >= 90 then - dSp2x = dSp2xa + dOffs2 + dSp2x = dSp2xa + dOffsC else dSp2x = 0 end @@ -562,29 +567,58 @@ local function CMP_Draw(bPreview) -- **[a.r1]:** solo il lato N interessato da A/F, angolo tra i lati acuto elseif Tab[N].InfoSd > 0 and Tab[Tab[N].RecNxt].InfoSd == 0 and abs( Alpha1) >= 90 then - dSp1x = -(dOffs1+dH1)*tan(90+Alpha1) + dOffs2 + dSp1x = -(dOffsR+dH1)*tan(90+Alpha1) + dOffsC if dSp1x ~= 0 then EgtMoveGroup( Tab[N].IdPz, {dSp1x, 0, 0}) end -- **[a.r2]:** solo il lato N+1 interessato da A/F elseif Tab[N].InfoSd == 0 and Tab[Tab[N].RecNxt].InfoSd > 0 and abs( Alpha1) >= 90 then - dSp2x = (dOffs1+dH2)*tan(90+Alpha1) - dOffs2 + dSp2x = (dOffsR+dH2)*tan(90+Alpha1) - dOffsC if dSP2x ~= 0 then EgtMoveGroup( Tab[Tab[N].RecNxt].IdPz, {dSp2x, 0, 0}) end end - - - end -- un solo angolo consecutivo a dx + SideNum = SideNum + 2 + + -- **[c]=[b.r1r2r3]:** due angoli consecutivi a dx; tre lati, N, N+1, N+2 interesssati da A/F + -- la somma dei due angoli interni deve essere >= 180° + elseif Alpha1 < 0 and Alpha2 < 0 and + (Tab[N].InfoSd > 0 and Tab[Tab[N].RecNxt].InfoSd > 0 and Tab[Tab[Tab[N].RecNxt].RecNxt].InfoSd > 0 ) then + local dSp1xa, dSp1xb, dSP3xa, dSp3xb + local dSp1x, dSp3x + --calcolo degli spostamenti per rettangolo 1 (lato N) + if abs( Alpha1) <= 90 and abs( Alpha2) <= 90 then + --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< QUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + dSp1xa = -(dOffsR+dH2)/sin(Alpha1) + dSP1xb = dOffsR*tan(90+Alpha1) + dSp1x = dSp1xa - dSP1xb + dOffsC + dSp3xb = -(dOffsR+dH2)/sin(Beta2) -- - dOffsR/sin(Beta1) + dSp3xa = -dOffsR*tan(90+Alpha1) -- - dOffsC*tan(90+Alpha1) + dSp3x = (dSp3xb - dSp3xa) - dOffsC + + if dSp1x ~= 0 then + EgtMoveGroup( Tab[N].IdPz, {dSp1x, 0, 0}) + end + if dSP3x ~= 0 then + EgtMoveGroup( Tab[Tab[Tab[N].RecNxt].RecNxt].IdPz, {dSp3x, 0, 0}) + end + elseif abs( Alpha1) >= 90 and abs( Alpha3) <= 90 then + CMP.ERR = 1 + CMP.MSG = Msg[370].. "da prevedere?" + elseif abs( Alpha1) <= 90 and abs( Alpha3) >= 90 then + CMP.ERR = 2 + CMP.MSG = Msg[370].. "da prevedere?" + else + CMP.ERR = 3 + CMP.MSG = Msg[370].. "da prevedere?" + end + SideNum = SideNum + 3 + else + SideNum = SideNum + 1 + end -- [c] = due angoli consecutivi a dx + end -- while /verifica intersezioni) - end -- for VERIFICA INTERSEZIONI ... - - - - - - --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< QUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< --[==[ MOVIMENTI diff --git a/Frontalini_ecc/CompoAF/PPcucinaC1ap.nge b/Frontalini_ecc/CompoAF/PPcucinaC1ap.nge index 96e658d..8a7b796 100644 Binary files a/Frontalini_ecc/CompoAF/PPcucinaC1ap.nge and b/Frontalini_ecc/CompoAF/PPcucinaC1ap.nge differ