def grid(script, size=<NUM_LIT:1.0>, x_segments=<NUM_LIT:1>, y_segments=<NUM_LIT:1>, center=False,<EOL>color=None):
size = util.make_list(size, <NUM_LIT:2>)<EOL>filter_xml = '<STR_LIT>'.join([<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(size[<NUM_LIT:0>]),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(size[<NUM_LIT:1>]),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(x_segments + <NUM_LIT:1>),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(y_segments + <NUM_LIT:1>),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'])<EOL>util.write_filter(script, filter_xml)<EOL>if isinstance(script, FilterScript):<EOL><INDENT>script.add_layer('<STR_LIT>', change_layer=True)<EOL><DEDENT>"""<STR_LIT>"""<EOL>transform.vert_function(script, z_func='<STR_LIT>')<EOL>"""<STR_LIT>"""<EOL>if center:<EOL><INDENT>transform.translate(script, value=[size[<NUM_LIT:0>]/<NUM_LIT:2>, -size[<NUM_LIT:1>]/<NUM_LIT:2>, <NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>transform.translate(script, value=[size[<NUM_LIT:0>], <NUM_LIT:0>, <NUM_LIT:0>])<EOL><DEDENT>if color is not None:<EOL><INDENT>vert_color.function(script, color=color)<EOL><DEDENT>return None<EOL>
2D square/plane/grid created on XY plane

    x_segments # Number of segments in the X direction.
    y_segments # Number of segments in the Y direction.
    center="false" # If true square will be centered on origin;
    otherwise it is place in the positive XY quadrant.