Commit Graph

45 Commits

Author SHA1 Message Date
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
36d47ce203 Fix leak in BMesh convex hull operator 2015-05-30 16:17:04 +10:00
ea5f9fee8d Cleanup: function arg wrapping 2015-05-05 16:34:38 +10:00
bd00770715 Cleanup: consistent arg order in bmesh 2015-01-14 01:36:03 +11:00
5580afb5df GHash/Edgehash: make simple iterator checking functions inline.
also remove NULL check, only a few areas made use of this.
2014-04-08 15:50:38 +10:00
412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
92d94ccb08 misc minor changes
- make cmake osx use of -ftemplate-depth match scons.
- use array size within sizeof(), more compact.
- replace AT with __func__ where the function is unique enough.
- BLI_box_pack_2D -> 2d to match other functions.
- rename new mesh normal calculation to mesh.calc_normals_split()
2013-09-10 19:23:39 +00:00
bbce51d116 replace hashes with sets where possible. 2013-08-25 20:03:45 +00:00
9470754fd3 bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
2013-08-21 07:51:47 +00:00
19d3e230e6 improved BM_face_copy_shared to copy from more possible connected loops and add filter function (not used yet). 2013-08-18 11:44:51 +00:00
b1f4e2b4db code comments: bmesh operator doxy header descriptions. 2013-03-30 08:54:50 +00:00
6f9f1399a0 code cleanup: operator headers 2013-03-25 22:40:11 +00:00
0d5b028d43 patch [#34103] use boolean in path functions and add comments.
path_util_1.patch from Lawrence D'Oliveiro (ldo)
2013-03-04 19:27:51 +00:00
0ac07404ba style cleanup: braces with multi-line statements, also add some comments. 2013-03-01 14:47:06 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
07ccd3ee3f fix [#33029] Applying modifier leaks memory
Thanks for Sergey for finding the bug & patching, This fix works a bit differently.
Theres no need to allocate the customdata in the first place - since its written into. So add a flag for vert/edge/face/loop creation functions so they can skip customdata creation.
2012-11-29 16:26:39 +00:00
8ecce451ab bmesh operator naming - use clearer names for args eg: (mat -> matrix, use_singleedge -> use_single_edge)
also remove duplicate docs for operator arg formatting.
2012-11-28 00:16:06 +00:00
dbdc76c9d0 code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.
all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.
2012-11-20 05:50:19 +00:00
48639af5f8 use input and output slots for bmesh operators, needed for the python api to get return values. 2012-11-19 14:58:31 +00:00
cdc4037f0d bmesh: BM_verts_in_face was using bmesh operator flag which is no longer ensured to be available,
use internal apiflag instead, Thanks to Nicholas Bishop for spotting.

also quiet some warnings.
2012-11-19 00:54:55 +00:00
97b7154142 replace BM_edge_face_count with BM_edge_is_manifold/BM_edge_is_wire/BM_edge_is_boundary 2012-11-12 04:50:45 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
69fa77d279 Various convex hull fixes
* Lower the required number of vertices from four to three. The new
  backend correctly outputs a triangle in this case.

* Fix the check for the number of input vertices. Before it was
  counting total number of input elements including edges and faces.

* Don't mark edges as holes if they are loose.

* Don't allow duplicate faces to be created.

* If use_existing_faces isn't enabled, but a face in the convex hull
  has the same vertices as an existing face in the mesh, mark it as
  output geometry rather than interior geometry.

* Fixes bug [#32960] Convex hull operator crashes when 'make holes' is
  selected.
  projects.blender.org/tracker/?func=detail&atid=498&aid=32960&group_id=9
2012-10-25 04:08:51 +00:00
1dadd3b7c6 Partially replace convex hull implementation with Bullet implementation
* Bullet's convex hull implementation is significantly more robust
  than the one I implemented, as well as being faster.

* This fixes bug [#32864] "Convex Hull fails in some cases."
  projects.blender.org/tracker/?func=detail&aid=32864&group_id=9&atid=498

  That bug, and others like it, relate to the poor handling of
  co-planar surfaces in the input. Pretty much any model that is
  simple-subdivided a few times gave very bad results before, Bullet's
  implementation handles this much better.

* In order to ensure a smooth transition, the Bullet output is
  translated into the existing HullTriangle hash structure. This makes
  it easy to ensure that the existing slot output stays the same; the
  interactions between the slots are somewhat complicated, detangling
  is a TODO.

* Reviewed by Brecht:
  https://codereview.appspot.com/6741063
2012-10-23 23:54:15 +00:00
e75f5c8208 quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
2012-09-15 01:52:28 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
3a0593cc3d code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly.
also added some comments.
2012-07-06 22:48:28 +00:00
2336aadb80 decrease size for convex hull epsilon when checking which side of a face the vertex is on.
this doesnt fix all cases but works better then it did.
2012-07-06 20:16:04 +00:00
1a9e7a00f3 style cleanup: var names 2012-07-06 19:22:21 +00:00
5f3bd06f37 code cleanup: use a define for bmesh hull epsilon 2012-07-05 18:03:07 +00:00
8b865c01cd style cleanup: comments 2012-06-30 22:49:33 +00:00
f57c1c8b34 Avoid adding overlapping triangles in convex hull
Add an epsilon value to the point-outside-hull test, helps when some
of the input vertices are nearly coplanar.

Fixes bug [#31941] convex hull fails (and depends on vertex order when it shouldn't)
http://projects.blender.org/tracker/index.php?func=detail&aid=31941&group_id=9&atid=498
2012-06-27 18:39:17 +00:00
9dd981a440 style cleanup: block comments 2012-05-16 23:37:23 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
0de912b82d Partial fix for bug #31458 Convex Hull operator crash
Change hull's point/triangle side test to > rather than >=.

This seems to fix the (infinite?) loop, but not the crash.
2012-05-14 20:59:08 +00:00
f87fda5864 Fix precision issue for bmo_hull.interior_geom output slot.
Keep track of interior verts during the hull build to avoid
imprecise floating-point test afterward.
2012-05-14 20:58:59 +00:00
4ea8c9ab38 Small hull bmop fix, distance check from plane needs absolute value. 2012-05-04 03:25:46 +00:00
2a1ba8c85b style cleanup: formatting and some float/double promotion 2012-05-03 19:57:24 +00:00
6f0cb140b0 Initialize an input in bmo_hull. 2012-05-02 23:29:52 +00:00
933b3166fc style cleanup: guys - set your editors to tabs! 2012-05-01 17:51:03 +00:00
8f3ed0501e code cleanup: quiet clang warnings, these would likely never but wont hurt to quiet them, 2012-04-30 10:47:32 +00:00
5979893711 style cleanup: edits to convex hull. 2012-04-30 10:39:35 +00:00
70f1279eab Add convex hull operator (bmesh operator and wm operator.)
Image-heavy user documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/Convex_Hull

Thanks to Campbell for providing code review:
http://codereview.appspot.com/6114060
2012-04-29 16:09:40 +00:00