Ooops!
Export
∫
÷
Fond
(niche+)
(niche-)
function getParameterDefinitions(){return[ { name: 'h', type: 'float', initial: 10, caption:'Profondeur:'} ,{ name: 'l', type: 'float', initial: 4, caption:'Epaisseur:'} ,{ name: 'w', type: 'text', initial:'[["p","P0",10,10],["p","P1",-10,10],["p","P2",-10,-10],["p","P3",10,-10],["p","P4",5,5],["p","P5",-5,5],["p","P6",-5,-5],["p","P7",5,-5],["b","P4P5_0",5,10,"P4"],["b","P4P5_1",-5,0,"P5"],["n","P0,P1,P2,P3"],["n","P4,P5,P6,P7"]]', caption: '(w)'} ,{ name: 'ech', type: 'float', initial: 0.25, caption:'Echelle:'} ,{ name: 'rx', type: 'float', initial: 180, caption:'Rotation X:'} ,{ name: 'rendu', type : 'choice', caption:'Rendu:', values:['3d','2d'], captions:['3d','2d']} ];} class Pt { constructor(id, x, y, idP) { this.x = x; this.y = y; this.id = id; if(idP !== undefined)this.idP = idP; } get p(){ return {x:this.x, y:this.y}; } } function nomme2Pts(id1, id2){return id1 < id2 ? id1 + id2 : id2 + id1;} function chercheId(T, id){ var i, r = -1; for(i=0;i
0){ if(params.rendu == '3d') csgBase.push(r.rectangularExtrude(params.l,params.h,16,true)) else csgBase.push(r.expandToCAG(params.h, 16)); } } R = csg[0]; if(csg.length>1){ csg.shift(); R = R.subtract(csg); } if(params.rendu == '3d') return R.extrude({offset:[0,0,params.h]}).union(csgBase).scale(0.25).lieFlat().rotateX(180) else{ R = center(true, R.union(csgBase)); R = R.rotateZ(params.rx+0); b = R.getBounds(); R = R.translate([-b[0].x, -b[0].y]); return R.scale(params.ech); } }