Commit 30c8b610 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

added accessor funtions

parent a62e629c
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -36,6 +36,22 @@ type Icosahedron struct {
	fs    Faces
}

// Level returns the number of the subdivisions done.
// Level() == 0 is the basic icosahedron.
func (i *Icosahedron) Level() int {
	return i.level
}

// Vertices returns the veritces of the icosahedron.
func (i *Icosahedron) Vertices() Vertices {
	return i.vs
}

// Faces returns the faces of the icosahedron.
func (i *Icosahedron) Faces() Faces {
	return i.fs
}

// Create creates the vertices and faces for a regular icosahedron.
func Create() (*Icosahedron, error) {
	vertices := Vertices{