sketch_3D_My_OB1_2タグのスケッチ
 sketch_3D_My_OB1_1タグのスケッチは以下となります。
//sketch_3D_My_OB2
My_OB01 OB01;//使用クラスの定義
void setup()
{
  size(400, 400, P3D);
  OB01=new My_OB01();//My_OBクラスのオブジェクトを生成
}
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.5);
    
  fill(255, 255, 255);
  scale(1,1,1);
  OB01.OB01_01_1();//ユニット01-項番01-品番1
}
(1)上記スケッチにおいて、画像を発生するコードはOB01.OB01_01_1();です。
(2)OB01.OB01_01_1();には引数が無く固定データです。
(3)OB01はユニット名です。
(4)_01は項番です。
(5)_1は品番です。
(6)項番は品番の組合せで構成され、ユニットは項番の組合せで構成されます。
(7)個々の品番は単純形状ですが、組み合わせると複雑な形状になります。
My_OBタグのスケッチ
 My_OBタグのスケッチは以下となります。
class My_OB
{
  void STD_02(float W,float T,float L,float R)//STD_02)ベース
  {
    int Pn=17;//ポイント数
    int Pn2=5;//ポイント数
    float[] X=new float[Pn];
    float[] Z=new float[Pn];
    float[] X1=new float[Pn];
    float[] Z1=new float[Pn];
    float[] X2=new float[Pn2];
    float[] Z2=new float[Pn2];
    int i;
    
    for(i=0;i<Pn;i++)
    {
      float angle = i*TWO_PI/(Pn-1);
      X1[i]=R*cos(angle);Z1[i]=R*sin(angle);
    }
    
    X2[0]=W/2;Z2[0]=W/2;
    X2[1]=-W/2;Z2[1]=W/2;
    X2[2]=-W/2;Z2[2]=-W/2;
    X2[3]=W/2;Z2[3]=-W/2;
    X2[4]=W/2;Z2[4]=W/2;
    beginShape();
    Y_Polyon_PY(Pn2,X2,T/2,Z2);//多角形
    for(i=0;i<Pn;i++){X[i]=X1[i]+L/2;Z[i]=Z1[i]+L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]-L/2;Z[i]=Z1[i]+L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]-L/2;Z[i]=Z1[i]-L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]+L/2;Z[i]=Z1[i]-L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,T/2,Z);//多角形
    endContour();
    endShape(CLOSE);
    
    beginShape();
    Y_Polyon_PY(Pn2,X2,-T/2,Z2);//多角形
    for(i=0;i<Pn;i++){X[i]=X1[i]+L/2;Z[i]=Z1[i]+L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,-T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]-L/2;Z[i]=Z1[i]+L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,-T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]-L/2;Z[i]=Z1[i]-L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,-T/2,Z);//多角形
    endContour();
    for(i=0;i<Pn;i++){X[i]=X1[i]+L/2;Z[i]=Z1[i]-L/2;}
    beginContour();
    Y_Polyon_MY(Pn-1,X,-T/2,Z);//多角形
    endContour();
    endShape(CLOSE);
    
    pushMatrix();
    translate(L/2,0,L/2);
    Y_Side(Pn,X1,Z1,T);//側面
    translate(-L,0,0);
    Y_Side(Pn,X1,Z1,T);//側面
    translate(0,0,-L);
    Y_Side(Pn,X1,Z1,T);//側面
    translate(L,0,0);
    Y_Side(Pn,X1,Z1,T);//側面
    popMatrix();
    
    Y_Side(Pn2,X2,Z2,T);//側面  
  }
}
(1)穴開けが以外と厄介です。
(2)穴開けがなければ、box()が使えるので簡単です。