I know this has been asked in the past and it appears that currently there is still no native RhinoCommon method for this. So I guess the only possibility is importing the GH node?
Are there any plans to port that or QuickHull to RhinoCommon soon?
I know this has been asked in the past and it appears that currently there is still no native RhinoCommon method for this. So I guess the only possibility is importing the GH node?
Are there any plans to port that or QuickHull to RhinoCommon soon?
Hi @Helvetosaur,
An option might be to use RhinoPolyhedra, which exposes a QuickHull solver.
import clr
import sys
import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs
from System import Array
# Note, this path may vary
sys.path.append('%APPDATA%/McNeel/Rhinoceros?6.0?Plug-ins/Rhino Polyhedra (666ae572-a6c5-44b5-b668-6b503d56c199)/6.0.6844.19198')
clr.AddReference('PolyhedraCommon.dll')
import PolyhedraCommon
points = rs.GetPointCoordinates("Select points")
arr = Array[Rhino.Geometry.Point3d](points)
polylines = PolyhedraCommon.Geometry.WatermanPolyhedron.CalculateConvexHull(arr)
mesh = PolyhedraCommon.PolyhedraUtils.MeshFromClosedPolylines(polylines, sc.doc.ModelAbsoluteTolerance)
sc.doc.Objects.AddMesh(mesh)
sc.doc.Views.Redraw()
– Dale
Anything happening on this or is it still necessary to get this function via GH or RhinoPolyhedra?
Hi @Helvetosaur,
RhinoCommon doesn’t have a convex hull calculation method, nor does the Rhino SDK.
– Dale
Hi @dale,
Quite old topic, but why not include the QuickHull calculation inside RhinoCommon? This is quite an handy feature
Hi @jeffoulet,
I believe something is in the works already.
https://mcneel.myjetbrains.com/youtrack/issue/RH-68446
RhinoPolyhedra uses a three dimensional implementation of Quickhull, as described in Barber, Dobkin, and Huhdanpaa, The Quickhull Algorithm for Convex Hulls (ACM Transactions on Mathematical Software, Vol. 22, No. 4, December 1996). I don’t know what algorithm GH2 has implemented.
– Dale
Hi @dale,
Thanks for your feedback, this is a great news!
It’s probably worth mentioning MIConvexHull here as well, which is C# and open source:
Thanks! Didn’t know this project.
MIConvexHull is also available as a NuGet package.
– Dale