]> git.scottworley.com Git - nt3d/blame - torus_by_extrude.html
Make extrude's arguments more flexible and powerful
[nt3d] / torus_by_extrude.html
CommitLineData
fc382d22
SW
1<html>
2 <head>
3 <title>Torus by extrude</title>
4 <script type="text/javascript" src="nt3d.js"></script>
5 <script type="text/javascript">
6 function torus_by_extrude(torus_radius, cross_section_radius, long_steps, short_steps) {
fc382d22 7 var path = nt3d.circle(torus_radius, long_steps);
08c25ec8
SW
8 return nt3d.closed_extrude(
9 path,
10 nt3d.circle(cross_section_radius, short_steps),
11 nt3d.rotate_about_origin(path, [0,0,1], Math.PI/2),
12 [0, 0, 1]);
fc382d22
SW
13 }
14 var params = [["Torus radus", 100],
15 ["Cross section radius", 40],
16 ["Steps around the long way", 50],
17 ["Steps around the short way", 16]];
18 </script>
19 </head>
20 <body onload="nt3d.framework(torus_by_extrude, params)">
21 <h1>Torus by extrude</h1>
22 <p>Make a torus by extruding a circle.</p>
23 </body>
24</html>