示例#1
0
  // ------------------------------------------------------------------------------------------------------------- //
  // The following should probably be moved into a "mesh" operator object that performs the
  // clean operation on a mesh. This way we can have lots of operations, without cluttering up basic
  // mesh functionality.
  // ------------------------------------------------------------------------------------------------------------- //
  public void clean() {
    while (connectAdjacentPaths()) ;

    // Remove any adjacent duplicates from the list, until none are found]
    List<Face> cleanedPolyLines = new ArrayList<Face>();
    for (Face poly : faces) {
      while (removeAdjacentDuplicates(poly)) ;
      if (poly.getVerts().size() > 1) cleanedPolyLines.add(poly);
    }

    faces.clear();
    faces.addAll(cleanedPolyLines);
  }