File: TriangleComposites.es

package info (click to toggle)
structure-synth 1.5.0-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,268 kB
  • ctags: 1,966
  • sloc: cpp: 10,209; python: 164; makefile: 71; sh: 15
file content (34 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (6)
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
// This example shows how to build
// custom primitives from individual polygons.
// Note that the Triangle primitives are NOT supported
// by most of the templates.

5 * { x 2 } 5 * { y 2 hue 20 } house

rule house {
	{ color black s 1.01 } grid
       box
 	{ z 1 sat 0.4 } pyramid
}

rule house {
	{ color black s 1.01 } grid
	 box
	{ z 1 } bar
}

rule pyramid { 
	 triangle[0,0,0;1,0,0;0.5,0.5,0.5] 
	 triangle[1,0,0;1,1,0;0.5,0.5,0.5] 
	 triangle[1,1,0;0,1,0;0.5,0.5,0.5] 
	 triangle[0,1,0;0,0,0;0.5,0.5,0.5] 
} 

rule bar { 
	 triangle[0,0,0;1,0,0;0.5,0,0.5] 
	 triangle[1,0,0;1,1,0;0.5,0,0.5] 
	 triangle[0.5,0,0.5;1,1,0;0.5,1,0.5] 
	 triangle[0,1,0;0.5,1,0.5;1,1,0] 
	 triangle[0,0,0;0.5,0,0.5;0,1,0] 
 	 triangle[0.5,0,0.5;0.5,1,0.5;0,1,0] 
}