コード例 #1
0
        public void CoreBySketchTest()
        {
            var polygon =
                new Polygon
                (
                    new[]
            {
                new Vector3(5.0, 5.0),
                new Vector3(10.0, 5.0),
                new Vector3(10.0, 10.0),
                new Vector3(5.0, 10.0)
            }
                );
            var model =
                Model.FromJson(System.IO.File.ReadAllText(INPUT + "LevelsByEnvelope.json"));
            var inputs =
                new CoreBySketchInputs(
                    perimeter: polygon,
                    coreHeightAboveRoof: 3.0,
                    "", "", new Dictionary <string, string>(), "", "", "");
            var outputs =
                CoreBySketch.Execute(new Dictionary <string, Model> {
                { "Levels", model }
            }, inputs);

            System.IO.File.WriteAllText(OUTPUT + "CoreBySketch.json", outputs.Model.ToJson());
            outputs.Model.AddElements(model.Elements.Values);
            outputs.Model.ToGlTF(OUTPUT + "CoreBySketch.glb");
        }
コード例 #2
0
        public void CoreBySketchTest()
        {
            var polygons =
                new Polygon [] {
                new Polygon(new Vector3[] {
                    new Vector3(30.0, 30.0),
                    new Vector3(60.0, 30.0),
                    new Vector3(60.0, 60.0),
                    new Vector3(30.0, 60.0)
                }
                            ),
                new Polygon(new Vector3[] {
                    new Vector3(60.0, 60.0),
                    new Vector3(90.0, 60.0),
                    new Vector3(90.0, 90.0),
                    new Vector3(60.0, 90.0)
                }
                            )
            };
            var model   = Model.FromJson(System.IO.File.ReadAllText("../../../../../../TestOutput/LevelsByEnvelope.json"));
            var inputs  = new CoreBySketchInputs(polygons, 3.0, "", "", new Dictionary <string, string>(), "", "", "");
            var outputs = CoreBySketch.Execute(new Dictionary <string, Model> {
                { "Levels", model }
            }, inputs);

            System.IO.File.WriteAllText("../../../../../../TestOutput/CoreBySketch.json", outputs.Model.ToJson());
            outputs.Model.ToGlTF("../../../../../../TestOutput/CoreBySketch.glb");
        }