Age | Commit message (Collapse) | Author |
|
Use the `aspect_ratio_min` available in the params for the edge
collapsible test instead of the hard coded value.
|
|
Create GUI and use `change_in_vertex_normal_max` for dynamic face
sizing calculation instead of the hard coded value.
|
|
Use values from given params instead of the hard coded parameter
values.
|
|
|
|
|
|
Compute the dynamic face sizing with respect to curvature and do eigen
decomposition of the final sizing to add constraints with respect to
edge lengths and aspect ratio.
|
|
Calculate derivative of the given float3s with respect to the uv space
coordinates of the given face.
|
|
Calculate the vert sizing by taking the uv area weighted average of
the sizing of the adjacent faces of the vert.
|
|
|
|
|
|
|
|
Add remeshing type support to both the cloth modifier and the adaptive
remesh modifier.
The basic call for dynamic remesh is also setup, only need to work on
finding the vertex sizing dynamically.
|
|
All unused parameter warnings in BKE_cloth_remesh.hh and
cloth_remesh.cc have been fixed either by adding a #ifndef NDEBUG
directive or by changing the code slightly.
|
|
Newly created sewing edges's verts should also be marked as preserve.
|
|
Option to split the opposite edge even if it does not meet the size
criterion, with the option, it ensures that no sewing edge is missed
when an edge is split (it can be missed if the opposite edge doesn't
meet the size criterion).
|
|
Mark all verts attached to sewing edge(s) as preserve, this ensures
that no sewing edge(s) are removed which would otherwise lead to
results are not in line with what the artist would want.
|
|
While trying to create the sewing edges, ensure that the vert in
question is between 2 or more edges that are between sewing edges.
Also ensure that the opposite is between sewing edges.
|
|
Since split edge triangulate already handles copying the extra data,
there is no need to try to add the flag `EDGE_BETWEEN_SEWING_EDGES` to
the newly split edges.
|
|
An extra option to copy to the extra data from the edge that is split
to the edges that are formed due to the split. This does not include
the other edges added for triangulation purposes.
|
|
Edges that had EDGE_BETWEEN_SEWING_EDGES when split, the new edges
should also be EDGE_BETWEEN_SEWING_EDGES.
|
|
Add a new flag for EdgeData that stores if the edge is between sewing
edges or not.
A function that marks all the edges that between sewing edges.
Call this function in the initialization of the static remeshing if
sewing is enabled.
|
|
Dump the serialized Mesh after adding the loose (sewing) edge.
|
|
|
|
If the opposite edge still exists and it can be split, add a sewing
edge between `vert` and the newly created vert.
|
|
Split edge now appends the flip edges mesh diff to the split edge mesh
diff and returns this complete mesh diff and the verts that were added
during split operation.
|
|
Return a complete MeshDiff of all the operations done in flip edges by
appending the MeshDiff(s) after each operation.
|
|
Abstract out the edge splittablity check to a function.
|
|
AdaptiveMesh specific compute info for elements. This internally calls
the Mesh specific compute info to make function calls easier.
|
|
Given a vertex, the function is supposed to add a sewing edge to it if
possible.
Currently the function gets the set of opposite edges. An opposite
edge is an edge that is in between 2 loose edges and these loose edges
are connected to edges that connect to the given vert.
e1 vert e5
e1_ov.________.________.e4_ov
| |
e2| |e4
._________________.
e2_ov opposite_edge e3_ov
(e3)
What needs to be done: With the set of opposite edges, if the edge is
splittable then it should be split and a new edge should be added
between vert and the newly created vert (vert created when splitting
the opposite edge).
|
|
Added a new flag to have sewing enabled. The flag doesn't do anything
yet (no functionality).
Added the required code to pass this sewing option to
adaptive_remesh().
Created the GUI for this flag in the AdaptiveRemesh modifier.
|
|
|
|
The goal of the ClothVertex causes the vertex to move towards xconst
so it doesn't make sense to interpolate the goal since this will lead
to a gradient for the goal and this is not artist friendly, there
would be no way for the artist to define only a specific vertex to be
attached to a point in 3D space.
|
|
|
|
While building the structural springs, the vertices that connect the
springs, their spring count is incremented.
Since the springs are being rebuilt entirely, the spring count should
also be reset.
|
|
|
|
Must take the non directional area (absolute value of the area) since
the order of the verts of the face may not correspond to normal of the
face always. The aspect ratio calculation should not be doing the
inversion testing as well. (This could be used for inversion testing
but without proper math backing it, don't want to use it right now).
|
|
Test to see if the faces generated when collapsing the edge will not
meet the aspect ratio criterion.
There is a lot more information about which algorithm is used for
calculating the aspect ratio in the code comments. A gist of it would
be that there many different ways to calculate the aspect ratio of a
triangle and each provides a different end result suitable for
different needs. This makes it hard to select the right algorithm.
|
|
When current frame (framenr) is not immediately following the
last_frame stored, the `prev_frame_mesh` is invalid and must be
deleted. When remesh is on, even the clothObject is invalid, so delete
that as well.
|
|
The modifier stack doesn't give the previously evaluated `Mesh`, this
means it needs to be stored within the `ClothModifierData`.
Some parts of the cloth modifier copy information from the given
`Mesh` to the `clothObject` every frame, this should not happen when
remeshing is on.
In `BKE_cloth_remesh()`, must use the previous frame mesh if available
for remeshing.
TODO: In case the user goes back a frame, must make the
`clmd->prev_frame_mesh` invalid otherwise the simulation will not know
that the simulation must be restart.
|
|
This allows the code that deserializes it to decide which type of Mesh
structure to deserialize to. Since msgpack is compact, it doesn't
store information about the size (explicitly or implicitly) of the
element, this means that deserialization can lead to weird outputs if
wrong data structures are used.
|
|
The cloth object doesn't know about the updated mesh, so update the
entire cloth object to utilize the new mesh.
|
|
Store the edge index as well.
|
|
An edge is collapsible only if it doesn't invert any faces.
|
|
A set of "3D edges" don't always have n1 and n2 (through the verts of
the edge) in the same order, useful to get it in the same order.
|
|
|
|
AdaptiveMesh needs some more calculations, like edge size.
|
|
Edge flippability test should prevent flipping of an edge that will
lead to inverted face normals.
|
|
|
|
Need to mark verts that should be preserves, ones that are on seams or
boundaries at the beginning of the remeshing process so that the
initial state is not altered.
Collapse edges should not collapse a vert that should be preserved
into another vert.
|
|
If the edge were to be collapsed, the newly formed edges shouldn't
exceed the edge size criterion (1.0 - small_value).
|