public static VertexStore MakeVxs(this Ellipse ellipse, ICoordTransformer tx, VertexStore output) { //1. moveto output.AddMoveTo(ellipse.originX + ellipse.radiusX, ellipse.originY, tx);//** //2. // int numSteps = ellipse.NumSteps; double anglePerStep = MathHelper.Tau / numSteps; double angle = 0; double orgX = ellipse.originX; double orgY = ellipse.originY; double radX = ellipse.radiusX; double radY = ellipse.radiusY; if (ellipse._cw) { for (int i = 1; i < numSteps; i++) { angle += anglePerStep; output.AddLineTo( orgX + Math.Cos(MathHelper.Tau - angle) * radX, orgY + Math.Sin(MathHelper.Tau - angle) * radY, tx);//** } } else { for (int i = 1; i < numSteps; i++) { angle += anglePerStep; output.AddLineTo( orgX + Math.Cos(angle) * radX, orgY + Math.Sin(angle) * radY, tx);//** } } //3. output.AddCloseFigure((int)EndVertexOrientation.CCW, 0); //4. output.AddNoMore(); return(output); }
public ShapeBuilder NoMore() { _vxs.AddNoMore(); return(this); }