Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about BSpline

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

like image 309
PlatoManiac Avatar asked Oct 10 '22 00:10

PlatoManiac


1 Answers

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

like image 168
Dr. belisarius Avatar answered Nov 15 '22 08:11

Dr. belisarius