Patch function - graphics objects, MATLAB in Engineering

Patch function - graphics objects:

The patch function is used to generate a patch graphics object, which is made from 2-dimensional polygons. The patch is defined by its vertices and faces. For illustration, consider a patch which has four vertices in 3-dimensional space, given by the coordinates:

(0, 0, 0)

(1, 0, 0)

(0, 1, 0)

(0.5, 0.5, 1)

 

Just to visualize these points first, the plot3 function is used, as shown in figure:

>> x = [0 1 0 0.5];

>> y = [0 0 1 0.5];

>> z = [0 0 0 1];

>> plot3(x,y,z,'ko')

837_Patch function.png

Rotating the figure shows all four points, as shown in figure.

2127_Patch function1.png

Generating and showing these points is not essential to generate a patch object; this was just complete to visualize at first the vertices . A patch object is defined by both the vertices and the faces of the polygon which connect these vertices. The one way of calling this function is patch(fv),here fv is a structure variable with fields known as vertices and faces.

polyhedron.vertices = [.  .  .

0 0 0

1 0 0

0 1 0

0.5 0.5 1];

polyhedron.faces = [.  .  .

1 2 3

1 2 4

1 3 4

2 3 4];

pobj = patch(polyhedron, .  .  .

'FaceColor',[0.8, 0.8, 0.8],.  .  .

'EdgeColor','black');

Posted Date: 10/22/2012 8:25:41 AM | Location : United States







Related Discussions:- Patch function - graphics objects, Assignment Help, Ask Question on Patch function - graphics objects, Get Answer, Expert's Help, Patch function - graphics objects Discussions

Write discussion on Patch function - graphics objects
Your posts are moderated
Related Questions
Defined a variable in work space: The variables defined in the script will become a part of the workspace: >> clear >> who >> mysummfile    15 >> who

Appending variables to the Mat-File: Appending to the file adds to what has been saved in a file, and is accomplished by using the -append option. For illustration, supposing

Example of modular program: In a modular program, there would be one main script which calls three separate functions to complete these tasks: A function to prompt an us

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

Technique to create Nested structures: This technique is the most proficient. Though, the other technique is to build the nested structure one field at a time. As this is a ne

Creating Cell arrays: There are many ways to create cell arrays. For illustration, we will create a cell array in which one element will store an integer, one element store ch

Algorithm for the function explaine: The algorithm for the function explaine is as shown:  Print a description of e, the exp function, and how to find the approximate va

Matrix solutions to systems of the linear algebraic equations: The linear algebraic equation is an equation of the form a 1 x 1 + a 2 x 2 + a 3 x 3    .  .  .  .  a n x n

I dont know how to input different videos on matlab program

Plotting File data: It is frequently essential to read data from a file and plot it. Generally, this entails knowing the format of the file. For illustration, let us suppose t