Module

MolDraw.BondSegment

Package
purescript-mol-draw
Repository
lukasturcani/molDraw

Defines and deals with bond segments.

To draw a bond, it must be divided into segments. A bond segment is always one color. A single bond will have two bond segments, because the color of each half of the bond must match the color of the atom it is connected to. A double bond will have 4 bond segments. This because you need two sticks to represent a double bond, and those sticks need to be split in half so that each half can have a different color. Triple bonds have 6 bond segments and so on.

#BondSegment Source

data BondSegment

Represents a segment of a bond, of a single color.

Instances

#atom Source

atom :: BondSegment -> GeometryAtom

Get the atom to which the segment is attached.

#position Source

position :: BondSegment -> Position

Get the position of a BondSegment.

#bondSegments Source

bondSegments :: BondOrder -> GeometryAtom -> GeometryAtom -> List BondSegment

Create bond segments from a bond between two atoms.

#gapSize Source

gapSize :: BondSegment -> Number

Get the gap between the BondSegment and the bond center.

#length Source

length :: BondSegment -> Number

Get the length of the segment.

#width Source

width :: BondSegment -> Number

Get the width of the segment.