- var cross_section = nt3d.circle(cross_section_radius, short_steps);
- var cross_section_normals = nt3d.rotate_about_origin(path, [0,0,1], Math.PI/2);
- var path_normals = [];
- path_normals.length = long_steps;
- for (var i = 0; i < long_steps; i++) {
- path_normals[i] = [0, 0, 1];
- }
- return nt3d.closed_extrude(path, cross_section, cross_section_normals, path_normals);
+ path = nt3d.rotate_about_origin(path, [0,1,0], rotation * 2*Math.PI);
+ return nt3d.closed_extrude(
+ path,
+ nt3d.circle(cross_section_radius, short_steps),
+ nt3d.shapenormals_from_closed_path(path),
+ [0, 0, 1]);