]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/geometry/CheckValveGeometryProvider.java
Check parameter inputs in geometry providers.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / geometry / CheckValveGeometryProvider.java
index 5106731647a34da576e1a4846b29648210ea1348..c14ff4b477fe1511cf3f8abeea5e186ccb7c3028 100644 (file)
@@ -19,6 +19,8 @@ public class CheckValveGeometryProvider extends BuiltinGeometryProvider {
        
        @Override
        public Collection<TopoDS_Shape> getModel() throws Exception {
+               if (radius < MathTools.NEAR_ZERO)
+                       return Collections.emptyList();
                double l = radius*0.2;
                TopoDS_Shape cyl = OccTriangulator.makeCylinder(new double[] {radius-l, 0.0, 0.0}, new double[] { 1.0, 0.0, 0.0 }, radius, l);
                TopoDS_Shape con = OccTriangulator.makeCone(new double[] {-radius, 0.0, 0.0}, new double[] { 1.0, 0.0, 0.0 }, radius, radius*0.1,radius*2);