From d9e6709b6eddb0fe80ef39f97914cff4a111fbee Mon Sep 17 00:00:00 2001 From: xenofem Date: Tue, 26 Jul 2022 20:05:39 -0400 Subject: [PATCH] completed cards, bread, wheels, overall layout --- blades.asy | 28 ++++++++++++++ bread.asy | 28 ++++++++++++++ cards.asy | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++ chairs.asy | 28 ++++++++++++++ numerals.asy | 22 +++++++++++ puppets.asy | 28 ++++++++++++++ scaling.asy | 2 + swords.asy | 28 ++++++++++++++ wheels.asy | 28 ++++++++++++++ 9 files changed, 298 insertions(+) create mode 100644 blades.asy create mode 100644 bread.asy create mode 100644 cards.asy create mode 100644 chairs.asy create mode 100644 numerals.asy create mode 100644 puppets.asy create mode 100644 scaling.asy create mode 100644 swords.asy create mode 100644 wheels.asy diff --git a/blades.asy b/blades.asy new file mode 100644 index 0000000..e7c574b --- /dev/null +++ b/blades.asy @@ -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); diff --git a/bread.asy b/bread.asy new file mode 100644 index 0000000..be1de39 --- /dev/null +++ b/bread.asy @@ -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); diff --git a/cards.asy b/cards.asy new file mode 100644 index 0000000..e8d1022 --- /dev/null +++ b/cards.asy @@ -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); + diff --git a/chairs.asy b/chairs.asy new file mode 100644 index 0000000..e7c574b --- /dev/null +++ b/chairs.asy @@ -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); diff --git a/numerals.asy b/numerals.asy new file mode 100644 index 0000000..d7ef100 --- /dev/null +++ b/numerals.asy @@ -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); diff --git a/puppets.asy b/puppets.asy new file mode 100644 index 0000000..e7c574b --- /dev/null +++ b/puppets.asy @@ -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); diff --git a/scaling.asy b/scaling.asy new file mode 100644 index 0000000..de03c6e --- /dev/null +++ b/scaling.asy @@ -0,0 +1,2 @@ +real height = 300; +real width = height*5/7; diff --git a/swords.asy b/swords.asy new file mode 100644 index 0000000..e7c574b --- /dev/null +++ b/swords.asy @@ -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); diff --git a/wheels.asy b/wheels.asy new file mode 100644 index 0000000..e7c574b --- /dev/null +++ b/wheels.asy @@ -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);