The math should be simple, but why does it lump the points into “groups” instead of producing even distribution? (the iteration input variable is the number of points to pick from the circle)
for (var j = 0; j < iterations; j++)
{
var i = j;
// Param for even distribution of points from around a circle
var c_t = circle.Circumference * i * 1.0 / iterations;
var pt = circle.PointAt(c_t);
param_points[i] = pt;
}
for (var j = 0; j < iterations; j++)
{
var i = j;
// Param for even distribution of points around a circle
var c_t = circle.Circumference / 45 * i * 1.0 / iterations;
var pt = circle.PointAt(c_t);
circum_points.Add(pt);
}
Only now it starts to look like expected when making a Polyline, proving that the points are in order:
I see now. The reason divide by 45 works is because that is your Radius in the example you sent. It should be divide by R not divide by 45., then it will work parametrically. You can see in Rhinocommon circles use a different calc for PointAt than say NurbsCurves. “Circles use trigonometric parameterization: t -> center + cos(t)radiusxaxis + sin(t)radiusyaxis.”
The PointAt() method works in the (0.0, 2\pi) range. So if you start sampling with a different frequency you start going around the circle and ending up not quite where you started. This ‘drift’ manifests itself as point clusters.