boltz_data.draw.mol3d#
Code for generating SVGs of 3D molecules.
Functions
|
Generate ball-and-stick representation primitives for a molecule. |
|
Render 3D primitives to an SVG string with depth-based shading. |
|
Arrange multiple groups of primitives in a grid layout. |
- boltz_data.draw.mol3d.ball_and_stick(bzmol)[source]#
Generate ball-and-stick representation primitives for a molecule.
Creates spheres for atoms and line segments for bonds, colored using CPK coloring. Only includes resolved atoms and bonds between resolved atoms.
- boltz_data.draw.mol3d.draw_3d_svg(*primitives, padding=2, depth=True)[source]#
Render 3D primitives to an SVG string with depth-based shading.
Projects 3D primitives onto 2D using orthographic projection (dropping Z coordinate). Applies depth-based darkening to create a pseudo-3D effect. Sorts primitives by depth for correct occlusion.
- Parameters:
- Return type:
- Returns:
SVG string representation of the 3D scene.
- Raises:
ValueError – If no primitives are provided.