Torus Knot shape is a complex shape that is useful for testing materials. We’d recommend trying it in the GUI-mode first, before scripting. It adds some new properties, compared to simple torus:
Basically, the larger numbers you use for Segments and Sides, the smoother shape you get.
Here is a sample script that creates a torus knot object:
var m = scene.root.addMesh("torus", "generator.simple.TorusKnot"); var g = m.generator; g.size = 10; g.amplitude = 5; g.thickness = 3; g.turns1 = 2; g.turns2 = 3; g.segments = 256; g.sides = 32;