Generating a square grid on a freeform shape / brep

You may give it a try with ShapeMap, and for your reference.

ShapeMap_Panel.gh (118.3 KB)