Module

MolDraw.DrawMol.Mesh

Package
purescript-mol-draw
Repository
lukasturcani/molDraw

Deals with three.js meshes.

#Mesh Source

data Mesh

Represents a three.js mesh.

#MeshOptions Source

type MeshOptions = { atomColor :: GeometryAtom -> Color, atomHeightSegments :: Int, atomScale :: Number, atomSize :: GeometryAtom -> Number, atomWidthSegments :: Int, bondHeightSegments :: Int, bondRadialSegments :: Int, material :: Color -> Material }

Holds user-provided options for customizing the drawn mesh.

  • atomSize: Takes a GeometryAtom and returns the size it should be drawn with.
  • atomColor: Takes a GeometryAtom and returns the color it should be drawn with.
  • atomScale: A scaling factor applied to the sizes of all atoms.
  • atomWidthSegments: The number of width segments used to draw each atom. More segments make the the atoms look rounder, but are more expensive to draw.
  • atomHeightSegments: The number of height segments used to draw each atom. More segments make the atoms look rounder, but are more expensive to draw. bondRadialSegments: The number of radial segments used to draw bonds. bondHeightSegments: The number of height segments used to draw bonds. material: Takes a color, and returns the material used for drawing atoms and bonds.

#Color Source

type Color = Int

#Material Source

data Material

Represents three.js materials.

#meshes Source

meshes :: MeshOptions -> GeometryData -> Array Mesh

Create the meshes which compose a molecule.