File: shapepathtest.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 (29 lines) | stat: -rw-r--r-- 418 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
startshape star(5, 2)
//startshape go

path star(number points, number skip)
{
  delta = 360 * skip / points
  MOVETO(0, 1)
  loop 1, points [r delta] {
    LINETO(cos(delta + 90), sin(delta + 90))
  }
  CLOSEPOLY()
  STROKE()[]
}

shape go {
  star(5, 2) []
}

path star_5_2
{
  delta = 360 * 2 / 5
  MOVETO(0, 1)
  loop 1, 5 [r delta] {
    LINETO(cos(delta + 90), sin(delta + 90))
  }
  CLOSEPOLY()
  STROKE()[]
}