关于 BSpline 的问题
这是一个带有 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.
In the next picture we can see that at both corners are open and the structure is not solid but actually hollow.
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.
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.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想探索
TetGenLink
, Mathematica 中的“隐藏功能”。来自帮助的图像:
You may want to explore
TetGenLink
, a "hidden feature" in Mathematica.Image from the help: