fill3

Draws filled polygons in 3-D space from vertex coordinates.

Category: Graphics > 2-D and 3-D Plots

Syntax

fill3(X, Y, Z, C)

Fills the polygon with vertices (X(k), Y(k), Z(k)) using the color C.

fill3(___, Name, Value)

Sets patch properties such as 'FaceAlpha'.

h = fill3(___)

Also returns the patch handles.

Description

It is the 3-D version of fill. The vertices need not be coplanar, but a flat polygon renders cleanly. Rotate the view with view to inspect the shape.

Input arguments

X, Y, Z
Vertex coordinates of equal size. For matrices, each column is a polygon.
C
Color letter, RGB triplet, or one value per vertex.

Output arguments

h
Patch handles.

Example

Two triangles

fill3([0 1 0.5], [0 0 1], [0 0 0], 'r')
hold on
fill3([0 1 0.5], [0 0 1], [1 1 1], 'b')
hold off
view(3)

In the app, the figure is drawn below the code.

See also

fill patch surf view