// @Override
public Collection<TopoDS_Shape> getModel() throws Exception {
-// GP_Circ circ = new GP_Circ(new double[]{-length*0.5, 0.0, 0.0,1.0,0.0,0.0}, radius);
-// GP_Circ circ2 = new GP_Circ(new double[]{length*0.5, 0.0, 0.0,1.0,0.0,0.0}, radius2);
-// System.out.println("Reducer " + length + " " + radius + " " + radius2);
+ if (radius < MathTools.NEAR_ZERO || radius2 < MathTools.NEAR_ZERO)
+ return Collections.emptyList();
double length = Math.max(0.1, Math.abs(radius-radius2)*4.0);
TopoDS_Shape shape;
if (Math.abs(radius-radius2) < MathTools.NEAR_ZERO) {
@Override
public Mesh getMesh() {
double length = Math.max(0.1, Math.abs(radius-radius2)*4.0);
- if (length < .0001)
+ if (length < .0001 || radius < MathTools.NEAR_ZERO || radius2 < MathTools.NEAR_ZERO)
return null;
Tube tube = new Tube();
tube.setResolution(16);
if (props.containsKey("offset")) {
offset = (Double)props.get("offset");
+ } else {
+ offset = 0.0;
}