X-Git-Url: http://git.scottworley.com/nt3d/blobdiff_plain/08c25ec8473e43e82a1291a528f8332239581483..4a6f6f14490c1c6f51843229d2d521368aa25c7f:/torus_by_extrude.html?ds=inline diff --git a/torus_by_extrude.html b/torus_by_extrude.html index c95f821..10ae92e 100644 --- a/torus_by_extrude.html +++ b/torus_by_extrude.html @@ -3,16 +3,18 @@ <title>Torus by extrude</title> <script type="text/javascript" src="nt3d.js"></script> <script type="text/javascript"> - function torus_by_extrude(torus_radius, cross_section_radius, long_steps, short_steps) { + function torus_by_extrude(torus_radius, cross_section_radius, rotation, long_steps, short_steps) { var path = nt3d.circle(torus_radius, long_steps); + 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.rotate_about_origin(path, [0,0,1], Math.PI/2), + nt3d.shapenormals_from_closed_path(path), [0, 0, 1]); } var params = [["Torus radus", 100], ["Cross section radius", 40], + ["Rotation (turns)", 0.001], ["Steps around the long way", 50], ["Steps around the short way", 16]]; </script>