Skip to content

Commit

Permalink
Remove error checking in Model getSurfacePoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Henrique committed Nov 7, 2016
1 parent 8fd2708 commit be33608
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/tracer/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
public interface Model extends Copyable<Model> {

/**
* Returns aleatory surface points with uniform probability of the model.
* Returns aleatory surface points with uniform probability of the model, if the count is less than 1, a zero sized
* vector array is returned.
*
* @param count the number of points to get (can not be less than 1)
* @param count the number of points to get
* @return points of the surface
*/
Vector3[] getSurfacePoints(int count);
Expand Down
3 changes: 0 additions & 3 deletions src/tracer/model/Sphere.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ public Model copy() {

@Override
public Vector3[] getSurfacePoints(int count) {
if (count < 1) {
throw new IllegalArgumentException("The count should be greater than 0.");
}
Vector3[] surfacePoints = new Vector3[count];
for (int i = 0; i < count; i++) {
surfacePoints[i] = TTRand.onPolarSphere().scale(radius).sum(center);
Expand Down
3 changes: 0 additions & 3 deletions src/tracer/model/Triangle.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ public Model copy() {

@Override
public Vector3[] getSurfacePoints(int count) {
if (count < 1) {
throw new IllegalArgumentException("The count should be greater than 0.");
}
Random prng = new Random();
Vector3[] surfacePoints = new Vector3[count];
for (int i = 0; i < count; i++) {
Expand Down

0 comments on commit be33608

Please sign in to comment.