https://openjscad.org/#https://raw.githubusercontent.com/gilboonet/designs/master/regularPolygons.jscad

My intention is to do the same for common polyhedrons (icosahedron and so on), so users could start a design from one of those volumes, just by picking the corresponding function.

I'm using a function (simpleRotate) to rotate my points, but was there a way to use an internal function to do the same ?

]]>https://openjscad.org/#https://raw.githubusercontent.com/gilboonet/designs/master/regularPolygons.jscad

My intention is to do the same for common polyhedrons (icosahedron and so on), so users could start a design from one of those volumes, just by picking the corresponding function.

I'm using a function (simpleRotate) to rotate my points, but was there a way to use an internal function to do the same ?

]]>The simpleRotate() function isn’t wrong but reminded me of a small piece in the new star primitive (new in V2).

const getPoints = (vertices, radius, startAngle, center) => {

var a1 = degToRad(startAngle)

var a = 2 * Math.PI / vertices

var points = []

for (var i = 0; i < vertices; i++) {

let point = vec2.fromAngleRadians(a * i + a1)

vec2.scale(point, radius, point)

vec2.add(point, center, point)

points.push(point)

}

return points

}

I hope this provides some encouragement.

]]>