File: subpathtest.cfdg

package info (click to toggle)
contextfree 3.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,432 kB
  • sloc: cpp: 34,857; lex: 416; makefile: 124; sh: 42; python: 41
file content (66 lines) | stat: -rw-r--r-- 1,482 bytes parent folder | download | duplicates (4)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SQRT3 = sqrt(3)
TTOP = sin(30)/SQRT3
HEXS = SQRT3/4
GOLD = 31      // Def limited to one parameter sat 0.9 b 0.9
BLUE = 201     // ............................ sat 0.8 b 0.73
MAGENTA = 42
GREEN = 132
RED = 356
startshape alhambraII

CF::Size = [s 6 6 x -2.5 y -3.5] // trim to hide the ragged edge

CF::Background = [b .6]
CF::AllowOverlap = 1

shape alhambraII{        // using switch
  loop i = 0, 10 [x .97]{
    loop j = 0, 10 [y .85 x -.48]{
       BLUE = [b .73 h BLUE sat .53]
       MAGENTA = [b .53 h MAGENTA sat .76]
       RED = [b .53 h RED sat .7]
       GREEN = [b .68 h GREEN sat .64]
       triangle[trans select(mod(i, 4), BLUE, MAGENTA, RED, GREEN)]
       switch (mod(j,2)){ 
       case 0: hexastar[x -.48 y .3 s .33 b .9 h GOLD sat .8]
       case 1: hexastar[x -.48 y .3 s .33 trans RED]
       }
      //hexagon[s .42 b 1]
      }
   }	
}

path hexagon{ 
  MOVETO(0.25, HEXS)          // 3.0 Syntax in path loop and definition
  loop 5 [r -60]{
  LINETO(0.5, 0)
  }
  CLOSEPOLY()  
  //FILL[]    
} 

path SQ {
  MOVETO(0.5,0.5)
  LINETO(-0.5,0.5)
  LINETO(-0.5,-0.5)
  LINETO(0.5,-0.5)
  LINETO(0.5,0.5)
  CLOSEPOLY()
}

path triangle {              // CF 3.0 Syntax in path loop and definition
    MOVETO(-0.5, -TTOP)
    loop 3 [r 120]{ 
    CURVETO(0, -TTOP, -0.25, 0.05) 
    CURVETO(0.5, - TTOP, CF::Continuous) 
    }
    CLOSEPOLY()
    //path hexagon[s 0.81]
    path CIRCLE[s 0.81]
    FILL[]
}

shape hexastar{
  TRIANGLE[r 90]
  TRIANGLE[r 270]
}