Grasshopper

algorithmic modeling for Rhino

I was doing a bit of testing on another thread here and I noticed that there was a big difference in performance between the Divide Curve component and the Divide Distance component.

For the test I fed the same curve into both components and set their parameters to result in approximately the same number of points.  In the image below you can see that the Divide Curve resulted in 50 points while the Divide Distance resulted in 52 points.

But the performance comparison is vastly different.  Divide Curve took just 1ms to complete while Divide Distance took 145ms to complete.

Is this to be expected just because of the way it has to divide up the curve, or is there some inefficiency in the Divide Distance component?

Views: 735

Replies to This Discussion

I believe divide distance algorithm is a lot more involved as lengths must be specific.

DivideCurve uses native Rhino algorithms that are highly optimized. Divide distance basically creates a sphere, intersects the curve with the sphere, finds the first intersection point, then moves the sphere to that point. Repeat until no more intersections are found. This is a lot slower, and it's expected to be a lot slower.

--

David Rutten

david@mcneel.com

Thanks

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service