CheL1: The level 1 of CHE - Prograf-UFF/che.js GitHub Wiki

This class represents the level 1 of CHE, it stores the value of the opposite half-edge for each half-edge, and which compound each of the vertices are part of.

Attributes

  • _tableOpposite: stores the opposite of each half-edge
  • _tableConnected: Stores the compound that each vertex is a part of.
  • _nCompound: Stores the amount of compounds found in the mesh.
  • _che: References the Che orchestrator class.

Initializers

  • computeOpposite()
    • Computes the opposite of each half-edge in the mesh.
  • orient()
    • Orients the half-edges of the mesh so they all have the same direction
  • computeConnected()
    • Computes the compound that each vertex is a part of.

Getters

  • compoundCount: returns the amount of compounds in the mesh

  • getCompound(vertexId)

    • returns the compound of the vertex id
  • getComponent(vertexId)

    • discovers which compound is associated with vertexId, sets and returns it.

Setters

  • setConnected(vertex1, vertex2)
    • sets vertex 1 as connected to vertex2
  • setOpposite(heId, oppositeHeId)
    • sets the opposite of heId as oppositeHeId.
  • setNBound(nCompounds)
    • sets the value of _nCompounds

Relation methods

All of the relation methods are enhanced by the new information at level 1.

  • relation00(vertexId)

    • Returns the index of the vertices in the star of the vertex identified by vertexId.
  • relation02(vertexId)

    • Returns the index of the triangles in the star of the vertex identified by vertexId.
  • relation10(halfEdgeId)

    • Returns the index of the vertices in the star of the edge identified by halfEdgeId.
  • relation12(halfEdgeId)

    • Returns the index of the triangles in the star of the edge identified by halfEdgeId.
  • relation22(halfEdgeId)

    • Returns the index of the triangles in the star of the triangle that contains the half-edge identified by halfEdgeId.

Integrity

  • checkConnectedTableSize()
    • check if the amount of items in the _tableConnected array is equal to the amount of vertices of the mesh.
  • checkOppositeTableSize()
    • checks if the amount of items in the _tableOpposite array is equal to the amount of half-edges in the system.
  • checkOpposites()
    • checks if all half-edges and their opposites are correct, i.e. if the opposite half-edge of a half-edge opposite is itself.
  • checkOrientation()
    • checks if the mesh is correctly orientated