diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 |
Initial commit
Diffstat (limited to 'graphics/circuit_macros/examples/svg/SierpinskiSVG.m4')
-rw-r--r-- | graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 b/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 new file mode 100644 index 0000000000..3a014b8a0f --- /dev/null +++ b/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 @@ -0,0 +1,26 @@ +.PS +# Sierpinski.m4 +gen_init + define Sierpinski { + if $1 > 0.04 then { + d = $1/2-lh + shade(1,line from $2+(d/2,d/2*s3+lw*2) right d/2 up d/2*s3 then left d*2 \ + then right d down d*s3 then right d/2 up d/2*s3 ) + Sierpinski($1/2,$2-($1/2,0)) + Sierpinski($1/2,$2+($1/2,0)) + Sierpinski($1/2,$2+(0,$1*s3/2)) + } + } + + r = 4 + linethick = 0.2 + lw = linethick pt__ /2 + s3 = sqrt(3) + lh = lw*s3 + A: 3,3 + d = r/2-lh + shade(0,line from A+(0,lw) right d then up d*s3 left d then down d*s3 left d\ + then right d ) +# psset_(linecolor=white) + Sierpinski(r/2,A) +.PE |