Remesh By Color won't iterate unless the mesh is almost flat?

I’m a few weeks into my Grasshopper adventures, although I have a fair bit of experience with Dynamo. I’m having fun with Kangaroo for form finding, but this particular issue has me completely stumped.

(I’m going to abbreviate RemeshByColor to RMBC)

Method

Model a very basic flat mesh. A rectangle with six rectangular holes.
TriReMesh it to make a dense mesh.
Colour that mesh’s vertices with a reference image.
RMBC to make the mesh denser where the image is darker.

It works. In this image, the bounds of the lookup image are orange, the source mesh is blue, the first remesh is red, and the RMBC is teal (offset for clarity).

Issues

If I move one of the source mesh vertices a little bit out of plane, nothing breaks (although the RMBC needs resetting). But as soon as I go beyond a pretty low threshold, the RMBC turns red complains: 1. Solution exception:Object reference not set to an instance of an object.

Before:

After:

The first remesh is performing fine and can admirably cope with a very contorted source mesh, but RMBC seems really picky about its input. (I have checked all the incoming data with Panels and nothing looks wrong).

And also the RMBC outputs Invalid Mesh unless I fix vertices as well as the curves.This one’s really weird. The output mesh reappears if I set iterations to 0, but that’s useless!

Please tell me there’s something obvious I’ve missed…

Thank you in advance :slight_smile:

remesh by color issues.gh (101.8 KB)
RemeshByColor issues.3dm (99.0 KB)
density map:

I think the problem comes from the following:

these are the deconstructed points of you mesh vertices, and are values measured from the Rhino coordinate system which has Origin at 0,0,0

these intervals, which define X and Y dimension of the rectangle you are using as Boundary, have Origin on the “private” plane on which the Rectangle is built:

indeed if I move the whole geometries away from the Origin, it doesn’t work anymore, and rectangle X, Y interval is indeed unchanged:

I would suggest to use Surface Closest Point instead, with Reparametrized Surface:

Just note, you can always find the Surface Closest Point even if a Vertex is moved completely out of the Rectangle Boundary :upside_down_face: so make sure all the Vertexes always stay inside the Rectangle

remesh by color issues_inno.gh (106.3 KB)

1 Like

Ah of course there’s a better way of getting the parameters from the image. It’s always the way when I have a pile of spaghetti performing some conceptually simple task! Thank you :slight_smile:

However, the problem still persists. Further experimentation with a simple quad for input shows that I have more success if the first remesh is denser. There is no color information being stored in the mesh here

This works:

But this doesn’t:

What’s even wilder is that the one that works still works if I feed it color data:

But only at low RMBC iteration values! that image was generated at 8, but at 9 or above we’re back to old behaviour.

It’s not the first remesh step causing the issue, and it’s not caused by using mm for large objects. I get similar trouble in a brand new file with a 15x15 mesh as input, no colour processing at all and units set to metres.

I’m going to hunt down some example files that use RMBC and see how they work. See if I can bend one into a shape that works for me…