Grasshopper

algorithmic modeling for Rhino

Hi everybody!

I was tryin to make a python version of the "offset curve" block, because the one in grasshopper fails too often (with internal offset), while the rhino command works way better...

(this was my first python experience, but the problem is another)

i tried with a normal script block:

input: x, y, z - output: out, a;

"

import rhinoscriptsyntax as rs
import math

rs.EnableRedraw(False)

offset = rs.OffsetCurve(x, y, z)
a = offset

"

at the first try i've seen it works very very slowly!

to make the offset of a bunch of curves it takes like 4 seconds for every slider value change and the mouse cursor constantly "blink" with the windows "loading" cursor

after that i deleted the python component to try with a normal offset block, just to see that now that it work at the same speed and the same blinking!

closed grasshopper and tried with a normal rhino offset command to a rectangle,

trought point: it work enough fast but the mouse cursor still blink

what's going on?

my laptop can offset real-time like 100 complex closed curve

my desktop now stutter doing a bunch of it...

Views: 978

Attachments:

Replies to This Discussion

Hi Riccardo,

EnableRedraw() only makes sence when you are adding geometry to Rhino Document.
In this case it's redundant, as you are adding geometry to the Grasshopper document.
Aslo importing modules which you won't use takes a few miliseconds (like "math" module).
After deleting or commenting out the "rs.EnableRedraw(False)" line you might need to restart your Rhino in order to achieve visible speed increase. Not sure why is that so (maybe it has something to do with rs.EnableRedraw calling the "scriptcontext.doc", so ghPython might get a bit confused, even afterwards).

In case you have more than one cpu core, try the python component at the bottom. It uses parallel module which can speed up things a little bit, depending on number of your cpu cores. You need to set "multithread" to "True" in order to start the component.

By the way: for some reason using it, crashed my Rhino two times. Have no idea why is that so.

If you are experiencing the same thing, just ignore it and use your edited component.


@Giulio any opinion on why is this happening (crashing Rhino when using parallel mode)? I have not had similar issues with parallel, up until now.

Attachments:

thanks for the reply

i tried but no better....

i made a video of the problem:

https://www.youtube.com/watch?v=NMb0y6KoOj8

as shown the normal offset component in grasshopper is very laggy/slow/stuttering

while the offset loose and scale components (as all the other components) works perfectly

also the "throught point" offsed i do in the first part of the video is slow;

it was not captured in the video but while moving the mouse during the "thought point" phase the cursor constantly blink with the "loading" cursor... (the azure circle)

this to say that also the normal offset command in rhino is messed up...

it's very slow!

i have recently installed the whole OS in an SSD, btw rhino is on lastest RS and also grasshopper and plug-ins (all downloaded in theese days)

i "feel" like the python script with the EnableRedraw() function "broke" my offset command in rhino;

i'm not sure of it because my enviroment/system is fresh

a complete reinstallation of rhino and components does not solve the problem...

any ideas?

i have to nuke the OS and restart all?

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