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/sketch/Data/2tori.sk |
Initial commit
Diffstat (limited to 'graphics/sketch/Data/2tori.sk')
-rw-r--r-- | graphics/sketch/Data/2tori.sk | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/graphics/sketch/Data/2tori.sk b/graphics/sketch/Data/2tori.sk new file mode 100644 index 0000000000..d5ca168163 --- /dev/null +++ b/graphics/sketch/Data/2tori.sk @@ -0,0 +1,35 @@ +# origin +def O (0,0,0) +def s1 [fillcolor=red] +def s2 [linewidth=.2pt,linestyle=dotted] + +def sweeptorus { + def N 80 + put { translate([1,0,0]) } { + sweep[s1,s2]{N, rotate(360/N, (-1,0,0), [0,1,0]) } { + line(0,-1,0)(1,-1,0)(1,1,0)(0,1,0)(0,-1,0) + } + } +} + +def tori { + put { translate([-2.2,0,0]) } {sweeptorus} + put { rotate(-30, (O), [0,0,1]) then translate([2.2,.5,0]) } {sweeptorus} +} + +def sceneProjection { + + put { rotate(20, (O), [0,0,1]) then + rotate(30, (O), [1,0,0]) then + translate([0,0,-10]) then + perspective(7) } {tori} +} + +{sceneProjection} + +global { + language tikz,context + set [linewidth=.1pt] + picturebox (-2,-2)(2,2) + frame +} |