Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable regenerating README.md from the project examples #170

Merged
merged 22 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,099 changes: 571 additions & 528 deletions README.md

Large diffs are not rendered by default.

464 changes: 464 additions & 0 deletions README.md.in

Large diffs are not rendered by default.

400 changes: 0 additions & 400 deletions examples/asemic/example.svg

This file was deleted.

110 changes: 97 additions & 13 deletions examples/asemic/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,111 @@
set -o errexit
set -o pipefail
set -o nounset
set -o noclobber

glyph() {
# BEGIN ASEMIC_SETUP_SNIPPET
glyphs() {
local glyph_kind="$1"
local number="$2"
local size="$3"

{
for _ in $(seq "$number"); do
$glyph_kind "$size"
done
} | pack --width 1000 --height 1000 --padding 20
}
# END ASEMIC_SETUP_SNIPPET
extract_snippet ASEMIC_SETUP_SNIPPET

ASEMIC_RANDOM_ROUNDED=./examples/asemic/random-rounded.svg
debug "Generating $ASEMIC_RANDOM_ROUNDED ..."
# BEGIN ASEMIC_RANDOM_ROUNDED_SNIPPET
random_rounded() {
local size="$1"
local width=2
local height=3
point-cloud --log-level WARN --domain unit-square --points 15 --scale 6 |
urquhart --output-format tgf |
traverse --log-level WARN --traversals 5 --length 5 --untraversed |
transform --scale="$size" |
smooth --iterations 4 |
bundle
}
glyphs random_rounded 90 10 | wkt2svg --output $ASEMIC_RANDOM_ROUNDED
# END ASEMIC_RANDOM_ROUNDED_SNIPPET
extract_snippet ASEMIC_RANDOM_ROUNDED_SNIPPET

grid --output-format graph --width="$width" --height="$height" |
traverse --traversals 4 --length 5 --remove-after-traverse |
ASEMIC_RANDOM_TRIANGULATED=./examples/asemic/random-triangulated.svg
debug "Generating $ASEMIC_RANDOM_TRIANGULATED ..."
# BEGIN ASEMIC_RANDOM_TRIANGULATED_SNIPPET
random_triangulated() {
local size="$1"
point-cloud --log-level WARN --domain unit-square --points 10 --scale 6 |
triangulate --output-format tgf |
traverse --log-level WARN --traversals 3 --length 3 --remove-after-traverse |
transform --scale="$size" |
smooth --iterations 4 |
bundle
}
glyphs random_triangulated 100 10 | wkt2svg --output $ASEMIC_RANDOM_TRIANGULATED
# END ASEMIC_RANDOM_TRIANGULATED_SNIPPET
extract_snippet ASEMIC_RANDOM_TRIANGULATED_SNIPPET

glyphs() {
local number="$1"
local size="$2"
ASEMIC_GRID_ROUNDED=./examples/asemic/grid-rounded.svg
debug "Generating $ASEMIC_GRID_ROUNDED ..."
# BEGIN ASEMIC_GRID_ROUNDED_SNIPPET
grid_rounded() {
local size="$1"
grid --output-format graph --width=2 --height=3 |
traverse --log-level WARN --traversals 5 --length 5 --remove-after-traverse |
transform --scale="$size" |
smooth --iterations 4 |
bundle
}
glyphs grid_rounded 120 20 | wkt2svg --output $ASEMIC_GRID_ROUNDED
# END ASEMIC_GRID_ROUNDED_SNIPPET
extract_snippet ASEMIC_GRID_ROUNDED_SNIPPET

for _ in $(seq "$number"); do
glyph "$size"
done
ASEMIC_GRID_BEVELED=./examples/asemic/grid-beveled.svg
debug "Generating $ASEMIC_GRID_BEVELED ..."
# BEGIN ASEMIC_GRID_BEVELED_SNIPPET
grid_beveled() {
local size="$1"
grid --output-format graph --width=2 --height=3 |
traverse --log-level WARN --traversals 5 --length 5 --remove-after-traverse |
transform --scale="$size" |
smooth --iterations 1 |
bundle
}
glyphs grid_beveled 120 20 | wkt2svg --output $ASEMIC_GRID_BEVELED
# END ASEMIC_GRID_BEVELED_SNIPPET
extract_snippet ASEMIC_GRID_BEVELED_SNIPPET

ASEMIC_GRID_TRIANGULATED=./examples/asemic/grid-triangulated.svg
debug "Generating $ASEMIC_GRID_TRIANGULATED ..."
# BEGIN ASEMIC_GRID_TRIANGULATED_SNIPPET
grid_triangulated() {
local size="$1"
grid --grid-type triangle --output-format graph --width=2 --height=3 |
traverse --log-level WARN --traversals 4 --length 5 --remove-after-traverse |
transform --scale="$size" |
smooth --iterations 4 |
bundle
}
glyphs grid_triangulated 100 20 | wkt2svg --output $ASEMIC_GRID_TRIANGULATED
# END ASEMIC_GRID_TRIANGULATED_SNIPPET
extract_snippet ASEMIC_GRID_TRIANGULATED_SNIPPET

glyphs 100 20 |
pack --width 1000 --height 1000 --padding 20
ASEMIC_GRID_JAGGED=./examples/asemic/grid-jagged.svg
debug "Generating $ASEMIC_GRID_JAGGED ..."
# BEGIN ASEMIC_GRID_JAGGED_SNIPPET
grid_jagged() {
local size="$1"
grid --grid-type ragged --output-format graph --width=2 --height=3 |
traverse --log-level WARN --traversals 4 --length 5 --remove-after-traverse |
transform --scale="$size" |
smooth --iterations 4 |
bundle
}
glyphs grid_jagged 100 20 | wkt2svg --output $ASEMIC_GRID_JAGGED
# END ASEMIC_GRID_JAGGED_SNIPPET
extract_snippet ASEMIC_GRID_JAGGED_SNIPPET
588 changes: 588 additions & 0 deletions examples/asemic/grid-beveled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
403 changes: 403 additions & 0 deletions examples/asemic/grid-jagged.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
592 changes: 592 additions & 0 deletions examples/asemic/grid-rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
403 changes: 403 additions & 0 deletions examples/asemic/grid-triangulated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 0 additions & 185 deletions examples/asemic/hex-smooth.svg

This file was deleted.

185 changes: 0 additions & 185 deletions examples/asemic/hex.svg

This file was deleted.

203 changes: 0 additions & 203 deletions examples/asemic/quads-45.svg

This file was deleted.

400 changes: 0 additions & 400 deletions examples/asemic/quads.svg

This file was deleted.

Loading
Loading