Thread Subject: Boundaries for TriScatteredInterp

Subject: Boundaries for TriScatteredInterp

From: Onno

Date: 30 Jun, 2011 16:34:09

Message: 1 of 4

I want to plot simulationdata from FEM-Simulation. Of course this data is scattered.
I' ve got a matrix mx3 with the coodinates and a vector with the Information.
At last i want to do a slice plot with a color interpolation.
 I used this code
% Meshgrid for the plot
m = 0;
n = 60;
s = 1;
l = (n-m)/s+1;
[x,y,z] = meshgrid(m:s:n,m:s:n,m:s:n);
% TriScatteredInterp
v=TriScatteredInterp(Centroids(:,1),Centroids(:,2),Centroids(:,3),...
Values);
% Interpolated Values
V = v(x,y,z);

Now my problem is, to sinp away the points which are outside my model, or to get boudaries for the plot.

Based on the triangulation, TriScat.. does, there are tetrahedrals outside of my structure. Using an existing DelaunayTri i am able to find these Tetrahedrals , cut them out and create a triRep with this information. But after i cannot use funktions like pointLocation on the triRep.

I see two possibilities:
1. convert the triRep to DelaunayTri

unfortunately the method in this thread http://www.mathworks.cn/matlabcentral/newsreader/view_thread/270129 doesn't work, because the in and outstuts is not supported for 3d

2. find another way to set the boundaries.

For both ways I could need some help.

Subject: Boundaries for TriScatteredInterp

From: Steven_Lord

Date: 30 Jun, 2011 16:53:16

Message: 2 of 4



"Onno " <Onno.Groenheim@web.de> wrote in message
news:iui8i1$jma$1@newscl01ah.mathworks.com...
> I want to plot simulationdata from FEM-Simulation. Of course this data is
> scattered.
> I' ve got a matrix mx3 with the coodinates and a vector with the
> Information.
> At last i want to do a slice plot with a color interpolation.
> I used this code
> % Meshgrid for the plot
> m = 0;
> n = 60;
> s = 1;
> l = (n-m)/s+1;
> [x,y,z] = meshgrid(m:s:n,m:s:n,m:s:n);
> % TriScatteredInterp
> v=TriScatteredInterp(Centroids(:,1),Centroids(:,2),Centroids(:,3),...
> Values);
> % Interpolated Values
> V = v(x,y,z);
>
> Now my problem is, to sinp away the points which are outside my model, or
> to get boudaries for the plot.

It sounds like you want the convex hull for your set of points. If so, you
can construct a DelaunayTri and ask for its convexHull. You can then use
that DelaunayTri to construct a TriScatteredInterp to perform your
interpolation.

dt = DelaunayTri(Centroids(:,1),Centroids(:,2),Centroids(:,3));
theBoundary = convexHull(dt);
v = TriScatteredInterp(dt, Values);
interpolatedValues = v(x, y, z);

http://www.mathworks.com/help/techdoc/ref/delaunaytriclass.html
http://www.mathworks.com/help/techdoc/ref/delaunaytri.convexhull.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Boundaries for TriScatteredInterp

From: Onno

Date: 2 Jul, 2011 15:14:09

Message: 3 of 4

"Steven_Lord" <slord@mathworks.com> wrote in message <iui9lr$mtn$1@newscl01ah.mathworks.com>...
> It sounds like you want the convex hull for your set of points. If so, you
> can construct a DelaunayTri and ask for its convexHull. You can then use
> that DelaunayTri to construct a TriScatteredInterp to perform your
> interpolation.
>
> dt = DelaunayTri(Centroids(:,1),Centroids(:,2),Centroids(:,3));
> theBoundary = convexHull(dt);
> v = TriScatteredInterp(dt, Values);
> interpolatedValues = v(x, y, z);
>
> http://www.mathworks.com/help/techdoc/ref/delaunaytriclass.html
> http://www.mathworks.com/help/techdoc/ref/delaunaytri.convexhull.html
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thanks for your answer.

The method you are describing was also the first i tried. But this interpolation doesn't end on the parts boundaries. In example: When i want to interpolate the Tension in a Part shaped like a ring, with the inner radius ri and the outer radius ro, this methods interpolates the values in the structure betwenn ri and ro and also in the area where r < ri.

I want to find a way to cut off these unwanted interpolated values, or to edit the triangulation in a way that it excludes these unwanted tetrahedrals.

Onno

Subject: Boundaries for TriScatteredInterp

From: Steven_Lord

Date: 5 Jul, 2011 03:14:18

Message: 4 of 4



"Onno " <Onno.Groenheim@web.de> wrote in message
news:iunck1$kp0$1@newscl01ah.mathworks.com...
> "Steven_Lord" <slord@mathworks.com> wrote in message
> <iui9lr$mtn$1@newscl01ah.mathworks.com>...
>> It sounds like you want the convex hull for your set of points. If so,
>> you can construct a DelaunayTri and ask for its convexHull. You can then
>> use that DelaunayTri to construct a TriScatteredInterp to perform your
>> interpolation.
>>
>> dt = DelaunayTri(Centroids(:,1),Centroids(:,2),Centroids(:,3));
>> theBoundary = convexHull(dt);
>> v = TriScatteredInterp(dt, Values);
>> interpolatedValues = v(x, y, z);
>>
>> http://www.mathworks.com/help/techdoc/ref/delaunaytriclass.html
>> http://www.mathworks.com/help/techdoc/ref/delaunaytri.convexhull.html
>>
>> --
>> Steve Lord
>> slord@mathworks.com
>> To contact Technical Support use the Contact Us link on
>> http://www.mathworks.com
>
> Thanks for your answer.
>
> The method you are describing was also the first i tried. But this
> interpolation doesn't end on the parts boundaries. In example: When i want
> to interpolate the Tension in a Part shaped like a ring, with the inner
> radius ri and the outer radius ro, this methods interpolates the values in
> the structure betwenn ri and ro and also in the area where r < ri.
>
> I want to find a way to cut off these unwanted interpolated values, or to
> edit the triangulation in a way that it excludes these unwanted
> tetrahedrals.

As far as I'm aware all the DelaunayTri/TriScatteredInterp methods assume
that the area being triangulated/interpolated is convex. An area with holes
in it is not. You will need to write code to detect when the points are
located in the "out of bounds" area and avoid interpolating for those points
or replace the interpolated values with NaN.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
triscatteredinterp Onno 30 Jun, 2011 12:37:05
3d Onno 30 Jun, 2011 12:36:45
boundaries Onno 30 Jun, 2011 12:36:39
trirep Onno 30 Jun, 2011 12:36:30
delaunay Onno 30 Jun, 2011 12:36:05
abaqus Onno 30 Jun, 2011 12:36:05
fem Onno 30 Jun, 2011 12:36:05
rssFeed for this Thread

Contact us at files@mathworks.com