algorithmic modeling for Rhino
Define 'centre'.
Curves have the TryGetPlane method which allows you to find the plane within which a curve lies. Once you have the plane you can access the ZAxis to get the normal. But the exact location of the plane may not be anywhere near whatever the 'centre' may be.
Thank you for a reply.
Could you tell me how to use TryeGetPlane correctly? I get an error:
No overload for method 'TryGetPlane' takes 0 arguments
C#:
Curve[] edges = glassSrf.GetWireframe(-1); // Edges
Curve joinedEdges = Curve.JoinCurves(edges)[0]; //Joined Edges
Plane planes = joinedEdges.TryGetPlane();
Plane pln;
joinedEdges.TryGetPlane(out pln);
Thanks you.
Thanks Daniel.
One more question.
How to add trasnparent icon to the component?
C#:
protected override System.Drawing.Bitmap Icon
{
get
{
// return Properties.Resources.offsetIcon.MakeTransparent(System.Drawing.Color.White); // This does not work.
return Properties.Resources.offsetIcon; // This works
}
}
Also tried:
Properties.Resources.offsetIcon.MakeTransparent(System.Drawing.Color.White);
return Properties.Resources.offsetIcon;
No error, but still no transparency.
Just add a transparent bitmap (.png format).
protected override System.Drawing.Bitmap Icon
{
get
{
return Properties.Resources.YourBitmap
}
}
or you can also create it (the bitmap) from code.
Works. Thank you.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by