blob: 496b7277b76caa6f974818952ec16ae8e82dfc2d (
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
|
package main
type Vertex struct{ X, Y, Z float64 }
type Patch []Vertex
func (p Patch) X() []float64 {
f := make([]float64, len(p))
for i, v := range p {
f[i] = v.X
}
return f
}
func (p Patch) Y() []float64 {
f := make([]float64, len(p))
for i, v := range p {
f[i] = v.Y
}
return f
}
func (p Patch) Z() []float64 {
f := make([]float64, len(p))
for i, v := range p {
f[i] = v.Z
}
return f
}
|