Hi all,
I’m new to Rhino and Grasshopper and currently working on generating a street surface model that follows elevation based on DEM data.
Here is a screenshot of the base geometry I’m working with:
Input Data
I’m using three files:
- DEM (dem.tif) – used to extract elevation (Z values)
- Polygon of the entire survey area (boundary_road.shp) – this is the base surface to be trimmed
- Polygons of city blocks (blocks.shp) – these will be extruded and used to trim the surface
Data set is available here:
(Optional: a street polygon shapefile - 20210101-road_edge_polygon.shp - is also included in the dataset, although not used in the current trimming approach.)
Workflow Summary
- Load the entire survey area polygon (from SHP)
- Convert it to a polyline, adjust each point’s Z value to follow the DEM, and generate a surface (Brep) using
FPatch
+Cap
- Load the city block polygons, extrude them vertically (with enough height to fully intersect the base Brep), and
Join
+Cap
them into solid Breps - Perform a Boolean Difference (Trim) operation:
Trim (A: street surface Brep, B: city block volumes)
The Problem
While some parts are trimmed correctly, many blocks (over half) do not result in any trimmed geometry.
For example, the green block shown below fully intersects the red base Brep, but it does not trim it at all:
I’ve tried the following:
- Ensuring all Breps are Closed
- Applying
Join
+Cap
before trimming - Using
Flatten
on inputs - Confirmed the block visually intersects the base Brep
But the problem still persists in many parts.
Additional Notes
It is appreciated if the holes (city blocks) also can be retrieved during the process as land lot surface.
I initially considered using street polygons directly (instead of trimming), but needed to explode them into points to assign DEM elevation (Z). Rebuilding surfaces from these often led to fragmented geometry, so I opted for this trimming-based approach.
If anyone has insight into why this Boolean Difference is partially failing, or has suggestions for a more robust workflow, I’d really appreciate your help!
Thank you in advance!