Lattice vox.lattice.Lattice

Represents a 3D lattice. This is an abstract class documenting the interface which all lattices must implement.

The main responsibility of the lattice is to translate between 3D coordinates and "lattice" coordinates (or "lattice positions"). A lattice position is an array of 3 or 4 numbers:

[helix X position (a), helix Y position (b), helix Z position (voxel number) (c), base index (d)]

The base index d is optional, and should be a position between 0 and <code>#length(a,b,c)</code>.

Properties

Access properties with .nameand .name = value.

  • depth : Number

    Size of the lattice in the z-direction

  • description : String

    Textual description of the lattice's configuration

  • height : Number

    Size of the lattice in the y-direction

  • width : Number

    Size of the lattice in the x-direction

Methods

Call methods with.name(),.name(arguments)or just .name arguments .

  • constructor ([w], [h], [d], options) -> vox.lattice.Lattice#
    Parameters
    w
    Number

    Width of the lattice

    (Optional)
    h
    Number

    Height of the lattice

    (Optional)
    d
    Number

    Depth of the lattice

    (Optional)
    options
    Object

    Options to be copied to the lattice

  • base (a, b, c, d, dir) -> Object#

    Get the geometry associated with a particular base; relies on cellSpline

    Parameters
    a
    Number
    b
    Number
    c
    Number
    d
    Number
    dir
    Number

    Direction of the base: +1 for 5' to 3' along the helical axis, -1 for 3' to 5'

    Return
    return
    Object
  • cellFootprint (a, b, c) -> THREE.Geometry#

    Returns a geometry associated with the 2d "footprint" of the cell, centered at the origin in world coordinates. These geometries for each cell are concatenated together to form the grid. Geometries should be in the THREE.LinePieces format (e.g. elements of the THREE.Geometry.vertices should be in pairs, where elements i and i+1 each represent a line segment.

    Parameters
    a
    Number
    b
    Number
    c
    Number
    Return
    return
    THREE.Geometry

    Geometry of the footprint

  • cellGeometry (a, b, c) -> THREE.Geometry#

    Returns a geometry for the cell at position a,b,c in the lattice, centered at the origin in world coordinates.

    Parameters
    a
    Number
    b
    Number
    c
    Number
    Return
    return
    THREE.Geometry

    Geometry of the cell

  • cellSpline (a, b, c) -> THREE.SplineCurve3#

    Returns a Catmull-Rom spline pointing from position a, b, c-1 to position a, b, c+1, through the center of cell a, b, c. The center of the spline (t=0.5) should correspond to the middle of the cell and should be at the origin in world coordinates.

    Parameters
    a
    Number
    b
    Number
    c
    Number
    Return
    return
    THREE.SplineCurve3
  • centroid ( ) -> [type]#

    Returns the position o

    Return
    return
    [type]

    [description]

  • each (iterator) -> undefined#

    Apply method to each vector on the lattice

    Parameters
    iterator
    Function

    Iterator to recieve point argument

  • isOnLattice (a, b, c, [d]) -> Boolean#

    Determines if a vector (a,b,c) is on the lattice

    Parameters
    a
    Number
    b
    Number
    c
    Number
    d
    Number (Optional; defaults to 0)
    Return
    return
    Boolean

    true if the vector is on the lattice, else false

  • latticeToPoint (a, b, c) -> Array#

    Accepts a position on the lattice and gives the center point of that cell in 3D space

    Parameters
    a
    Number
    b
    Number
    c
    Number
    Return
    return
    Array

    Point in 3D space

  • length (a, b, c) -> Number#

    Returns the length of the given voxel, in bases

    Parameters
    a
    Number
    b
    Number
    c
    Number
    Return
    return
    Number

    Length

  • max ( ) -> Array#

    Returns the top/right/front position of the lattice---the highest- numbered valid position on the lattice.

    Return
    return
    Array

    [X position, Y position, Z position]

  • maxLength ( ) -> Number#

    Gives the largest length of any voxel on the lattice; this is useful for constructing fixed-size arrays, even when the lattice may have variable-length voxels.

    Return
    return
    Number

    Max length

  • min ( ) -> Array#

    Returns the bottom/left/back position of the lattice---the lowest- numbered valid position on the lattice.

    Return
    return
    Array

    [X position, Y position, Z position]

  • neighbor (a, b, c, d, dir, neighbor) -> Number[]#

    Gets the 5' or 3' neighbor of a base at [a, b, c, d] running in the given direction

    Parameters
    a
    Number
    b
    Number
    c
    Number
    d
    Number
    dir
    Number

    Direction of the strand; +1 is 5' -> 3', -1 is 3' -> 5'f

    neighbor
    Number

    Which neighbor; +1 is 3', -1 is 5'

    Return
    return
    Number[]

    Position of the neighboring base [a', b', c', d']

  • neighbor3p (a, b, c, d, dir) -> Number[]#

    Gets the 3' neighbor of a base at [a, b, c, d] running in the given direction

    Parameters
    a
    Number
    b
    Number
    c
    Number
    d
    Number
    dir
    Number

    Direction of the strand; +1 is 5' -> 3', -1 is 3' -> 5'

    Return
    return
    Number[]

    Position of the neighboring base [a', b', c', d']

  • neighbor5p (a, b, c, d, dir) -> Number[]#

    Gets the 5' neighbor of a base at [a, b, c, d] running in the given direction

    Parameters
    a
    Number
    b
    Number
    c
    Number
    d
    Number
    dir
    Number

    Direction of the strand; +1 is 5' -> 3', -1 is 3' -> 5'

    Return
    return
    Number[]

    Position of the neighboring base [a', b', c', d']

  • pointToCenter (x, y, z) -> Array#

    Snaps a point in 3D space to the center of the corresponding lattice cell.

    Parameters
    x
    Number
    y
    Number
    z
    Number
    Return
    return
    Array

    Center point in 3D space

  • pointToLattice (x, y, z, base) -> Array#

    Converts a point in 3D space to a position vector on the lattice

    Parameters
    x
    Number
    y
    Number
    z
    Number
    base
    Boolean

    true to give the base index as the fourth position value

    Return
    return
    Array

    Position on the lattice

  • shape ( ) -> Array#

    Returns the shape of the lattice: [width, height, depth]

    Return
    return
    Array

    Shape of the lattice