Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
creating patches

Subject: creating patches

From: Dave Brackett

Date: 20 Jan, 2010 16:04:05

Message: 1 of 2

Hi, I have a set of vertices (cols: ID, x, y, z coords):

56 318.705352800000 330.850616500000 184.728744500000
57 318.650695800000 330.912231400000 185.640884400000
181252 318.614135700000 330.484527600000 185.406341600000
181253 319.214843800000 330.958099400000 186.374649000000
181254 318.855896000000 329.916259800000 184.870681800000
181255 318.637817400000 328.659332300000 187.398559600000

and a set of faces (cols: face id, 3 vertex ids) e.g.:

364135 181252 57 56
364136 57 181252 232616
364137 57 181253 239840
364138 56 181254 181252
364139 181255 243175 239839

I want to create patches for each face. From the documentation I see this can be done using patch('Faces',...,'Vertices',...) but this seems to only work for vertices with IDs 1,2,3,4,5 etc. in order.

How can I create patches for data shown above without having to alter the IDs themselves? Thanks for any help you can provide.

Subject: creating patches

From: Walter Roberson

Date: 29 Jan, 2010 16:41:45

Message: 2 of 2

Dave Brackett wrote:
> Hi, I have a set of vertices (cols: ID, x, y, z coords):
>
> 56 318.705352800000 330.850616500000 184.728744500000
> 57 318.650695800000 330.912231400000 185.640884400000
> 181252 318.614135700000 330.484527600000 185.406341600000
> 181253 319.214843800000 330.958099400000 186.374649000000
> 181254 318.855896000000 329.916259800000 184.870681800000
> 181255 318.637817400000 328.659332300000 187.398559600000

> I want to create patches for each face. From the documentation I see
> this can be done using patch('Faces',...,'Vertices',...) but this seems
> to only work for vertices with IDs 1,2,3,4,5 etc. in order.

> How can I create patches for data shown above without having to alter
> the IDs themselves?

I don't believe that is possible. The documentation indicates that the
IDs must be vertex indices, implying 1 to the number of vertices rather
than arbitrary markers.

You could use unique() and ismember() to define a mapping from your
arbitrary numbers into vertex indices (which would require changing the
data you pass in to the patch() call.)

Tags for this Thread

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.

Contact us