如何栅格化 3D 网格?

发布于 2024-11-28 21:20:23 字数 335 浏览 2 评论 0原文

我有一个 3d 网格(一组三角形),它定义了一个封闭的水密表面。我想栅格化这个网格,即将网格占用的空间划分为均匀的小立方体(2d 像素的 3d 等效项),并将三角形穿过的立方体绘制为黑色,其余的绘制为白色。例如,类似于将 2D 矢量图形图像光栅化为光栅化 BMP 的方式。 换句话说,我想输出一个 3d 数组 A,即 M x M x M,这样 A(i,j,k)如果存在某个三角形穿过立方体在位置i,j,k处占据的空间,则code>为1。 希望这是清楚的,如果没有 - 告诉我,我会澄清。

任何算法、库、matlab 例程都可以。

I have a 3d mesh (a set of triangles) that defines a closed watertight surface. I want to rasterize this mesh, that is divide the space occupied by the mesh to even, little cubes (the 3d equivalent of 2d pixels), and paint the cubes that a triangle passes through as black and the rest as white. Similar to how one would rasterize a 2d vector-graphic image into a rasterized bmp, for instance.
In other words, I want to output a 3d array, A that is M x M x M, such that A(i,j,k) is 1 if there is some triangle which passes through the space occupied by the cube at the location i,j,k.
Hope that was clear, if not - tell me and I'll clarify.

Any algorithm, library, matlab routine will do.

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

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

发布评论

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

评论(2

吹泡泡o 2024-12-05 21:20:23

我无法向您展示一些算法或库,但可以提供一个小提示。您要查找的术语是体素化。尝试谷歌,它可能会为您提供一些这方面的资源,以及这个小但也很旧的主题简介,这可能是进一步研究的基础。

I cannot present you some algorithm or library, but a small hint. The term you are looking for is Voxelization. Try google and it may present you some ressources on this, along with this small but also quite old introduction to the topic which might be a foundation for further research.

不弃不离 2024-12-05 21:20:23

我发现这个体素分析器非常适合我的需求。它运行速度相当快,并且还有一个 matlab 脚本,用于将生成的体素文件读入 matlab。

I've found this voxelizer quite fitting for my needs. It works quite fast, and also has a matlab script for reading the resulting voxel file into matlab.

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