Jump to content
ianwww

Why does a boolean intersection of a grid with metaballs give slices with color striations?

Recommended Posts

I've scattered randomly sized and colored metaballs onto a grid (some of which merge), converted them to polygons and then boolean intersected them with the grid, to get colored slices as attached.  The slices have color striations (attached).

Does anyone know what's causing the striations and how to avoid or get rid of them so that I have flat colors?

Metaball_intersected_with_grid.PNG

Share this post


Link to post
Share on other sites

This looks like the boolean has tried to make the flat plane a watertight mesh, meaning it has a polygon on each side of the plane, but since the plane is infinitely thin these two sides are directly on top of each other and are z-fighting with each other. I think you can fix this by telling the boolean to treat your plane like a flat geometry instead of a solid geometry in the boolean node.

Share this post


Link to post
Share on other sites

Thanks for the suggestion but I don't think that's the cause.  I had already specified my grid as a surface (and the polygon as a solid).

I've attached a simpler version of the same issue - this time intersecting a single polysphere with a grid.  It seems that the striations come from the varying point density around the slice (first image).  If I make the point distribution uniform (with an edge equalize SOP), the striations become more uniform (second image) but they're still there.  So, the color of the slice is set by the color of the points (Cd point attribute) around its edge and I think Houdini interpolates color between points as a gradient.

I may be missing something really obvious but I can't work out how to overcome this.

Polysphere_intersected_with_grid.PNG

Polysphere_intersected_with_grid_then_points_uniformed.PNG

Share this post


Link to post
Share on other sites

If it's not the case that the polygon has become two-sided then the issue is most likely just that it is an n-gon. Only having points with normals along the edges means that their value will have to be used for the entire polygon surface, hence why when you equalize the points the lines become less sporadic/random and more ordered.
The only way to fix this I think is to give the mesh propper topology somehow, maybe via subdividing or triangulating the mesh in some way. Maybe forcing the normal direction to be the same could help some but in general, I'd recommend trying to fix the underlying problem of the n-gon.

Share this post


Link to post
Share on other sites

I've found a solution. 

My two part fix required 1) increasing the number of rows and columns in the intersecting grid, and 2) transferring the color attribute from the polygon to the intersecting grid.

Initially, my intersecting grid was only 2 rows by 2 columns (ie. 4 corner points).  In the polysphere example, this gave me the problem pattern (attachment 1).

By making the grid, say, 5 rows by 5 columns and then also doing an attribute transfer of the sphere's Cd to the intersecting grid I get the even color that I wanted (attachment 2).

(Just doing the attribute transfer onto the 2 x 2 grid wasn't enough.  The grid needed to be at least 3 x 3 for the fix to have effect.)

Thanks for your interest and advice!

Slice_for2x2_grid_no_Cd_transfer.PNG

Slice_for5x5_grid_with_Cd_transfer.PNG

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×