Thread Subject: closed 3d surface of scattered data

Subject: closed 3d surface of scattered data

From: Tim Braun

Date: 31 Jul, 2009 10:10:18

Message: 1 of 7

Hey folks,

hope you guys can help me.

I have a set of scattered 3d-points. Lets imagine these are temperature values inside a cube.

So I have X,Y,Z-coordinates of each point and a temperature-value for each of these positions.

Now I want to plot these points. No problem till here. But: Now you can enter a temperature, for example 300K and I want to show a closed surface surrounding all the points having a temperature value of about 300K or higher.

I tried using surf, convhull and all of the derivates using delaunay, meshgrid etc.

For me it seems as if there is no function in matlab to plot a closed surface?! I just want to plot my scattered points and enclose all the points of a specified temperature. It should look like a baloon or whatever. I am getting tired hunting on the internet for a solution.

So, anyone, any ideas? I would appreciate any suggestions!
So long!

Subject: closed 3d surface of scattered data

From: John D'Errico

Date: 31 Jul, 2009 10:23:02

Message: 2 of 7

"Tim Braun" <rubbish@gmx.info> wrote in message <h4ufua$51l$1@fred.mathworks.com>...
> Hey folks,
>
> hope you guys can help me.
>
> I have a set of scattered 3d-points. Lets imagine these are temperature values inside a cube.
>
> So I have X,Y,Z-coordinates of each point and a temperature-value for each of these positions.
>
> Now I want to plot these points. No problem till here. But: Now you can enter a temperature, for example 300K and I want to show a closed surface surrounding all the points having a temperature value of about 300K or higher.
>
> I tried using surf, convhull and all of the derivates using delaunay, meshgrid etc.
>
> For me it seems as if there is no function in matlab to plot a closed surface?! I just want to plot my scattered points and enclose all the points of a specified temperature. It should look like a baloon or whatever. I am getting tired hunting on the internet for a solution.
>
> So, anyone, any ideas? I would appreciate any suggestions!
> So long!

An alpha shape is on approach, though there is no
such code on the file exchange in 3-d. If your cloud
is a convex one, then a convex hull will solve your
problem, but then so will a delaunay tessellation.
Since you say these were inadequate, convexity must
not be a property of your cloud.

You might look at the work of Luigi Giacarri on the
file exchange.

http://www.mathworks.com/matlabcentral/fileexchange/authors/31779

HTH,
John

Subject: closed 3d surface of scattered data

From: us

Date: 31 Jul, 2009 10:36:03

Message: 3 of 7

"Tim Braun" <rubbish@gmx.info> wrote in message <h4ufua$51l$1@fred.mathworks.com>...
> Hey folks,
>
> hope you guys can help me.
>
> I have a set of scattered 3d-points. Lets imagine these are temperature values inside a cube.
>
> So I have X,Y,Z-coordinates of each point and a temperature-value for each of these positions.
>
> Now I want to plot these points. No problem till here. But: Now you can enter a temperature, for example 300K and I want to show a closed surface surrounding all the points having a temperature value of about 300K or higher.
>
> I tried using surf, convhull and all of the derivates using delaunay, meshgrid etc.
>
> For me it seems as if there is no function in matlab to plot a closed surface?! I just want to plot my scattered points and enclose all the points of a specified temperature. It should look like a baloon or whatever. I am getting tired hunting on the internet for a solution.
>
> So, anyone, any ideas? I would appreciate any suggestions!
> So long!

in addition to jd's references, you may want to look at these nice classes introduced in r2009...

     help trirep; % <- peruse the 3D example...
     help delaunaytri;

us

Subject: closed 3d surface of scattered data

From: Luigi Giaccari

Date: 31 Jul, 2009 10:44:03

Message: 4 of 7

"Tim Braun" <rubbish@gmx.info> wrote in message <h4ufua$51l$1@fred.mathworks.com>...
> Hey folks,
>
> hope you guys can help me.
>
> I have a set of scattered 3d-points. Lets imagine these are temperature values inside a cube.
>
> So I have X,Y,Z-coordinates of each point and a temperature-value for each of these positions.
>
> Now I want to plot these points. No problem till here. But: Now you can enter a temperature, for example 300K and I want to show a closed surface surrounding all the points having a temperature value of about 300K or higher.
>
> I tried using surf, convhull and all of the derivates using delaunay, meshgrid etc.
>
> For me it seems as if there is no function in matlab to plot a closed surface?! I just want to plot my scattered points and enclose all the points of a specified temperature. It should look like a baloon or whatever. I am getting tired hunting on the internet for a solution.
>
> So, anyone, any ideas? I would appreciate any suggestions!
> So long!

If your shape isn't convex but it is quite well sampled:

http://www.mathworks.com/matlabcentral/fileexchange/22185

Another solutions is to start from the original triangualted surface (with all points included) and remove the points that do not respet your criteria (T=300K) adjusting the connectivity.

Anyway your solutions mainly depends on the the shape of your dataset, I thing you need to give addictional infos like the number of points, sampling density, spatial disposition,..etc


http://www.advancedmcode.org/
http://giaccariluigi.altervista.org/blog/

Subject: closed 3d surface of scattered data

From: us

Date: 31 Jul, 2009 10:58:02

Message: 5 of 7

"us "
> in addition to jd's references, you may want to look at these nice classes introduced in r2009...
>
> help trirep; % <- peruse the 3D example...
> help delaunaytri;

an simple example (assuming a convex hull, of course) is shown below...

% the data
     v=rand(5000,3);
     mi=.2;
     ma=.8;
% the engine
     ix= v(:,1)>=mi&v(:,1)<=ma &...
          v(:,2)>=mi&v(:,2)<=ma &...
          v(:,3)>=mi&v(:,3)<=ma;
     vi=v(ix,:);
     dv=delaunayn(vi);
     tr=TriRep(dv,vi);
     [trv,vb]=freeBoundary(tr);
% the result
     line(v(:,1),v(:,2),v(:,3),...
          'marker','.',...
          'linestyle','none',...
          'color',[0,0,0]);
     line(vi(:,1),vi(:,2),vi(:,3),...
          'marker','s',...
'markerfacecolor',[1,0,0],...
          'linestyle','none',...
          'color',[1,0,0]);
     hold on;
     trisurf(trv,vb(:,1),vb(:,2),vb(:,3),'facecolor',[1,1,0]);
     colormap(pink(256));
     shading interp;
     view(3);
     shg;

us

Subject: closed 3d surface of scattered data

From: Tim Braun

Date: 31 Jul, 2009 11:13:02

Message: 6 of 7

"us " <us@neurol.unizh.ch> wrote in message <h4uinq$63d$1@fred.mathworks.com>...
> "us "
> > in addition to jd's references, you may want to look at these nice classes introduced in r2009...
> >
> > help trirep; % <- peruse the 3D example...
> > help delaunaytri;
>
> an simple example (assuming a convex hull, of course) is shown below...
>
> % the data
> v=rand(5000,3);
> mi=.2;
> ma=.8;
> % the engine
> ix= v(:,1)>=mi&v(:,1)<=ma &...
> v(:,2)>=mi&v(:,2)<=ma &...
> v(:,3)>=mi&v(:,3)<=ma;
> vi=v(ix,:);
> dv=delaunayn(vi);
> tr=TriRep(dv,vi);
> [trv,vb]=freeBoundary(tr);
> % the result
> line(v(:,1),v(:,2),v(:,3),...
> 'marker','.',...
> 'linestyle','none',...
> 'color',[0,0,0]);
> line(vi(:,1),vi(:,2),vi(:,3),...
> 'marker','s',...
> 'markerfacecolor',[1,0,0],...
> 'linestyle','none',...
> 'color',[1,0,0]);
> hold on;
> trisurf(trv,vb(:,1),vb(:,2),vb(:,3),'facecolor',[1,1,0]);
> colormap(pink(256));
> shading interp;
> view(3);
> shg;
>
> us

Thank you so far guys. But as I am using R2006b I cannot use TriRep or DelaunayTri.

Seems as if there is no way, but to use the convhull-solution as presented by Luigi!

Thanks again!

Subject: closed 3d surface of scattered data

From: Steven Lord

Date: 31 Jul, 2009 13:19:44

Message: 7 of 7


"Tim Braun" <rubbish@gmx.info> wrote in message
news:h4ufua$51l$1@fred.mathworks.com...
> Hey folks,
>
> hope you guys can help me.
>
> I have a set of scattered 3d-points. Lets imagine these are temperature
> values inside a cube.
>
> So I have X,Y,Z-coordinates of each point and a temperature-value for each
> of these positions.
>
> Now I want to plot these points. No problem till here. But: Now you can
> enter a temperature, for example 300K and I want to show a closed surface
> surrounding all the points having a temperature value of about 300K or
> higher.
>
> I tried using surf, convhull and all of the derivates using delaunay,
> meshgrid etc.
>
> For me it seems as if there is no function in matlab to plot a closed
> surface?! I just want to plot my scattered points and enclose all the
> points of a specified temperature. It should look like a baloon or
> whatever. I am getting tired hunting on the internet for a solution.

It sounds like you're looking for CONTOUR3:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/contour3.html

or perhaps an ISOSURFACE.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/isosurface.html

--
Steve Lord
slord@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
logical indexing us 31 Jul, 2009 06:59:08
trirep us 31 Jul, 2009 06:59:08
delaunayn us 31 Jul, 2009 06:59:08
code us 31 Jul, 2009 06:59:08
graphics handle us 31 Jul, 2009 06:59:08
trisurf us 31 Jul, 2009 06:59:08
reference us 31 Jul, 2009 06:39:09
convhull Tim Braun 31 Jul, 2009 06:14:04
surf Tim Braun 31 Jul, 2009 06:14:04
delaunay Tim Braun 31 Jul, 2009 06:14:04
meshgrid Tim Braun 31 Jul, 2009 06:14:04
surface Tim Braun 31 Jul, 2009 06:14:04
closed Tim Braun 31 Jul, 2009 06:14:04
points Tim Braun 31 Jul, 2009 06:14:04
scattered Tim Braun 31 Jul, 2009 06:14:04
3d Tim Braun 31 Jul, 2009 06:14:03
rssFeed for this Thread

Contact us at files@mathworks.com