29 lines
900 B
Plaintext
29 lines
900 B
Plaintext
import "scaling.asy" as scaling;
|
|
|
|
//real x = width/3;
|
|
//real y = 2*height/6;
|
|
|
|
//path bread = (x,0){right}..{up}(width, height-y){up}..{left}(width-x, height){left}..{down}(0,y){down}..{right}cycle;
|
|
|
|
real outer_radius = height*0.42;
|
|
real inner_radius = outer_radius*4/5;
|
|
real center_radius = outer_radius/5;
|
|
real axle_radius = center_radius/2;
|
|
|
|
int gaps = 6;
|
|
real spoke_width = center_radius*0.7;
|
|
|
|
path spoke_part = (spoke_width/2, 0)--(spoke_width/2, outer_radius);
|
|
|
|
path gap = buildcycle(circle((0,0), center_radius), spoke_part, reverse(circle((0,0), inner_radius)), reflect((0,0), dir(90-180/gaps))*spoke_part);
|
|
|
|
//draw((-width/2,-height/2)--(width/2,-height/2)--(width/2,height/2)--(-width/2,height/2)--cycle);
|
|
|
|
path wheel[] = { circle((0,0), outer_radius), circle((0,0), axle_radius) };
|
|
|
|
for (int i = 0; i < gaps; ++i) {
|
|
wheel = wheel^^(rotate(360*i/gaps)*gap);
|
|
}
|
|
|
|
//fill(wheel, evenodd+red);
|