โ† All examples

mesh algorithms

Coil spring along a helix

Sweep a round wire along a helix with exact rotation-minimizing frames and flat end caps, giving a closed spring mesh. Use it for mechanical props, suspension parts and coiled cables.

Recorded render of Coil spring along a helix

What this component contains

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

How it works

Entry points
helix_frame, coil_spring, main
Parameters
coil_radius, pitch, turns, wire_radius, steps_per_turn, sides
Complexity
O(turns * steps_per_turn * 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

Turns touch or pass through each other when the pitch is below twice the wire radius; nothing checks this. The volume check allows 0.8 percent below cross-section times helix length, the loss from straight segments and tilted rings at 36 steps per turn. Ends are cut square to the wire (no ground flat ends). No texture coordinates. Cap vertices are separate from the wire ends, so the mesh is closed after welding.