createSegmentTrianglesWithMiddleSection method

dynamic createSegmentTrianglesWithMiddleSection(
  1. dynamic joinIsOnLeftSide,
  2. dynamic innerSideModified,
  3. dynamic u1
)

Implementation

createSegmentTrianglesWithMiddleSection(
    joinIsOnLeftSide, innerSideModified, u1) {
  if (innerSideModified) {
    if (joinIsOnLeftSide) {
      addVertex(lastPointR, u0, 1);
      addVertex(lastPointL, u0, 0);
      addVertex(currentPointL, u1, 0);

      addVertex(lastPointR, u0, 1);
      addVertex(currentPointL, u1, 0);
      addVertex(innerPoint, u1, 1);

      addVertex(currentPointL, u0, 0);
      addVertex(currentPoint, u1, 0.5);
      addVertex(innerPoint, u1, 1);

      addVertex(currentPoint, u1, 0.5);
      addVertex(nextPointL, u0, 0);
      addVertex(innerPoint, u1, 1);
    } else {
      addVertex(lastPointR, u0, 1);
      addVertex(lastPointL, u0, 0);
      addVertex(currentPointR, u1, 1);

      addVertex(lastPointL, u0, 0);
      addVertex(innerPoint, u1, 0);
      addVertex(currentPointR, u1, 1);

      addVertex(currentPointR, u0, 1);
      addVertex(innerPoint, u1, 0);
      addVertex(currentPoint, u1, 0.5);

      addVertex(currentPoint, u1, 0.5);
      addVertex(innerPoint, u1, 0);
      addVertex(nextPointR, u0, 1);
    }
  }
}