I miss DA.SetData the component gets null while taking the latency , on the other hand if use it the component has two kicks , is there anyway to get rid the first kick?
GH_Structure<IGH_Goo> D = new GH_Structure<IGH_Goo>(); GH_Structure<IGH_Goo> C = new GH_Structure<IGH_Goo>(); protected override void SolveInstance(IGH_DataAccess DA) { bool sw = false; int delay = 0; DA.GetData(1, ref delay); DA.GetData(2, ref sw); DA.GetDataTree(0, out D); DA.SetDataTree(0, C);
if (sw) C = D.Duplicate();
if (delay > 4)
base.OnPingDocument().ScheduleSolution(delay, cullback);
}
private void cullback(GH_Document doc) { var gate=base.Params.Output[0]; gate.ClearData(); gate.AddVolatileDataTree(C); foreach (IGH_Param i in gate.Recipients) i.ExpireSolution(false); }…
Added by Amin Bahrami at 12:00am on February 12, 2016
I'm facing a quite strange issue with an "intermediate" script (that counts branches on a per "node" basis).
Let's describe first why this "intermediate" script is required:
As you can see the "main" script provides points/lines et all in non identical data trees (obvious: since the path structure depends upon if a surface is open or closed). Thus if we need to "post process" (iterate correctly through branches, that is) these trees (in a variety of scripts) we need a way to count branches on a per "node" basis.
This is what this (WIP) script does :
And now the strange issue:
The first function finds the max path dimension ( i.e. for path {a;b;c;d} dimension is 4). Then this value is passed to other functions as argument and life goes on:
The function is really simple:
Now choose this as test tree (works OK: max path dimension=3):
Then switch to the crazy tree (works OK, max path dimension=4):
Then switch back to the initial tree (Oops : max path dimension=4 instead of 3)
Maybe has to do with the exception handling here:
best, the jelly fish
…
calculation is enough and it is also way faster.
To have a single object (not a brep that is a multi-surface) I've converted it to a single mesh.
Now we have an object with a normal property!
Locally, each vertex "check" the normal of the closest point on the mesh to determine if the angle is convex or not.
(Here the logic I've done works back and forth with crossproduct and stuff... hard to explain sorry...)
The definition should work also with simple trees inputs, but some bugs somewhere should be expected...
Last thing:
starting from a point, 2 vectors, define a plane (if not parallel)
if this plane is normal to the patch we've done, it will just be a random choice between treating the angle as convex or not....
The polyline/border (in yellow) of this shape for example:
Except for the 4 corners, the others angles, are convex or not?
boh!
:D
…
eir vertex order if their direction around the shared edge is wrong. In the image below:
So in this example, if 0 is your start face, you'd want to guarantee that for face 1, its vertices on the shared edge go in the order D-E and not E-D. In the example above you'd want to flip the vertex order on face 2 because the vector at the shared edge is parallel to the one in face 0 rather than anti-parallel.
Assuming your mesh doesn't pull any nasty mobius strip topology tricks, I think this is sufficient to guarantee that your face vertex lists are all clockwise (or all counter-clockwise), which is in turn sufficient for the calculation of the face normal according to newell's method. (the cross product of two adjacent edge vectors).
Also note (I learned this the hard way) if you can't guarantee that the polygons are convex, you need to calculate the cross product for EVERY pair of edges rather than just two, and then take the sum of all the cross products.
So to sum up, in my best attempt at a pseudocode version of the above (I will most certainly butcher BFS but clearly you have an idea how it works):
breadth-first search across the faces of the polymesh
for each face check the vector of the adjacent edge against the vector of the same edge in the previous face
if they are parallel flip the order of the vertices in the polygon
calculate the normal using newell's method
next
I make no guarantees that this will even work! But I hope maybe it spurs your thinking a bit :) It's a pretty interesting problem, so please share what solution ends up working - I am eager to learn for myself!…
is :D. Oh and does anyone know how could I have quadtree to match up when I run it with different patterns of points?(I mean a set distance between each division that repeats no matter the pattern without affecting the leaf(division?) order/count and not inserting new leafs where original pattern has none. Simple point grid messes with a lot of stuff that I have mentioned(Maybe some sort of point grid that runs outside the desired area? so it constrains the divisions, and I would later remove it? Anyway how you guys doing? After these crazy few weeks in which I have learned most of my grasshopper knowledge you guys are becoming the only social aspect of my life. So I think it's time for us to get to know each other, knowing that we got a long road ahead of us grasshoppering together. I'll start... My name is Jonas, and I have been using grasshopper for 4 weeks now... Hey Jonas..
https://www.youtube.com/watch?v=1wYNFfgrXTI
^we can relate to the opening
When I am gone, get all the autosave files off my hard drive and continue where I have left off. kek.…
hole new realm?
This Parametric Design Workshop will provide you with the necessary knowledge and ability to use Grasshopper, a free visual programming plugin in Rhinoceros. The workshop will also include a hands on parametric project.
If you already know Grasshopper and would like to uplift your parametric knowledge, then you can choose option 2.
Option 1: General Workshop for Beginners - 16 hours: Start 17.11.2018
Option 2: Intensive Workshop for Intermediates - 8 hours: Start 24.11.2018
Kindly reserve your Tickets here:
https://billetto.eu/en/e/parametric-design-workshop-rhino-grasshopper-lava-berlin-tickets-309905…
res more patience than I have right now. WARNING!! This is painful.
I created a grid and used the brightness filter of the image sampler to set the 'Z' value for all the grid points; then created lines from the points and lofted them. Not sure if nurbs curves ('Degree (D)' = 1?) or polylines work better for the lines. Might want to play with the loft options too.
The more grid points, the higher the resolution but the slower the results. Baking the surface at 178 by 178 (31K total points!) effectively froze my laptop for awhile. But for the stone pattern, the higher the resolution, the better. The 'Scale' and 'jDistance' sliders make a difference too.
You might want to consider sampling one or just a few bricks separately and then repeating the surface in the brick pattern. To keep from freezing up when you open the file, I dropped the 'iNumber' slider from 178 down to 100.
…
Added by Joseph Oster at 9:51am on October 21, 2015
rent way than that.
There are two options to fix your issue, I'm not totally sure about the second one.
Option 1.
The Time buffer has to be directly connected to any of the D inputs of the Loop End. You can add an additional input if you need. It'll hold the data and prevent the Loop End from sending it back to the Loop Start. If there is anything in between (even a component producing a null value), it will still provide the Loop End with some value (null), and will trigger the next iteration.
Option 2.
Switch the Time Buffer to regular mode. By default it is Multithreaded, which means it let's GH do whatever GH wants while it holds the data internally. This will force the current thread in which GH works to Sleep for the specified time. That way you're actually getting what you want in your description (simulating some long process)... unless you're already doing that (no visual indication to deduct that, my fault).
…
ies of reference boxes and using the Box Morph component.
So far I've had some success, as shown in the image. However a few things have cropped up (probably not helped by my limited GH skills!)
1- The morphed geometry isn't aligned. I have ensured the original points match point for point; I have a feeling the u&v directions might have swapped?
2- So far I have been splitting the complex geometry manually in Rhino and defining manually in GH, then matching reference box to target box one by one. This was more for the sake of expedience, and to see if it worked; however I feel there must be a better way of doing this. Maybe the reference boxes split the complex geometry, then test for any contained geometry (the 'Inside' component?)
3- I feel there might be a better (existing!) solution somewhere, as I can't be the first person to try this!
I've attached an image of what I'm trying to do + the definition. The .3dm file is 12MB, I can send it upon request :D
All help would be much appreciated, thanks…
re's some of the code:
Private Sub RunScript(ByVal ini As Double, ByVal iter As Integer, ByVal startpt As List(Of Point3d), ByVal size As Object, ByVal wrap As Boolean, ByVal obstacles As List(Of Point3d), ByRef A As Object, ByRef B As Object)
........
End Sub
'<Custom additional code>
Public Class Agent
......
Private Function avoid(boids As list(Of boid)) As vector3d Dim objdist As Double = 50 Dim steer As New Vector3d(0, 0, 0) Dim count As Integer = 0
For i As Integer = 0 To boids.count - 1 Dim obst As obstacles = obstacles(i) Dim d As Double = loc.DistanceTo(obstacle)
....
How do I access the obstacle points within this public class? Whats the trick here?
Thanks
…