I've been trying to learn OpenSCAD recently to work on (Open) OM90, and I am banging my head against the wall. I want to do something like this:

//assume pi and the math functions are already defined

void polygon(int r, int N, int theta, int x_off, int y_off)

{

int x[N];

int y[N];

for(int i = 0; i < N; i++)

{

x[i] = r*cos((2pi*(i/N))+theta)+x_off; //calculates the X coordinate

y[i] = r*sin((2pi*(i/N))+theta)+y_off; //calculates the Y coordinate

}

}

But I don't think that's possible in OpenSCAD. Can someone help me? (also, does anyone know how to do real code posting in blogger?)

## No comments:

## Post a Comment