Hello,
I would like to use RhinoPolyhedra in my script to create QuickHulls, providing the points directly from the script. Is there any way to do that?
PS: no idea if this is relevant, but when I try to get the plugin’s GUID (Rhino.PlugIns.PlugIn.IdFromPath) I get this: {0}
0. 00000000-0000-0000-0000-000000000000
For native GH components I know it is totally possible, but not quite sure for custom plugins.
If it’s possible you need to add the plugin .gha file as a reference to the C# script, and try to access the class of the component you want to use. The class will give methods to instantiate the components, set inputs and retrieve outputs.
What I did was go to manage assemblies and Add PolyhedraCommon.dll then I can use PolyhedraCommon.Something.
However I also have a GhPolyhedra.gha file which I added to the components library. However when I try to do GhPolyhedra.Something I can’t.
Not sure if this make sense, but if it does, how do I go about it?
Is the logic of the quick hull algorithm here the same as the one stated in Quickhull Algorithm for Convex Hull - GeeksforGeeks where
“ The QuickHull algorithm is a Divide and Conquer algorithm similar to QuickSort. Let a[0…n-1] be the input array of points. Following are the steps for finding the convex hull of these points.
1. Find the point with minimum x-coordinate lets say, min_x and similarly the point with maximum x-coordinate, max_x. 2. Make a line joining these two points, say L . This line will divide the whole set into two parts. Take both the parts one by one and proceed further. 3. For a part, find the point P with maximum distance from the line L. P forms a triangle with the points min_x, max_x. It is clear that the points residing inside this triangle can never be the part of convex hull. 4. The above step divides the problem into two sub-problems (solved recursively). Now the line joining the points P and min_x and the line joining the points P and max_x are new lines and the points residing outside the triangle is the set of points. Repeat point no. 3 till there no point left with the line. Add the end points of this point to the convex hull.” @dale