From 27c0cb7c2a1ad6c71cf188f9f720a4c5f8b760fb Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 30 Jul 2024 15:06:23 -0700 Subject: [PATCH] Library system for shared variables --- make | 1 + src/global.asy | 1 + src/zakhat/zakhat.asy | 10 ++++++++++ src/zakhat/zakhat_line_black.asy | 12 ------------ src/zakhat/zakhat_medium_outline_black.asy | 15 +++++++++++++++ src/zakhat/zakhat_medium_solid_black.asy | 15 +++++++++++++++ src/zakhat/zakhat_solid_black.asy | 12 ------------ 7 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 src/global.asy create mode 100644 src/zakhat/zakhat.asy delete mode 100644 src/zakhat/zakhat_line_black.asy create mode 100644 src/zakhat/zakhat_medium_outline_black.asy create mode 100644 src/zakhat/zakhat_medium_solid_black.asy delete mode 100644 src/zakhat/zakhat_solid_black.asy diff --git a/make b/make index f7d995f..73adcea 100755 --- a/make +++ b/make @@ -73,6 +73,7 @@ if len(sys.argv) != 1: sys.argv.pop(1) print("Removing output directory...") shutil.rmtree("output") # Scary + print("Output directory removed") if sys.argv[1] == "all": if len(sys.argv) == 3: diff --git a/src/global.asy b/src/global.asy new file mode 100644 index 0000000..700f561 --- /dev/null +++ b/src/global.asy @@ -0,0 +1 @@ +int unit_size = 20; diff --git a/src/zakhat/zakhat.asy b/src/zakhat/zakhat.asy new file mode 100644 index 0000000..cf1ded3 --- /dev/null +++ b/src/zakhat/zakhat.asy @@ -0,0 +1,10 @@ +access "src/global.asy" as global; + +int size_small = 70; +int size_medium = 50; + +path brim = (0,-28) .. (3.5,-31) .. (10,-33) -- (30,-33) .. (36.5,-31) .. (40,-28); + +path top = box((10,0), (30,-26)); + +path belt = box((10,-26), (30,-33)); diff --git a/src/zakhat/zakhat_line_black.asy b/src/zakhat/zakhat_line_black.asy deleted file mode 100644 index 1a03a08..0000000 --- a/src/zakhat/zakhat_line_black.asy +++ /dev/null @@ -1,12 +0,0 @@ -unitsize(20); - -pen p=defaultpen+linewidth(50); // Set the pen width - -// Brim -draw((0,-28) .. (3.5,-31) .. (10,-33) -- (30,-33) .. (36.5,-31) .. (40,-28), p); - -// Top -draw(box((10,0), (30,-26)), p); - -// Belt -draw(box((10,-26), (30,-33)), p); diff --git a/src/zakhat/zakhat_medium_outline_black.asy b/src/zakhat/zakhat_medium_outline_black.asy new file mode 100644 index 0000000..6a84f94 --- /dev/null +++ b/src/zakhat/zakhat_medium_outline_black.asy @@ -0,0 +1,15 @@ +access "src/global.asy" as global; +access "src/zakhat/zakhat.asy" as zakhat; + +unitsize(global.unit_size); + +pen p=defaultpen+linewidth(zakhat.size_medium); // Set the pen width + +// Brim +draw(zakhat.brim, p); + +// Top +draw(zakhat.top, p); + +// Belt +draw(zakhat.belt, p); diff --git a/src/zakhat/zakhat_medium_solid_black.asy b/src/zakhat/zakhat_medium_solid_black.asy new file mode 100644 index 0000000..356eb40 --- /dev/null +++ b/src/zakhat/zakhat_medium_solid_black.asy @@ -0,0 +1,15 @@ +access "src/global.asy" as global; +access "src/zakhat/zakhat.asy" as zakhat; + +unitsize(global.unit_size); + +pen p=defaultpen+linewidth(zakhat.size_medium); // Set the pen width + +// Brim +draw(zakhat.brim, p); + +// Top +filldraw(zakhat.top, drawpen=p); + +// Belt +draw(zakhat.belt, p); diff --git a/src/zakhat/zakhat_solid_black.asy b/src/zakhat/zakhat_solid_black.asy deleted file mode 100644 index 2762262..0000000 --- a/src/zakhat/zakhat_solid_black.asy +++ /dev/null @@ -1,12 +0,0 @@ -unitsize(20); - -pen p=defaultpen+linewidth(50); // Set the pen width - -// Brim -draw((0,-28) .. (3.5,-31) .. (10,-33) -- (30,-33) .. (36.5,-31) .. (40,-28), p); - -// Top -filldraw(box((10,0), (30,-26)), drawpen=p); - -// Belt -draw(box((10,-26), (30,-33)), p);