示例#1
0
        public void Ribs()
        {
            var ribs = ShapeMaker.L(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Ribs();

            Assert.Equal(6, ribs.Count);
            ribs = ShapeMaker.C(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Ribs();
            Assert.Equal(8, ribs.Count);
            ribs = ShapeMaker.X(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Ribs();
            Assert.Equal(12, ribs.Count);
        }
示例#2
0
        public void Skeleton()
        {
            var skeleton = ShapeMaker.L(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Skeleton();

            Assert.Equal(8, skeleton.Count);
            skeleton = ShapeMaker.C(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Skeleton();
            Assert.Equal(11, skeleton.Count);
            skeleton = ShapeMaker.X(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Skeleton();
            Assert.Equal(16, skeleton.Count);
        }
示例#3
0
        public void L()
        {
            var polygon  = ShapeMaker.L(Vector3.Origin, new Vector3(3.0, 5.0), 1.0);
            var vertices = polygon.Vertices;

            Assert.Contains(vertices, p => p.X == 0.0 && p.Y == 0.0);
            Assert.Contains(vertices, p => p.X == 3.0 && p.Y == 0.0);
            Assert.Contains(vertices, p => p.X == 3.0 && p.Y == 1.0);
            Assert.Contains(vertices, p => p.X == 1.0 && p.Y == 1.0);
            Assert.Contains(vertices, p => p.X == 1.0 && p.Y == 5.0);
            Assert.Contains(vertices, p => p.X == 0.0 && p.Y == 5.0);
        }
示例#4
0
        public void Jigsaw()
        {
            var jigsaw = ShapeMaker.L(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Jigsaw();

            Assert.Equal(6, jigsaw.Count);
            jigsaw = ShapeMaker.C(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Jigsaw();
            Assert.Equal(8, jigsaw.Count);
            jigsaw = ShapeMaker.X(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Jigsaw();
            Assert.Equal(12, jigsaw.Count);
            var model = new Model();

            foreach (var polygon in jigsaw)
            {
                model.AddElement(new Space(polygon, 4.0, new Material(Palette.Aqua, 0.0f, 0.0f, false, null, false, Guid.NewGuid(), "room")));
            }
            model.ToGlTF("../../../../GeometryExTests/output/polygon.Jigsaw.glb");
        }
示例#5
0
        public void Spine()
        {
            var spine = ShapeMaker.L(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Spine();

            Assert.Equal(2, spine.Count);
            spine = ShapeMaker.C(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Spine();
            Assert.Equal(3, spine.Count);
            spine = ShapeMaker.X(Vector3.Origin, new Vector3(100.0, 100.0), 25.0).Spine();
            Assert.Equal(4, spine.Count);
            var model     = new Model();
            var corridors = new List <Polygon>();

            foreach (var line in spine)
            {
                corridors.Add(new Polyline(new[] { line.Start, line.End }).Offset(1.0, EndType.Square).First());
            }
            corridors = Shaper.Merge(corridors);
            foreach (var corridor in corridors)
            {
                model.AddElement(new Space(corridor, 4.0, new Material(Palette.Aqua, 0.0f, 0.0f, false, null, false, Guid.NewGuid(), "corridor")));
            }
            model.ToGlTF("../../../../GeometryExTests/output/polygon.Spine.glb");
        }