-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathtwisted-torus-ring.scad
More file actions
35 lines (30 loc) · 935 Bytes
/
twisted-torus-ring.scad
File metadata and controls
35 lines (30 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// by Les Hall
// started 4-16-2014
// Generalized to use sweep() by Marius Kintel
use <sweep.scad>
use <scad-utils/transformations.scad>
use <scad-utils/shapes.scad>
use <scad-utils/linalg.scad>
use <draw-helpers.scad>
amplitude = 1.5;
margin = 0.1;
numRings = 4;
numRolls = 3;
separationAngle = 360 / numRings;
shapeRadius = amplitude * sin(separationAngle/2) - 2*margin;
ringDiameter = 14.88 + amplitude + shapeRadius;
numSegments = 100;
function shape() = circle(shapeRadius, $fn=16);
function f(t, i) = take3(
rotation([0,0,t*360]) *
translation([ringDiameter/2, 0, 0]) *
rotation([-90,0,0]) *
rotation([0,0,i*separationAngle + t*360*numRolls]) *
translation([amplitude, 0, 0]) * [0,0,0,1]);
for (i=[0:numRings-1]) {
assign (path = [ for (t = [0:1/numSegments:1]) f(t, i) ]) {
assign(path_transforms = construct_transform_path(path)) {
sweep(shape(), path_transforms, true);
}
}
}