Skip to content
AsciiC6hem

Coordinates

Atoms can carry explicit coordinates using the @(x,y) (2D) or @(x,y,z) (3D) suffix. These map to CML x2/y2 or x3/y3/z3 attributes on the <atom> element.

Source Rendered
C@(10,20)
C

The two numbers inside @(...) are the x and y positions. Negative coordinates are supported.

Source Rendered
C@(0,0)-O@(10,0)-H@(10,5)
C - O - H

Add a third number for z-axis:

Source Rendered
C@(1,2,3)
C

3D coordinates map to CML x3/y3/z3 attributes. The Layout module uses pre-positioned atoms directly — elkrb layout is skipped when all atoms carry coordinates.

Source Rendered
C@(0,-5)
C
C@(-10.5,3.2)
C

2D coordinates produce x2/y2 attributes:

<atom id="a1" elementType="C" x2="10" y2="20"/>

3D coordinates produce x3/y3/z3 attributes:

<atom id="a1" elementType="C" x3="1.0" y3="2.0" z3="3.0"/>

Coordinates survive AsciiChem → CML → AsciiChem round-trip without loss. When parsed back, the Layout module uses the CML coordinates directly for SVG rendering.

Play