Commit Graph

1894 Commits

Author SHA1 Message Date
Howard Trickey
543c64ef74 Fix bug where corner boundary was straight when it should curve.
Some adjustments to how bevel edge 'profiles' are adjusted in some
cases. For the bug fix, wanted to handle cases of middle of three
coplanar beveled cases to make profile curve rather than linear
interpolate.
Also undid an earlier decision to make profile plane be perpendicular
to beveled edge i the non-coplanar case.
2016-06-01 08:51:08 -04:00
Campbell Barton
fe766d9c7a BMesh: don't alloc zero sized select elem array 2016-05-26 15:56:12 +10:00
Howard Trickey
7928030eff Fix T47257: bevel crash when there are internal faces.
Bevel had assumed that when rebuilding a face that touches
a vertex with beveled edges, the edges of the face at that vertex
would be adjacent in internal order. That is not necessarily true
if there are edges with more than two faces attached.
We could just prohibit beveling any edges that touch a vertex
where this happens (we already don't bevel non-manifold edges)
but the use case in the model of T47257 seems reasonable.
Also had to fix the edge-ordering code, and the face reconstruction
code to take care of cases where the face normal may not be as expected.
2016-05-25 08:48:46 -04:00
Campbell Barton
b9996a3cc3 Fix Cube generated UV's rotated incorrectly 2016-05-14 23:01:59 +10:00
Campbell Barton
ede742917a Correct BM_iter_mesh_bitmap_from_filter return 2016-05-14 04:49:42 +10:00
Campbell Barton
86b509229f Fix T48413: editmesh intersect tool crash
Its important to add tri-edge intersections from both sides.
2016-05-12 21:00:08 +10:00
Campbell Barton
8d3f367c01 Correct debug prints 2016-05-12 20:59:48 +10:00
Campbell Barton
80b1adf8c2 BMesh: avoid calling delete operator w/ face dissolve
In nearly all cases this isn't needed.
2016-05-12 16:47:30 +10:00
Campbell Barton
689e45284b Recent bmesh face-join caused regression (T48407) 2016-05-12 16:11:42 +10:00
Campbell Barton
544b76ac9c BMesh: ignore non-manifold face connections
Was showing an error message,
now dissolve the faces that and delimit at non-manifold boundaries.
2016-05-12 06:00:05 +10:00
Campbell Barton
a46d930d8b BMesh: add BMW_ISLAND_MANIFOLD
An island walker that only walks over manifold edges.
2016-05-12 05:59:59 +10:00
Campbell Barton
f6948083e9 BMesh Island Walker: use direct loop access 2016-05-12 05:30:20 +10:00
Campbell Barton
135064c45e BMesh: remove exception from face-join function
Callers need to check for NULL, if we need to know exact cause it could be a return arg.
2016-05-12 04:42:45 +10:00
Campbell Barton
1b003511be BMesh: boundary walker, skip non-manifold loops
Instead of setting an exception, treat non-manifold edges as boundaries.
2016-05-12 04:39:01 +10:00
Campbell Barton
674bf2fe58 BMesh: add check for manifold loop 2016-05-12 04:37:36 +10:00
Campbell Barton
4a135ad2b7 BMesh: correct fix for face-join removing attached faces 2016-05-11 20:12:52 +10:00
Campbell Barton
e525a06800 BMesh: only remove loose geometry when joining faces
Joining faces could remove faces that happened to share an edge that would normally be removed.
2016-05-11 02:47:38 +10:00
Campbell Barton
e0e7d94f79 Fix error introduced by removing faces before executing bridge
Commit 86abddc9, caused an error when the face-region included boundary edges.
Since removing the faces first, caused the edges along the boundaries to be removed.

Add support for deleting faces and internal edges, that keeps boundaries.
2016-05-09 16:21:00 +10:00
Campbell Barton
bc1a7d9283 Cleanup: warnings
Values set but not used
2016-05-06 16:49:25 +10:00
Campbell Barton
304501193b Fix T48356: Bridge tool creates self-intersecting loop
When loops are planar to eachother, initialize their winding based on surrounding geometry.
2016-05-06 10:22:02 +10:00
Campbell Barton
4aaafcbc45 Fix for fix, sorry for the noise 2016-05-06 05:46:07 +10:00
Campbell Barton
2812a8f7eb Missed last commit 2016-05-06 05:42:33 +10:00
Campbell Barton
7122b05ac3 Correct own mistake int recent transform API edits
Need to return number of enabled elements.
2016-05-06 05:40:07 +10:00
Germano Cavalcante
0b5a0d8412 Transform/Snap: EditMesh/BKE_bvhutils API improvements
Separate the creation of trees from EditMesh from the creation of trees from DerivedMesh.
This was meant to simplify the API, but didn't work out so well.

`bvhtree_from_mesh_*` actually is working as `bvhtree_from_derivedmesh_*`.
This is inconsistent with the trees created from EditMesh. Since for create them does not use the DerivedMesh.

In such cases the dm is being used only to cache the tree in the struct DerivedMesh. What is immediately released once
bvhtree is being used in functions that change(tag) the DM cleaning the cache.

- Use a filter function so users of SnapObjectContext can define how edit-mesh elements are handled.
- Remove em_evil.
- bvhtree of EditMesh is now really cached in the snap functions.
- Code becomes organized and easier to maintain.

This is an important patch for future improvements in snapping functions.
2016-05-06 05:01:51 +10:00
Campbell Barton
e30f0427a5 Fix error in BM_face_exists_overlap_subset
Was re-using loop index, thanks to @bzztploink for spotting!
2016-05-05 01:35:09 +10:00
Campbell Barton
6d0cae56e8 Fix T48290: Hook fails after deleting geometry
Now CD_SHAPEKEY_INDEX customdata is stored in edit-mode when hooks and vertex parents are used.

This also fixes a bug where undo would loose key-index data.

Move to structs for BM_mesh_bm_to/from_me to avoid passing many argument, which mostly aren't used.
2016-04-29 23:39:50 +10:00
Campbell Barton
b5ce2bbef7 BMesh: when multiple vertices have the same key-index, use the first
Simple error case where many vertices share an original index,
now use the first match instead of the last.
2016-04-29 21:52:09 +10:00
Campbell Barton
d3344ca7b1 Minor optimization to bmesh shape key conversion
Avoid linked linked loop and custom-data lookups per vertex,
use a table of shape-keys with array offsets instead.
2016-04-29 15:02:04 +10:00
Campbell Barton
6e94ec623d BMesh: limited-dissolve, add check for wire edges
Recent degenerate check crashed on chains of wire edges
2016-04-28 12:50:12 +10:00
Campbell Barton
bde7439816 Minor optimization for limited-dissolve
Use dot product instead of angle.
2016-04-20 07:50:48 +10:00
Campbell Barton
7cc9f6b6f8 Minor edits to last commit
Avoid redundant tests
2016-04-19 13:07:01 +10:00
Campbell Barton
12b0c03e49 Fix T47998: Limited dissolve fails /w holes
Holes with flat surfaces could have their edges dissolved causing degenerate faces.
Now check that collapsing a vertices isn't creating self-overlapping faces.
2016-04-19 12:18:19 +10:00
Campbell Barton
5231b049d7 Fix T47443: Circle & UV Sphere aren't aligned
D1912 by @samb96

Change the starting point of the UV sphere so that it is aligned with the circle, cylinder, and cone primitives.
2016-04-12 19:47:29 +10:00
Campbell Barton
5ddf6ca87a Quiet warning for release build 2016-04-06 18:26:39 +10:00
Campbell Barton
78d39cad8b Tweak fill-region method to produce fewer 'gaps' 2016-04-06 15:07:37 +10:00
Campbell Barton
c6b27dd4fa BMesh: improve path-select fill region w/ ngons
Rewrote to work with ngons and and more complex topology, now uses separate function.
Fixes T48009.
2016-04-01 23:36:06 +11:00
Campbell Barton
83b5f0268e Fix T48012: Knife Project crash 2016-04-01 06:27:35 +11:00
Campbell Barton
a55477d32a Shortest Path Select: option to select all paths between 2 elements
This option selects all paths between source/destination which are no longer than the path found.

Handy for selecting meshes with a grid-topology.
2016-03-31 04:25:19 +11:00
Campbell Barton
2683dd8b93 Docs: add missing bmesh.ops descriptions 2016-03-20 19:40:03 +11:00
Sergey Sharybin
d042962025 Cleanup some warnings 2016-03-15 14:16:16 +05:00
Campbell Barton
b9ae96dc12 Cleanup: move MDisps flipping to own function 2016-03-14 15:33:54 +11:00
Campbell Barton
66043cc6c1 Fix T47788: Symmetrize flips multi-res data
Symmetrize was unusable with multi-res data,
add an option for the bmesh operator not to flip the multi-res depth.
2016-03-14 14:21:16 +11:00
Campbell Barton
0024768f88 Cleanup: style/spelling 2016-03-14 13:21:13 +11:00
Campbell Barton
0bcbbb1ee3 Fix T47749: Crash subdividing wire edge w/ mdisps 2016-03-11 10:32:56 +11:00
Campbell Barton
5fd0c1ed3f BMesh: avoid assert dissolving degenerate faces
For dissolving 2-sided faces, theres no need to check they are valid before removal.
2016-03-06 17:25:56 +11:00
Campbell Barton
4e500101a7 Cleanup: quiet -Wcomma, cast to void where needed 2016-03-05 09:16:12 +11:00
Campbell Barton
0658659f74 GHash: BLI_ghash_ensure_p_ex now takes a pointer-to-key arg
This is an alternative to passing a copy callback which is some times inconvenient.
Instead the caller can write to the key - needed when the key is duplicated memory.

Allows for minor optimization in ghash/gset use.

Also add BLI_gset_ensure_p_ex
2016-03-02 11:18:56 +11:00
Mike Erwin
a1d7f67d81 cleanup: spelling / typos
no functional changes
2016-01-28 00:30:50 -05:00
Campbell Barton
f5604af464 Cleanup: use BM_mesh_* prefix for BMesh functions 2016-01-14 13:00:11 +11:00
Bastien Montagne
c6c223ade6 Fix T47164: [Scene.raycast] - True result when it should be False.
We cannot use FLT_MAX as initi distance for raycast...

Renamed TRANSFORM_DIST_MAX_RAY to BVH_RAYCAST_DIST_MAX, moved it into BLI_kdopbvh,
and use in RNA raycast callbacks (and all other places using that API).
2016-01-12 10:09:00 +01:00