关于 BSpline 的问题

发布于 2024-12-05 02:05:39 字数 1753 浏览 1 评论 0原文

这是一个带有 3D 点簇的 数据文件。现在我们可以用它形成一个 BSpline 曲面。

dat=Import["C:\\Users\\Andy\\Desktop\\Foil.mat"];
surface=BSplineFunction[dat];
ParametricPlot3D[surface[x,y], {x, 0, 1}, {y, 0, 1},
                MaxRecursion->4,Axes->None,Mesh->All,Boxed->False]

现在我们可以看到结构了。但问题是我想制作一个 3D 实体,而这个结构实际上有两个可见的孔。

在此处输入图像描述

在下一张图片中,我们可以看到两个角都是开放的,结构不是实心的,而是空心的。

在此处输入图像描述

所以我想出了一个解决方案,我确信该解决方案可以在视觉上工作,但不会返回坚固的结构。

pic=Show[Graphics3D[
       {Polygon[Table[surface[0,y],{y,0,1,0.005}]],
        Polygon[Table[surface[1,y],{y,0,1,.005}]]}],
        ParametricPlot3D[surface[x,y],{x,0,1},{y,0,1},
           MaxRecursion-> 4,PlotPoints-> 20,
           Mesh-> All],Boxed->False,Axes-> None];

图形网格[ {{ParametricPlot3D[表面[x,y],{x,0,1},{y,0,1}, 情节点-> 20、Mesh->全部,盒装->假,轴->没有任何], Graphics3D[{多边形[表[表面[0,y],{y,0,1,0.005}]], 多边形[表[表面[1,y],{y,0,1,.005}]]}], pic}}]

这是输出。 在此处输入图像描述

现在我们将第三张图片导出为 *.obj 文件,其中孔在视觉上已闭合。我们可以在任何基于 CAD 的网格编辑器(例如 Meshlab)中导入该文件。在那里人们可以看到要检测的孔。

在此处输入图像描述

现在有一种简单的方法,使我们可以使用给定的数据点在 Mathematica 中形成一个坚实的结构Foil.mat 文件。我希望 BSpline 函数中可以使用一些选项来实现此目的。正如人们所期望的那样,我想要一个没有孔的封闭表面。

希望我能够足够明确地解释我的问题。将等待您的回复。

BR

Here is a data file with cluster of 3D points. Now we can form a BSpline surface out of that.

dat=Import["C:\\Users\\Andy\\Desktop\\Foil.mat"];
surface=BSplineFunction[dat];
ParametricPlot3D[surface[x,y], {x, 0, 1}, {y, 0, 1},
                MaxRecursion->4,Axes->None,Mesh->All,Boxed->False]

Now we can see the structure. But the problem is that I want to make a 3D solid and this structure has actually two visible holes.

enter image description here

In the next picture we can see that at both corners are open and the structure is not solid but actually hollow.

enter image description here

So I came up with a solution which I am sure may work visually but does not return a solid structure.

pic=Show[Graphics3D[
       {Polygon[Table[surface[0,y],{y,0,1,0.005}]],
        Polygon[Table[surface[1,y],{y,0,1,.005}]]}],
        ParametricPlot3D[surface[x,y],{x,0,1},{y,0,1},
           MaxRecursion-> 4,PlotPoints-> 20,
           Mesh-> All],Boxed->False,Axes-> None];

GraphicsGrid[
{{ParametricPlot3D[surface[x,y],{x,0,1},{y,0,1},
PlotPoints-> 20,Mesh-> All,Boxed->False,Axes-> None],
Graphics3D[{Polygon[Table[surface[0,y],{y,0,1,0.005}]],
Polygon[Table[surface[1,y],{y,0,1,.005}]]}],
pic}}]

Here goes the output.
enter image description here

Now we export the third picture where the holes are visually closed as an *.obj file. We can import that file in any CAD based mesh editor like Meshlab. There one can see the holes to be detected.

enter image description here

Now is there a simple way so that we can form a solid structure in Mathematica with the given data points in the Foil.mat file. I expect some options might be available with in the BSpline function to achieve this. As one can expect I want to have a closed surface with no holes.

Hope I have been able to explain my problem explicitly enough. Will wait for your reply.

BR

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

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

发布评论

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

评论(1

你与清晨阳光 2024-12-12 02:05:39

您可能想探索 TetGenLink, Mathematica 中的“隐藏功能”。

TetGen is a quality tetrahedral mesh generator and a three-dimensional 
Delaunay triangulator.   
TetGenLink is a Mathematica application that uses Wolfram Library Link  
to link to TetGen functions. It is used automatically by Mathematica for  
various operations such as interpolation in three-dimensional convex domains.  
However, it can also be used directly where it gives a flexible and innovative  
way to use the functionality of TetGen.

来自帮助的图像:

在此处输入图像描述

You may want to explore TetGenLink, a "hidden feature" in Mathematica.

TetGen is a quality tetrahedral mesh generator and a three-dimensional 
Delaunay triangulator.   
TetGenLink is a Mathematica application that uses Wolfram Library Link  
to link to TetGen functions. It is used automatically by Mathematica for  
various operations such as interpolation in three-dimensional convex domains.  
However, it can also be used directly where it gives a flexible and innovative  
way to use the functionality of TetGen.

Image from the help:

enter image description here

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