Exemple #1
0
        public void Units(DxfUnitsType sourceUnits, DistanceUnitsType destUnits)
        {
            var reader = new DXFReader(CreateTestPolyline(), sourceUnits);

            reader.Should().NotBeNull();

            reader.FindEntitiesSection().Should().BeTrue();

            var success = reader.GetBoundaryFromPolyLineEntity(true, out var eof, out var boundary);

            success.Should().BeTrue();

            boundary.Boundary.Points.Should().BeEquivalentTo(new List <FencePoint>
            {
                new FencePoint(0, 0),
                new FencePoint(10 * UnitUtils.DistToMeters(destUnits), 0),
                new FencePoint(0, 10 * UnitUtils.DistToMeters(destUnits))
            });
        }
Exemple #2
0
        public void ReadSimplePolyLine()
        {
            var reader = new DXFReader(CreateTestPolyline(), DxfUnitsType.Meters);

            reader.Should().NotBeNull();

            reader.FindEntitiesSection().Should().BeTrue();

            var success = reader.GetBoundaryFromPolyLineEntity(true, out var eof, out var boundary);

            success.Should().BeTrue();

            boundary.Should().NotBeNull();
            boundary.Name.Should().BeEmpty();
            boundary.Type.Should().Be(DXFLineWorkBoundaryType.Unknown);

            boundary.Boundary.Points.Count.Should().Be(3);
            boundary.Boundary.Points.Should().BeEquivalentTo(new List <FencePoint> {
                new FencePoint(0, 0), new FencePoint(10, 0), new FencePoint(0, 10)
            });
        }