generating irregular mesh of a cube - matlab

I want to generate a mesh for solving the Laplace equation on using FEM. I want to solve it on a cube and I would like to mesh the cube using tetrahedra. Is there a way to do this in MATLAB using unstructured meshes, i.e. that I can choose if the density if elements should be higher in a specific region?

Related

Plane extraction in 3D data

What is the best way to:
1. Detect a plane in a set of 3D points with high noise around part of it (not all the points)?
Extract plane equation of two intersection planes in 3D data.
Thanks in advance
Use the pcfitplane function in the Computer Vision System Toolbox.

Generate 3D surface from scattered or data points

Can anyone tell me how to generate a 3D surface model like CAD in Matlab ?
1.Input: Input is a collection of points with (x,y,z) where surface is present for an object(I'm using this for a 3D scanner where my inputs are (x,y,z) of surface)
2.Points should be displayed as a surface using some smooth interpolation.
3.More like surface generation from data points.
Thanks you.
In order to plot surfaces, you can use patch function. However, you need along with the points the faces information. In patch a surface consists of polygons that is specified using 3 point, which is the face information.
1
Since it seems like you will be inputting discrete points located on the surface of the object, you will first want to create a Nonconvex Polygon based on the data using Matlab's boundary function.
https://www.mathworks.com/help/matlab/ref/boundary.html
You can then use the trimesh function to create the figure
This question shows the input data and what was produced using this method: How do I create a 3D polygon/mesh over data points?

Minimizing area of a triangle containing data points in 3D plane

I have a set of data in 3D which are in the same plane. I have a Triangle containing those data points in the same plane. But the Area of the Triangle is much larger. I want to find the smallest area triangle (co-ordinate of its 3 points) containing all the data point inside it. There are some concepts available for 2D data points, but I need to find this in 3D dimension.
It looks like Matlab has a function for this, convhull. You want to find the convex hull of the data set. http://www.mathworks.com/help/matlab/ref/convhull.html This function works for points in 2d or 3d space.

Matlab : Conversion of Triangular mesh to Regular (Square) Mesh

mI currently possess a triangular mesh model of a heart that is loaded into Matlab for further manipulation. The current problem is the that I require a regular (square) mesh model of the heart in order to perform proper texture mapping of an image. Can anyone provide a function or even another program that can convert the current TRIANGULAR mesh model to a regular SQUARE model? Thank you :)
I've had good results with the FEX submission GridTriMesh.

How to compute projections of 3D meshes in matlab

I'm trying to compute 2d projections of a 3d mesh from different views using matlab.
The solution I m using now, is to plot the 3d mesh, rotate it, and make a screenshot.
I would like to know if there is any matlab internal functions or any other solution that allow me, given a set of vertices and triangles, to compute the projections without having to plot the 3D mesh
Thanks
You can use the view command to rotate the axes and change the viewpoint. The azimuth and elevation are given in degrees (ref. documentation for more info). Here's a small example:
ha=axes;
[x,y,z]=peaks;
surf(x,y,z);
xlabel('x');ylabel('y');zlabel('z')
%#projection on the X-Z plane
view(ha,[0,0])
%#projection on the Y-Z plane
view(ha,[90,0])
%#projection on the X-Y plane
view(ha,[0,90])
This is what it looks like:
Projections on different 2D planes
X-Z
Y-Z
X-Y