/torus3D-code

Torus code in Processing and in 3Dturtle-LOGO project

Primary LanguageProcessing

torus3D-code

Torus code in Processing and in 3Dturtle-LOGO project

Repo that captures the code to build a Torus using 3D Turtle/LOGO program by @Chrisir. In the initial four scripts I capture my steps to reach to the final goal: Step 1: Draw a circle, the main axis of the Torus Step 2: Draw concentric rings: For each delta step in the main axis, draw a full circle in a plane perpendicular to the main axis' current step. Step 3: Draw a Torus as two repeats: Firs rpeat draws a circle while second repeat takes care of the steering to follow circle. Step 4: Extra step only to show how to draw a spiral. It is intrinsic to the construction of the torus. Steering applied to a sprial object ONLY at the right position and direction is what creates a torus. Advanced torus knots could be created my having stearing of mixed angles.

References for this code:

Turtle3D/LOGO: https://forum.processing.org/two/discussion/comment/101179/#Comment_101179 Torus 3D parametric equation: https://math.stackexchange.com/questions/1352792/how-to-derive-the-3d-equation-of-a-torus Torus know discussion: https://forum.processing.org/two/discussion/comment/102748/#Comment_102748

I added a Processing version of creating a Torus based on two vector operations. I will be interesting to generate the parametric version of this solution but that will be for another day. For the Processing version, instructions on how to run the script is provided when running the sketch.

END@KF@29JUL2017