completed cards, bread, wheels, overall layout

main
xenofem 2022-07-26 20:05:39 -04:00
commit d9e6709b6e
9 changed files with 298 additions and 0 deletions

28
blades.asy Normal file
View File

@ -0,0 +1,28 @@
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/2;
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);

28
bread.asy Normal file
View File

@ -0,0 +1,28 @@
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 a = height*7/12;
real b = a/2;
real angle = 60;
real slash_a = a/11;
real slash_b = b*5/8;
real slash_angle = angle-15;
real slash_spacing = a*5/12;
pair center = (0,0);
path loaf = (center+a*dir(angle))..(center+b*dir(angle+90))..(center+a*dir(angle+180))..(center+b*dir(angle+270))..cycle;
path slash = (center+slash_b*dir(slash_angle+90))..(center+slash_a*dir(slash_angle+180))..(center+slash_b*dir(slash_angle+270))--(center+slash_b*dir(slash_angle+270))..(center+slash_a*dir(slash_angle))..(center+slash_b*dir(slash_angle+90))--cycle;
//draw((-width/2,-height/2)--(width/2,-height/2)--(width/2,height/2)--(-width/2,height/2)--cycle);
path[] bread = loaf^^slash^^(shift(slash_spacing*dir(angle))*slash)^^(shift(slash_spacing*dir(angle+180))*slash);
//draw(bread, evenodd+red);

106
cards.asy Normal file
View File

@ -0,0 +1,106 @@
import "scaling.asy" as scaling;
import "puppets.asy" as puppets_suit;
import "bread.asy" as bread_suit;
import "chairs.asy" as chairs_suit;
import "blades.asy" as blades_suit;
import "wheels.asy" as wheels_suit;
import "numerals.asy" as numerals_paths;
real corner_radius = width/10;
path corner = arc(((width/2 - corner_radius), (height/2 - corner_radius)), corner_radius, 0, 90);
path card = corner--reverse(reflect((0,0), (0,1))*corner)--rotate(180)*corner--reverse(reflect((0,0), (1,0))*corner)--cycle;
real scpx = 0.2;
real scpy = 0.35;
pair placements[][] = {
// 0
{},
// 1
{ (0,0) },
// 2
{ (0,height*scpy), (0,-height*scpy) },
// 3
{ (0,0), (0,height*scpy), (0,-height*scpy) },
// 4
{ (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy) },
// 5
{ (0,0), (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy) },
// 6
{ (width*scpx,0), (-width*scpx,0), (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy) },
// The four face cards
{}, {}, {}, {},
/* Forgot the deck doesn't have numbers past 6 lol
// 7
{ (0,-height*scpy/2), (width*scpx,0), (-width*scpx,0), (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy) },
// 8
{ (0, height*scpy/2), (0,-height*scpy/2), (width*scpx,0), (-width*scpx,0), (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy) },
// 9
{ (0,0), (width*scpx,height*scpy), (width*scpx,-height*scpy), (-width*scpx,height*scpy), (-width*scpx,-height*scpy), (width*scpx,height*scpy/3), (width*scpx,-height*scpy/3), (-width*scpx,height*scpy/3), (-width*scpx, -height*scpy/3) },
*/
};
real scale_factor = 0.15;
real one_scale_factor = 0.3;
real numeral_scale_factor = 0.15;
pair numeral_pos = (-width*0.39, height*0.37);
real indicator_scale_factor = 0.1;
pair indicator_pos = (-width*0.39, height*0.22);
int PUPPETS = 0;
int BREAD = 1;
int CHAIRS = 2;
int BLADES = 3;
int WHEELS = 4;
int CARDS = 5;
path icons[][] = {
null,
bread,
null,
null,
wheel,
};
path[] recursive_card(int value, int suit, int depth=3, bool outermost=true) {
path result[];
if (!outermost) {
result.push(card);
}
path[] suit_icon;
if (suit == CARDS) {
if (depth == 0) { return result; }
suit_icon = recursive_card(value, suit, depth - 1, false);
} else {
suit_icon = icons[suit];
}
path[] indicator = shift(indicator_pos)*scale(indicator_scale_factor)*suit_icon;
path[] numeral = shift(numeral_pos)*scale(numeral_scale_factor)*numerals[value];
result = result^^indicator^^(rotate(180)*indicator)^^numeral^^(rotate(180)*numeral);
real current_scale_factor = scale_factor;
if (value == 1) {
current_scale_factor = one_scale_factor;
}
for(int i = 0; i < placements[value].length; ++i) {
result = result^^(shift(placements[value][i])*scale(current_scale_factor)*suit_icon);
}
return result;
}
filldraw(card, white, black);
fill(recursive_card(2, BREAD), evenodd+red);

28
chairs.asy Normal file
View File

@ -0,0 +1,28 @@
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/2;
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);

22
numerals.asy Normal file
View File

@ -0,0 +1,22 @@
import "scaling.asy" as scaling;
path numerals[][] = { {} };
path onearc = arc((0,height*0.4), height*0.1, 0, 180);
path[] one = { onearc--(rotate(180)*onearc)--cycle };
numerals.push(one);
path[] two = { shift(width/4, 0)*one[0], shift(-width/4, 0)*one[0] };
numerals.push(two);
path[] three;
numerals.push(three);
path[] four;
numerals.push(four);
path[] five = { (0,-height*0.3)---(width*0.45,height/2)..(width/2, height*0.45)---(height*0.1, -height*0.45)..(-height*0.1, -height*0.45)---(-width/2, height*0.45)..(-width*0.45,height/2)--cycle };
numerals.push(five);
path[] six;
numerals.push(six);

28
puppets.asy Normal file
View File

@ -0,0 +1,28 @@
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/2;
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);

2
scaling.asy Normal file
View File

@ -0,0 +1,2 @@
real height = 300;
real width = height*5/7;

28
swords.asy Normal file
View File

@ -0,0 +1,28 @@
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/2;
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);

28
wheels.asy Normal file
View File

@ -0,0 +1,28 @@
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/2;
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);