Grasshopper

generative modeling for Rhino

Ian Chan
  • Male
  • Canton
  • China, mainland
Share on Facebook
Share Twitter
  • Blog Posts
  • Discussions (24)
  • Events
  • Groups
  • Photos
  • Photo Albums
  • Videos

Ian Chan's Friends

  • Charles Aweida

Ian Chan's Discussions

How to Marshal a variable sized array of ON_3dPoint to C#
8 Replies

Let's say, (-"-) in c++: static ON_3dPoint* MakeSomePoints(ON_Line* line, int* num){ *num = total point numberON_3dPoint* result = new ON_3dPoint[*num]();get *num points on the line; }static void…Continue

Started this discussion. Last reply by Ian Chan Dec 1, 2012.

Draw custom object
8 Replies

public class MyComponent:GH_Component{  myObject obj;   void MyPreview(object sender, DrawEventArg e)  {    //draw my object in the display pipeline  }   public override void…Continue

Started this discussion. Last reply by Ian Chan Mar 5, 2012.

Problem in dividing a srf and output a point matrix
1 Reply

here is my code:         private Point3d[,] UVPointMatrix(Surface srf, int u, int v,bool swap)        {            Interval domU = srf.Domain(0);            Interval domV = srf.Domain(1);           …Continue

Started this discussion. Last reply by David Rutten Aug 11, 2010.

Grasshopper VS. Houdini , Maya Hypergraph
13 Replies

I've been writing some custom components for Grasshopper for several days.Something is bugging me.And I start to comparing GH to some other Node Based softwares.Sometimes, a component in GH contains…Continue

Started this discussion. Last reply by Ian Chan Aug 15, 2010.

 

Ian Chan's Page

Latest Activity

Ian Chan replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"Thanks a lot. Rhino.Runtime.InteropWrappers namespace is very handy!"
Dec 1, 2012
Steve Baer replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"Hi Ian, Here's some sample code that may clarify how I would go about performing the pInvoke. https://gist.github.com/3970130 Let me know if you have any questions. Thanks, -Steve"
Oct 28, 2012
Ian Chan replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"Thanks, David. Marshalling double instead of Point3d struct can close the gap a little bit. //double[] dataArray = data.ToArray(); double[] dataArray = (double[])typeof(List) .GetField("_items", BindingFlags.NonPublic |…"
Oct 28, 2012
David Rutten replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"RhinoCommon consists of two parts, rhcommon_c.dll which is a pure C++ library that exposes Rhino SDK features as easily PInvokeable functions and RhinoCommon.dll which is a pure C# library which invokes these methods. We have a small console…"
Oct 27, 2012
Ian Chan replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"ON_3dPoint* MarchingCubeComputeMeshPoints(int resX, int resY, int resZ, double data[], double iso, ON_3dPoint* minCorner,ON_3dPoint*maxCorner, int* outNum) { int resX_1 = resX+1, resY_1 =…"
Oct 27, 2012
David Rutten replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"Where is this C++ code running from? -- David Rutten david@mcneel.com Poprad, Slovakia"
Oct 26, 2012
Ian Chan replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"I'm trying to marshal some points which are generated by MarchingCube from c++ to c# //PInvoke in c#: //static ON_3dPoint* ComputeMeshPoints(int resX, int resY, int resZ, double data[], double iso, ON_3dPoint* minCorner, ON_3dPoint* maxCorner,…"
Oct 26, 2012
Andrew Heumann replied to Ian Chan's discussion How to Marshal a variable sized array of ON_3dPoint to C#
"Two recommendations: 1. use the non-legacy scripting components, so use RhinoCommon types - this means using Point3d instead of ON_3dPoint, and Line instead of ON_Line.  2. Use the built-in System.Collections types. Rather than going through…"
Oct 25, 2012
Ian Chan posted a discussion

How to Marshal a variable sized array of ON_3dPoint to C#

Let's say, (-"-) in c++: static ON_3dPoint* MakeSomePoints(ON_Line* line, int* num){ *num = total point numberON_3dPoint* result = new ON_3dPoint[*num]();get *num points on the line; }static void DisposeMyPoints(ON_3dPoint* ptrObject[]){if(ptrObject!=NULL){delete [] ptrObject;ptrObject =NULL;}}See More
Oct 25, 2012
Ian Chan replied to Ian Chan's discussion Draw custom object
"DocumentRemoved event is raised when a document, any of the opened documents, is closed.  So the form is closed not only when its parent document is closed. But, problem solved.  Thanks, David!"
Mar 5, 2012
Ian Chan replied to Andrea Lu's discussion A real bug in C#!!!!!
"Maybe you can try Grasshopper.GH_InstanceServer.DebugLogAddEntry(string)"
Mar 5, 2012
David Rutten replied to Ian Chan's discussion Draw custom object
"Grasshopper.GH_InstanceServer has a member called DocumentServer. This class maintains all the loaded documents that Grasshopper is aware of. DocumentServer has events for DocumentAdded and DocumentRemoved. If you handle DocumentRemoved from within…"
Mar 1, 2012
Ian Chan replied to Ian Chan's discussion Draw custom object
"A component creates a windows.form. Then if the active GH_document is closed, the form can not be disposed. Is there anything I can do when the document is closing?"
Mar 1, 2012
David Rutten replied to Ian Chan's discussion Draw custom object
"You're right. -- David Rutten david@mcneel.com Poprad, Slovakia"
Feb 28, 2012
Ian Chan replied to Ian Chan's discussion Draw custom object
"In this component, all the objects that DrawViewportwire draws are not parameters. They're in the component's field, assigned by solverInstance. I had tried Hidden property before. But when the component is disabled,…"
Feb 28, 2012
David Rutten replied to Ian Chan's discussion Draw custom object
"You might want to rely on the Hidden property instead. -- David Rutten david@mcneel.com Poprad, Slovakia"
Feb 28, 2012

Profile Information

Company, School, or Organization
SCUT

Comment Wall

You need to be a member of Grasshopper to add comments!

Join Grasshopper

  • No comments yet!
 
 
 

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service