python 3d图形控件 可交互_如何使用Python在(交互式)3D中可视化图形?

我有像

Python这样的

Python图:

# Each element is a tuple with coordinates (x,y,z).

# The index is the id of the vertex

vertexList = [(0,0,0),(1,0,0),(1,1,0),(0,1,0),

(0,0,1),(1,0,1),(1,1,1),(0,1,1)]

# Each element is a tuple with the vertex-ids and a weight (vertexId1, vertexId2, weight)

edgeList = [(0,1,1), (1,2,1), (2,3,1), (3,0,1),

(0,4,1),

(4,5,1), (5,6,1), (6,7,1), (7,4,1)]

graph = (vertexList, edgeList)

这是一个小例子.我编写的应用程序使用包含大约100个顶点和300个边的图形.

我想用python来形象化这个,最好有一个可供Ubuntu使用的库.如果可以在3D可视化中移动图形将会很棒.

到目前为止我做了什么

目前我使用UBIGRAPH.可视化和交互非常好,但我不能指定顶点的坐标:

def visulizeGraph(Graph):

vertexList, edgeList = Graph

server_url = 'http://127.0.0.1:20738/RPC2'

server = xmlrpclib.Server(server_url)

G = server.ubigraph;

G.clear()

for identifier, vertex in enumerate(vertexList):

G.new_vertex_w_id(identifier)

for vertex1, vertex2, weight in edgeList:

x1, y1, z1 = vertexList[vertex1]

x2, y2, z2 = vertexList[vertex2]

G.new_edge(vertex1, vertex2)

matplot

我找到了matplotlib,但它非常大.我没有找到一个我喜欢的例子,但我可能错过了它.它可用于Ubuntu.

VTK

与matplot相同的问题.如果你能给我一些有用的例子,那可能是最好的解决方案.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值