An algorithm for point clustering and grid generation | Synapse