We use AngelCAD to generate OpenSCAD input :-)
Generate a polygon witn N sides, from an array of positions
// AngelCAD code: openscad_polygon.as
shape@ main_shape()
{
// build an array from np points
array<pos2d@> p;
double rad = 25;
uint np = 16;
for(uint i=0;i<np;i++) {
double angle = i*2*PI/np;
p.push_back(rad*pos2d(cos(angle),sin(angle)));
}
// create a polygon
return polygon(p);
}
void main()
{
shape@ obj = main_shape();
// instead of the usual xcsg, write an OpenSCAD .csg file: openscad_polygon.csg
obj.write_csg(GetInputFullPath());
}