Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4140

Is Rhino 8 C# really slow?

$
0
0

Hello,

Just tried rebuilding a Rhino 7 C# component in Rhino 8 C#. It is really slow. Anyone know why? R7 is at the top (43ms), the R8 is at the bottom (227ms)

The code is:

private void RunScript(double x, double y, ref object rect, ref object joined)

    if (x.GetHashCode() == 0) x = 200;
    if (y.GetHashCode() == 0) y = 200;

    x *= 0.5;
    y *= 0.5;

    Point3d[] pts = {
      new Point3d(-x, -y, 0),
      new Point3d(-x, y, 0),
      new Point3d(x, y, 0),
      new Point3d(x, -y, 0)
      };

    GH_Line[] line = {
      new GH_Line(new Line(pts[0], pts[1])),
      new GH_Line(new Line(pts[1], pts[2])),
      new GH_Line(new Line(pts[2], pts[3])),
      new GH_Line(new Line(pts[3], pts[0]))
      };

    rect = line;
    joined = new Polyline(new[] {pts[0], pts[1], pts[2], pts[3], pts[0]});
}

Any suggestions very welcome!!

Ash

6 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 4140

Trending Articles