如何编写 wxPython GUI 程序来定向立方体中的磁盘?

发布于 2024-10-11 17:09:30 字数 395 浏览 3 评论 0原文

我是一名地质学学生,正在尝试制定一个程序来说明岩体中的节理网络。

基本上我只需要 wxPython 脚本,或者任何能够创建一个 GUI 程序的脚本片段,该程序在一个盒子内显示许多磁盘,并带有参数(即开始时输入的磁盘的相对位置、方向和半径)。有谁知道这样的脚本,或者是否可能?我的问题是,这是我的论文,尽管我之前涉足过 Python,但没有涉足过像这样复杂的任何东西,当然也不是 GUI。我什至不知道从哪里开始尝试显示几何形状。

不幸的是,我没有时间学习足够的 wxPython 来做到这一点,我正在寻找任何预先编写的示例代码。我已经下载了 wxPython 并完成了一些有关创建消息窗口等的教程,但现在我不知道在哪里寻求帮助。任何建议/提示/代码都将不胜感激,我非常需要帮助!

I am a geology student and am trying to come up with a program for illustrating joint networks in rock masses.

Basically I just need wxPython script, or any snippets of script that would be able to create a GUI program which displays a number of disks inside a box, with the parameters (ie relative position, orientation and radius) of the disks being input at the beginning. Does anyone know of any script like that, or if thats even possible? My problem is that this is for my thesis, and although I have dabbled in Python before, not on anything anywhere near as complex as this, and certainly not GUI. I literally don't even know where to begin trying to display geometric shapes.

I unfortunately don't have the time to learn enough wxPython to do this, I'm looking for any pre-written example code. I have downloaded wxPython and have done some tutorials on creating message windows etc but now I'm not sure where to look for help now. Any advice/tips/code at ALL would be greatly appreciated, I am desperate for help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小矜持 2024-10-18 17:09:30

我不确定我是否完全理解您在这里想要做什么。您要创建交互式 GUI 还是只是可视化?听起来你想要 3D 的东西。您应该查看 VPython ,其中包含一些教程和演示代码。 PyOpenGL 也更强大。对于 wxPython 中的某些内容和实际的 2D 用户界面,您应该真正查看 wxPython 中包含的演示代码。有一个相当不错的完整示例库,其中包含源代码,您只需复制和修改即可。我很确定有一些绘制任意大小/形状的多边形的示例。

I'm not sure I understand exactly what you are trying to do here. Are you creating an interactive GUI or just a visualization? It sounds like you want something in 3D. In that can you should check out VPython which has some tutorials and demo code. Also much more powerful is PyOpenGL. For something and actual 2D user interface in wxPython you should really look through the demo code included with wxPython. There is quite a nice library of complete examples with source code that you can just copy and modify. I am pretty sure there are some examples for drawing polygons of arbitrary size/shape.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文