algorithmic modeling for Rhino
hello,
i guess there is a way to generate branches from same x values for example. lets say we have 10 points ordered like pins in bowling. now every row has the same x value and i want a list which has 4 branches for every row but the items within each branch will vary from 4 to 1. can someone tell me how to accomplish this please?
thx!
Tags:
Hey Danny,
Why is the jitter neede here?
And how do you like this solution? Its combined by Davids resort2D and your pathmapper.
Best Regards
DeDackel
I realised this would be confusing so I added the EDIT comment
the Jitter is just to demonstrate that it can be applied to any flat list of random points
With your method you could have used the Flip Matrix Component instead of the Path Mapper that way you can change the data structure without having to edit the Path Mapper.
Unfortunately it only really works with this example using the Divide Surface, because it has the basic path structure already present to manipulate. I don't think you would get the same results with a flat list of points.
Sorry if this sounds harsh.
Great sollution! THX a lot
I have a similar Problem, maybe someone can help.
I have a huge amount of points with a clear defined ID pattern. I have to sort the points out by their Obeject ID (this script works) and connect the points in sequence.
The pattern is a surface name (from 000 to 999) and a corner (from 00 to 003) f.ex.; P1-ERDR-F-450-001
I leave the script uncomplete, as I tried so many combinations and I gave up now.
as the files are not uploading, find attached the public link
https://dl.dropboxusercontent.com/u/51129150/glass%20test.3dm
You're still using 0.9.0014 so you won't be able to open my file. You probably don't have the [Tree Statistics] component either, but you can use the [Param Viewer] to the same effect.
I made your VB script a bit bigger. Since you already had one I figured it doesn't count as cheating. The code is now:
Private Sub RunScript(ByVal ID As Guid, ByRef N As Object, ByRef S As Object, ByRef C As Object)
Dim rhObject As New ObjRef(ID)Dim name As String = rhObject.Object.Attributes.Name
Dim fragments As String() = name.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)N = name
S = Convert.ToInt32(fragments(3))
C = Convert.ToInt32(fragments(4))
End Sub
There's no need a Try...Catch block, scripts already run in a safe environment. Also, don't use the weird DBNULL constant but Nothing instead. I removed that entirely because if the script throws an exception than the outputs will be Nothing anyway.
Once I have the surface ID (which is an integer luckily) and the Corner index, I graft both the original pointdata and the corner data. Then by replacing the default grafting paths {0;0}, {0;1}, {0;2} etc. with the surface integers, I can create a datatree which uses the surface ID as the paths.
At this point we have all corners that belong together in individual lists. However they are still unsorted. By also grafting and replacing the Corner numbers we can then sort the remaining points using the corners to achieve the final result.
--
David Rutten
david@mcneel.com
Tirol, Austria
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
© 2024 Created by Scott Davidson. Powered by