setPrepositionedPoints method

void setPrepositionedPoints()

Implementation

void setPrepositionedPoints() {
  var anchors = [
    for (var a in linspace(
            start: startAngle, end: angle + startAngle, count: numComponents)
        .getColumn(0))
      RIGHT * cos(a) + UP * sin(a)
  ];

  var dTheta = angle / (numComponents - 1);
  var tangentVectors = [for (var a in anchors) Vector3(-a.y, a.x, a.z)];

  var handles1 = [
    for (var i in range(end: anchors.length - 1))
      anchors[i] + tangentVectors[i] * (dTheta / 3)
  ];

  var handles2 = [
    for (var i in range(start: 1, end: anchors.length))
      anchors[i] - tangentVectors[i] * (dTheta / 3)
  ];

  setAnchorsAndHandles(
      withoutLast(anchors), handles1, handles2, withoutFirst(anchors));
}