Skip to content

Commit

Permalink
1. Boundary conditions check
Browse files Browse the repository at this point in the history
2. Function order changes
3. Material naming condition changes
  • Loading branch information
Lan Pengwei authored and Lan Pengwei committed Jun 23, 2016
1 parent 041565d commit 91a3178
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 539 deletions.
10 changes: 9 additions & 1 deletion src/org/bimserver/osm/serializer/OsmMaterial.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ public OsmMaterial(String name, String roughness, double thickness, double condu
this.handle = UUID.randomUUID().toString();
this.name = name;
this.roughness = "MediumRough";
this.thickness = Double.compare(thickness, 3.0) < 0 ? thickness : 3.0;

if (Double.compare(thickness, 0.0) > 0 && Double.compare(thickness, 3.0) < 0) {
this.thickness = thickness;
} else if (Double.compare(thickness, 0.0) <= 0) {
this.thickness = 0.001;
} else if (Double.compare(thickness, 3.0) >= 0) {
this.thickness = 3.0;
}

this.conductivity = Double.compare(conductivity, 0.0) > 0 ? conductivity : 0.001;
this.density = Double.compare(density, 0.0) > 0 ? density : 0.001;
this.specificHeat = Double.compare(specificHeat, 0.0) > 0 ? specificHeat : 0.001;
Expand Down
Loading

0 comments on commit 91a3178

Please sign in to comment.