Open Jeddu opened 4 years ago
Thanks for your comments. I hadn't had any experience with a MultiDiGraph so glad you could adapt it to your needs and are finding it useful!
I haven't really considered taking this seriously - initially I was going to try and merge this capability into NetworkX natively, but didn't find the time. Would be happy to support if this if it's something you are keen to take on.
Hi, I'm using your curved_edges.py, it is very useful.
I've found a problem when I tried to use it with a MultiGraph or MultiDiGraph. This is what I found and what I changed to get it work.
If you are using G as MultiDiGraph,
edges = np.array(G.edges())
causes this problem:I changed it to support MultiDiGraph edges: (a, b, c)
edges = np.array([edge for edge in G.edges()])
The next issue is to not use a fixed
degree=2
, In my use case, I notice the degree can change so I found a better option inbezier.Curve.from_nodes(nodes)
. Since it just return the Curve computing the degree itself.So, if I run:
curveplots.append(bezier.Curve(nodes, degree=2).evaluate_multi(np.linspace(0,1,bezier_precision)).T)
I get this:
So I changed it to:
curveplots.append(bezier.Curve.from_nodes(nodes).evaluate_multi(np.linspace(0,1,bezier_precision)).T)
Lastly, would you consider to publish your module in pypi?