Integrating Trisurf for 3D Mesh Comparison in Domain D

  • MATLAB
  • Thread starter member 428835
  • Start date
  • Tags
    Integrating
In summary, the conversation is about computing a double numerical integration on two 3D meshes defined over the same domain. The suggested method involves using the trapz function and expressing the integrand as a matrix of values. This can be done by interpolating the surfaces on a finer mesh.
  • #1
member 428835
Hi PF!

I have a 3D mesh generated via the trisurf function, where they each have different node numbers, but are both defined over the same domain ##D##. See attachments for clear image.

If the surfaces are ##f1## and ##f2##, I'd like to compute ##\iint_D(f1-f2)^2## where ##D = [0,2]\times[0,2]## . Any idea how?
 

Attachments

  • t1.pdf
    39.1 KB · Views: 282
  • t2.pdf
    14.8 KB · Views: 301
Physics news on Phys.org
  • #2
Here is an example on how to do a double numerical integration:
http://www.mathworks.com/help/matlab/ref/trapz.html#buakefe-1_1

The idea is that you express the integrand as a matrix of values, then call trapz the first time operating on the rows, then take that result and integrate a second time operating on the columns. It looks something like this:

Code:
dx = 0.1;
dy = 0.1;
x = 0:dx:2;
y = 0:dy:2;
[X,Y] = meshgrid(x,y);   % create mesh
f1 = X.^2 + Y.^2;        % first surface defined on the mesh of (x,y) points
f2 = X.^2 + Y.^2 + 1;    % second surface
f = (f1 - f2).^2;        % integrand
Q = trapz(x,f,2);        % integrate wrt X
I = trapz(y,Q)           % integrate the result wrt Y

In this simple example you have the same surface separated vertically by 1 unit, so since the domain is a 2x2 square, you expect the integral to reproduce the volume of a 2x2x1 cube, which acts as a nice sanity check for the code above:

Code:
I =

    4

If the data you have for the surfaces is coarse, you can interpolate to define the surface on a finer mesh, then integrate the new surface.
 
Last edited:

1. What is Trisurf and how is it used for 3D mesh comparison?

Trisurf is a software tool that is used for creating and manipulating 3D triangular meshes. It can be integrated into a domain D, or a specific area of interest, to compare different 3D meshes for accuracy and similarity.

2. What are the benefits of using Trisurf for 3D mesh comparison?

Trisurf offers a user-friendly interface and powerful algorithms for accurately comparing 3D meshes. It also allows for easy visualization of the comparison results, making it a valuable tool for researchers and engineers working with 3D data.

3. How does Trisurf handle different types of 3D mesh data?

Trisurf is capable of handling a variety of 3D mesh data formats, including STL, OBJ, and PLY. It also has the ability to import and export meshes in different file formats, allowing for compatibility with a wide range of software and applications.

4. Can Trisurf be customized for specific research needs?

Yes, Trisurf offers a range of customizable options for 3D mesh comparison, including adjustable tolerance levels and different methods for calculating mesh differences. These options can be tailored to fit the specific needs of a research project.

5. Is Trisurf suitable for both qualitative and quantitative analysis of 3D meshes?

Yes, Trisurf can be used for both qualitative and quantitative analysis of 3D meshes. It provides visualizations for qualitative analysis and numerical data for quantitative analysis, making it a versatile tool for researchers in various fields.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
2
Views
979
Replies
7
Views
2K
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
27
Views
3K
  • General Engineering
Replies
4
Views
12K
Replies
3
Views
1K
  • Programming and Computer Science
Replies
8
Views
796
  • Differential Equations
Replies
17
Views
5K
Back
Top