Class/Object

edu.berkeley.ce.sparkrocks

Block

Related Docs: object Block | package sparkrocks

Permalink

case class Block(center: Array[Double], faces: Seq[Face], generation: Int = 0) extends Serializable with Product

A rock block.

center

Cartesian coordinates for the center of the rock block. The individual components can be accessed as 'centerX', 'centerY', and 'centerZ'.

faces

The faces that define the boundaries of the rock block.

generation

An integer identifying the joint that caused this rock block to be cut from its parent. The generation is used to avoid unnecessary checks for geometrically redundant faces, but it can be safely left as its default value of 0.

Annotations
@SerialVersionUID()
Linear Supertypes
Product, Equals, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Block
  2. Product
  3. Equals
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Block(center: Array[Double], faces: Seq[Face], generation: Int = 0)

    Permalink

    Create a new rock block

    Create a new rock block

    center

    Cartesian coordinates for the center of the rock block. The individual components can be accessed as 'centerX', 'centerY', and 'centerZ'.

    faces

    The faces that define the boundaries of the rock block.

    generation

    An integer identifying the joint that caused this rock block to be cut from its parent. The generation is used to avoid unnecessary checks for geometrically redundant faces, but it can be safely left as its default value of 0.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def approximateEquals(inputBlock: Block, tolerance: Double = NumericUtils.EPSILON): Boolean

    Permalink

    Compare this block and input block for approximate equality within specified tolerance

    Compare this block and input block for approximate equality within specified tolerance

    inputBlock

    Input block

    returns

    True if blocks are equal, otherwise false

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def calcVertices: Map[Face, Seq[Array[Double]]]

    Permalink

    Calculate the vertices of each face of the block

    Calculate the vertices of each face of the block

    returns

    A mapping from each face of the block to a Seq of vertices for that face This function should only be called once all redundant faces have been removed.

  7. val center: Array[Double]

    Permalink

    Cartesian coordinates for the center of the rock block.

    Cartesian coordinates for the center of the rock block. The individual components can be accessed as 'centerX', 'centerY', and 'centerZ'.

  8. val centerX: Double

    Permalink
  9. val centerY: Double

    Permalink
  10. val centerZ: Double

    Permalink
  11. def centroid: Array[Double]

    Permalink

    Calculates the centroid of the block using simplex integration.

    Calculates the centroid of the block using simplex integration.

    returns

    The centroid of the block, (centerX, centerY, centerZ).

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def cut(joint: Joint, minSize: Double = 0.0, maxAspectRatio: Double = Double.PositiveInfinity, generation: Int = 0): Seq[Block]

    Permalink

    Divide this block into two child blocks if a joint intersects this block.

    Divide this block into two child blocks if a joint intersects this block.

    joint

    A joint that may or may not divide this block.

    minSize

    The minimum radius of a sphere that can be inscribed in the child blocks. If either child block falls below this minimum, no cut is performed.

    maxAspectRatio

    The maximum ratio of a child block's bounding sphere to the radius of the largest sphere that can be inscribed in the block. If either child falls above this minimum, no cut is performed.

    generation

    The generation of any child blocks cut from this joint (see Block constructor documentation for a description of the generation field).

    returns

    A Seq of Block objects, containing the two child blocks divided by the joint if it intersects this block and any minimum requirements for radius or aspect ratio are met. Otherwise, returns a one-item Seq containing only this block.

  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(obj: Any): Boolean

    Permalink
    Definition Classes
    Block → Equals → AnyRef → Any
  16. val faces: Seq[Face]

    Permalink

    The faces that define the boundaries of the rock block.

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. val generation: Int

    Permalink

    An integer identifying the joint that caused this rock block to be cut from its parent.

    An integer identifying the joint that caused this rock block to be cut from its parent. The generation is used to avoid unnecessary checks for geometrically redundant faces, but it can be safely left as its default value of 0.

  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    Block → AnyRef → Any
  21. def intersects(joint: Joint): Option[Array[Double]]

    Permalink

    Determine whether or not a joint intersects this rock block.

    Determine whether or not a joint intersects this rock block.

    joint

    The joint to check for intersection.

    returns

    None if the joint does not intersect this block, or Some((x,y,z)) where (x,y,z) is the point of intersection.

  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. lazy val maxInscribableRadius: Double

    Permalink
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. def nonRedundantFaces: Seq[Face]

    Permalink

    Compute the faces of the rock block that are not geometrically redundant.

    Compute the faces of the rock block that are not geometrically redundant.

    returns

    A list of faces that uniquely determine this rock block and are not geometrically redundant.

  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def orientedVertices: Map[Face, Seq[Array[Double]]]

    Permalink

    Get the counter-clockwise oriented vertices of each face of the block

    Get the counter-clockwise oriented vertices of each face of the block

    returns

    A mapping from each face of the block to a Seq of vertices for that face in a counter-clockwise orientation. This function should only be called once all redundant faces have been removed.

  29. lazy val sphereCenterX: Double

    Permalink
  30. lazy val sphereCenterY: Double

    Permalink
  31. lazy val sphereCenterZ: Double

    Permalink
  32. lazy val sphereRadius: Double

    Permalink
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def updateFaces(localOrigin: Array[Double]): Seq[Face]

    Permalink

    Calculates the distances of the joints relative to a new origin

    Calculates the distances of the joints relative to a new origin

    returns

    List of faces with updated distances

  35. lazy val volume: Double

    Permalink
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Product

Inherited from Equals

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped