- function medusa(first_ring_radius, num_rings, ring_spacing, num_fingers, finger_radius, finger_faces, finger_points, finger_twirl, finger_height) {
- var finger_crosssection = nt3d.circle(finger_radius, finger_faces);
+ function finger(params, finger_crosssection, ring_radius, finger_angle) {
+ var path = [];
+ var twirl_angle = params.finger_twirl_distance / (ring_radius * 2 * Math.PI);
+ console.log(twirl_angle);
+ for (var finger_point = 0; finger_point <= params.finger_points; finger_point++) {
+ var angle = (finger_angle + twirl_angle * finger_point / params.finger_points) * 2 * Math.PI;
+ var x = ring_radius * Math.cos(angle);
+ var y = ring_radius * Math.sin(angle);
+ path.push([x, y, params.finger_height * finger_point / params.finger_points]);
+ }
+ return nt3d.extrude(path, finger_crosssection, [0, 0, 1], nt3d.pathnormals_from_point(path, [0, 0, 0]));
+ }
+ function medusa(params) {
+ var finger_crosssection = nt3d.circle(params.finger_radius, params.finger_faces);