Koch curve.
More...
Inherits Resource.
Koch curve.
Definition at line 69 of file KochLine.cs.
◆ KochCurve()
Fractals.KochCurve.KochCurve |
( |
Vector2 |
start, |
|
|
Vector2 |
end, |
|
|
int |
generations |
|
) |
| |
|
inline |
Create new Koch curve.
- Parameters
-
start | Starting point |
end | Ending point |
generations | Generation count |
Definition at line 84 of file KochLine.cs.
86 _generations = generations;
88 _lines.Add(
new KochLine()
◆ Draw()
void Fractals.KochCurve.Draw |
( |
CanvasItem |
canvas | ) |
|
|
inline |
Draw curve using canvas.
- Parameters
-
Definition at line 148 of file KochLine.cs.
150 foreach (var line
in _lines)
◆ DrawUntil()
void Fractals.KochCurve.DrawUntil |
( |
CanvasItem |
canvas, |
|
|
int |
index |
|
) |
| |
|
inline |
Draw curve using canvas until line index.
- Parameters
-
canvas | Canvas item |
index | Line index |
Definition at line 159 of file KochLine.cs.
161 var limit = Mathf.Max(0, Mathf.Min(index,
Count));
162 for (var i = 0; i < limit; ++i)
163 _lines[i].
Draw(canvas);
void Draw(CanvasItem canvas)
Draw curve using canvas.
◆ GenerateAll()
void Fractals.KochCurve.GenerateAll |
( |
| ) |
|
|
inline |
Generate all needed generations.
Definition at line 98 of file KochLine.cs.
100 for (
int i = 0; i < _generations; ++i)
void GenerateOne()
Generate one generation.
◆ GenerateOne()
void Fractals.KochCurve.GenerateOne |
( |
| ) |
|
|
inline |
Generate one generation.
Definition at line 107 of file KochLine.cs.
109 var next =
new List<KochLine>();
111 foreach (var line
in _lines)
113 var a = line.KochA();
114 var b = line.KochB();
115 var c = line.KochC();
116 var d = line.KochD();
117 var e = line.KochE();
119 next.Add(
new KochLine()
124 next.Add(
new KochLine()
129 next.Add(
new KochLine()
134 next.Add(
new KochLine()
◆ Count
int Fractals.KochCurve.Count |
|
get |
The documentation for this class was generated from the following file: