Creates a torus knot mesh primitive (twisted mathematical knot shape). Takes textureSlots, uvMode, unique, p (number of times knot winds around major axis, clamped 1-16), q (number of times knot winds around minor axis, clamped 1-16), segments (path detail, clamped 8-256), sides (tube detail, clamped 3-32), majorRadius (knot overall size), minorRadius (tube thickness). Returns mesh entity handle or 0 on failure.
Creates a torus knot mesh primitive (twisted mathematical knot shape). Takes textureSlots, uvMode, unique, p (number of times knot winds around major axis, clamped 1-16), q (number of times knot winds around minor axis, clamped 1-16), segments (path detail, clamped 8-256), sides (tube detail, clamped 3-32), majorRadius (knot overall size), minorRadius (tube thickness). Returns mesh entity handle or 0 on failure. Creates surface-based mesh using parametric torus knot equations, generates twisted tube along knot path, sets normals, unlocks. Returns mesh entity handle.
This function creates decorative mathematical knots for artistic and geometric shapes. Torus knot = tube that winds around torus surface (p,q) times without intersecting itself. p parameter: windings around major circle (horizontal loops). q parameter: windings around minor circle (vertical loops). Common knots: (2,3)=trefoil knot, (3,2)=cinquefoil, (5,2)=pentafoil, (3,4)=figure-eight variant. Clamped p/q: 1-16 (higher values create complex multi-loop knots). segments: subdivisions along knot path (higher = smoother curves), clamped 8-256. sides: tube cross-section detail (higher = rounder tube), clamped 3-32. majorRadius: overall knot size. minorRadius: tube thickness. Use cases: (1) Decorative knots (Celtic designs), (2) Mathematical visualization (topology education), (3) Jewelry (knot pendants, rings), (4) Abstract art, (5) Science fiction props. Common pattern: knot=b3dCreateTorusKnot(BBR_ONE_SLOT, BBR_TEXTURE_UV, 0, 2, 3, 128, 16, 1.0, 0.2), creates smooth trefoil knot. Vertex count: segments x sides. Triangle count: 2 x segments x sides. segments=128, sides=16: 2048 vertices, 4096 triangles. Quality: higher segments for smooth path curves, higher sides for round tube. Typical values: segments=64-128 for smooth knots, sides=12-16 for good tube. Normals: perpendicular to tube surface. UV mapping: wraps around tube. Parametric equations: x = (majorRadius + minorRadius x cos(qxt)) x cos(pxt), y = minorRadius x sin(qxt), z = (majorRadius + minorRadius x cos(qxt)) x sin(pxt). Alternative: b3dCreateTorus for simple torus, custom spline mesh for arbitrary curves. Modification: surface-based, editable. Self-intersection: some (p,q) combinations may self-intersect visually (not topologically).