Skip to main content

Module spokes

Module spokes 

Source
Expand description

Ring-center spoke detection and rigid placement (CX m:).

The SMILES dummy * is dropped from the spoke graph so it is not an extra CoordGen vertex. The first real bond is placed at a 120° chain angle to the stem (ethyl zigzag), not collinear with the centroid. A silent dummy sits at the centroid; the painted stem runs from there to the substituent (one bond past the ring).

Structs§

SpokeComp
One ring-center substituent after dropping the dummy from the spoke graph.

Constants§

CHAIN_BOND_OFFSET
120° chain bond at the attachment carbon (turn of π/3 off the stem).

Functions§

ang_diff
bisector_angles
Outward angles of ring-bond perpendicular bisectors (centroid → midpoint).
detect_ring_spokes
Detect CX m: groups whose endpoints lie on a ring (fusion allowed).
first_spoke_neighbor
First substituent neighbor of attach in spoke_atoms (not dummy).
greedy_spoke_angle
Greedy bisector slot, then 1-D refine (rigid rotation around the centroid).
kink_turn
Interior direction change at b along a → b → c (0 = collinear).
place_spoke
Rotate/translate local so attach sits at centroid + L·u(θ).
point_segment_dist
ring_exit_along_ray
Distance from the ring centroid along angle to the ring perimeter.
spoke_angle_energy
Energy of a stem angle: hard no-cross of ring atoms, soft snap to a bisector.
spoke_stem_len
Stem length: ring perimeter along the ray, plus one house bond — not from the centroid (too close) and not an extra bond past the ring (too far).