Skip to content

Commit a371a99

Browse files
committed
Fixed max line length.
1 parent 5acd5c0 commit a371a99

File tree

14 files changed

+255
-207
lines changed

14 files changed

+255
-207
lines changed

MeshLibCoreClean2022/src/mesh/animator/Morpher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public void onUpdate(float tpf) {
5555
Vector3f tmp = new Vector3f(position);
5656
Vector3f velocity = new Vector3f();
5757

58-
velocity = this.target.getVertexAt(i).subtract(this.mesh.getVertexAt(i)).normalize().mult(speed);
58+
velocity = this.target.getVertexAt(i)
59+
.subtract(this.mesh.getVertexAt(i)).normalize().mult(speed);
5960

6061
tmp.addLocal(velocity);
6162

MeshLibCoreClean2022/src/mesh/creator/archimedian/SnubCubeCreator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ public Mesh3D create() {
1818

1919
private void createVertices() {
2020
float a = 1.0f;
21-
float b = (1.0f / 3.0f) * (Mathf.pow(17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f)
22-
- Mathf.pow(-17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f) - 1.0f);
21+
float b = (1.0f / 3.0f)
22+
* (Mathf.pow(17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f)
23+
- Mathf.pow(-17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f)
24+
- 1.0f);
2325
float c = 1.0f / b;
2426

2527
addVertex(+a, +b, -c);

MeshLibCoreClean2022/src/mesh/creator/archimedian/SnubDodecahedronCreator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ public Mesh3D create() {
1212

1313
float a = 2.0f;
1414
float b = (1.0f + Mathf.sqrt(5.0f)) / 2.0f;
15-
float c = Mathf.pow(b / 2.0f + (1.0f / 2.0f) * Mathf.sqrt(b - (5.0f / 27.0f)), 1.0f / 3.0f)
16-
+ Mathf.pow(b / 2.0f - (1.0f / 2.0f) * Mathf.sqrt(b - (5.0f / 27.0f)), 1.0f / 3.0f);
15+
float c = Mathf.pow(
16+
b / 2.0f + (1.0f / 2.0f) * Mathf.sqrt(b - (5.0f / 27.0f)),
17+
1.0f / 3.0f)
18+
+ Mathf.pow(b / 2.0f
19+
- (1.0f / 2.0f) * Mathf.sqrt(b - (5.0f / 27.0f)),
20+
1.0f / 3.0f);
1721
float d = c - (1.0f / c);
1822
float e = c * b + Mathf.pow(b, 2.0f) + b / c;
1923
float f = 2.0f * d;

MeshLibCoreClean2022/src/mesh/creator/assets/CrateCreator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package mesh.creator.assets;
22

3+
import java.awt.Insets;
34
import java.util.List;
45

56
import math.Mathf;
@@ -151,10 +152,11 @@ private Mesh3D createCrossBeam() {
151152

152153
if (crossBeamType == CrossBeamType.CROSS) {
153154
float a = radius;
155+
float b = a + (inset / 2);
154156
Mesh3D mesh1 = mesh.copy();
155157

156158
mesh1.getVertexAt(2).subtractLocal(a, 0, a);
157-
mesh1.getVertexAt(3).subtractLocal(a + (inset / 2), 0, a + (inset / 2));
159+
mesh1.getVertexAt(3).subtractLocal(b, 0, b);
158160
mesh1.getVertexAt(4).subtractLocal(a, 0, a);
159161
mesh1.getVertexAt(7).subtractLocal(a, 0, a);
160162
mesh1.getVertexAt(8).subtractLocal(a, 0, a);

MeshLibCoreClean2022/src/mesh/creator/assets/FlangePipeCreator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,16 @@ private void createFlange() {
111111

112112
private void createBottomBoltHeads() {
113113
Mesh3D bottom = createBoltHeads();
114-
bottom.translateY(-flangeDepth - flangeGrooveWidth - (boltHeadHeight / 2f));
114+
bottom.translateY(
115+
-flangeDepth - flangeGrooveWidth - (boltHeadHeight / 2f));
115116
segment.append(bottom);
116117
}
117118

118119
private void createTopBoltHeads() {
119120
Mesh3D bottom = createBoltHeads();
120121
bottom.rotateX(Mathf.PI);
121-
bottom.translateY(-flangeDepth - flangeGrooveWidth - pipeSegmentLength + (boltHeadHeight / 2f));
122+
bottom.translateY(-flangeDepth - flangeGrooveWidth - pipeSegmentLength
123+
+ (boltHeadHeight / 2f));
122124
segment.append(bottom);
123125
}
124126

@@ -182,7 +184,8 @@ private float calculateBoltHeadRadius() {
182184
}
183185

184186
private float calculateSegmentHeight() {
185-
return pipeSegmentLength + flangeDepth + flangeDepth + flangeGrooveWidth;
187+
return pipeSegmentLength + flangeDepth + flangeDepth
188+
+ flangeGrooveWidth;
186189
}
187190

188191
private float calculateTotalHeight() {

MeshLibCoreClean2022/src/mesh/selection/Compare.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
public class Compare {
44

5-
public static <T extends Number> boolean compare(CompareType compare, T a, T b) {
5+
public static <T extends Number> boolean compare(CompareType compare, T a,
6+
T b) {
67
if (compare == null)
78
throw new IllegalArgumentException("Compare type cannot be null.");
89
switch (compare) {

MeshLibCoreClean2022/src/mesh/selection/FaceSelection.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public void selectByVertexCount(int n) {
5959
}
6060

6161
/**
62-
* Selects all faces that have a similar normal as the provided one. This is a
63-
* way to select faces that have the same orientation (angle).
62+
* Selects all faces that have a similar normal as the provided one. This is
63+
* a way to select faces that have the same orientation (angle).
6464
*
6565
* @param normal
6666
* @param threshold
@@ -84,7 +84,8 @@ public void selectSimilarNormal(Vector3f normal, float threshold) {
8484
public void selectSimilarPerimeter(Face3D face, float threshold) {
8585
float perimeter0 = Mesh3DUtil.perimeter(mesh, face);
8686
for (Face3D f : mesh.faces) {
87-
if (Mathf.abs(Mesh3DUtil.perimeter(mesh, f) - perimeter0) <= threshold) {
87+
if (Mathf.abs(
88+
Mesh3DUtil.perimeter(mesh, f) - perimeter0) <= threshold) {
8889
faceSet.add(f);
8990
}
9091
}
@@ -235,13 +236,15 @@ public void selectWithCenterXLessThan(float x) {
235236
}
236237
}
237238

238-
public void selectRegion(float minX, float maxX, float minY, float maxY, float minZ, float maxZ) {
239+
public void selectRegion(float minX, float maxX, float minY, float maxY,
240+
float minZ, float maxZ) {
239241
for (Face3D f : mesh.faces) {
240242
int n = f.indices.length;
241243
boolean add = true;
242244
for (int i = 0; i < n; i++) {
243245
Vector3f v = mesh.getVertexAt(i);
244-
add &= (v.getX() >= minX && v.getX() <= maxX && v.getY() >= minY && v.getY() <= maxY && v.getZ() >= minZ
246+
add &= (v.getX() >= minX && v.getX() <= maxX && v.getY() >= minY
247+
&& v.getY() <= maxY && v.getZ() >= minZ
245248
&& v.getZ() <= maxZ);
246249
}
247250
if (add) {
@@ -250,13 +253,15 @@ public void selectRegion(float minX, float maxX, float minY, float maxY, float m
250253
}
251254
}
252255

253-
public void removeRegion(float minX, float maxX, float minY, float maxY, float minZ, float maxZ) {
256+
public void removeRegion(float minX, float maxX, float minY, float maxY,
257+
float minZ, float maxZ) {
254258
for (Face3D f : mesh.faces) {
255259
int n = f.indices.length;
256260
boolean remove = true;
257261
for (int i = 0; i < n; i++) {
258262
Vector3f v = mesh.getVertexAt(i);
259-
remove &= (v.getX() >= minX && v.getX() <= maxX && v.getY() >= minY && v.getY() <= maxY
263+
remove &= (v.getX() >= minX && v.getX() <= maxX
264+
&& v.getY() >= minY && v.getY() <= maxY
260265
&& v.getZ() >= minZ && v.getZ() <= maxZ);
261266
}
262267
if (remove) {
@@ -268,7 +273,8 @@ public void removeRegion(float minX, float maxX, float minY, float maxY, float m
268273
public void selectLeftFaces() {
269274
for (Face3D f : mesh.faces) {
270275
Vector3f v = mesh.calculateFaceNormal(f);
271-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
276+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
277+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
272278
if (v0.getX() == -1) {
273279
faceSet.add(f);
274280
}
@@ -278,7 +284,8 @@ public void selectLeftFaces() {
278284
public void selectRightFaces() {
279285
for (Face3D f : mesh.faces) {
280286
Vector3f v = mesh.calculateFaceNormal(f);
281-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
287+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
288+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
282289
if (v0.getX() == 1) {
283290
faceSet.add(f);
284291
}
@@ -288,7 +295,8 @@ public void selectRightFaces() {
288295
public void selectTopFaces() {
289296
for (Face3D f : mesh.faces) {
290297
Vector3f v = mesh.calculateFaceNormal(f);
291-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
298+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
299+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
292300
if (v0.getY() == -1) {
293301
faceSet.add(f);
294302
}
@@ -298,7 +306,8 @@ public void selectTopFaces() {
298306
public void selectBottomFaces() {
299307
for (Face3D f : mesh.faces) {
300308
Vector3f v = mesh.calculateFaceNormal(f);
301-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
309+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
310+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
302311
if (v0.getY() == 1) {
303312
faceSet.add(f);
304313
}
@@ -308,7 +317,8 @@ public void selectBottomFaces() {
308317
public void selectFrontFaces() {
309318
for (Face3D f : mesh.faces) {
310319
Vector3f v = mesh.calculateFaceNormal(f);
311-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
320+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
321+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
312322
if (v0.getZ() == 1) {
313323
faceSet.add(f);
314324
}
@@ -318,7 +328,8 @@ public void selectFrontFaces() {
318328
public void selectBackFaces() {
319329
for (Face3D f : mesh.faces) {
320330
Vector3f v = mesh.calculateFaceNormal(f);
321-
Vector3f v0 = new Vector3f(Mathf.round(v.getX()), Mathf.round(v.getY()), Mathf.round(v.getZ()));
331+
Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
332+
Mathf.round(v.getY()), Mathf.round(v.getZ()));
322333
if (v0.getZ() == -1) {
323334
faceSet.add(f);
324335
}

MeshLibCoreClean2022/src/mesh/selection/FaceSelectionRules.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public void isNGon(int n) {
6464
add(new SelectFaceRuleVertexCount(n, CompareType.EQUALS));
6565
}
6666

67-
public void centerDistanceToOrigin(Vector3f origin, CompareType compare, float distance) {
67+
public void centerDistanceToOrigin(Vector3f origin, CompareType compare,
68+
float distance) {
6869
add(new SelectFaceRuleCenterDistance(origin, compare, distance));
6970
}
7071

MeshLibCoreClean2022/src/mesh/selection/SelectFaceRuleCenterDistance.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ public class SelectFaceRuleCenterDistance implements IFaceSelectionRule {
1212

1313
private CompareType compare;
1414

15-
public SelectFaceRuleCenterDistance(Vector3f origin, CompareType compare, float distance) {
15+
public SelectFaceRuleCenterDistance(Vector3f origin, CompareType compare,
16+
float distance) {
1617
this.distance = distance;
1718
this.origin = origin;
1819
this.compare = compare;
1920
}
2021

2122
@Override
2223
public boolean isValid(Mesh3D mesh, Face3D face) {
23-
return Compare.compare(compare, origin.distance(mesh.calculateFaceCenter(face)), distance);
24+
return Compare.compare(compare,
25+
origin.distance(mesh.calculateFaceCenter(face)), distance);
2426
}
2527

2628
}

MeshLibCoreClean2022/src/mesh/selection/SelectFaceRuleCenterX.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public SelectFaceRuleCenterX(CompareType compare, float x) {
1616

1717
@Override
1818
public boolean isValid(Mesh3D mesh, Face3D face) {
19-
return Compare.compare(compare, mesh.calculateFaceCenter(face).getX(), x);
19+
return Compare.compare(compare, mesh.calculateFaceCenter(face).getX(),
20+
x);
2021
}
2122

2223
}

0 commit comments

Comments
 (0)