Age | Commit message (Collapse) | Author |
|
"void' function returning a value".
|
|
This catches missing normal updates that may cause invalid tessellation.
|
|
This value is always 'sides - 2', no need to return this value.
|
|
Support calculating face normals when tessellating. When this is done
before updating vertex normals it gives ~20% performance improvement.
Now vertex normal calculation only needs to perform a single pass on the
mesh vertices when called after tessellation.
Extended versions of normal & looptri update functions have been added:
- BM_mesh_calc_tessellation_ex
- BM_mesh_normals_update_ex
Most callers don't need to be aware of this detail by using:
- BKE_editmesh_looptri_and_normals_calc
- BKE_editmesh_looptri_and_normals_calc_with_partial
- EDBM_update also takes advantage of this,
where calling EDBM_update with calc_looptri & calc_normals
enabled uses the faster normal updating logic.
|
|
Bypass stored edge-vectors for ~16% performance gains.
While this increases unit-length edge-vector calculations by around ~4x
the overhead of a parallel loop over all edges makes it worthwhile.
Note that caching edge-vectors per-vertex performs better and may be
worth investigating further, although in my tests this increases code
complexity with barley measurable benefits over not using cache at all.
Details about performance and possible optimizations are noted in
bm_vert_calc_normals_impl.
|
|
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
|
|
Use BM_iter_parallel for face tessellation, this gives around
6.5x speedup for BM_mesh_calc_tessellation on high poly meshes in my
tests, although exact speedup depends on available cores.
|
|
Support thread local storage for BLI_task_parallel_mempool,
as well as support for the reduce and free callbacks.
mempool_iter_threadsafe_* functions have been moved into a private
header thats only shared between task_iterator.c and BLI_mempool.c
so the TLS can be made part of the iterator array without having to
rely on passing in struct offsets.
Add test task.MempoolIterTLS that ensures reduce and free
are working as expected.
Reviewed By: mont29
Ref D11548
|
|
Simplify vertex normal calculation by moving the main normal
accumulation function to operate on vertices instead of faces.
Using faces had the down side that it needed to zero, accumulate and
normalize the vertex normals in 3 separate passes, accumulating also
needed a spin-lock for thread since the face would write it's normal
to all of it's vertices which could be shared with other faces.
Now a single loop over vertices is performed without locking.
This gives 5-6% speedup calculating all normals.
This also simplifies partial updates, fixing a problem where
all connected faces were being read from when calculating normals.
While this could have been resolved separately,
it's simpler to operate on vertices directly.
|
|
|
|
|
|
|
|
|
|
This patch exposes functionality for performing partial mesh updates
for normal calculation and face tessellation while transforming a mesh.
The partial update data only needs to be generated once,
afterwards the cached connectivity information can be reused
(with the exception of changing proportional editing radius).
Currently this is only used for transform, in the future it could be
used for other operators as well as the transform panel.
The best-case overall speedup while transforming geometry is about
1.45x since the time to update a small number of normals and faces is
negligible.
For an additional speedup partial face tessellation is multi-threaded,
this gives ~15x speedup on my system (timing tessellation alone).
Exact results depend on the number of CPU cores available.
Ref D11494
Reviewed By: mano-wii
|
|
Follow own code style docs.
|
|
Prepare for multiple code-paths that recalculate tessellation.
|
|
Prepare for further refactoring for these functions.
|
|
This was kept since these blocks are easier to follow.
Remove as the overall result wasn't so readable
(especially with nested ifdef's).
Replace disabled code with comment on the indices used for quads/tris.
|
|
2 sided faces aren't supported and will cause problems in many areas
of Blender's code.
Removing (implied) support for faces with fewer than 3 sides
means the total number of triangles is known ahead of time.
This simplifies adding support for multi-threading and partial updates
to an existing tessellation - as the face and loop indices can be used
to access the range of triangles associated with a face.
Also correct outdated comments.
|
|
bf_bmesh historically always build with the /WX flag
on windows making all warnings errors, somewhere along
the way this has broken for msbuild, ninja still exhibits
the expected behaviour.
The flags are still passed to the target, and I've validated
they are there when the add_library call fires, but they
somehow never make it to the generated msbuild project files.
I suspect this is a cmake bug but I'm seemingly unable
to extract a repro case to file a bug upstream.
Setting the same options target_compile_options seems to work,
I'm not happy about the unexplained nature of the breakage
but this will have to do for now.
|
|
|
|
- Corrected spellings
- Comments added and edited
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10991
|
|
BMesh intersect could leave invalid items in the selection list,
causing a crash. The list is now cleared since boolean is such a
destructive operation, it's unlikely the selection order would be useful.
Thanks to @lukastoenne for finding the root cause.
|
|
Incrementing a floating point value in a loop resulted in the vertex
locations for circles in primitives being slightly asymmetric.
|
|
Differential Revision: https://developer.blender.org/D11115
|
|
Logic for bisect handled edges in the face crossing the plane,
but not concave N-gons containing multiple edges that lie on the plane.
|
|
|
|
|
|
Add argument to BM_vert_collapse_faces to remove any faces that become
duplicate as result of the collapse.
|
|
|
|
The main goal here is to remove the need for a C API to the code in
`mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c`
to C++ and making the necessary changes for it to compile. On top of
that there are some other slight simplifications possible to the
direct mesh boolean code: it doesn't need to copy the material
remaps, and the modifier code can use some other C++ types directly.
|
|
|
|
|
|
|
|
Changes to increase subdivision by one along both axis (X and Y)
For example with x_segment = 3 and y_segment = 3.
There should be 16 vertices ((3 + 1) * (3 + 1)) for correct
number of subdivisions. Currently they are 3 * 3 = 9 vertices.
Ref D10699
|
|
- New Walker added `bmw_NonManifoldedgeWalker_type`.
- This walks over edges connected with 3 or more faces connected.
Ref D10497 with edits.
|
|
The commit rB6f63417b500d that made exact boolean work on meshes
with holes (like Suzanne) unfortunately dramatically slowed things
down on other non-manifold meshes that don't have holes and didn't
need the per-triangle insideness test.
This adds a hole_tolerant parameter, false by default, that the user
can enable to get good results on non-manifold meshes with holes.
Using false for this parameter speeds up the time from 90 seconds
to 10 seconds on an example with 1.2M triangles.
|
|
Also use doxygen comments for sculpt functions.
|
|
|
|
When polygons around a bevel are rebuilt, sometimes UVs are merged
around a new vertex in the case of the face opposite a single edge
being beveled on a 3-edge vertex. This should not have been done
if any of the edges at that vertex were a seam.
|
|
Also add minor corrections clarifications elsewhere.
|
|
These were flipped since their introduction in rBa070a5befa11.
Maniphest Tasks: T85753
Differential Revision: https://developer.blender.org/D10465
|
|
This was introduced in the new geodesic distances algorithm for proportional
editing. When all faces of an edge are hidden, that edge should be considered
as loose geometry.
Initial patch by Pablo with modifications by Brecht.
Differential Revision: https://developer.blender.org/D10488
|
|
|
|
|
|
|
|
|
|
|
|
While Boolean is not guaranteed to work if the operands are not
volume-enclosing (technically: PWN - piecewise constant winding number),
it needs to do something in those cases. This change makes
more cases meet user expectations in T84493, T64544, T83403,
T82642 (though very slow on that one).
The original new boolean code used "generalized winding number"
for this fallback; replaced this with code that uses raycasting.
Raycasting would have been faster, but for unfortunately also
switchd to per-triangle tests rather than per-patch tests since
it is possible (e.g., with Suzanne) to have patches that are
both inside and outside the other shape. That can make it much
slower in some cases, sadly.
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|