Hi everyone,
This may sound like a noob question, but I’m wrapping my head around it and can’t figure it out. I’m using a script to generate points and edges to visualize Wolfram Hypergraphs using the networkx library. I have all the points working and used the Proximity POP to make the lines visible, but these are not the original formula lines.
For each edge, my script outputs a DAT row like this:
['P1(0)', 'P1(1)', 'P1(2)', 'P2(0)', 'P2(1)', 'P2(2)', 'node_id_a', 'node_id_b']
where P1 and P2 are the 3D coordinates of the two endpoints.
How can I use this DAT to connect the points from P1 to P2 for each row, so I get the actual edges from my hypergraph, not just proximity lines?
Thanks for any advice!
I also Have another version of the scrip where the points have a line_id attribute so I know what the groups are, have been trying to use the primitive POP to connect them as lines but with no success, here is my table format:
P|0)|P(1)|P(2)|line_id|
|-11.515011059631018|-19.191685099385033|-3.3299139160406828|0|
|-16.668480194049437|-5.515065017323636|-5.362388205466765|0|
|-12.015011059631018|-18.891685099385032|-3.3299139160406828|1|
|-16.668480194049437|-5.515065017323636|-5.362388205466765|1|
I tried to use primitive Method: pattern, type line and the point index pattern but I don´t see how to add my line_id attribute, also the Method: by Set but cant see to make is work I feel it should be easy task but can´t figure it out…
Hello @Abas.fly
For your first problem, one approach would be to split Point A and Points B using two DAT to POP nodes, then merge them and generate the lines using a Primitive POP. Once you know how many point pairs you have, use the By Set method and specify the appropriate value for Skip Every Nth Point.
For your second problem, a possible solution to create lines from points sharing the same line_id is to use a Trail POP with Match By Attribute enabled.
EdgePoints.toe (6.7 KB)
The Trail POP is perfect because I can simplify the script to output everything at once, many many thanks!!!
1 Like