class segment{ float centerx,centery,innerradius, outerradius, startangle, endangle; color c; segment(){ centerx=centery=innerradius=outerradius=startangle=endangle=0.0f; } segment(float cx, float cy, float ir, float or, float sa, float ea){ centerx=cx; centery=cy; innerradius=ir; outerradius=or; startangle=sa; endangle=ea; int grayvalue=int(random(120)); c=color(grayvalue*random(1.0,min(5.0,(grayvalue==0)?1.0:255.0/grayvalue)),grayvalue, grayvalue); } void linedraw(){ float p1x,p1y,p2x,p2y,p3x,p3y,p4x,p4y; p1x=centerx+innerradius*cos(startangle); p1y=centery+innerradius*sin(startangle); p2x=centerx+outerradius*cos(startangle); p2y=centery+outerradius*sin(startangle); p3x=centerx+innerradius*cos(endangle); p3y=centery+innerradius*sin(endangle); p4x=centerx+outerradius*cos(endangle); p4y=centery+outerradius*sin(endangle); line(p1x,p1y,p2x,p2y); line(p3x,p3y,p4x,p4y); arc(centerx, centery, innerradius, innerradius, startangle, endangle); arc(centerx, centery, outerradius, outerradius, startangle, endangle); } void polydraw(){ fill(c); int steps=round(abs(endangle-startangle)/radians(5.0f)); float da=(endangle-startangle)/steps; beginShape(POLYGON); vertex(centerx+innerradius*cos(startangle),centery+innerradius*sin(startangle)); for (int i=0;i