algorithmic modeling for Rhino
Hi all!
Im recording a walking point with rec
this actually is a list.
there is a new point just moving the walker point
by the other hand there is a curve wich I need to divide in my code.
questions :
it is possible to regulate the timelapse between new walking point instances?
it is possible to add a new point with an event?( not just moving)
and
knowing that the code will be executed each time I move the walking point
what could I do to divide the curve just one time?
Tags:
I don't understand what you're after. Can you elaborate, perhaps with pictures?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
sorry
Ill try to be more explicit.
in the attached definition there is a point in a 2d slider
collect the positions with rec.
each time I move the point there is a new point colected with rec.
stored in a list
related to the rec
question 1: a new point in the list depends of the slider movement?
question 2 : there is a timelapse between new appearances if I practice a non stop movement?
question 3: in that case it is possible to regulate this timelapse?
related to the code interface:
the code bubble I attach to rec , as far as I understand, should be executed each time I move the 2d slider and produce a new point.
then
the code I want to be excuted each time rec adds a new point to the list should be in the "main" side of the interface
the declarations I just need to do once should be in the " custom aditional code"
but..
where I could write code to execute once?
( example: to divide the curve just one time , and not each time I add a new point)
my intention is to produce new points with a regulated timelapse or with an event, like for example the right click of the mouse moving the 2d slider
...
and write code to be executed just once.
GH is an event based interface. So what happens is this:
There's no 'sampling frequency' that determines at what interval GH tests the mouse cursor. It handles all events as quickly as it can. There's obviously no way to speed it up as it is already happening as fast as possible, though theoretically it is possible to slow it down.
Instead of using the RECORD object, you could start recording data yourself in a C# component and refuse to add a record if it's too soon after the newest record.
It's an odd thing to want to accomplish though, people are rarely looking to slow things down. What actual problem are you trying to solve?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
so far, so clear, so good
What do you mean by "just once"?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
From looking at your code I think what you want to achieve is to cache the division points of the DivideByLength method so you only compute these points once for every curve. Is that correct?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
I attached a file which only computes the DivideByLength() once. However it will not update even when you change the curve. I don't think we have a good mechanism in RhinoCommon to test whether a curve is exactly the same as some other curve which is what you'd need in this case.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
your solution is enought for me,
I could try an "interruptor" as a reset function to load again the base curves...
lot of points to learn from your piece of code.
thanks a lot!
youre right
still ambiguous,
just once you open the file and make the point moves,
so I think is your last option.
Hola,
Maybe this is what you are looking for. This will add a new point every second while the slider is moving instead of at every component update.
I deleted the attachment apparently.
Hi! What's the difference with the Data Dam component?
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by