algorithmic modeling for Rhino
Hi,
I have been working on the following problem and am wondering if anyone knows a better way:
Given a group of interconnected line elements, I wish to generate 1) a list of all unique points (ie the "nodes") and 2) generate a list of line elements identified by those points.
For example, given the following, I wish to obtain the following lists:
1) The list of nodes and their coordinates:
{5,0,0}
{0,5,0}
{0,0,0}
{5,5,0}
2) The elements described by these coordinates:
{0 1}
{1 2}
{2 0}
{0 3}
{1 3}
After trying for quite some time with Karamba (generating beam elements and then filtering the output text), I have attempted the attached with C#. However, it seems cumbersome and imperfect. Additionally, I would like the nodal points ordered by their x, z, and y values respectively as a bonus (not shown above).
It seems really simple, but I am pretty stumped. Thanks!
Tags:
We use connectivity DataTrees for similar stuff.
Are you familiar with the whole concept?
In short (and for Point to Point): for a given List<Point3d> we do a DataTree whee branch primary dimension is the index of a given point (in the List) and items are the indices (in the same List) of the connected Points. Same for Point to Line (2 Lists required), Line to Point (ditto). Pretty much like the connectivity in Breps/Meshes etc etc (where we co-relate Vertices, Edges and Faces: 9 possible connectivity trees).
If you are not experienced with coding on these matters try Sandbox.
However: IF you have Lists of line graphs (into a Tree) Sandbox is utterly cryptic (it should output things entirely differently).
Hi Peter,
Thanks so much - Sandbox is more or less what I needed. However, it is strange that the line topology component does not output the indices of the lines. I'll look into Datatrees for future work.
Well ... it's a very good exercise to attempt to do that with C# (and deal with Lists of graphs as well making a far more suitable output than Sandbox does).
Try it and if you hit the wall make a thread (in the coding category).
BTW: This is where Sandbox does some results that are a "bit" hard to decipher (line graph Lists > should yield 2 dimension connectivity trees, that is). Topologizer ... well ... hmm...
Given the opportunity since we have 2 sorts of animals in line graphs (points and lines) we expect 4 (2*2) connectivity trees (PP, PL, LP, LL) kinda like the 9 out of breps/meshes (VV, VE, VF, EV, EE, EF, FV, FE, FF).
On the other hand a capability that checks for stuff < document tolerance and "auto" corrects things is a must for engineering purposes.
Try Topologizer. If the order it return does not satisfy you, you can reorder the points and their topology.
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