Replacing a locally deformed surface patch into a surface

Hello everyone,

I am working on a workflow where I want to locally modify an area of an existing surface (for example a sphere). Conceptually, I have a target surface (eg sphere), and I would like to replace a local region of it with a custom deformed surface, while keeping the body watertight

Currently my idea is to do a kind of “ surface replacement”:

  1. I project a reference surface on the target geometry.

  2. I modify this reference surface into the surface I actually want to integrate (transformed surface).

  3. I scale the region of the reference surface slightly to get some tolerance buffer.

  4. I trim out the corresponding area from the target surface using the scaled surface.

  5. I use lofting between the edges to connect the modified surface and the original body.

  6. I try to rebuild it into a surface

This almost works, but in the end I always end up with very small gaps along the transition, most likely due to tolerance.

surface_replacing.gh (4.1 MB)

I think i could transform it into a mesh and then use ShrinkWrap to fix it, but thats to computationally.

Performance is important to me. I deliberately only want to manipulate a small region of the object, because the final models will become larger and more complex. I already tried more approaches such as:

  • converting everything to dense point grids and then deform the points

  • locally increasing mesh resolution (for deformation workflows like Mesh by Color)

Both worked conceptually but became too computationally expensive.

Do you guys have an ideas for:

  • a robust approach for replacing or locally deforming a surface region

  • ideally something that is not extremely computationally heavy

Any guidance, best practices, or example definitions would be highly appreciated.

Thanks!

Where are the gaps in your model?

Wow, i forgot to flatten it…. ^^