public async Task InvokeFunction() { var root = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../../"); var config = Hypar.Model.Function.FromJson(File.ReadAllText(Path.Combine(root, "hypar.json"))); var store = new FileModelStore <FacadeByEnvelopeInputs>(root); // Create an input object with default values. var input = new FacadeByEnvelopeInputs(); // Read local input files to populate incoming test data. if (config.ModelDependencies != null) { var modelInputKeys = new Dictionary <string, string>(); foreach (var dep in config.ModelDependencies) { modelInputKeys.Add(dep.Name, $"{dep.Name}.json"); } input.ModelInputKeys = modelInputKeys; } // Invoke the function. // The function invocation uses a FileModelStore // which will write the resulting model to disk. // You'll find the model at "./model.gltf" var l = new InvocationWrapper <FacadeByEnvelopeInputs, FacadeByEnvelopeOutputs>(store, FacadeByEnvelope.Execute); await l.InvokeAsync(input); }
public void FacadeByEnvelopeTest() { var inputs = new FacadeByEnvelopeInputs( panelWidth: 3.0, glassLeftRightInset: 3.0, glassTopBottomInset: 3.0, panelColor: Colors.Yellow, groundFloorSetback: 1.0, "", "", new Dictionary <string, string>(), "", "", ""); var envModel = Model.FromJson(System.IO.File.ReadAllText(INPUT + "Envelope.json")); var lvlModel = Model.FromJson(System.IO.File.ReadAllText(INPUT + "Levels.json")); var outputs = FacadeByEnvelope.Execute( new Dictionary <string, Model> { { "Envelope", envModel }, { "Levels", lvlModel } }, inputs); System.IO.File.WriteAllText(OUTPUT + "FacadeByEnvelope.json", outputs.Model.ToJson()); outputs.Model.AddElements(envModel.Elements.Values); outputs.Model.AddElements(lvlModel.Elements.Values); outputs.Model.ToGlTF(OUTPUT + "FacadeByEnvelope.glb"); }
public async Task InvokeFunction() { var store = new FileModelStore <FacadeByEnvelopeInputs>("./", true); // Create an input object with default values. var input = new FacadeByEnvelopeInputs(); // Invoke the function. // The function invocation uses a FileModelStore // which will write the resulting model to disk. // You'll find the model at "./model.gltf" var l = new InvocationWrapper <FacadeByEnvelopeInputs, FacadeByEnvelopeOutputs>(store, FacadeByEnvelope.Execute); var output = await l.InvokeAsync(input); }