Grasshopper

algorithmic modeling for Rhino

when writing c# script in GH, I know how to handle following data types.

Curve, Mesh, Brep, int, bool, double.....

but for example, when trying to reference curve objects in rhino document, I have learned that I have to write something like following,

      List<Curve> crvs = new List<Curve>();
      List<double> lengths = new List<Double>();


      foreach(Rhino.DocObjects.RhinoObject obj in doc.Objects.GetObjectList(Rhino.DocObjects.ObjectType.Curve)){


        GH_Curve crv = new GH_Curve();
        crv.CastFrom(obj.Geometry);
        crvs.Add(crv.Value);
        lengths.Add(crv.Value.GetLength());


        }

Q1.
how is Rhino.DocObjects.RhinoObject different from grasshopper usual data types(Curve, Mesh, Brep, int, bool, double...)?

Q2.

I do not undetstand exact concept of 'Casting'. how is 'CastFrom' different from .ConvertToXXX, or .ToXXX?

Q3.

how is GH_Curve different from Curve data type?

Q4

When I search Grasshopper3D for similar topics, I often see GemetryBase, GeometricGoo..... What are these?

Sorry in advance that my coding proficiency is very frustrating...


     

Views: 639

Replies to This Discussion

Hi Andy,

These questions come up a lot, I'll see about writing something comprehensive after I get back from cycling today.

Thanks David as always.

See this: http://www.grasshopper3d.com/forum/topics/grasshopper-data-types

Further questions of course welcome.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service