//sketch_3D_Catalog_01 ケーブルグランド void setup() { size(400, 400, P3D); } void draw() { background(255, 255, 255); lights(); ortho(-width/2, width/2, -height/2, height/2); // Same as ortho() translate(width / 2, height / 2); rotateY(map(mouseX, 0, width, -PI/1, PI/1)); rotateX(map(mouseY, 0, height, PI/1, -PI/1)); //noStroke(); strokeWeight(0.1); fill(255, 255, 255); scale(4, 4,4); pushMatrix(); Catalog_01_1(16,20.5,15,5,19,3.4,2.9);//ケーブルグランド本体 translate(0,0,25); Z_Pipe(12,8,5.2);//ケーブルグランド固定ナット popMatrix(); } //ケーブルグランド本体 void Catalog_01_1(float M,float D1,float L1,float L2,float L3,float L4,float L5) { int Sn=9;//面数 int Pn=17;//ポイント数 float[][] X=new float[Sn][Pn]; float[][] Y=new float[Sn][Pn]; float[] Z=new float[Sn]; int i; Z[0]=L1; Z[1]=0; Z[2]=0; Z[3]=-L2; Z[4]=-L2; Z[5]=-L2-L4; Z[6]=-L2-L4; Z[7]=-L2-L3+L5; Z[8]=-L2-L3; for(i=0;i