def annulus(script, radius=None, radius1=None, radius2=None, diameter=None,<EOL>diameter1=None, diameter2=None, cir_segments=<NUM_LIT:32>, color=None):
if radius is not None and diameter is None:<EOL><INDENT>if radius1 is None and diameter1 is None:<EOL><INDENT>radius1 = radius<EOL><DEDENT>if radius2 is None and diameter2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT><DEDENT>if diameter is not None:<EOL><INDENT>if radius1 is None and diameter1 is None:<EOL><INDENT>radius1 = diameter / <NUM_LIT:2><EOL><DEDENT>if radius2 is None and diameter2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT><DEDENT>if diameter1 is not None:<EOL><INDENT>radius1 = diameter1 / <NUM_LIT:2><EOL><DEDENT>if diameter2 is not None:<EOL><INDENT>radius2 = diameter2 / <NUM_LIT:2><EOL><DEDENT>if radius1 is None:<EOL><INDENT>radius1 = <NUM_LIT:1><EOL><DEDENT>if radius2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT>filter_xml = '<STR_LIT>'.join([<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>' % radius1,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>' % radius2,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>' % cir_segments,<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>if color is not None:<EOL><INDENT>vert_color.function(script, color=color)<EOL><DEDENT>return None<EOL>
Create a 2D (surface) circle or annulus
    radius1=1 # Outer radius of the circle
    radius2=0 # Inner radius of the circle (if non-zero it creates an annulus)
    color="" # specify a color name to apply vertex colors to the newly created mesh

    OpenSCAD: parameters: diameter overrides radius, radius1 & radius2 override radius