docs: @SuppressWarnings("checkstyle:npathcomplexity")
      public int computeCrossings(
              int crossings,
              double x0, double y0, double z0,
              double x1, double y1, double z1) {
          int numCrosses =
                  Segment3afp.computeCrossingsFromRect(crossings,
                          this.boundingMinX,
                          this.boundingMinY,
                          this.boundingMinZ,
                          this.boundingMaxX,
                          this.boundingMaxY,
                          this.boundingMaxZ,
                          x0, y0, z0,
                          x1, y1, z1);
  
          if (numCrosses == GeomConstants.SHAPE_INTERSECTS) {
              // The segment is intersecting the bounds of the shadow path.
              // We must consider the shape of shadow path now.
              this.x4ymin = this.boundingMinX;
              this.x4ymax = this.boundingMinX;
              this.crossings = 0;
              this.hasX4ymin = false;
              this.hasX4ymax = false;
              final PathIterator3afp<?> iterator;
              if (this.started) {
                  iterator = this.pathIterator.restartIterations();
              } else {
                  this.started = true;
                  iterator = this.pathIterator;
              }
  
              discretizePathIterator(
                      iterator,
                      x0, y0, z0, x1, y1, z1);
  
              // Test if the shape is intesecting the shadow shape.
              final int mask = iterator.getWindingRule() == PathWindingRule.NON_ZERO ? -1 : 2;
              if (this.crossings == GeomConstants.SHAPE_INTERSECTS
                      || (this.crossings & mask) != 0) {
                  // The given line is intersecting the path shape
                  return GeomConstants.SHAPE_INTERSECTS;
              }
  
              // There is no intersection with the shadow path's shape.
              // Compute the crossings with the minimum/maximum y borders.
              int inc = 0;
              if (this.hasX4ymin) {
                  ++inc;
              }
              if (this.hasX4ymax) {
                  ++inc;
              }
  
              if (y0 < y1) {
                  numCrosses = inc;
              } else {
                  numCrosses = -inc;
              }
  
              // Apply the previously computed crossings
              numCrosses += crossings;
          }
  
          return numCrosses;
      }