diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-10-24 03:54:15 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-10-24 03:54:15 +0400 |
commit | 1dadd3b7c65ac24f5299d10766d7df3aa5f8c495 (patch) | |
tree | 8ab14638b417895e347a2f025d554bb67447c455 /source/blender/editors/mesh | |
parent | 0b16c9e201adfcbeebd3e3cda94ccd752c243c03 (diff) |
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
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/SConscript | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 9aa3f3633f3..417cf92c29f 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -73,4 +73,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_BULLET) + add_definitions(-DWITH_BULLET) +endif() + blender_add_lib(bf_editor_mesh "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript index 923bb3f9057..91ffdc91685 100644 --- a/source/blender/editors/mesh/SConscript +++ b/source/blender/editors/mesh/SConscript @@ -27,4 +27,7 @@ else: if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') +if env['WITH_BF_BULLET']: + defs.append('WITH_BULLET') + env.BlenderLib ( 'bf_editors_mesh', sources, Split(incs), defs, libtype=['core'], priority=[45] ) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 90a7e2fe0ea..44933f6a1c0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5389,6 +5389,7 @@ void MESH_OT_wireframe(wmOperatorType *ot) RNA_def_boolean(ot->srna, "use_replace", TRUE, "Replace", "Remove original faces"); } +#ifdef WITH_BULLET static int edbm_convex_hull_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); @@ -5482,6 +5483,7 @@ void MESH_OT_convex_hull(wmOperatorType *ot) join_triangle_props(ot); } +#endif static int mesh_symmetrize_exec(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index c4e8fd70989..864db7f096d 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -165,7 +165,9 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_wireframe); WM_operatortype_append(MESH_OT_edge_split); +#ifdef WITH_BULLET WM_operatortype_append(MESH_OT_convex_hull); +#endif WM_operatortype_append(MESH_OT_symmetrize); |