Quad remesh retain mesh shape

Hi community,

I have the following problem with the quad remesh component. I am trying to quad remesh a high number of meshes (walls of a rough building). My goal is to get a mesh with approximately square faces, but still in the same shape as the original mesh.

Example input:

My problem is that no matter how I change the settings of the quad remesh component, it always cuts off the corners of the original geometry. See next image:

Problem (cut off corners)

Could someone help me out and explain how to quad remesh with regular square faces, without losing the original shape? One solution I have tried is to split the original mesh in separate faces. However, this resulted in a significantly higher computation time, because the script has to call the quad remesh component for each wall individually.

Hereby an example attached:
Example_internalized.gh (13.0 KB)

Thank you for your time!

Have you tried using the vertical edges of your input geometry as guides for the quad remesh component?

And set hard edges to True…

That already looks significantly better! Thanks for the suggestion. However, from the top view I can still see some slight variations. Do you have any suggestions how to fix those as well? I don’t mind if there are slightly less square, as long as they fit the original shape. Hereby the script attached:
Example_2_internalized.gh (16.2 KB)

There is no possibilities to fix that with what you want. Discretization means that somewhere there will be some deviation. Most of the time less deviation is denser mesh.
The solutions could be
move the points at the kink but mesh will be less squared ! You can do it with Rhinoceros. Bake the mesh and move the points.
Lower the size of the square

Thanks for letting me know! Unfortunately I have to automate this process for 100.000 meshes, so I think I have to find a work-around for the irregularity then.

Align vertices first maybe?

Shrink wrap in Rhino 8 WIP could also be an option