Notifications
Clear all

[Closed] How to use this C# library?

How would I go about using this C# library:
http://miconvexhull.codeplex.com/documentation

My problem is the return value of the principal function of that library:

List<IVertexConvHull> ConvexHull.FindConvexHull(optional int dimensions)

List<IVertexConvHull> ConvexHull.FindConvexHull(out List<IFaceConvHull> faces, Type face_Type, optional int dimensions)

Any suggestions how to use/access that using MAXScript?

Thanks a lot in advance
– MartinB

2 Replies
 lo1

Have you been able to even load the dotnet assembly?? It gives me an error.

The return type is a generic list of type <IVertexConvHull>
If you can tell me how you loaded the assembly I’ll try to get it to work…

edit: found the problem, I forgot to un-sandbox the dll.

 lo1

Something seems strange in that assembly. It’s referencing other assemblies not included in the dll (namely StarMath library).
I downloaded StarMath dll from CodePlex, but it seems that MIConvexHull is calling methods in StarMath that are not found in the library.

Here’s what I have so far:

assembly = dotNetClass "System.Reflection.Assembly"

r2 = assembly.loadfrom "C:\\StarMath.dll"
r = assembly.loadfrom "C:\\MIConvexHullPlugin.dll"

myMesh = snapShotAsMesh $Teapot01
myVerts = #()

myArr = dotNetObject "System.Double[,]" myMesh.numVerts 3 

for i = 0 to myMesh.numVerts-1 do
(
	local v = getVert myMesh (i+1)
	myArr.Set i 0 (v.x as double)
	myArr.Set i 1 (v.y as double)
	myArr.Set i 2 (v.z as double)
)

chClass = (dotNetClass "MIConvexHull.ConvexHull")
chClass.inputvertices myArr

newVerts = chClass.FindConvexHull 2