Commit Graph

1934 Commits

Author SHA1 Message Date
Bastien Montagne
c5d7602925 Fix T49471: Vertex Connect randomly broken.
Not sure where this comes from, but code was converting BMEdge* to BMVert* to check oflags,
i.e. not accessing correct memory.

Regression, to be backported to 2.78a.
2016-09-28 16:58:11 +02:00
Campbell Barton
5bdff9ea80 Quiet shadow warning
No need to declare new iterator for second loop.
2016-09-25 12:19:38 +10:00
Peter Lu
a070a5befa Mesh: added default UVs for Monkey, improved UVs for UV Sphere and Icosphere.
Fixes T47488 and T47478.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2224
2016-09-24 16:39:23 +02:00
Howard Trickey
0f8f494d63 Fix T49296, assert failure in Bevel code.
The mesh interpolation function failed to fill a fractions-of-the-way
array properly when the distances are very small but nonzero.
2016-09-12 07:29:31 -04:00
Bastien Montagne
f4e4009afd Cleanup: some bad sizeof() usages. 2016-08-18 16:18:58 +02:00
Howard Trickey
e3b5aa9bb1 Fix Bevel crashes T49088 and T48858.
Was calling the fast path for finding edge order in cases
where it should not have been called.
2016-08-17 11:24:31 -04:00
Campbell Barton
710ab5be36 Cleanup: spelling, style 2016-07-31 17:41:05 +10:00
Campbell Barton
e8037867b6 Correct mistake comparing vertices 2016-07-22 18:18:59 +10:00
Campbell Barton
192df299d9 Fix T48926: Subdivide edge-ring crash
Also resolves: T34294
2016-07-22 15:45:04 +10:00
Campbell Barton
cddef5589a BMesh: compare face angles as angles cosine 2016-07-22 07:22:47 +10:00
Campbell Barton
5f7fd0444d BMesh: improve BM_face_splits_check_legal
- remove edge scaling, instead avoid checking intersections with connected edges.
- replace local line intersection functions with BLI_math
- center the projection for more precise calculation.
2016-07-20 10:00:35 +10:00
Campbell Barton
3948f65686 Cleanup: style, spelling 2016-07-19 10:27:33 +10:00
Campbell Barton
bd59206b5c Cleanup: style, spelling 2016-07-19 09:16:38 +10:00
Campbell Barton
c885cea7bb Cleanup: spelling 2016-07-16 17:48:57 +10:00
Campbell Barton
8343518272 Cleanup: comment blocks 2016-07-15 02:39:45 +10:00
Campbell Barton
7a3ea87bbf Cleanup: use normalize_v#_length 2016-07-08 10:14:49 +10:00
Campbell Barton
30d951ce34 Cleanup: spelling 2016-07-08 09:49:01 +10:00
Campbell Barton
124bfa4d2d Cleanup: spelling, style 2016-07-08 00:48:45 +10:00
Campbell Barton
b1047640ad BMesh: utility function to resize bmesh elements
This can be used to re-allocate bmesh data with/without tool flags.
Needed for Symmetrize since it uses bmesh operators from dyntopo.
2016-07-02 18:18:47 +10:00
Campbell Barton
9f5621bb4a Cleanup: comment blocks 2016-07-02 10:08:33 +10:00
Campbell Barton
0a026033ae BMesh: make toolflags optional
Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.
2016-07-01 19:29:22 +10:00
Campbell Barton
e6d947f037 BMesh Intersect: use flags to keep track of verts
For simple cases bitmasks were OK, but didnt work for vert/edge, vert/edge tests.

Tag verts instead, makes logic easier to follow and gives minor speedup.
2016-06-29 16:09:58 +10:00
Campbell Barton
c7a6ff0981 Docs: arg names 2016-06-27 13:21:14 +10:00
Campbell Barton
a10117562f BMesh: avoid redundant calculations comparing angles 2016-06-24 19:01:35 +10:00
Campbell Barton
73a9c56607 Fix T48716: Knife cut creates inverted normals
In the case of having 3+ boundary edges, we need to find the best.
2016-06-24 18:58:42 +10:00
Campbell Barton
d9a01a1d04 Fix T48707: Edit-mesh intersect crash
In rare cases intersect would attempt to add edges with the same vertex twice
from edge-vert / edge-edge intersections.

Solve by checking for duplicates when creating vertex-array for these types of intersections
(always under 3x comparisons, so not much overhead).
2016-06-23 22:20:40 +10:00
Campbell Barton
57744df38f Correct recent change to edge-net
Need account for cases where vertex connects a single edge.
2016-06-23 22:20:40 +10:00
Campbell Barton
a8898d3105 Correct assert 2016-06-23 12:26:26 +10:00
Campbell Barton
8ae74ece9a Fix null-pointer free
Own error in recent decimeter commit
2016-06-22 05:34:04 +10:00
Campbell Barton
a170607578 Fix T48683: Knife cut creates hole
BM_face_split_edgenet wasn't correctly detecting boundary vertices to walk over,
since vertices may be attached to boundary edges not part of the newly created face.
2016-06-21 08:10:56 +10:00
Campbell Barton
ed225d4517 BMesh: avoid verts-of-edge iterator
Since this function is called a lot, loop over data directly.
2016-06-21 08:10:51 +10:00
Dalai Felinto
72273b08cc Fix building for Windows after 57cff46v (booleans unitialized) 2016-06-20 13:02:53 -03:00
Campbell Barton
bcde045b32 Fix T48667: Bisect-fill crash
BMO iterator would loop over removed faces.

Recent changes to mempool FREEWORD size exposed this bug.
2016-06-17 21:45:56 +10:00
Campbell Barton
3f744a16c4 Correct error in recent commit 2016-06-16 22:18:59 +10:00
Campbell Barton
5ea27bec1f BMesh Decimate: use doubles to calculate optimized position
This allows the error threshold for calculating the optimized location to be much lower.

Resolves visible artifacts w/ 1m-tri happy-buddha example.
2016-06-16 19:25:02 +10:00
Campbell Barton
57cff46cec BMesh Decimate: support ngons 2016-06-16 04:30:59 +10:00
Campbell Barton
9285bbe484 Fix error splitting convex faces
Created double faces, leaked memory.
2016-06-16 03:43:22 +10:00
Campbell Barton
51cb4ea2cf Fix T48154: Decimate topology changes with scale
This can't be avoided completely, however the threshold used can be much lower.
2016-06-14 17:12:29 +10:00
Campbell Barton
1883dbd8c3 Fix T48616: Auto-merge selects extra edges
Auto-merge caused all edges between selected vertices to be selected.
This only makes sense in vertex-select-mode.

Correct edge-flag merging code, which now merges flags from multiple edges.
2016-06-13 18:07:59 +10:00
Campbell Barton
65df2fd997 bmesh py api: expose BM_face_calc_tangent_*
D1988 by @wisaac, with own edits and improvements.

This improves on existing tangent calculation functions too.

- BM_face_calc_tangent_auto: Chooses method based on number of sides, used by manipulator (not exposed to Python).
- BM_face_calc_tangent_edge: from longest edge.
- BM_face_calc_tangent_edge_pair: from longest edge-pair (most useful with quads).
- BM_face_calc_tangent_edge_diagonal: edge farthest from any vertex.
- BM_face_calc_tangent_vert_diagonal: vert farthest from any vertex.

Also optimize BM_vert_tri_calc_tangent_edge* functions to avoid sqrt.
2016-06-12 15:12:34 +10:00
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