//sketch_3D_Z_Bolt_D 台形頭ボルト(アイボルト合成用) 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); Bolt_D(8,15.25,12.5,27);//台形頭ボルト(アイボルト合成用)(M16) } void Bolt_D(float r,float R,float H,float L)//台形頭ボルト(アイボルト合成用) { int Sn=4;//面数 int Pn=17;//ポイント数 float[][] X=new float[Sn][Pn]; float[][] Y=new float[Sn][Pn]; float[] Z=new float[Sn]; int i; float R0=R-H*tan(PI*(90-82)/180); Z[0]=H; Z[1]=0; Z[2]=0; Z[3]=-L; for(i=0;i