# Extracting Isosurface as Curves

## Recommended Posts

Hi There,

I am trying to extract isosurface from a geometry as curves so that I can manipulate it in another software - Rhino -. I was wondering if there is any procedural way to do that as my geometry will be keep changing.

With my limited knowledge, I thought of trying to somehow convert the black areas into continuous - ideally closed - curves. But I am open to any other suggestion.

The only constraint for me is for these contours to be three dimensional and organic as in the crappy image below. In the multi-color image that would be equivalent to getting a boundary curve for each color.

I have also attached the houdini file

Thanks

Levent

isosurfacetest.hiplc

##### Share on other sites

Here is a solution using some stacked grids and intersect analysis:

• 1

##### Share on other sites

Evenly spaced curves from surface distance:

3D straight skeletons from connecting curves centroids:

iso_curves.hipnc

• 7
• 1

##### Share on other sites

Hey @konstantin magnus, great solution for the contour lines. Thanks for sharing! I'm studying this exact subject and arrived at a similar place but through a different process. However, I have a question regarding this idea of extracting contour edges/lines from meshes and how to create faces from the contour lines.

So this is what I tried...On a high-res mesh box, I add a mountain sop and then I use a copy and transform sop connected to the initial box decreasing its scale and creating copies in a way that all copied and transformed boxes "cover" and slice the box with the mountain noise. After that, I use a boolean sop set to "seams" and the result I get is the contour lines.

However, I'm struggling to find a way to create faces from those contour edges. My goal is to create a topographical terrain or a model where the contour lines are actually extruded steps. I understand how to achieve the extruded steps terrain on a 2D mesh using a boolean sop but on a 3D mesh is a different story. Attached are images showing where I landed with my exercise and the reference showing what I'm trying to achieve. The reference is in 2D but I would like to achieve the same effect on a 3D mesh.

Would you have any recommendation on how to create a 3D model with the same aesthetic as the reference image or possible routes I could try? I tried extruding the initial box inwards to cover all lines and then connect a boolean sop set to subtract but no success. I wonder if the open lines are messing things up. I also tried poly fill and cap sops as a last resort but nothing.  Any help is greatly appreciated.

ContourLines.hip

Edited by Rival Consoles

##### Share on other sites

Hi Rival,

interesting topic, although decorating round shapes with flat slices comes with collisions (activate split along UVs for comparison). Here is a quick sketch on averaging normals, positions and distances for every piece, then projecting the extrusions to individual planes.

slices.hiplc

##### Share on other sites

Hi Konstantin,

Thanks for chiming in on the idea. I'm still trying to get the look i'm going for and your file gave me some ideas for other things that are not quite related to this which is great. Nothing like studying Houdini through hip files. I'll keep trying.

Cheers

##### Share on other sites

I was trying to slice the VDB inside its depth and do booleen but can 't get for a now a nice result in a quick way.

In the second case, i clip the sdf

Im sure there are some way . The two other way i was thinking were

- Render a spherical cam inside using depth image, import it in COP and trace the image slice by slice with a solver

- work in a flat 2d voxel heighfield base and wrap back ...

@konstantin magnus suggestion are always great

##### Share on other sites

Edited by vinyvince

##### Share on other sites
36 minutes ago, vinyvince said:

trying to slice the VDB

You could sample the volume again based on rounded position values:

```float slices = chf('slices');
vector pos = v@P;
pos.x = rint(pos.x * slices) / slices;
f@surface = volumesample(0, 0, pos);```

volume_slices.hiplc

• 1

##### Share on other sites
1 hour ago, konstantin magnus said:

You could sample the volume again based on rounded position values:

```
float slices = chf('slices');
vector pos = v@P;
pos.x = rint(pos.x * slices) / slices;
f@surface = volumesample(0, 0, pos);```

Here we go, Rival you own Konstantin's a beer

##### Share on other sites

Now come the same problem to for example compute the gradient. Knowing you could only compute one direction gradient,  how will you combine the 3 directions, in a like triplanar way or spherical way (my suggestions above).. that's the hard part, maybe it's also hardly make sense, i though its was What Rival wanted no?

##### Share on other sites

You could simply step the displacement amounts:

volume_terraces.hiplc

• 1

## Create an account

Register a new account