2022-07-26 20:05:39 -04:00
|
|
|
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;
|
|
|
|
|
2022-07-27 02:55:21 -04:00
|
|
|
real corner_radius = width/12;
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2022-07-27 02:55:21 -04:00
|
|
|
transform placements[][] = {
|
2022-07-26 20:05:39 -04:00
|
|
|
// 0
|
|
|
|
{},
|
|
|
|
|
|
|
|
// 1
|
2022-07-27 02:55:21 -04:00
|
|
|
{ identity },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 2
|
2022-07-27 02:55:21 -04:00
|
|
|
{ shift(0,height*scpy), shift(0,-height*scpy)*rotate(180) },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 3
|
2022-07-27 02:55:21 -04:00
|
|
|
{ identity, shift(0,height*scpy), shift(0,-height*scpy)*rotate(180) },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 4
|
2022-07-27 02:55:21 -04:00
|
|
|
{ shift(width*scpx,height*scpy), shift(width*scpx,-height*scpy)*rotate(180), shift(-width*scpx,height*scpy), shift(-width*scpx,-height*scpy)*rotate(180) },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 5
|
2022-07-27 02:55:21 -04:00
|
|
|
{ identity, shift(width*scpx,height*scpy), shift(width*scpx,-height*scpy)*rotate(180), shift(-width*scpx,height*scpy), shift(-width*scpx,-height*scpy)*rotate(180) },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 6
|
2022-07-27 02:55:21 -04:00
|
|
|
{ shift(width*scpx,0), shift(-width*scpx,0), shift(width*scpx,height*scpy), shift(width*scpx,-height*scpy)*rotate(180), shift(-width*scpx,height*scpy), shift(-width*scpx,-height*scpy)*rotate(180) },
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
// 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;
|
2022-07-27 02:55:21 -04:00
|
|
|
real one_scale_factor = 0.4;
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
real numeral_scale_factor = 0.15;
|
2022-07-27 02:55:21 -04:00
|
|
|
pair numeral_pos = (-width*0.38, height*0.4);
|
2022-07-26 20:05:39 -04:00
|
|
|
real indicator_scale_factor = 0.1;
|
2022-07-27 02:55:21 -04:00
|
|
|
pair indicator_pos = (-width*0.38, height*0.25);
|
2022-07-26 20:05:39 -04:00
|
|
|
|
|
|
|
int PUPPETS = 0;
|
|
|
|
int BREAD = 1;
|
|
|
|
int CHAIRS = 2;
|
|
|
|
int BLADES = 3;
|
|
|
|
int WHEELS = 4;
|
|
|
|
int CARDS = 5;
|
|
|
|
|
|
|
|
path icons[][] = {
|
2022-07-27 02:55:21 -04:00
|
|
|
{},
|
2022-07-26 20:05:39 -04:00
|
|
|
bread,
|
2022-07-27 02:55:21 -04:00
|
|
|
{},
|
|
|
|
blade,
|
2022-07-26 20:05:39 -04:00
|
|
|
wheel,
|
|
|
|
};
|
|
|
|
|
2022-07-27 02:55:21 -04:00
|
|
|
// note: if you bump this depth value to 4, you'll need to set
|
|
|
|
// buf_size=5000000 so latex doesn't choke
|
|
|
|
path[] recursive_card(int value, int suit, int depth=4, bool outermost=true) {
|
2022-07-26 20:05:39 -04:00
|
|
|
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) {
|
2022-07-27 02:55:21 -04:00
|
|
|
result = result^^(placements[value][i]*scale(current_scale_factor)*suit_icon);
|
2022-07-26 20:05:39 -04:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2022-07-27 02:55:21 -04:00
|
|
|
//filldraw(card, white, black);
|
|
|
|
//fill(recursive_card(6, BLADES), evenodd+red);
|
2022-07-26 20:05:39 -04:00
|
|
|
|