Grasshopper

algorithmic modeling for Rhino

Transforming Geometry (like Curves, Polylines etc.) in C# component

Hello,

I've just started to learn C#. So, I have a very basic question, how can I apply transformations to a geometry? I attached the code and gh file. 

Can anyone recommend a website where I can find reference codes like Processing reference list? 

Thanks in advance

Views: 1355

Attachments:

Replies to This Discussion

Set a TypeHint on crv so it is supplied as the correct Type (ie. Polyline in this case, but it could be Curve as well, or GeometryBase). Then the code you're after is:

private void RunScript(Polyline crv, Vector3d v, ref object A)
{
  crv.Transform(Transform.Translation(v));
  A = crv;
}

Ie. 

Attachments:

Thanks a lot! It is working now

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