Planarity functions


“network_is_xy” function does not seem to work correctly.


Hi Salmo,

If this seems like a bug, Can you provide some more details and create an issue on the issue tracker?

Please let us know what you have input, and what error message you are getting.



Hi Andrew,

I get the following error on “network_is_xy”, while using “network_is_planar_embedding”:
"TypeError: ‘Network’ object is not iterable"
however the other two functions “network_is_planar” and “network_is_crossed” are not giving me errors, meaning the input “network” is OK.


hi all,

this is a leftover from old functionality that allowed the iteration over the vertices of the data structures by doing the following:

for key in network:

this has been removed in the more recent versions.
will update the algorithm accordingly…



fixed in hotfix 0.1.0-#35


Thanks Tom.

I also have a question/comment on “network_embed_in_plane” function:

It looks like that for a handful of planar networks it is unable to embed the network (i.e. returns False), even the ones that I easily can draw the embedding on the paper (it works fine for the fink truss). Is there any other way to draw the embedding of a planar network?


network_embed_in_plane is a bit experimental and indeed not very robust. it was specifically designed for the examples in the Algebraic Graphic Statics paper and not really tested beyond that scope.

creating planar straight-line drawings of graphs is not an easy task, especially if a particular type of result is desired, as in the case of using these drawings for AGS-style purposes. usually force layout algorithms are used, which is also what happens in the network_embed_in_plane function.

development on compas_ags will start to pick up again soon, but i cannot promise that we will immediately find a much better solution for the embedding stuff.

just for my information, could you provide a bit more context to your questions and perhaps a (few) small example(s)?



Hi Tom,

At this point I am aware that it is not an easy task to draw a crossing-free embedding as you have mentioned in your AGS paper. I have some truss patterns as the output of my ground truss optimization algorithm and I would like to be able to create their dual.

Below are examples of the output patterns. The “network_is_planar” returns True for all of them, however “network_embed_in_plane” returns False.

Hope that provides you a bit of context.


Another observation:

“network_find_crossings” provides repetitive edge pairs, one is opposite the other, is it a bug?


yes that is a bug.
please add it to the issue tracker, then i will fix it!

BTW, will try to get back to you about your examples as soon as possible…