Example #1
0
        public void SimplePipe()
        {
            var pipe    = TestGeomGenerator.CreatePipe();
            var drawing = PipeDrawing.Create(pipe.Body);

            Assert.IsNotNull(drawing.Extents);
            var svg = _Export(drawing);

            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "SimplePipe.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Example #2
0
        public void FindPipe()
        {
            Assert.IsNull(PipeDrawing.FindPipeModifier(null));

            var body1 = TestGeomGenerator.CreateImprint().Body;

            Assert.IsNull(PipeDrawing.FindPipeModifier(body1));

            var pipe  = TestGeomGenerator.CreatePipe();
            var body2 = pipe.Body;

            Assert.AreSame(pipe, PipeDrawing.FindPipeModifier(body2));
        }
Example #3
0
        //--------------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------------

        #region Helper

        public MemoryStream _Export(PipeDrawing pipeDrawing)
        {
            Drawing drawing = new()
            {
                Name = "Pipe"
            };

            drawing.Add(pipeDrawing);

            return(SvgDrawingExporter.Export(drawing));
        }

        #endregion
    }
Example #4
0
        public void SelectBestPosition()
        {
            var           sketch = Sketch.Create();
            SketchBuilder sb     = new SketchBuilder(sketch);

            sb.StartPath(0.0, -48.0);
            sb.LineTo(0.0, 5.0);
            sb.LineTo(-9.0, 4.0);
            sb.LineTo(-18.0, -7.0);
            var body = Body.Create(sketch);
            var pipe = Pipe.Create(body);

            Assume.That(pipe.Make(Shape.MakeFlags.None));

            var drawing = PipeDrawing.Create(pipe.Body);

            Assert.IsNotNull(drawing.Extents);
            var svg = _Export(drawing);

            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "SelectBestPosition.svg"), svg, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
Example #5
0
        public void MultipleDimensionEntities()
        {
            var           sketch = Sketch.Create();
            SketchBuilder sb     = new SketchBuilder(sketch);

            sb.StartPath(0.0, -48.0);
            sb.LineTo(0.0, 5.0);
            sb.LineTo(-9.0, 4.0);
            sb.LineTo(-18.0, -7.0);
            var body = Body.Create(sketch);
            var pipe = Pipe.Create(body);

            Assume.That(pipe.Make(Shape.MakeFlags.None));

            var     pipeDrawing = PipeDrawing.Create(pipe.Body);
            Drawing drawing     = new();

            drawing.Add(pipeDrawing);

            var dxf = DxfDrawingExporter.Export(drawing, DxfVersion.AC1015);

            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "MultipleDimensionEntities.dxf"), dxf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }