Compare commits

...

5 Commits

4 changed files with 15 additions and 32 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
build/
build/

View File

@ -1,15 +1,20 @@
suits := puppets bread wheels blades chairs cards
suits := blades puppets chairs bread cards wheels
values := 1 2 3 4 5 6 traveler knight wizard noble
nobles := count-of-cards queen-of-puppets earl-of-bread scion-of-blades prince-of-wheels regent-of-chairs
cards := $(foreach suit,$(suits),$(foreach value,$(values),$(value)-$(suit)))
svgcards := $(foreach card,$(cards),build/$(card).svg)
pngcards := $(foreach card,$(cards),build/$(card).png)
svgdeck: $(foreach card,$(cards),build/$(card).svg)
svgdeck: $(svgcards)
pngdeck: $(foreach card,$(cards),build/$(card).png)
pngdeck: $(pngcards)
build/%.svg: deck.asy cards.asy numerals.asy suits.asy nobles.asy $(foreach suit,$(suits),$(suit).asy) $(foreach noble,$(nobles),$(noble).asy)
mkdir -p build
sh -c "buf_size=5000000 asy -globalwrite deck.asy"
build/sample.png: $(svgcards)
montage -density 100 -background transparent $(svgcards) -tile 10x6 -geometry +0+0 build/sample.png
build/%.png: build/%.svg
convert -density 512 -background transparent $< $@

View File

@ -11,7 +11,7 @@ path corner = arc(((width/2 - corner_radius), (height/2 - corner_radius)), corne
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;
real scpy = 0.325;
transform placements[][] = {
// 0
@ -39,13 +39,13 @@ transform placements[][] = {
{}, {}, {}, {},
};
real scale_factor = 0.15;
real scale_factor = 0.175;
real one_scale_factor = 0.4;
real numeral_scale_factor = 0.15;
pair numeral_pos = (-width*0.38, height*0.4);
real indicator_scale_factor = 0.1;
pair indicator_pos = (-width*0.38, height*0.25);
real numeral_scale_factor = 0.125;
pair numeral_pos = (-width*0.4, height*0.4);
real indicator_scale_factor = 0.085;
pair indicator_pos = (-width*0.4, height*0.275);
// note: if you bump this depth value to 4, you'll need to set
// buf_size=5000000 so latex doesn't choke

View File

@ -1,22 +0,0 @@
import "cards.asy" as cards;
import "numerals.asy" as numerals;
import "suits.asy" as suits;
int suit = PUPPETS;
int value = 5;
filldraw(card, white, black);
currentpen = evenodd+suit_colors[suit];
if (suit == CARDS && value == 1) {
// due to exponential growth, with the larger suit icon on the 1
// card, the endpoint of the recursion is a *lot* more visible
fill(recursive_card(value, suit, 6));
} else if (suit == CARDS && value > 6) {
// conversely, face cards don't need as much recursion depth
// because the only icons present are significantly smaller
fill(recursive_card(value, suit, 3));
} else {
//fill(recursive_card(value, CARDS, 1), evenodd+lightgrey);
fill(recursive_card(value, suit);
}