Here are some screens from a convex hull maker script that I made as we began to integrate physics engines into our games and hence had the need for convex shells for collision calculations.

It was an interesting script to right.  I treat the source meshes as a point cloud.  I then start at any three points, build a face, and then randomly jump through all of the remaining points looking to the center to see if it can see any triangles.  It is sees one, it is concave and is deleted.  Then new faces are built.  Process is repeated until all the points have been run through.

Description:

  • This script builds convex hulls based on selected geometry.
  • Definition of a convex mesh: ”An object is defined as convex if, given any two points inside the object, you can always go in a straight line from one to the other without going out of the object.”

Usage:

  • Workflow:
  1. Select the object(s) that you want to build a convex hull around.
  2. Verify that the scope option in the script’s ui is set appropriately.
  3. Press the “Build Hull” button to create the new hull object(s).
  4. Select the new hull(s) and name them properly. (They will all be named “ObjectXX”)
  • Options:
    • Scope:
      • “Selection as single object”
      • “Individual Objects”
      • “Update Viewports”
        • This is a frivolous option that will allow you to watch the hull being built in the viewport.
        • Note this option drastically slows down the hull creation process.