6
$\begingroup$

I would very much like to get the Convex Hull (of the Rigid Body Collision shape) as an actual mesh.

Is there any way?

$\endgroup$
9
$\begingroup$

Edit mode(Tab) > Select All(a) > Mesh > Vertices (Ctrl+v)> Convex Hull (h):

Edit mode(<kbd>Tab</kbd>) > Select All(<kbd>a</kbd>) > Mesh > Vertices (<kbd>Ctrl</kbd>+<kbd>v</kbd>)> Convex Hull (<kbd>h</kbd>)

$\endgroup$
2
$\begingroup$

Convex hull bmesh operator

bmesh.ops.convex_hull(bm, input, use_existing_faces)

Convex Hull

Builds a convex hull from the vertices in ‘input’.

If ‘use_existing_faces’ is true, the hull will not output triangles that are covered by a pre-existing face.

All hull vertices, faces, and edges are added to ‘geom.out’. Any input elements that end up inside the hull (i.e. are not used by an output face) are added to the ‘interior_geom’ slot. The ‘unused_geom’ slot will contain all interior geometry that is completely unused. Lastly, ‘holes_geom’ contains edges and faces that were in the input and are part of the hull.

Test script, creates a convex hull for the active mesh object.

import bpy
import bmesh
from mathutils import Vector, Matrix

context = bpy.context
scene = context.scene
ob = context.object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)
copy = ob.copy()
ch = bpy.data.meshes.new("%s convexhull" % me.name)
bmesh.ops.convex_hull(bm, input=bm.verts)
bm.to_mesh(ch)
copy.name = "%s (convex hull)" % ob.name
copy.data = ch
scene.objects.link(copy)

enter image description here Suzanne and convex hull Suzanne

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.