コード例 #1
0
        public void SubdivideSlabRotated()
        {
            var polygon = new Polygon(new[] {
                new Vector3(0.0, 0.0),
                new Vector3(5.0, 0.0),
                new Vector3(10.0, 5.0),
                new Vector3(5.0, 10.0)
            });
            var model = new Model();

            model.AddElement(new Floor(polygon, 2.0));
            var inputs = new SubdivideSlabInputs(
                length: 2.0,
                width: 2.0,
                subdivideAtVoidCorners: false,
                alignToLongestEdge: true,
                "", "", new Dictionary <string, string>(), "", "", "");
            var outputs = SubdivideSlab.Execute(new Dictionary <string, Model> {
                { "Floors", model }
            }, inputs);

            System.IO.File.WriteAllText(OUTPUT + "SubdivideSlabRotated.json", outputs.Model.ToJson());
            outputs.Model.AddElements(model.Elements.Values);
            outputs.Model.ToGlTF(OUTPUT + "SubdivideSlabRotated.glb");
        }
コード例 #2
0
ファイル: RunTest.cs プロジェクト: M-JULIANI/BuildingBlocks
 public void RunSubdivAlgo()
 {
     var jsonIn  = System.IO.File.ReadAllText("../../../../Floors.json");
     var model   = Model.FromJson(jsonIn);
     var inputs  = new SubdivideSlabInputs(2, 2, false, true, "", "", new Dictionary <string, string>(), "", "", "");
     var outputs = SubdivideSlab.Execute(new Dictionary <string, Model> {
         { "Floors", model }
     }, inputs);
     var json = outputs.Model.ToJson();
 }
コード例 #3
0
ファイル: RunTest.cs プロジェクト: M-JULIANI/BuildingBlocks
        public void TestRotation()
        {
            var polygon = new Polygon(new[] {
                new Vector3(0, 0, 0),
                new Vector3(5, 0, 0),
                new Vector3(10, 5, 0),
                new Vector3(5, 10, 0)
            });
            var profile = new Profile(polygon);
            var floor   = new Floor(profile, 2);
            var model   = new Model();

            model.AddElement(floor);
            var inputs = new SubdivideSlabInputs(2, 2, false, true, "", "", new Dictionary <string, string>(), "", "", "");

            var outputs = SubdivideSlab.Execute(new Dictionary <string, Model> {
                { "Floors", model }
            }, inputs);
            var json = outputs.Model.ToJson();
        }
コード例 #4
0
        public void SubdivideSlabImportFloor()
        {
            var model =
                Model.FromJson(System.IO.File.ReadAllText(INPUT + "Floors.json"));
            var inputs =
                new SubdivideSlabInputs(
                    length: 200.0,
                    width: 200.0,
                    subdivideAtVoidCorners: false,
                    alignToLongestEdge: true,
                    "", "", new Dictionary <string, string>(), "", "", "");
            var outputs =
                SubdivideSlab.Execute(new Dictionary <string, Model> {
                { "Floors", model }
            }, inputs);

            System.IO.File.WriteAllText(OUTPUT + "SubdivideSlabImportFloor.json", outputs.Model.ToJson());
            outputs.Model.AddElements(model.Elements.Values);
            outputs.Model.ToGlTF(OUTPUT + "SubdivideSlabImportFloor.glb");
        }