Parametric DNA Double Helix Generator¶
Description¶
A procedurally generated model of the Deoxyribonucleic Acid (DNA) double helix. This script demonstrates the power of parametric curves and polar coordinates in CadQuery. The model represents the classical B-DNA structure, featuring two intertwining sugar-phosphate backbones connected by color-coded nitrogenous base pairs. Itโs an excellent educational tool for visualizing molecular biology through the lens of algorithmic design.
Key Features¶
- Dual-Helix Geometry: The backbones are generated using three-dimensional parametric splines defined by sine and cosine functions:
-
Color-Coded Base Pairs: Features a visual representation of adenine, thymine, cytosine, and guanine (A-T, C-G) using distinct colors for the spheres and rungs.
-
Modular Assembly: Each segment of the strand (backbone, base, and hydrogen bond) is an independent object, allowing for easy adjustment of thickness and scale.
-
Periodic Repetition: The script can generate any number of "turns" (periods) of the helix by simply adjusting the total rotation parameter.
Dimensions (Default)¶
- Helix Radius: 10 mm
- Pitch (Height per turn): 34 mm
- Base Pair Diameter: 2 mm
- Sphere Radius: 3 mm