addVertexToHull method

ConvexHull addVertexToHull(
  1. VertexNode eyeVertex
)

Implementation

ConvexHull addVertexToHull(VertexNode eyeVertex) {
  var horizon = [];

  unassigned.clear();

  // remove 'eyeVertex' from 'eyeVertex.face' so that it can't be added to the 'unassigned' vertex list

  removeVertexFromFace2(eyeVertex, eyeVertex.face!);

  computeHorizon(eyeVertex.point, null, eyeVertex.face!, horizon);

  addNewFace2s(eyeVertex, horizon);

  // reassign 'unassigned' vertices to the new faces

  resolveUnassignedPoints(newFace2s);

  return this;
}