Elements
Elements copied to clipboard
Missing Json types
Is your feature request related to a problem? Please describe. I would like to have MeshElement.json created and Topography.json so I can reference these elements in other schemas.
Describe the solution you'd like Currently, these object types are not available from json which means I am unaware of any method to include it as a serialisable object for other Element types I would like to create and integrate.
Describe alternatives you've considered I have looked around and through the forums but there appears to be no way to reference a class object directly.
Additional context My only other comment is to understand what criteria is required for objects that go into https://github.com/hypar-io/Elements/tree/master/Schemas vs https://github.com/hypar-io/Schemas. There appears to be overlap and there are a number of features in Schemas with the code in the Elements repository. Cleaning this up would make it clearer for users.
~~You should be able to depend on MeshElements + Topography in other functions — because they are "built-in," you don't need to include them in element_types
. To get the topography from the Location function, simply add a dependency on location
and get AllElementsOfType<Topography>
. See the Cut And Fill function for an example: https://github.com/hypar-io/CutAndFill~~
Ah, was too hasty - misread your initial issue.
There is a schema for MeshElement
here: https://prod-api.hypar.io/schemas/MeshElement. We don't currently expose a public schema for Topography, but we could fix this.
To give some more context around our future plans w/r/t schemas — Neither of those locations (https://github.com/hypar-io/Elements/tree/master/Schemas and https://github.com/hypar-io/Schemas) are our "final" strategy for schemas. Instead, we are developing a schema manager UI, where it is easy to browse all available schemas and create new ones:
Thanks Andrew it would be great if there was a way to see those lists? Or is that currently internal?
Here is the snippet of the type I am creating called site. The "SiteSurface" property is what I would like to link with the topography object.
{ "$id": "/Site.json", "$schema": "http://json-schema.org/draft-07/schema#", "description": "The features required for the Site Component.", "title": "Site", "x-namespace": "Elements", "type": [ "object", "null" ], "allOf": [ { "$ref": "https://hypar.io/Schemas/Element.json" } ], "required": [ "discriminator"], "discriminator": "discriminator", "properties": { "discriminator": { "type": "string" }, "SiteBoundaries": { "description": "The site parcels.", "$ref": "Layout.json" }, "SiteSurface": { "description": "The site topography.", "$ref": "TOPOGRAPHY.json" }, }, "additionalProperties": false }
For 2.0, we should expose a schema for topography.