Skip to content
Permalink
Browse files
Simplify array initialization
  • Loading branch information
singhbaljit committed Dec 28, 2020
1 parent a39e89d commit aabebd684e6eac8497a709c856f55c303c9a0e19
Showing 1 changed file with 4 additions and 11 deletions.
@@ -24,7 +24,6 @@
import java.util.NoSuchElementException;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import org.apache.commons.geometry.core.GeometryTestUtils;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
@@ -57,10 +56,7 @@ public void testFrom_verticesAndFaces() {
Vector3D.of(0, 0, 1)
};

final int[][] faceIndices = new int[][] {
{0, 1, 2},
{0, 2, 3}
};
final int[][] faceIndices = {{0, 1, 2}, {0, 2, 3}};

// act
final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(vertices, faceIndices, TEST_PRECISION);
@@ -110,7 +106,7 @@ public void testFrom_verticesAndFaces_empty() {
// arrange
final Vector3D[] vertices = {};

final int[][] faceIndices = new int[][] {};
final int[][] faceIndices = {};

// act
final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(vertices, faceIndices, TEST_PRECISION);
@@ -337,17 +333,14 @@ public void testToTriangleMesh() {
public void testFace_doesNotDefineTriangle() {
// arrange
final DoublePrecisionContext precision = new EpsilonDoublePrecisionContext(1e-1);
final Vector3D[] vertices = new Vector3D[] {
final Vector3D[] vertices = {
Vector3D.ZERO,
Vector3D.of(0.01, -0.01, 0.01),
Vector3D.of(0.01, 0.01, 0.01),
Vector3D.of(1, 0, 0),
Vector3D.of(2, 0.01, 0)
};
final int[][] faces = new int[][] {
{0, 1, 2},
{0, 3, 4}
};
final int[][] faces = {{0, 1, 2}, {0, 3, 4}};
final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(vertices, faces, precision);

// act/assert

0 comments on commit aabebd6

Please sign in to comment.