โ† All examples

mesh algorithms

Torus with wrapped texture coordinates

Build a ring torus around the Y axis with unit normals and a texture grid that wraps in both directions. Use it for rings, donuts, tyres and as a genus-one test surface.

Recorded render of Torus with wrapped texture coordinates

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • example.gltf
  • meshkit.py
  • preview.png
  • test_package.py
  • torus.py
  • verification/native.json

How it works

Entry points
torus, main
Parameters
major_radius, minor_radius, segments, sides
Complexity
O(segments * sides)
Axes
+Y up, metres

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • generator_runs_system_python
  • generator_runs_verifier_python
  • gltf_strict_structure
  • interpreters_agree
  • example_matches_generator
  • godot_headless_gltf_load
  • godot_compatibility_render

Limits to consider

The texture seam duplicates one row and one column, so the mesh is closed only after welding. Self-intersecting (horn and spindle) tori, with the minor radius at or above the major radius, are not handled specially. The polygon volume is below the smooth torus's.