Grasshopper

algorithmic modeling for Rhino

Hi guys,

I've been working on a script which acts as a very basic 3D scanner. I have a laser deflection meter on a 3d printer, which scans over the object, sending the height data to Grasshopper, via an Arduino & Firefly.

It looked like it was working, but then i noticed that the distance between points was variable, and there were not nearly as many points being collected as there should have been.

I did some tests and realised that the timer component doesn't seem to count properly - the inaccuracy is huge - when testing with a simple sketch (like attached) against a stopwatch it seems the timer is ~75% slower than real time, and this applies to 1 sec intervals all the way down to 100ms (or less)

Is this a bug, or am i missing something regarding the timer component accuracy?, as i've tried it on more than one computer too..

I guess, if i have to, i can build a serial read script in Processing and pass over the data via gHowl, but it would be a bit of a shame not to keep it all in GH if possible!

Thanks

fergal

Views: 792

Attachments:

Replies to This Discussion

Hi fergal,

it is not in fact possible to have a fully accurate timer while running on a system which allocates processor time-slices on its own terms.

However note that a Grasshopper timer doesn't count the time between events. When you set a timer to 100ms it will cause another Grasshopper solution 100ms after the previous one completed. So what you end up with is 100ms + the time it takes to run the Grasshopper solver. That could be 10ms, it could be 100ms, it could be 10 minutes.

On top of that you get the general inaccuracy due to a multi-task machine that has to run more tasks than it has processors which can amount to quite a large percentage if your timer is set to fire very frequently. However in this case I'm pretty sure it's the Grasshopper solution time that's causing the bulk of the problem.

--

David Rutten

david@mcneel.com

Tirol, Austria

Ah, I see!

Thanks for the clear (and quick!) explanation David.

If that's the case, I think i'll use Processing / Firmata to read and stream into GH, using a dedicated Arduino as clock. It should be accurate enough for my task!

Thanks again

Fergal

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