Offsetting a open polysurfacesurface/mesh according to heightmap surface


I have been enjoying getting a grip of Rhino and Grasshopper with the aim of using it to build 3D solid models based on a scanned (open) 3D surface and various user parameters. The surface scan is of a custom seat and starts as a mesh. Where I am currently having trouble is applying a variable offset to that scanned surface, specified by a heightmap style surface. The heightmap is a surface in Rhino.

Thus far I have been successful in applying this variable offset based on a heightmap surface to a surface. This uses a method (in the grasshopper code attached, which works with the models in the rhino file) where:

  1. A uv coordinate grid is calculated for both surfaces
  2. Normal vectors at these coordinates over the surface to offset calculated
  3. The vectors scaled in magnitude based on the heightmap height the uv coordinate grid is moved by these vectors
  4. A new, offsetted surface is recreated based on this grid. This method and the result is shown in the below image, and can be recreated with the attached files.

I have converted the mesh scan (also in the Rhino file) to a NURBs representation. This is an open polysurface with over a 100 surfaces. Unfortunately, the above method does not directly work for offsetting an open polysurface. I have tried a few other things to either convert the polysurface to a surface or achieve the variable offset:

  • Trying to combine the surfaces in the polysurface into one surface using a combination of matchsrf, blendsrf and mergesrf. This can reduce the number of surfaces, but not down to one. This is due to mismatches in the edge length of the surfaces.
  • Contouring the object in various directions and using Loft and Sweep1 to recreate the form (this is difficult and fails because of the interrupted contours that result with this kind of model)
  • Attractors (don’t seem to give a specific enough offset at a given position)

Perhaps it is also possible to offset the mesh directly, but I have not been successful in my attempts to do this as recreating the mesh surface from the offsetted points resulted in holes and kinks in the offsetted mesh.

I would appreciate any tips on how I can use the heightmap surface to offset the mesh (or open polysurface representation of the mesh).

Note: for this case, the accuracy does not need to be extremely high - within 0.5-1mm is fine. Another pragmatic point is that I am trying to automate this operation as much as possible (part of the reason I am using grasshopper), hence, an approach that requires manually merging all surfaces or lots of tweaking is less relevant.


Map_heightmapsurface_open_scanned_surface.3dm (4.3 MB) (11.7 KB)