.net - 如何快速(易于编写脚本)预览 3D 矢量/线条?

标签 .net python 3d ironpython

我正忙着从工具中读取 3D 建筑模型,从而生成一堆 Line(p1, p2) 对象,每个对象由两个 Point(x, y, z) 对象。我想在一个简单的 3D 查看器中显示这些内容,有点像 SVG(据我所知,它只支持 2D)。

读取是用 Python 完成的,特别是 IronPython。我可以使用 .NET 查看器库,也可以通过在适当的程序中手动打开结果来编写包含要显示的数据的 text/xml/whatnot 文件。

您会使用什么格式/工具来查看数据?

(目前,这仅用于调试目的,因此不必是一流的。只需一个线框即可!)

我确实检查了 mathplot 库,但这似乎只绘制函数......

编辑:我最终确实走上了 X3D 路线并写了一个 little blog post on how to do it 。以下是 1x1x1 立方体的示例 X3D 线框文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
  "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile="Immersive" >
  <Scene>

    <Transform>
      <Shape>
        <LineSet vertexCount="5">
            <Coordinate point="1 0 0
                               1 1 0
                               0 1 0
                               0 0 0
                               1 0 0"
                               />
        </LineSet>
    </Shape>
    <Shape>
        <LineSet vertexCount="5">
            <Coordinate point="1 0 1
                               1 1 1
                               0 1 1
                               0 0 1
                               1 0 1"
                               />
        </LineSet>
    </Shape>
    <Shape>
        <LineSet vertexCount="5">
            <Coordinate point="0 0 1
                               1 0 1
                               1 0 0
                               0 0 0
                               0 0 1"
                               />
        </LineSet>
    </Shape>
    <Shape>
        <LineSet vertexCount="5">
            <Coordinate point="0 1 1
                               1 1 1
                               1 1 0
                               0 1 0
                               0 1 1"
                               />
        </LineSet>
      </Shape>
    </Transform>
  </Scene>
</X3D>

最佳答案

要使用写入文件方法,您可以调查 X3D ,它是 VRML 的后继者。另请参阅this list of vector graphics markup languages

关于.net - 如何快速(易于编写脚本)预览 3D 矢量/线条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1345485/

相关文章:

python - reshape LSTM 自动编码器的输入数据

algorithm - 射线和三角边相交怎么办?

c# - 如何制作像 Timer.Tick 这样的事件处理程序

.net - 是否存在指定的(子)索引分隔符?

python - 将 Django 与遗留数据库集成不起作用

python - 仅匹配数字的扩展名

c++ - 骨骼动画 : interpolation between transformation matrices (collada)

python - 将正方形旋转为向量的法线

c# - guid 到 base64,用于 URL

.net - 变量 '<variablename>' 将变量隐藏在封闭 block 中