Ejemplo n.º 1
0
        internal static SvgPath GetSvgPath(this DxfArc arc)
        {
            var startAngle = arc.StartAngle * Math.PI / 180.0;
            var endAngle   = arc.EndAngle * Math.PI / 180.0;

            return(SvgPath.FromEllipse(arc.Center.X, arc.Center.Y, arc.Radius, 0.0, 1.0, startAngle, endAngle));
        }
Ejemplo n.º 2
0
        public static XElement ToXElement(this DxfHatch hatch)
        {
            List <SvgPathSegment> segments = new List <SvgPathSegment>();

            // TODO: support/check all HatchStyle
            if (hatch.HatchStyle == DxfHatchStyle.OddParity)
            {
                return(null);
            }

            foreach (var bp in hatch.BoundaryPaths)
            {
                var s = GetSvgPathSegments(bp);
                if (s != null)
                {
                    segments.AddRange(s);
                }
            }

            var path = new SvgPath(segments);

            return(new XElement(DxfToSvgConverter.Xmlns + "path",
                                new XAttribute("d", path.ToString()),
                                new XAttribute("fill-opacity", hatch.Transparency < 100 ? 100 - hatch.Transparency: 100),
                                new XAttribute("fill", hatch.Color.ToRGBString()))
                   .AddVectorEffect());
        }
Ejemplo n.º 3
0
 internal static SvgPath GetSvgPath(this DxfEllipse ellipse)
 {
     return(SvgPath.FromEllipse(ellipse.Center.X, ellipse.Center.Y, ellipse.MajorAxis.X, ellipse.MajorAxis.Y, ellipse.MinorAxisRatio, ellipse.StartParameter, ellipse.EndParameter));
 }