Documentation ¶
Index ¶
- func BinTree(n int) image.Image
- func ExportToPNG(filePath string, m image.Image)
- func Hilbert(n int) image.Image
- func Hilbert3d(fname string, n int) error
- func Lindenmayer(start []string, rules map[string][]string, n int) []string
- func Plant(n int) image.Image
- func Plant3d(fname string, n int) error
- func Pyramid3d(fname string, n int) error
- func Tree(n int) image.Image
- type Bounds
- type Bounds3d
- type Turtle
- func (t *Turtle) Angle() (degree float64)
- func (t *Turtle) Cleanup()
- func (t *Turtle) Color() color.Color
- func (t *Turtle) Draw(f, r float64)
- func (t *Turtle) Go(path []string) image.Image
- func (t *Turtle) Move(f, r float64)
- func (t *Turtle) Position() (x, y float64)
- func (t *Turtle) Restore()
- func (t *Turtle) Save()
- func (t *Turtle) SetColor(c color.Color)
- func (t *Turtle) SetWidth(w float64)
- func (t *Turtle) Turn(degree float64)
- func (t *Turtle) Width() float64
- type Turtle3d
- func (t *Turtle3d) Cleanup()
- func (t *Turtle3d) Draw(f float64)
- func (t *Turtle3d) GetColor() color.Color
- func (t *Turtle3d) GetForward() vectors.Vec3
- func (t *Turtle3d) GetPosition() (x, y, z float64)
- func (t *Turtle3d) GetWidth() float64
- func (t *Turtle3d) Go(fname string, path []string) error
- func (t *Turtle3d) Move(f float64)
- func (t *Turtle3d) Pitch(angle float64)
- func (t *Turtle3d) Restore()
- func (t *Turtle3d) Roll(angle float64)
- func (t *Turtle3d) Rotate(angle float64)
- func (t *Turtle3d) Save()
- func (t *Turtle3d) SetColor(c color.Color)
- func (t *Turtle3d) SetWidth(w float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportToPNG ¶
func Lindenmayer ¶
Lindenmayer iterative function. See: http://en.wikipedia.org/wiki/L-system
Types ¶
type Turtle ¶
type Turtle struct {
// contains filtered or unexported fields
}
Turtle implements a turtle-esque drawing system.
type Turtle3d ¶
type Turtle3d struct {
// contains filtered or unexported fields
}
Turtle3d implements a turtle-esque drawing system IN 3D! This code is partially inspired by: https://github.com/yalue/l_system_3d and: https://github.com/recp/cglm/blob/master/include/cglm/vec3.h
func NewTurtle3d ¶
NewTurtle3d returns a new Turtle3d struct.
func (*Turtle3d) GetForward ¶
GetForward gets the current forward vector
func (*Turtle3d) GetPosition ¶
GetPosition gets the current position.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.