addAdjoiningFace2 method

dynamic addAdjoiningFace2(
  1. dynamic eyeVertex,
  2. dynamic horizonEdge
)

Implementation

addAdjoiningFace2(eyeVertex, horizonEdge) {
  // all the half edges are created in ccw order thus the face is always pointing outside the hull

  var face = Face2.create(eyeVertex, horizonEdge.tail(), horizonEdge.head());

  faces.add(face);

  // join face.getEdge( - 1 ) with the horizon's opposite edge face.getEdge( - 1 ) = face.getEdge( 2 )

  face.getEdge(-1)!.setTwin(horizonEdge.twin);

  return face.getEdge(0); // the half edge whose vertex is the eyeVertex
}