Mesh generation for an arbitrary 3D closed surface

9 Ansichten (letzte 30 Tage)
AP
AP am 25 Jun. 2011
I have an arbitrary 3D surface and I want to generate some grids inside the surface like a CFD/FEM pre-processor to be able to do some analysis on that. Can MATLAB do this?
Thank you.

Antworten (1)

Kevin Moerman
Kevin Moerman am 6 Feb. 2012
I’m not aware of a specific command for this. By mesh and grid do you mean just a mesh of evenly spaced points (e.g. as produced by meshgrid but then only defined inside your closed surface)? Do you only have a surface description in the form of say vertices and faces? Do you perhaps also have a starting FE model (This may contain a 3D tessellation of your shape which is useful)? There are various methods to create the points but the trick is to do this ONLY INSIDE the closed surface. This involves checking whether points are inside/on/outside the surface. In 2D there is the inpolygon command but as far as I know there is no 3D equivalent like something like “inclosedsurf”. Matlab does have a command to check whether a set of points are inside a tessellation for a given set of other points, see for instance the “tsearchn” (and related) command. t = tsearchn(X,TES,XI); Here TES is a tessellation for the coordinates X and XI your query points. The output t contains the TES features (e.g. tetrahedrons) in which your points XI are found. If they are outside the function returns NaN. Therefore this returns a logic array for the points inside the tessellation: L=~isnan(t); Although TES should perhaps strictly speaking be a Delaunay tessellation, you could test whether this works for other tessellations. I’ve used this a bit for FE models but haven’t tested this thoroughly yet. Say if you have a hexahedral mesh definition for your CFD/FEA model. Then you can import that data into Matlab, convert the hexahedral mesh (tessellation) to a tetrahedral tessellation. Then you define your set of mesh points you wanted to create say using meshgrid and you check using tsearchn whether they are inside your model or outside. Something like: [x,y,z]=meshgrid(…); XI=[x(:) y(:) z(:)]; t = tsearchn(X_tes,TES,XI); L=~isnan(t); XI_inside=XI(L,:);
Kevin

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by