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); }
protected void processPosition( SortedPositionList<BorePoint> borePointList, BorePointInterface currentPosition) { // Update bore radius at hole // At this stage, the hole must be between the first and second bore // point Iterator<BorePoint> points = borePointList.iterator(); BorePoint leftPoint = points.next(); BorePoint rightPoint = points.next(); double leftPosition = leftPoint.getBorePosition(); double rightPosition = rightPoint.getBorePosition(); double thisPosition = currentPosition.getBorePosition(); double holeRelativePosition = (thisPosition - leftPosition) / (rightPosition - leftPosition); double leftDiameter = leftPoint.getBoreDiameter(); double rightDiameter = rightPoint.getBoreDiameter(); double holeBoreDiameter = leftDiameter + (rightDiameter - leftDiameter) * holeRelativePosition; currentPosition.setBoreDiameter(holeBoreDiameter); // Make new bore section if (rightPosition > thisPosition) { rightPoint = new BorePoint(); rightPoint.setBoreDiameter(holeBoreDiameter); rightPoint.setBorePosition(thisPosition); borePointList.add(rightPoint); } addSection(leftPoint, rightPoint); borePointList.remove(leftPoint); }
protected void convertDimensions(double multiplier) { if (mouthpiece != null) { mouthpiece.convertDimensions(multiplier); } if (borePoint != null) { for (BorePoint aPoint : borePoint) { aPoint.convertDimensions(multiplier); } } if (hole != null) { for (Hole aHole : hole) { aHole.convertDimensions(multiplier); } } if (termination != null) { termination.convertDimensions(multiplier); } }
protected void processTermination(SortedPositionList<BorePoint> borePointList) { BorePoint lastPoint = borePointList.getLast(); termination.setBoreDiameter(lastPoint.getBoreDiameter()); termination.setBorePosition(lastPoint.getBorePosition()); }