Skip to content

Commit 5862250

Browse files
Merge pull request #30 from ArtifactForms/working
Working
2 parents 1afa661 + 7674789 commit 5862250

25 files changed

+561
-453
lines changed

src/main/java/mesh/modifier/BendModifier.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ public BendModifier(float factor) {
4949

5050
/**
5151
* Modifies the provided mesh by applying bending to its vertices along the
52-
* X-axis. If the provided mesh contains no vertices, the method safely returns
53-
* the mesh without changes.
52+
* X-axis. If the provided mesh contains no vertices, the method safely
53+
* returns the mesh without changes.
5454
* <p>
5555
* The bending is only applied if the {@link #factor} value is valid (greater
56-
* than a small threshold, defined by {@link #EPSILON}). This prevents the mesh
57-
* from being unnecessarily modified when the bending factor is negligible and
58-
* would result in division by zero issues.
56+
* than a small threshold, defined by {@link #EPSILON}). This prevents the
57+
* mesh from being unnecessarily modified when the bending factor is
58+
* negligible and would result in division by zero issues.
5959
* </p>
6060
*
6161
* @param mesh the 3D mesh to bend. Cannot be {@code null}.
62-
* @return the modified mesh after applying bending, or the original mesh if no
63-
* changes are applied.
62+
* @return the modified mesh after applying bending, or the original mesh if
63+
* no changes are applied.
6464
* @throws IllegalArgumentException if {@code mesh} is null.
6565
*/
6666
@Override

src/main/java/mesh/modifier/BevelEdgesModifier.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ private void createFaceForOldEdgeAt(Face3D face, int i) {
161161
if (isProcessed(edge) || isProcessed(pair))
162162
return;
163163

164-
addNewFace(new int[] { edge.toIndex, edge.fromIndex, pair.toIndex, pair.fromIndex });
164+
addNewFace(new int[] { edge.toIndex, edge.fromIndex, pair.toIndex,
165+
pair.fromIndex });
165166

166167
markAsProcessed(edge);
167168
markAsProcessed(pair);
@@ -191,7 +192,8 @@ private int[] createIndices(int size, int nextVertexIndex) {
191192
}
192193

193194
private int[] toReverseArray(List<Integer> values) {
194-
return values.stream().sorted(Collections.reverseOrder()).mapToInt(x -> x).toArray();
195+
return values.stream().sorted(Collections.reverseOrder()).mapToInt(x -> x)
196+
.toArray();
195197
}
196198

197199
private void clearAll() {

src/main/java/mesh/modifier/BevelFacesModifier.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55

66
public class BevelFacesModifier implements IMeshModifier {
77

8-
private float size;
9-
10-
public BevelFacesModifier() {
11-
setSize(0.1f);
12-
}
13-
14-
public BevelFacesModifier(float size) {
15-
this.size = Mathf.clamp(size, 0f, 1f);
16-
}
17-
18-
@Override
19-
public Mesh3D modify(Mesh3D mesh) {
20-
float scale = 1f - size;
21-
float amount = size;
22-
mesh.apply(new ExtrudeModifier(scale, amount));
23-
return mesh;
24-
}
25-
26-
public float getSize() {
27-
return size;
28-
}
29-
30-
public void setSize(float size) {
31-
this.size = Mathf.clamp(size, 0f, 1f);
32-
}
8+
private float size;
9+
10+
public BevelFacesModifier() {
11+
setSize(0.1f);
12+
}
13+
14+
public BevelFacesModifier(float size) {
15+
this.size = Mathf.clamp(size, 0f, 1f);
16+
}
17+
18+
@Override
19+
public Mesh3D modify(Mesh3D mesh) {
20+
float scale = 1f - size;
21+
float amount = size;
22+
mesh.apply(new ExtrudeModifier(scale, amount));
23+
return mesh;
24+
}
25+
26+
public float getSize() {
27+
return size;
28+
}
29+
30+
public void setSize(float size) {
31+
this.size = Mathf.clamp(size, 0f, 1f);
32+
}
3333

3434
}

0 commit comments

Comments
 (0)