Skip to content

Commit 641debc

Browse files
committed
2 parents c18e806 + 3927bbe commit 641debc

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

documentation/manual.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Artifact Forms - Java Mesh Library
22

33
[Workspace](workspace.md)
4+
5+
[Modifiers](modifiers.md)

documentation/modifiers.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Mesh Modifiers
2+
3+
## Basic Modifiers
4+
* **BendModifier:** Bends the mesh along a specified axis.
5+
* **BevelEdgesModifier:** Creates a bevel along the edges of the mesh.
6+
* **BevelFacesModifier:** Creates a bevel around the faces of the mesh.
7+
* **BevelVerticesModifier:** Creates a bevel around the vertices of the mesh.
8+
* **CenterAtModifier:** Centers the mesh at a specific point.
9+
* **CrocodileModifier:**
10+
* **ExtrudeModifier:** Extrudes the faces of the mesh along their normals.
11+
* **FitToAABBModifier:** Scales and **/translates???/** the mesh to fit within an axis-aligned bounding box.
12+
* **FlipFacesModifier:** Flips the orientation of the faces of the mesh.
13+
* **HolesModifier:** Creates holes in the mesh.
14+
* **InsetModifier:** Insets the faces of the mesh inward.
15+
* **NoiseModifier:** Adds noise to the vertex positions of the mesh. **Normals!**
16+
* **PushPullModifier:** Pushes or pulls vertices towards or away from a specified center point.
17+
* **RemoveDoubleVerticesModifier:** Removes duplicate vertices from the mesh.
18+
* **RotateXModifier:** Rotates the mesh around the X-axis.
19+
* **RotateYModifier:** Rotates the mesh around the Y-axis.
20+
* **RotateZModifier:** Rotates the mesh around the Z-axis.
21+
* **ScaleModifier:** Scales the mesh uniformly or non-uniformly.
22+
* **SmoothModifier:** Smoothes the mesh by averaging vertex positions. **???**
23+
* **SolidifyModifier:** Adds thickness to the faces of the mesh.
24+
* **SpherifyModifier:** Spherifies the mesh.
25+
* **TranslateModifier:** Translates the mesh.
26+
* **UpdateFaceNormalsModifier** Updates the face normals of the mesh.
27+
* **WireframeModifier:** Converts the mesh to a wireframe representation. **???**
28+
29+
## Subdivision Modifiers
30+
* **CatmullClarkModifier:** Subdivides the mesh using the Catmull-Clark subdivision scheme.
31+
* **DooSabinModifier:** Subdivides the mesh using the Doo-Sabin subdivision scheme.
32+
* **LinearSubdivisionModifier:** Subdivides the mesh using a linear subdivision scheme.
33+
* **PlanarMidEdgeCenterModifier:** Subdivides the mesh by splitting edges and connecting their midpoints.
34+
* **PlanarMidEdgeModifier:** Subdivides the mesh by splitting edges and connecting their midpoints to the face centroids.
35+
* **PlanarVertexCenterModifier:** Subdivides the mesh by connecting vertices to face centroids.
36+
* **PlanarVertexMidEdgeCenterModifier:** Subdivides the mesh by connecting vertices, edge midpoints, and face centroids.
37+
* **PokeFacesModifier:** Adds a vertex to the center of each face.
38+
* **QuadsToTrianglesModifier:** Converts quad faces to triangles.
39+
40+
## Bend Modifier
41+
42+
**Purpose:**
43+
44+
The Bend Modifier is a tool designed to deform a 3D mesh by bending it along the X-axis. It's particularly useful for creating curved shapes or simulating bending effects.
45+
46+
**How it works:**
47+
48+
**Bending Factor:**
49+
50+
The ```factor``` parameter controls the intensity of the bend. A higher factor results in a more pronounced curve.
51+
52+
**Vertex Deformation:**
53+
54+
* For each vertex in the mesh:
55+
* The X-coordinate of the vertex is used to calculate a bending angle.
56+
* The Y and Z coordinates are then modified based on this angle and the ```factor``` to achieve the desired bending effect.
57+
58+
**Using the Bend Modifier:**
59+
60+
1. **Create a Mesh:** Start with a basic 3D mesh, such as a grid, cube, or sphere.
61+
2. **Create the Modifier:** Create an instance of the BendModifier class, specifying the desired bending factor.
62+
3. **Modify the Mesh:** Apply the modify method of the BendModifier to the mesh.
63+
64+
**Example:**
65+
66+
```java
67+
GridCreator creator = new GridCreator();
68+
creator.setSubdivisionsX(10);
69+
creator.setSubdivisionsZ(10);
70+
creator.setTileSizeX(1);
71+
creator.setTileSizeZ(1);
72+
73+
Mesh3D mesh = creator.create(); // Create a grid mesh
74+
BendModifier modifier = new BendModifier(0.5f); // Create a BendModifier with a factor of 0.5
75+
76+
mesh.apply(modifier); // Apply the modifier to the mesh
77+
```
78+
79+
**Additional Considerations:**
80+
81+
* **Extreme Bending:** For very high factor values, the mesh may become distorted or self-intersecting.
82+
* **Mesh Topology:** The effectiveness of the modifier can be influenced by the mesh topology. For complex meshes, additional considerations may be necessary.
83+
* **Combining with Other Modifiers:** The Bend Modifier can be combined with other modifiers to create more complex deformations.
84+
85+
By understanding the basic principles and parameters of the Bend Modifier, you can effectively use it to create a wide range of 3D shapes and effects.
86+
87+
## Push-Pull Modifier
88+
89+
**Purpose:**
90+
91+
The Push-Pull Modifier is a versatile tool for deforming 3D meshes. It allows you to push or pull vertices towards or away
92+
from a specified center point, creating a variety of effects like bulging, indenting, or extruding parts of the mesh.
93+
94+
**How it works:**
95+
96+
1. **Center Point:** The modifier uses a defined center point as a reference for the deformation.
97+
2. **Distance:** The ```distance``` parameter controls the magnitude of the push or pull. A positive value pushes vertices away from the center, while a negative value pulls them towards the center.
98+
3. **Vertex Deformation:** For each vertex in the mesh:
99+
* The ```distance``` between the vertex and the center point is calculated.
100+
* The vertex is moved along the vector connecting it to the center point, by the specified distance.
101+
102+
**Using the Push-Pull Modifier:**
103+
104+
1. **Create a Mesh:** Start with a basic 3D mesh, such as a plane, cube, or sphere.
105+
2. **Apply the Modifier:** Create an instance of the PushPullModifier class, specifying the desired distance and center point.
106+
3. **Modify the Mesh:** Apply the modify method of the PushPullModifier to the mesh.
107+
108+
**Example:**
109+
110+
```java
111+
// TODO
112+
```
113+
114+
**Additional Considerations:**
115+
116+
* **Mesh Topology:** The effectiveness of the modifier can be influenced by the mesh topology. For complex meshes, additional considerations may be necessary.
117+
* **Combining with Other Modifiers:** The Push-Pull Modifier can be combined with other modifiers to create more complex deformations.
118+
119+
By understanding the basic principles and parameters of the Push-Pull Modifier, you can effectively use it to create a wide range of 3D shapes and effects.
120+
121+
## Translate Modifier
122+
123+
**Purpose:**
124+
125+
The Translate Modifier is a simple yet powerful tool for transforming 3D meshes. It allows you to shift all vertices of a mesh by a specified distance along the X, Y, and Z axes. This is useful for positioning meshes, aligning them with other objects, or creating more complex deformations in combination with other modifiers.
126+
127+
**How it works:**
128+
129+
1. **Translation Vector:** The `deltaX`, `deltaY`, and `deltaZ` parameters define the translation vector, which specifies the amount of shift in each axis.
130+
2. **Vertex Translation:** For each vertex in the mesh, the `deltaX`, `deltaY`, and `deltaZ` values are added to its respective X, Y, and Z coordinates.
131+
132+
**Using the Translate Modifier:**
133+
134+
1. **Create a Mesh:** Start with a basic 3D mesh, such as a plane, cube, or sphere.
135+
2. **Apply the Modifier:** Create an instance of the `TranslateModifier` class, specifying the desired translation values.
136+
3. **Modify the Mesh:** Apply the `modify` method of the `TranslateModifier` to the mesh.
137+
138+
**Example:**
139+
140+
```java
141+
Mesh3D mesh = new CubeCreator().create() // Create a cube mesh
142+
TranslateModifier translateModifier = new TranslateModifier(2, 1, -3); // Create a TranslateModifier with a translation of (2, 1, -3)
143+
mesh.apply(translateModifier); // Apply the modifier to the mesh
144+
```
145+
146+
This will shift the entire cube mesh 2 units along the X-axis, 1 unit along the Y-axis, and -3 units along the Z-axis.
147+
148+
**Additional Considerations:**
149+
150+
* **Combining with Other Modifiers:** The Translate Modifier can be combined with other modifiers like Rotate, Scale, or Bend to create more complex deformations.
151+
* **Order of Application:** The order in which modifiers are applied can affect the final result. Experiment with different sequences to achieve desired effects.
152+
153+
By understanding the basic principles and parameters of the Translate Modifier, you can effectively use it to position and manipulate 3D meshes in your projects.
154+

0 commit comments

Comments
 (0)