diff --git a/.gitignore b/.gitignore index 567609b..d163863 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -build/ +build/ \ No newline at end of file diff --git a/Makefile b/Makefile index 76eb357..4aa46e4 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,15 @@ -suits := blades puppets chairs bread cards wheels +suits := puppets bread wheels blades chairs cards 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: $(svgcards) +svgdeck: $(foreach card,$(cards),build/$(card).svg) -pngdeck: $(pngcards) +pngdeck: $(foreach card,$(cards),build/$(card).png) 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 $< $@ diff --git a/cards.asy b/cards.asy index ab9ffa1..b39f7fe 100644 --- a/cards.asy +++ b/cards.asy @@ -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.325; +real scpy = 0.35; transform placements[][] = { // 0 @@ -39,13 +39,13 @@ transform placements[][] = { {}, {}, {}, {}, }; -real scale_factor = 0.175; +real scale_factor = 0.15; real one_scale_factor = 0.4; -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); +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); // note: if you bump this depth value to 4, you'll need to set // buf_size=5000000 so latex doesn't choke diff --git a/single-card.asy b/single-card.asy new file mode 100644 index 0000000..ca85bb0 --- /dev/null +++ b/single-card.asy @@ -0,0 +1,22 @@ +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); +}