Example #1
0
  protected void processMouthpiece(SortedPositionList<BorePoint> borePointList) {
    double mouthpiecePosition = mouthpiece.getBorePosition();

    // Make the bore sections above mouthpiece
    makeSections(borePointList, mouthpiecePosition);

    // Make bore section that ends with mouthpiece
    // Set mouthpiece boreDiameter
    processPosition(borePointList, mouthpiece);

    List<BoreSection> headspace = new ArrayList<BoreSection>();
    for (Iterator<ComponentInterface> it = components.iterator(); it.hasNext(); ) {
      ComponentInterface component = it.next();
      if (component instanceof BoreSection) {
        BoreSection section = (BoreSection) component;
        if (section.getRightBorePosition() <= mouthpiecePosition) {
          headspace.add((BoreSection) component);
          it.remove();
        }
      }
    }

    mouthpiece.setHeadspace(headspace);

    // Move the first borepoint to top of TSH
    //		BorePoint firstPoint = borePointList.getFirst();
    //		double newPosition = firstPoint.getBorePosition() -
    // mouthpiece.getFipple().getWindowLength();
    //		firstPoint.setBorePosition(newPosition);
  }
Example #2
0
  protected void addSection(BorePoint leftPoint, BorePoint rightPoint) {

    BoreSection section = new BoreSection();
    section.setLength(rightPoint.getBorePosition() - leftPoint.getBorePosition());
    section.setLeftRadius(leftPoint.getBoreDiameter() / 2);
    section.setRightRadius(rightPoint.getBoreDiameter() / 2);
    section.setRightBorePosition(rightPoint.getBorePosition());

    components.add(section);
  }