summaryrefslogtreecommitdiff
path: root/graphics/sketch/Data/2tori.sk
blob: d5ca16816358ca81c5f713b9e74d73458d58e0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
}