public TrefoilKnotModel(double interval = 0.02)
{
this.interval = interval;
bool initialized = false;
vec3 max = new vec3();
vec3 min = new vec3();
int uCount = GetUCount(interval);
for (int uIndex = 0; uIndex < uCount; uIndex++)
{
double t = Math.PI * 2 * uIndex / uCount;
var position = GetPosition(t);
if (!initialized)
{
max = position;
min = position;
initialized = true;
}
else
{
position.UpdateMax(ref max);
position.UpdateMin(ref min);
}
}
this.Lengths = max - min;
}