window.extrajs = ` // SHOW IN 3D if (!this.group) // création du group { this.group = this._ez3D.createGroup(); this._ez3D.add(this.group); } this.group.clear(); // vide le group d'objet, on va le reconstruire if (!this.tech) this.tech = { profondeur: 6.3, epaisseur_cadre: 2.6, epaisseur_montants: 2.6, profondeur_montants: 3.7, ecart_mini: 30, marge: 5.2, // epaisseur cadre *2 design: [[], [[25, 50, 75]], [[75], [25], [50]], [], [[75]], [[80, -1]], [], [[80, -3]], [[80, -4]]], designm: [[[0, 100]], [[0, 25, 50, 75, 100]], [[0, 100]], [[0, 100]], [[0, 75, 100]], [[0, 80, 100]], [], [[0, 80, 100]], [[0, 80, 100]]], z: 0, factory_height: 90 } if (!this.data) this.data = { width: 200, height: 150, start: 100, // hauteur de sol baie: "1sideR", // closed / 1sideL, 1 sideR / full open design: 6, // classic / inclines inclines: 1, niches: 3, max_niches: 10, niches_ecart: 2, nichestype: "mix", // rectangle , carres , mix , mix2 , mix3 color_montants: 1024, // 3 couleurs disponbiles color_verre: 1022, // gris perle color_montants_texte: "Chêne Naturel", // 3 couleurs disponbiles color_verre_texte: "Verre Transparent", // gris perle perso: [] } if (this.data.design == 2) { this.tech.design[1] = [[50]]; // une traverse if (this.data.height > 115) this.tech.design[1] = [[33.33333, 66.66666]]; // 2 traverses if (this.data.height > 160) this.tech.design[1] = [[25, 50, 75]]; // 3 traversess this.tech.designm[1] = [[0, 50, 100]]; // une traverse if (this.data.height > 115) this.tech.designm[1] = [[0, 33.33333, 66.66666, 100]]; // 2 traverses if (this.data.height > 160) this.tech.designm[1] = [[0, 25, 50, 75, 100]]; // 3 traversess } // c'est parti ! // création du cadre principal var h = this.data.height + this.data.start; var center = this.data.start / 2; var floor = -h / 2; var bottom = floor + this.data.start; var top = bottom + this.data.height; var left = -this.data.width / 2; var right = this.data.width / 2; var depth = this.tech.profondeur_montants; var epaiss = this.tech.epaisseur_montants; var ecart = this.tech.ecart; var ecart_mini = this.tech.ecart_mini; var marge = this.tech.marge; var ecart_total = ecart + epaiss; var isMobile = /Mobi|Android/i.test(navigator.userAgent); var reverse = !(this.data.design == 1 || this.data.design == 3 || this.data.design == 4); var largeur_max = 120; if (this.data.height < 220) largeur_max = 160; if (this.data.height < 160) largeur_max = 220; if (this.data.height < 120) largeur_max = 275; this.data.partwidth = this.data.width; var visualmargin = 0.2; var decalagevertical = 0; if (this.data.design == 8 || this.data.design == 9) ecart_mini = 42; // nombre de parties nécessaires var nb_espaces_mini = Math.floor((this.data.width - marge + this.tech.epaisseur_montants) / (ecart_mini + this.tech.epaisseur_montants)); var nb_part_mini = Math.ceil((this.data.partwidth) / largeur_max); var nb_montants = 10; var nbpart = 10; var dec = 1; if (this.data.design == 6) dec = 2; if (this.data.design == 7) dec = 2; var dif = nb_part_mini > 1 ? dec % 2 : 0; var best = 10000; for (var i = 10; i >= nb_part_mini; i--) { for (var j = dec; j < 10; j += dec) { if (i * j <= best + dif && i * j >= nb_espaces_mini) // le 1.2 est une tolérance, pour réduire le nombre de parties quand on en a beaucoup { best = i * j; nbpart = i; nb_montants = j; nbpart = Math.ceil(nbpart); nb_montants = Math.max(Math.ceil(nb_montants), 1); this.data.partwidth = (this.data.width / nbpart); decalagevertical = - this.data.partwidth * (nbpart - 1) / 2; } } } var espace_dipso = this.data.partwidth - this.tech.epaisseur_cadre * 2; var ecart = (espace_dipso + this.tech.epaisseur_montants) / nb_montants; ecart_total = ecart; nb_montants--; var largeur_montant_vert = ecart_total - this.tech.epaisseur_montants; console.log("largeur_montant_vert", largeur_montant_vert); var hauteurBrut = (this.data.height - this.tech.epaisseur_cadre * 2 + this.tech.epaisseur_montants); if (this.data.design == 7) { var perPos = 100 - ((largeur_montant_vert / hauteurBrut) * 100); this.tech.design[6] = [[perPos, -2]]; this.tech.designm[6] = [[0, perPos, 100]]; } var dto = []; // reinit DTO // this.data.inclines = 0; var niches = []; this.data.positions = niches; if (this.engine.project.title == "(sans titre)") this.engine.project.title = 'Verrière'; this.engine.project.title = this.engine.project.title.split(' # ')[0] + " # " + this.data.width + " x " + this.data.height; // on retire un écart car il sera ignoré, et une lame car on veux les centres des design var center_lame = -(this.data.partwidth) / 2 + this.tech.epaisseur_cadre + ecart_total - this.tech.epaisseur_montants / 2; // centre de la premiere lame // position du group pour s'aligner au mur this.group.position.set(0, 0, this.tech.z); if (this.data.baie == '1sideR') this.group.position.set(-50, 0, this.tech.z); if (this.data.baie == '1sideL') this.group.position.set(50, 0, this.tech.z); var color_montants = this.engine.dataRepo._uiEasyColours.find((e) => e.Id == this.data.color_montants); // replace e:any dans TS var color = this.engine.dataRepo._uiEasyColours.find((e) => e.Id == this.data.color_verre);// replace e:any dans TS if (!color) color = this.engine.dataRepo._uiEasyColours[1];// replace e:any dans TS if (!color_montants) color_montants = this.engine.dataRepo._uiEasyColours[0]; var decalageverticaldto = - this.data.partwidth; // ondécalle un coup a gauche pour respecter la boucle decalagevertical -= this.data.partwidth; // ondécalle un coup a gauche pour respecter la boucle var nb_montants_total = 0; var nb_traverses = 0; for (var ik = 0; ik < nbpart; ik++) { decalageverticaldto += this.data.partwidth; decalagevertical += this.data.partwidth; var material = this._ez3D.createPanelMat(color_montants); var material_verre = this._ez3D.createPanelMat(color); material.map && material.map.repeat.set(1, 1); var box = this._ez3D.create4Box(this.data.partwidth - visualmargin * (ik == nbpart - 1 ? 0 : 1), this.data.height, this.tech.profondeur, this.tech.epaisseur_cadre, this.tech.epaisseur_cadre, material, true, true); box.position.set(0 + decalagevertical, center, 0); this.group.add(box); // AJOUR FILLER ENTRE LES VERRIERES if (ik > 0) { var lame = this._ez3D.createBox(visualmargin, this.data.height, this.tech.profondeur - visualmargin * 2); var box = this._ez3D.createMesh(lame, material, true, true);// lame complete box.position.set(0 + decalagevertical - this.data.partwidth / 2, center, 0); this.group.add(box); } // FIN FILLER dto.push({ type: "Cadre", typecolor: "cadrey", w: this.data.partwidth, h: this.tech.epaisseur_cadre, x: 0 + decalageverticaldto, y: 0 }); // lame bas dto.push({ type: "Cadre", typecolor: "cadrey", w: this.data.partwidth, h: this.tech.epaisseur_cadre, x: 0 + decalageverticaldto, y: this.data.height - this.tech.epaisseur_cadre }); // lame haut dto.push({ type: "Cadre", typecolor: "cadre", w: this.tech.epaisseur_cadre, h: this.data.height - this.tech.epaisseur_cadre * 2, x: 0 + decalageverticaldto, y: this.tech.epaisseur_cadre }); // lame gauche dto.push({ type: "Cadre", typecolor: "cadre", w: this.tech.epaisseur_cadre, h: this.data.height - this.tech.epaisseur_cadre * 2, x: this.data.partwidth - this.tech.epaisseur_cadre + decalageverticaldto, y: this.tech.epaisseur_cadre }); // lame droite var hlameg = this.data.height - this.tech.epaisseur_cadre * 2; var decallage_montants = this.data.design == 4 ? this.tech.factory_height : 0; var pos = 1; var design_traverses = this.tech.design[this.data.design - 1]; var design_montant = this.tech.designm[this.data.design - 1][0]; for (var i = 0; i < nb_montants; i++) { for (var ik2 = 0; ik2 < design_montant.length - 1; ik2++) { var from = design_montant[ik2] * (this.data.height - this.tech.epaisseur_cadre * 2 + this.tech.epaisseur_montants) / 100 + decallage_montants; var to = design_montant[ik2 + 1] * (this.data.height - this.tech.epaisseur_cadre * 2 + this.tech.epaisseur_montants) / 100; var dim = to - from - this.tech.epaisseur_montants; var lame = this._ez3D.createBox(epaiss, dim, depth); var material = this._ez3D.createPanelMat(color_montants, true); //material.map && material.map.offset.set(i * 0.2, i * 0.2); // material.map && material.map.repeat.set(depth / 100, this.data.height / 100); if (material.map) material.map.offset.set(0.4 * i, 0.2 * i); if (material.map) material.map.rotation = Math.PI / 2; if (material.map) material.map.repeat.set(this.data.height / 100, epaiss / 100); var pos_lame = center_lame + ecart_total * i; var box = this._ez3D.createMesh(lame, material, true, true);// lame complete box.position.set(pos_lame + decalagevertical, bottom + this.tech.epaisseur_cadre + dim / 2 + from, 0); var posi = [pos_lame + decalageverticaldto - epaiss / 2 + this.data.partwidth / 2, box.position.y - dim / 2 + this.data.height / 2 - center]; dto.push({ type: "Lame", typecolor: "lame", w: epaiss, h: dim, x: posi[0], y: posi[1] }); // lame bas this.group.add(box); /* */ } } var color_bas_factory = color_montants; if (decallage_montants > 0) { // ajout cadre bas var material = this._ez3D.createPanelMat(color_montants, true); var lame = this._ez3D.createBox(this.data.partwidth - this.tech.epaisseur_cadre * 2, this.tech.epaisseur_montants, depth); material.map && material.map.repeat.set(this.data.partwidth / 100, this.tech.epaisseur_montants / 100); var box = this._ez3D.createMesh(lame, material, true, true);// lame complete box.position.set(0 + decalagevertical, bottom + decallage_montants + this.tech.epaisseur_montants / 2, 0); var posi = [decalageverticaldto + this.tech.epaisseur_cadre, decallage_montants]; dto.push({ type: "Traverse Atelier", typecolor: "traverse_atelier", w: this.data.partwidth - this.tech.epaisseur_cadre * 2, h: this.tech.epaisseur_cadre, x: posi[0], y: posi[1] }); // lame bas*/ this.group.add(box); // ajout cadre bas var material = this._ez3D.createPanelMat(color_bas_factory, true); //material.map && material.map.offset.set(i * 0.2, i * 0.2); material.map && material.map.repeat.set(decallage_montants / 100, this.data.partwidth / 100); var lame = this._ez3D.createBox(decallage_montants, this.data.partwidth, 1); var box = this._ez3D.createMesh(lame, material, true, true);// lame complete box.rotation.set(0, 0, Math.PI / 2) box.position.set(0 + decalagevertical, bottom + decallage_montants / 2, 0); var posi = [decalageverticaldto + this.tech.epaisseur_cadre, this.tech.epaisseur_cadre]; dto.push({ type: "Filler Atelier", typecolor: "filler_atelier", w: this.data.partwidth - this.tech.epaisseur_cadre * 2, h: decallage_montants - this.tech.epaisseur_cadre, x: posi[0], y: posi[1] }); // lame bas*/ this.group.add(box); nb_traverses++; } var material = this._ez3D.createPanelMat(color_montants, true); var real_long_traverse = !reverse ? largeur_montant_vert : this.data.partwidth - this.tech.epaisseur_cadre * 2; var long_traverse = largeur_montant_vert; if (material.map) material.map.offset.set(real_long_traverse / 100 * i, 0); if (material.map) material.map.repeat.set(real_long_traverse / 100, this.tech.epaisseur_montants / 100); var traverse = this._ez3D.createBox(real_long_traverse, this.tech.epaisseur_montants, this.tech.profondeur_montants); var center_traverse = -(this.data.partwidth) / 2 + this.tech.epaisseur_cadre + largeur_montant_vert / 2; // centre de la premiere lame var prev = 0; console.log("nb_montants",nb_montants) for (var i = 0; i < nb_montants + 1; i++) { // affichage des traverses var traverses = design_traverses[nb_montants_total % design_traverses.length]; console.log("traverses",traverses) if (traverses) for (var j = 0; j < traverses.length; j++) { if (traverses[j] == -1) { // ARCHE var pos_traverse = (this.data.height - this.tech.epaisseur_cadre * 2) * prev / 100; var svg = []; var svg2 = []; var extray = 0; var precision = 100; var dim = largeur_montant_vert - 0.01; var dim2 = largeur_montant_vert + 2.5; var dimy = largeur_montant_vert - 0.01 + extray; var dimy2 = largeur_montant_vert + 2.5 + extray; bottom_taverse -= dim + this.tech.epaisseur_montants / 2 + extray; for (var ics = 0; ics <= precision; ics++) { var x = Math.sin(ics / precision * Math.PI / 2) * dim; var y = Math.cos(ics / precision * Math.PI / 2) * dimy; if (i % 2 == 0) { // on inverse l'arche une fois sur deux x = dim - x; } svg.push(Math.round(x * 1000) / 1000 + ',' + Math.round(y * 1000) / 1000); // interieur de l'arche var x = Math.sin(ics / precision * Math.PI / 2) * dim2; var y = Math.cos(ics / precision * Math.PI / 2) * dimy2; if (x > largeur_montant_vert) x = largeur_montant_vert; if (x < 0) x = 0; if (y > largeur_montant_vert + extray) y = largeur_montant_vert + extray; if (y < 0) y = 0; if (i % 2 == 0) { // on inverse l'arche une fois sur deux x = dim - x; } svg2.unshift(Math.round(x * 1000) / 1000 + ',' + Math.round(y * 1000) / 1000); // exterieur de l'arche } var d = "m " + svg.join(' L ') + " L " + svg2.join(' L ') + " z"; // console.log(d); // var d = "m 0,-30 L 0,-29 L 29,0 L 30,0 z"; var shape = this._ez3D.svgPathToShape(d); var g = this._ez3D.createExtrusion(shape); var angle = this._ez3D.createMesh(g, material, false, false);// lame complete angle.scale.set(1, 1, -1.28); angle.position.set(center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_taverse, -0.32); this.group.add(angle); var angle2 = this._ez3D.createMesh(g, material, false, false);// lame complete angle2.scale.set(1, 1, 1.28); angle2.position.set(center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_taverse, 0.32); this.group.add(angle2); var posi = [decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, bottom_taverse + this.data.height / 2 - center]; dto.push({ typecolor: "arche", type: "Plat cintré à coller", w: largeur_montant_vert, h: largeur_montant_vert, x: posi[0], y: posi[1], svg: d }); // lame bas continue; } if (traverses[j] == -2) { // DOME var pos_traverse = (this.data.height - this.tech.epaisseur_cadre * 2) * prev / 100; var svg = []; var svg2 = []; var extray = 0; var precision = 100; var dim = largeur_montant_vert - 0.01; var dim2 = largeur_montant_vert + 2.5; var dimy = largeur_montant_vert - 0.01 + extray; var dimy2 = largeur_montant_vert + 2.5 + extray; bottom_taverse -= this.tech.epaisseur_montants / 2 + extray; for (var ics = 0; ics <= precision; ics++) { var x = Math.sin((ics / precision) * Math.PI / 2) * dim; var y = Math.cos((ics / precision) * Math.PI / 2) * dimy; if (i % 2 == 0) { x = dim - x; } svg.push(Math.round(x * 1000) / 1000 + ',' + Math.round(y * 1000) / 1000); var x2 = Math.sin((ics / precision) * Math.PI / 2) * dim2; var y2 = Math.cos((ics / precision) * Math.PI / 2) * dimy2; if (x2 > largeur_montant_vert) x2 = largeur_montant_vert; if (x2 < 0) x2 = 0; if (y2 > largeur_montant_vert + extray) y2 = largeur_montant_vert + extray; if (y2 < 0) y2 = 0; if (i % 2 == 0) { x2 = dim - x2; } svg2.unshift(Math.round(x2 * 1000) / 1000 + ',' + Math.round(y2 * 1000) / 1000); } var d = "m " + svg.join(' L ') + " L " + svg2.join(' L ') + " z"; var shape = this._ez3D.svgPathToShape(d); var g = this._ez3D.createExtrusion(shape); // === ANGLE HAUT GAUCHE === var angle = this._ez3D.createMesh(g, material, false, false); angle.scale.set(1, 1, -1.28); angle.position.set( center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_taverse, -0.32 ); this.group.add(angle); // === ANGLE HAUT DROIT === var angle2 = this._ez3D.createMesh(g, material, false, false); angle2.scale.set(1, 1, 1.28); angle2.position.set( center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_taverse, 0.32 ); this.group.add(angle2); // === POSITION AJUSTÉE POUR LES ANGLES BAS === //var bottom_angle_bas = this.tech.epaisseur_cadre * 2 + decalagevertical + this.tech.epaisseur_montants; var bottom_angle_bas = this.tech.epaisseur_cadre - ( this.data.height - this.data.start) /2 + largeur_montant_vert; console.log('bottom_angle_bas', bottom_angle_bas) // === ANGLE BAS GAUCHE (TOUT EN BAS DU SCHÉMA, MAIS AJUSTÉ) === var angleBas1 = this._ez3D.createMesh(g, material, false, false); angleBas1.scale.set(1, -1, -1.28); // symétrie verticale angleBas1.position.set( center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_angle_bas, -0.32 ); this.group.add(angleBas1); // === ANGLE BAS DROIT (TOUT EN BAS DU SCHÉMA, MAIS AJUSTÉ) === var angleBas2 = this._ez3D.createMesh(g, material, false, false); angleBas2.scale.set(1, -1, 1.28); // symétrie verticale angleBas2.position.set( center_traverse + decalagevertical + (-0.5) * largeur_montant_vert, bottom_angle_bas, 0.32 ); this.group.add(angleBas2); var posi = [ decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, bottom_taverse + this.data.height / 2 - center ]; dto.push({ typecolor: "arche", type: "Plat cintré à coller", w: largeur_montant_vert, h: largeur_montant_vert, x: posi[0], y: posi[1], svg: d }); continue; } if (traverses[j] == -3) { // NEO ARCHE var pos_traverse = (this.data.height - this.tech.epaisseur_cadre * 2) * prev / 100; var svg = []; var svg2 = []; var precision = 100; // Rayon de l’arche (horizontal = largeur / 2) var rayonX = largeur_montant_vert / 2; // Rayon vertical : ajusté pour avoir un vrai demi-cercle var rayonY = rayonX; var extrudeDepth = 2.5; for (var ics = 0; ics <= precision; ics++) { var angle = Math.PI - (ics / precision) * Math.PI; // de PI à 0 (180° à 0°) // Points intérieurs var x = Math.cos(angle) * rayonX; var y = Math.sin(angle) * rayonY; svg.push((Math.round(x * 1000) / 1000) + ',' + (Math.round(y * 1000) / 1000)); // Points extérieurs (un peu plus large) var x2 = Math.cos(angle) * (rayonX + extrudeDepth); var y2 = Math.sin(angle) * (rayonY + extrudeDepth); svg2.unshift((Math.round(x2 * 1000) / 1000) + ',' + (Math.round(y2 * 1000) / 1000)); } var d = "m " + svg.join(' L ') + " L " + svg2.join(' L ') + " z"; var shape = this._ez3D.svgPathToShape(d); var g = this._ez3D.createExtrusion(shape); // Position verticale // var bottom_taverse = pos_traverse - rayonY - this.tech.epaisseur_montants / 2; var marginTop = 2; bottom_taverse -= rayonY + this.tech.epaisseur_montants / 2 + marginTop; var angle = this._ez3D.createMesh(g, material, false, false); angle.scale.set(1, 1, -1.28); angle.position.set( center_traverse + decalagevertical, bottom_taverse, -0.32 ); this.group.add(angle); var angle2 = this._ez3D.createMesh(g, material, false, false); angle2.scale.set(1, 1, 1.28); angle2.position.set( center_traverse + decalagevertical, bottom_taverse, 0.32 ); this.group.add(angle2); var posi = [ decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, bottom_taverse + this.data.height / 2 - center, ]; dto.push({ typecolor: "arche", type: "Demi-cercle complet", w: largeur_montant_vert, h: largeur_montant_vert, x: posi[0], y: posi[1], svg: d }); continue; } if (traverses[j] == -4) { //ONDE var pos_traverse = (this.data.height - this.tech.epaisseur_cadre * 2) * prev / 100; var precision = 100; var rayonX = largeur_montant_vert / 2; var rayonY = rayonX; var extrudeDepth = 2.5; // === DEMI-CERCLE HAUT === var svgHaut = [], svg2Haut = []; for (var ics = 0; ics <= precision; ics++) { var angle = Math.PI - (ics / precision) * Math.PI; var x = Math.cos(angle) * rayonX; var y = Math.sin(angle) * rayonY; svgHaut.push((x.toFixed(3)) + ',' + (y.toFixed(3))); var x2 = Math.cos(angle) * (rayonX + extrudeDepth); var y2 = Math.sin(angle) * (rayonY + extrudeDepth); svg2Haut.unshift((x2.toFixed(3)) + ',' + (y2.toFixed(3))); } var dHaut = "m " + svgHaut.join(' L ') + " L " + svg2Haut.join(' L ') + " z"; var shapeHaut = this._ez3D.svgPathToShape(dHaut); var gHaut = this._ez3D.createExtrusion(shapeHaut); var marginTop = 2; bottom_taverse -= rayonY + this.tech.epaisseur_montants / 2 + marginTop; var haut1 = this._ez3D.createMesh(gHaut, material, false, false); haut1.scale.set(1, 1, -1.28); haut1.position.set(center_traverse + decalagevertical, bottom_taverse, -0.32); this.group.add(haut1); var haut2 = this._ez3D.createMesh(gHaut, material, false, false); haut2.scale.set(1, 1, 1.28); haut2.position.set(center_traverse + decalagevertical, bottom_taverse, 0.32); this.group.add(haut2); // DTO haut var posiHaut = [ decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, bottom_taverse + this.data.height / 2 - center, ]; dto.push({ typecolor: "arche", type: "Demi-cercle haut", w: largeur_montant_vert, h: largeur_montant_vert, x: posiHaut[0], y: posiHaut[1], svg: dHaut }); // === DEMI-CERCLE BAS === var svgBas = [], svg2Bas = []; for (var ics = 0; ics <= precision; ics++) { var angle = (ics / precision) * Math.PI; var x = Math.cos(angle) * rayonX; var y = (rayonY + extrudeDepth)-Math.sin(angle) * rayonY; // inversé pour bas svgBas.push((x.toFixed(3)) + ',' + (y.toFixed(3))); var x2 = Math.cos(angle) * (rayonX + extrudeDepth); var y2 = (rayonY + extrudeDepth) -Math.sin(angle) * (rayonY + extrudeDepth); svg2Bas.unshift((x2.toFixed(3)) + ',' + (y2.toFixed(3))); } var dBas = "m " + svgBas.join(' L ') + " L " + svg2Bas.join(' L ') + " z"; var shapeBas = this._ez3D.svgPathToShape(dBas); var gBas = this._ez3D.createExtrusion(shapeBas); // Position en bas du cadre // var posYBas = this.tech.epaisseur_cadre + this.tech.epaisseur_montants / 2 + 0.01; //var posYBas = this.tech.epaisseur_cadre * 2 + decalagevertical + this.tech.epaisseur_montants; var posYBas = this.tech.epaisseur_cadre - ( this.data.height - this.data.start) /2 ; var bas1 = this._ez3D.createMesh(gBas, material, false, false); bas1.scale.set(1, 1, -1.28); bas1.position.set(center_traverse + decalagevertical, posYBas, -0.32); this.group.add(bas1); var bas2 = this._ez3D.createMesh(gBas, material, false, false); bas2.scale.set(1, 1, 1.28); bas2.position.set(center_traverse + decalagevertical, posYBas, 0.32); this.group.add(bas2); // DTO bas var posiBas = [ decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, posYBas + this.data.height / 2 - center, ]; dto.push({ typecolor: "arche", type: "Demi-cercle bas", w: largeur_montant_vert, h: largeur_montant_vert, x: posiBas[0], y: posiBas[1], svg: dBas }); continue; } prev = traverses[j]; //position taverse var pos_traverse = (this.data.height - this.tech.epaisseur_cadre * 2 + this.tech.epaisseur_montants) * traverses[j] / 100; var bottom_taverse = bottom + this.tech.epaisseur_cadre + pos_traverse - this.tech.epaisseur_montants / 2; if (!reverse || i == 0) // si on est en inversé , on fusionne les traverses { var box = this._ez3D.createMesh(traverse, material, true, true);// lame complete box.position.set(center_traverse + decalagevertical + real_long_traverse / 2 - long_traverse / 2, bottom_taverse, 0); var posi = [decalageverticaldto + this.tech.epaisseur_cadre + ecart_total * i, box.position.y - this.tech.epaisseur_montants / 2 + this.data.height / 2 - center]; dto.push({ type: "Traverse", typecolor: "traverse", w: real_long_traverse, h: this.tech.epaisseur_montants, x: posi[0], y: posi[1] }); // lame bas this.group.add(box); } nb_traverses++; } nb_montants_total++; center_traverse += ecart_total; } // affichage du verre } // fin bloucles verrieres en plusieurs parties var material = this._ez3D.createPanelMat(color_montants, true); var verre = this._ez3D.createBox(this.data.width - this.tech.epaisseur_cadre * 2, this.data.height - this.tech.epaisseur_cadre * 2 - decallage_montants, 0.68); var box = this._ez3D.createMesh(verre, material_verre, true, true);// lame complete box.position.set(0, center + decallage_montants / 2, 0); this.group.add(box); if (!this.group.sihouette) { var d = "m 28,55 -2.3,1.58 -1.6,2.93 -6.12,43.8 -1.2,2 0.13,1.73 V 108.24 l 5.99,40.07 1.33,-0.4 0.67,2.8 0.93,0.93 1.86,-0.53 1.6,5.33 2.66,3.33 -1.2,15.04 v 28.89 l 0.53,11.32 3.06,24.36 6.39,29.69 -2,3.2 0.67,7.19 1.73,-0.67 -0.4,1.2 -6.66,5.72 -7.06,3.33 -0.27,1.86 -0.53,0.93 5.86,1.07 11.32,-0.13 6.26,-3.06 4.66,0.67 6.12,-2.13 -0.4,-3.2 -0.8,-0.27 0.93,-1.07 -0.4,-3.59 -2.93,-3.59 1.07,-1.86 -0.27,-5.86 -2.13,-4.26 -1.46,-38.61 -2.93,-9.19 3.59,-14.25 -0.13,-5.72 6.92,-24.63 1.86,8.65 1.73,17.31 0.13,59.78 -3.86,15.84 -0.4,2.26 0.8,3.2 2.13,-0.8 -0.53,3.99 0.53,3.06 -0.27,2.8 -0.13,1.6 0.67,0.67 -0.93,1.6 2,0.93 12.78,0.13 4.26,-1.07 -0.27,-1.73 -1.33,-0.67 0.93,-0.27 -2.66,-4.26 -2.13,-4.53 0.13,-1.6 2.66,-3.99 1.2,-3.73 1.86,-3.46 0.13,-3.33 1.07,-2.53 1.33,-19.84 0.4,-22.63 4.39,-45.13 1.86,-16.11 1.6,-4.39 v -3.06 h 1.33 0.67 l 0.53,-3.99 3.59,-0.67 0.93,-39.14 1.6,-2.53 -1.33,-2.8 L 98.79,82.15 97.34,64.64 95.34,55.62 93.97,54.32 91.4,53.54 74.92,49.17 71.66,47.23 l -1.9,-2.23 0.04,-2.53 1.79,-3.98 1.4,-0.68 0.53,-1.26 2.86,-4.76 0.04,-1.17 2.38,-4.66 -0.44,-5.05 -2.29,-4.66 -3.26,-4.08 -5.4,-3.01 -5.3,-1.36 -4.62,-0.1 -3.55,1.07 -3.45,3.98 -1.71,3.11 -1.03,3.69 -0.05,7.97 -0.93,1.26 0.14,1.26 1.4,1.85 0.53,3.3 1.7,1.36 0.72,4.86 -0.64,4.08 -3.07,3.69 z"; var shape = this._ez3D.svgPathToShape(d); var g = this._ez3D.createExtrusion(shape); g.translate(-55, -294, 0); var gris = this._ez3D.createPanelMat({ Color: 'CCCCCC', basic: true, TextureId: 0, tex: false, texture: false, Reflectivity: 0.5 }); this.group.sihouette = this._ez3D.createMesh(g, gris, false, false);// lame complete this.group.sihouette.inexport = false; this.group.sihouette.inexport_info = 'silhouette'; this.group.sihouette.scale.y = -0.58; this.group.sihouette.scale.x = 0.58; this.group.sihouette.position.set(0, floor, -150); this.group.add(box); } this.group.sihouette.position.set(0, floor, -150); if (this.data.baie == '1sideR') this.group.sihouette.position.set(this.data.width / 2 - 5, floor, -50); //decalage du centre de 50 cm pour améliorer le visuel if (this.data.baie == '1sideL') this.group.sihouette.position.set(-this.data.width / 2 + 5, floor, -50); //decalage du centre de 50 cm pour améliorer le visuel this.group.add(this.group.sihouette); this.group.sihouette.inexport = false; this.group.sihouette.inexport_info = 'silhouette'; if (updatescene) { window.currentStore.s3d.update("ground", this.data.height + this.data.start, this.tech.profondeur, this.data.width, reposcamera, this.data); } // creation liste technique for (var idto = 0; idto < dto.length; idto++) { if (!dto[idto].ref) dto[idto].ref = this.data.color_montants_texte; dto[idto].x = Math.round(dto[idto].x * 10); // passage en mm dto[idto].y = Math.round(dto[idto].y * 10); dto[idto].w = Math.round(dto[idto].w * 10); dto[idto].h = Math.round(dto[idto].h * 10); } this.data.dto = dto; //console.log(dto); //console.log(this.data); // calcul du prix //console.log('DETAILS DU PRIX : '); if (this.data.color_verre == 1023) { prixTTC = 225; // console.log('Base dépoli : ', 225); prixTTC += 400 * this.data.height / 100 * this.data.width / 100; // console.log('Dimesnions dépoli : ', "400 * this.data.height / 100 * this.data.width / 100", 400 * this.data.height / 100 * this.data.width / 100); } else { var prixTTC = 216; //console.log('Base normal : ',216); prixTTC += 384 * this.data.height / 100 * this.data.width / 100; //console.log('Dimesnions normal : ', "384 * this.data.height / 100 * this.data.width / 100",384 * this.data.height / 100 * this.data.width / 100); } prixTTC += nb_traverses * 48; console.log('Ajout traverses : ','nb_traverses ('+nb_traverses+') + * 48',nb_traverses * 48 , prixTTC); if (this.data.design == 6) { prixTTC += nb_traverses * 105; // console.log('Ajout Arches : ','nb_traverses ('+nb_traverses+') + * 105',nb_traverses * 105); } if (this.data.design == 7) { prixTTC += nb_traverses * 2 * 105; } if (this.data.design == 8) { prixTTC += nb_traverses * 48; prixTTC += (nb_traverses * 2) * 105; } if (this.data.design == 9) { prixTTC += nb_traverses * 48; console.log('Ajout traverses 2 : ','nb_traverses ('+nb_traverses+') + * 48',nb_traverses * 48 , prixTTC); prixTTC += (nb_traverses *2 *2) * 105; } /* if (this.data.design == 'classic') { prixTTC += 540 * this.data.height/100 * this.data.partwidth/100; for (var i =0; i< niches.length ; i++) { if (niches[i].size == 1) prixTTC += 156; if (niches[i].size == 2) prixTTC += 168; } } else { prixTTC += 600 * this.data.height/100 * this.data.partwidth/100; for (var i =0; i< niches.length ; i++) { if (niches[i].size == 1) prixTTC += 156; if (niches[i].size == 2) prixTTC += 168; } }*/ this._totalPriceExVAT = prixTTC / 1.2; this.source.updateFacadePrice(Math.round(this._totalPriceExVAT * 100) / 100, 0); `;