예제 #1
0
        public virtual void DrawArc(double x1, double y1, double x2, double y2, double bulge)
        {
            double cx, cy, rad;

            if (!GeomUtil.GetArcCenterFromBulge(x1, y1, x2, y2, bulge, out cx, out cy))
            {
                DrawLine(x1, y1, x2, y2);
                return;
            }

            rad = GeomUtil.GetArcRadiusFromBulge(x1, y1, x2, y2, bulge);
            DrawEllipticArc(cx, cy, rad, rad, 0.0, GeomUtil.Angle(cx, cy, x1, y1), GeomUtil.GetArcSweepAngleFromBulge(bulge));
        }
예제 #2
0
        public virtual void DrawArcT(double x1, double y1, double x2, double y2, double bulge)
        {
            var t = Transform;

            if (t.IsUniform)
            {
                //the arc will still be an arc after transform
                //transform it an draw with standrad arc function
                t.Apply(x1, y1, out x1, out y1, true);
                t.Apply(x2, y2, out x2, out y2, true);
                DrawArc(x1, y1, x2, y2, t.Determinant < 0.0 ? -bulge : bulge); //-buylge to support mirrored arcs
                return;
            }
            else
            { //the arc might change into an elliptic arc
                double cx, cy, rad;
                if (!GeomUtil.GetArcCenterFromBulge(x1, y1, x2, y2, bulge, out cx, out cy))
                {
                    //the arc is a line
                    DrawLineT(x1, y1, x2, y2);
                    return;
                }
                rad = GeomUtil.GetArcRadiusFromBulge(x1, y1, x2, y2, bulge);
                DrawEllipticArcT(cx, cy, rad, rad, 0.0, GeomUtil.Angle(cx, cy, x1, y1), GeomUtil.GetArcSweepAngleFromBulge(bulge));
            }
        }