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

blender version #3

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6e91604
blender version
brentharts Dec 17, 2024
2fe8ccf
trace curve
brentharts Dec 18, 2024
d2ea60c
grease pencil support
brentharts Dec 24, 2024
f3d4da9
mystic shape
brentharts Dec 26, 2024
094b327
find tile pairs
brentharts Dec 30, 2024
4e0e1a7
connect pairs with bezier curve
brentharts Dec 31, 2024
dc009e4
color shapes
brentharts Jan 1, 2025
82bb623
nurbs shape
brentharts Jan 1, 2025
1b7738a
blender UI
brentharts Jan 2, 2025
84b856b
export and import json
brentharts Jan 2, 2025
8a7635e
import json restore left right curves
brentharts Jan 2, 2025
24e5a3b
curve trace border tiles
brentharts Jan 2, 2025
58217ca
blender UI refactor
brentharts Jan 3, 2025
7148931
import and export json buttons
brentharts Jan 3, 2025
052fe6f
generate tiles button
brentharts Jan 3, 2025
b262bda
trace inner edges of shape
brentharts Jan 3, 2025
b1e5354
UI helpers set border buttons
brentharts Jan 4, 2025
950beee
convert border tiles into smooth curves
brentharts Jan 4, 2025
a4a37e7
command line args: --clean --gpencil --num-mystic
brentharts Jan 6, 2025
1a6a046
option rotation
brentharts Jan 6, 2025
5920356
rotation option and doc --help
brentharts Jan 6, 2025
7a97d2d
command line --iterations=1,2,3,4
brentharts Jan 7, 2025
5036f37
nurbs shapes connecting layer mystics
brentharts Jan 8, 2025
bfca375
grease pencil circle primes
brentharts Jan 8, 2025
3669788
matplotlib
brentharts Jan 9, 2025
9af285f
grease pencil fixes
brentharts Jan 9, 2025
1a6c620
matplotlib updates
brentharts Jan 12, 2025
fa2c06f
plot number of tiles for each iteration and group
brentharts Jan 13, 2025
07d7607
option --max-tiles
brentharts Jan 13, 2025
715aa1c
trace shape border tiles button
brentharts Jan 14, 2025
9630161
matplotlib shape border tiles data
brentharts Jan 15, 2025
8d68610
Makefile
brentharts Jan 15, 2025
90b7525
rotation tests
brentharts Jan 16, 2025
4820288
plot data for single iterations with --plot
brentharts Jan 16, 2025
70633b9
trace tests
brentharts Jan 17, 2025
96a660d
option --trace
brentharts Jan 17, 2025
c7bab77
shape tests
brentharts Jan 18, 2025
8a4a943
fixing import and export json
brentharts Jan 18, 2025
96ad19e
options --trace-shape --trace-shape-smooth --trace-shape-smooth-iter
brentharts Jan 18, 2025
abf8c16
options --trace-shape --trace-shape-smooth --trace-shape-smooth-iter
brentharts Jan 18, 2025
b06cb33
shape smooth trace tests
brentharts Jan 19, 2025
4f23571
plot shape left right sharp smooth ratios
brentharts Jan 19, 2025
dba558b
simple shape1
brentharts Jan 19, 2025
0734c98
plot tweaks
brentharts Jan 19, 2025
df29ad2
refactoring collections
brentharts Jan 19, 2025
aa96383
knot tests
brentharts Jan 20, 2025
c27bcf5
option --knot
brentharts Jan 20, 2025
71bd938
bezier curve with colors
brentharts Jan 20, 2025
f16f15e
bezier curve with colors
brentharts Jan 20, 2025
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
103 changes: 103 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
default:
python3 spectre_tiles_blender.py --iterations=1,2,3 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --trace

layers:
python3 spectre_tiles_blender.py --iterations=1,2,3 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --trace

layers4:
python3 spectre_tiles_blender.py --iterations=1,2,3,4 --plot --plot-labels --gpencil --minimal --num-mystic --rotation=30 --layer-expand=30 --trace

trace:
python3 spectre_tiles_blender.py --iterations=1,2,3 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --trace

order:
python3 spectre_tiles_blender.py --iterations=1,2,3 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --order-expand=1 --trace

odd:
python3 spectre_tiles_blender.py --iterations=1,3 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --trace
even:
python3 spectre_tiles_blender.py --iterations=2,4 --plot --plot-labels --gpencil --num-mystic --rotation=30 --layer-expand=30 --trace

level1_knot:
python3 spectre_tiles_blender.py --iterations=1 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot --trace --knot
level2_knot:
python3 spectre_tiles_blender.py --iterations=2 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot --trace --knot
level3_knot:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot --trace --knot

level1:
python3 spectre_tiles_blender.py --iterations=1 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot

level1_90:
python3 spectre_tiles_blender.py --iterations=1 --gpencil --gpen-fills=0 --num-mystic --rotation=90 --plot

level2:
python3 spectre_tiles_blender.py --iterations=2 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot

level3:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=30 --plot

level3_0:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=0 --plot

level3_31:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=31 --plot

level3_90:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=90 --plot

level3_270:
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 --num-mystic --rotation=270 --plot

level4:
python3 spectre_tiles_blender.py --iterations=4 --gpencil --gpen-fills=1 --num-mystic --rotation=30 --plot --minimal
level5:
python3 spectre_tiles_blender.py --iterations=5 --gpencil --gpen-fills=1 --num-mystic --rotation=30 --plot --minimal

new_shape:
python3 spectre_tiles_blender.py --iterations=3 --make-shapes

echo_shape0:
echo '{"left":[72],"right":[257],"left_bor":[269,73,79,80,86,270,268],"right_bor":[278,251,258,256,279,250],"joins":[]}' > /tmp/tmp.json
echo_shape1:
echo '{"left": [73, 72], "right": [257, 279], "left_bor": [269, 79, 80, 75, 86, 74, 270, 268, 76], "right_bor": [278, 251, 230, 284, 258, 256, 229, 280, 250], "joins": []}' > /tmp/tmp.json

load_shape: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --color-fade=0

load_shape: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --color-fade=0
load_shape_sharp: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0 --trace-shape-smooth-iter=0 --color-fade=0
load_shape_smooth: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=1 --trace-shape-smooth-iter=10 --color-fade=0


load_shape_smooth_1: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.1 --trace-shape-smooth-iter=5 --color-fade=0
load_shape_smooth_2: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.2 --trace-shape-smooth-iter=5 --color-fade=0
load_shape_smooth_4: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.4 --trace-shape-smooth-iter=5 --color-fade=0
load_shape_smooth_6: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.6 --trace-shape-smooth-iter=5 --color-fade=0
load_shape_smooth_8: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.8 --trace-shape-smooth-iter=5 --color-fade=0
load_shape_smooth_10: echo_shape0
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=1 --trace-shape-smooth-iter=5 --color-fade=0

load_shape1_smooth_0: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0 --trace-shape-smooth-iter=0 --color-fade=0
load_shape1_smooth_1: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.1 --trace-shape-smooth-iter=5 --color-fade=0
load_shape1_smooth_2: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.2 --trace-shape-smooth-iter=5 --color-fade=0
load_shape1_smooth_4: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.4 --trace-shape-smooth-iter=5 --color-fade=0
load_shape1_smooth_6: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.6 --trace-shape-smooth-iter=5 --color-fade=0
load_shape1_smooth_8: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=0.8 --trace-shape-smooth-iter=5 --color-fade=0
load_shape1_smooth_10: echo_shape1
python3 spectre_tiles_blender.py --iterations=3 --gpencil --gpen-fills=0 /tmp/tmp.json --trace-shape --trace-shape-smooth=1 --trace-shape-smooth-iter=5 --color-fade=0

8 changes: 4 additions & 4 deletions spectre.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def forEachTile(self, doProc, transformation=IDENTITY):
for tile, trsf in zip(self.tiles, self.transformations):
tile.forEachTile(doProc, (mul(transformation, trsf)))

def buildSpectreBase():
def buildSpectreBase(rotation=30):
tiles = {label: (Tile(label) ) for label in TILE_NAMES if label != "Gamma"}
# special rule for Mystic == Gamma == Gamma1 + Gamma2
tiles["Gamma"] = MetaTile(tiles=[Tile("Gamma1"),
Expand All @@ -145,7 +145,7 @@ def buildSpectreBase():
mul(np.array([
[1,0,SPECTRE_POINTS[8,0]],
[0,1,SPECTRE_POINTS[8,1]]
]), trot(30))
]), trot(rotation))
],
quad=SPECTRE_QUAD.copy())
# print(f"at buildSpectreBase: tiles[Gamma]={tiles['Gamma'].transformations}")
Expand Down Expand Up @@ -230,13 +230,13 @@ def update_transformation_range(T, _label): # drowsvg
return

#### main process ####
def buildSpectreTiles(n_ITERATIONS,edge_a,edge_b):
def buildSpectreTiles(n_ITERATIONS,edge_a,edge_b, rotation=30):
global SPECTRE_POINTS, Mystic_SPECTRE_POINTS, SPECTRE_QUAD

SPECTRE_POINTS = get_spectre_points(edge_a, edge_b) # tile(Edge_a, Edge_b)
Mystic_SPECTRE_POINTS = get_spectre_points(edge_b, edge_a) # tile(Edge_b, Edge_a)
SPECTRE_QUAD = SPECTRE_POINTS[[3,5,7,11],:]
tiles = buildSpectreBase()
tiles = buildSpectreBase( rotation=rotation )
for _ in range(n_ITERATIONS):
tiles = buildSupertiles(tiles)

Expand Down
Loading