Пример #1
0
		static void Main(string[] args)
		{
			try
			{
				Page page = new Page(215, 279, SvgLengthType.SVG_LENGTHTYPE_MM);

				CircuitBoardBase circuitBoardBase = new CircuitBoardBase();
				string svgText = circuitBoardBase.BuildSvg(page);
				Save(svgText, "CircuitBoardBase.svg");

				double outerRadius = 37;
				double slotLength = 12;
				int slotCount = 40;
				double edgeOffset = 0.3;

				EncoderDisk encoderDisk = new EncoderDisk(outerRadius, 4);
				encoderDisk.OuterEncoderRing = new EncoderRing(outerRadius - edgeOffset, slotLength, slotCount, 0);
				encoderDisk.InnerEncoderRing = new EncoderRing(outerRadius - edgeOffset - slotLength, slotLength, slotCount, 180);

				svgText = encoderDisk.BuildSvg(page);
				Save(svgText, "EncoderDisk.svg");

			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.ToString());
			}
			finally
			{
				Console.WriteLine("Done");
				Console.ReadLine();
			}
		}
Пример #2
0
        public void InsertSvg(SvgSvgElement root, int index)
        {
            SvgGroupElement slicesGroup = new SvgGroupElement("Slices" + index.ToString());

            slicesGroup.Style = s_FilledWhite;
            root.AddChild(slicesGroup);

            InsertSlices(slicesGroup);
            // Add inner black disk
            root.AddChild(EncoderDisk.CreateCenteredCircle(this.OuterRadius - this.SlotLength, s_FilledBlack));
        }