I want to generate a connection graph as shown in the figure above. I have the 3D points (vertices/dots in the figure). I want to run a condition check for each pair of vertices and draw the line segments (edges) connecting the vertices if the condition is true. Can someone please help me with proper functions in the pseudo code below to draw line segments and display the final 3D connection graph? Thank you.
P=vertices; (points, nx3)
if condition for vertices 'i' and 'j' is true:
connect the vertices with line segment
#display final connection graph with vertices and edges