hypar-io / Elements

The smallest useful BIM.
https://www.hypar.io
MIT License
352 stars 74 forks source link

Topography Cut/Fill Features #567

Open Gytaco opened 3 years ago

Gytaco commented 3 years ago

Is your feature request related to a problem? Please describe. I would like a way to procedurally setup Cut/Fill features for my sites and load in more detailed sites from other sources. Currently, this is not possible. We are building site selection tools that focus on the potential costs of site works and optimising for this issue. There are no tools that allow you to quickly iterate through topography cut/fill options.

As an output we would require the following.

Describe the solution you'd like An ability to create Custom Topography from dxf or solids that work like the current topography from Mapbox. An ability to use solids or surfaces to Cut (Boolean) into Topography and get the Cut Volume. An ability to use solids or surfaces to Fill creates a new solid between the difference of the current topography and the solid/surfaces. An additional ability to set a gradient of the Fill as well.

This is basically a creation of Revit Site tools with a grading feature to specify the gradient of the site from the surface.

Describe alternatives you've considered Revit currently has most functions but it is not exposed to the API, we have to manually update the pad footings then extract the data then perform another transaction so it is very slow. We have built similar functions with Grasshopper but we have issues with booleans so we had to use mesh conversions to get the work done.

Additional context Cut/Fill example using a Surface. (Expected Functionality) image

Ability to set a Gradient for the Topography image

ikeough commented 3 years ago

Thanks @Gytaco. This is great. I'd propose the following new APIs:

// Cut a Topography with a polygon to a specified depth and return the volume of cut in meters^3
double Topography.Cut(Polygon perimeter, double depth)

// Fill a Topography with a polygon extruded to a specified height, with a specified batter angle, and return the volume of fill in meters^3
double Topography.Fill(Polygon perimeter, double topElevation, double batterAngle)

// Construct a Topography from a set of polylines. Polylines are assumed to be set at elevations representing topographic lines.
Topography(IList<Polyline> polylines)

Does this sound about right?

Another way that I've thought to handle this is to standardize around the Mapbox image format for topographies, a 24bit image where the RGB channels encode the elevation, then to provide APIs that enable you to update that image with cut/fill areas then generate the topography from the image.

Gytaco commented 3 years ago

I think the only issue you've highlighted is what if a Polygon is creating both a cut and fill? I wonder if we just have single command and let the API take of all of it. I know it will be a bit more work but users have to guess which polygons cut and which sections fill could be problematic. Refer to the image above to see what I mean.

It would be great if we can convert a Mapbox mesh into a topography for editing in addition to drawing polylines.