]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/geometry/BallValveGeometryProvider.java
Check parameter inputs in geometry providers.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / geometry / BallValveGeometryProvider.java
index b0da882a29ca6f6358bf0ed0c0d9fefe18771647..c58ce987b7841c456578206927f96b02fdb96aa7 100644 (file)
@@ -19,6 +19,8 @@ public class BallValveGeometryProvider extends BuiltinGeometryProvider {
        
        @Override
        public Collection<TopoDS_Shape> getModel() throws Exception {
+               if (radius < MathTools.NEAR_ZERO)
+                       return Collections.emptyList();
                TopoDS_Shape cyl = OccTriangulator.makeCylinder(new double[] {-radius*2, 0.0, 0.0}, new double[] { 1.0, 0.0, 0.0 }, radius, radius*4);
                TopoDS_Shape sph = OccTriangulator.makeSphere(0, 0, 0, radius*1.5);
                TopoDS_Shape shape = OccTriangulator.makeCompound(new TopoDS_Shape[]{cyl, sph});