How to use this C# library?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  08 August 2011
How to use this C# library?

How would I go about using this C# library:

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
  08 August 2011
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.

Last edited by lo : 08 August 2011 at 08:49 PM.
  08 August 2011
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
  08 August 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:13 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.