putStartAndEndOn method
Implementation
void putStartAndEndOn(
Vector3 start,
Vector3 end,
) {
var currentStart = getStart();
var currentEnd = getEnd();
var currentVec = currentEnd - currentStart;
if (currentStart == currentEnd) {
throw 'Cannot position endpoints of a closed loop';
}
var targetVec = end - start;
scaleUniformly(targetVec.norm() / currentVec.norm(),
aboutPoint: currentStart);
rotate(targetVec.angle() - currentVec.angle(), aboutPoint: currentStart);
shift(start - currentStart);
}