Module util

Basic definitions and helper functions

Functions

tableEqual (t1, t2)
translateTransf (t, transl, f)
diffTransf (t1, t2)
copy (t) provides a copy function for tables and classes
tableUnique (t[, func=<])
calcScale (dist, angle)
isStraight (e1, e2)
isCircular (e1, e2)

Tables

modelDefinition
edgeDefinition
edgeListDefinition
nodeDefinition
moduleDefinition Each field can also be a function taking the params table and returning the needed value(s)


Functions

tableEqual (t1, t2)

Parameters:

Returns:

    boolean
translateTransf (t, transl, f)

Parameters:

  • t ug.linalg.Mat4x4
  • transl {number,number,number}
  • f number

Returns:

    table
diffTransf (t1, t2)

Parameters:

  • t1 ug.linalg.Mat4x4
  • t2 ug.linalg.Mat4x4

Returns:

    ug.linalg.Mat4x4
copy (t)
provides a copy function for tables and classes

Parameters:

Returns:

    table
tableUnique (t[, func=<])

Parameters:

  • t table
  • func function compare function (default <)

Returns:

    table
calcScale (dist, angle)

Parameters:

  • dist number
  • angle number

Returns:

    number
isStraight (e1, e2)

Parameters:

Returns:

    boolean
isCircular (e1, e2)

Parameters:

Returns:

    boolean

Tables

modelDefinition

Fields:

  • id string model to use in the final construction and preview (if field preview isn't set), empty string = no model at all
  • transf ug.linalg.Mat4x4
  • preview string use this model in the preview instead, empty string = no model at all (optional)
edgeDefinition

Fields:

  • 0 {number,number,number} or vec3 node position inside the module
  • 1 {number,number,number} or vec3 node direction
  • isSnap boolean if this node can be a snapNode (only if not connected inside the final construction) (default false)
  • removable boolean if this node can be removed when trying to simplify the network (default true)
edgeListDefinition

Fields:

  • type ug.construction.EdgeList.type
  • params ug.construction.EdgeList.params
  • alignTerrain ug.construction.EdgeList.alignTerrain (optional)
  • edgeType ug.construction.EdgeList.edgeType (optional)
  • edgeTypeName ug.construction.EdgeList.edgeTypeName (optional)
  • edges {edgeDefinition,...}
  • preview boolean only use these edges in the preview, not in the final construction (default false)
nodeDefinition

Fields:

  • 0 {number,number,number} or vec3 node position inside the module
  • 1 {number,number,number} or vec3 node direction
  • dist number max connection distance for this node in m (default 100)
  • angle number max connection angle for this node in radians (default 2.3562)
moduleDefinition
Each field can also be a function taking the params table and returning the needed value(s)

Fields:

  • models {modelDefinition,...}
  • edgeLists {edgeListDefinition,...} (optional)
  • edgeObjects ug.construction.Instance.edgeObjects (optional)
  • groundFaces ug.construction.Instance.groundFaces (optional)
  • terrainAlignmentLists ug.construction.Instance.terrainAlignmentLists (optional)
  • nodes {nodeDefinition,...} (optional)
  • cost number (optional)
generated by LDoc 1.4.6 Last updated 2018-11-09 12:08:57