surface_properties

surface_properties — description of the 3D entities properties

Description

The Surface entity is a leaf of the graphics entities hierarchy. Two classes appears under this type of entity : Plot3d and Fac3d according to the ploting function.

This entity is still under developpement and will problably evolve a lot. In particular we intend to extend the Axes data structure to 3D and split the Axes propteies and Surface drawing properties similarily to the 2D case.

visible: This field contains the visible property value for the entity . It should be "on" or "off" . By default, surfaces are visibles, the value's property is "on" . If "off" the 3D graphics are not displayed on the screen.
data: This field is not yet available. It will be define a matrix data of a row and column indices of each element as the x- and y-coordinates and the value of each element as the z-coordinate.
data_bounds: This field contains the boundary values for the x, y and z coordinates. It is the matrix [xmin,xmax;ymin,ymax;zmin,zmax].
flags:

a real vector of size three flag=[mode,type,box] where:

mode: a string (treatment of hidden parts).

If mode>0 the hidden parts of the surface are removed and the surface is painted with color "mode".

if mode=0 the hidden parts of the surface are drawn.

if mode<0 only the backward facing facets are painted with color or pattern id "-mode".

type: an integer (scaling).

if type=0 the plot is made using the current 3D scaling (set by a previous call to param3d, plot3d, contour or plot3d1).

if type=1 rescales automatically 3d boxes with extreme aspect ratios, the boundaries are specified by the value of the property data_bounds.

if type=2 rescales automatically 3d boxes with extreme aspect ratios, the boundaries are computed using the given data.

if type=3 3d isometric with box bounds given by the property data_bounds.

if type=4 3d isometric bounds are derived from the data.

if type=5 3d expanded isometric bounds with box bounds are given by the property data_bounds.

thickness: This field contains the default thickness value of the lines used to draw the axes and the facets contours. It should be a positive integer.
foreground: This field contains the color index used to draw the axes and the facets contours. Its value should be a color index (relative to the current colormap).
rotation_angles: This field is the vector [theta,alpha]. These two values give the spherical coordinates of the observation points (in degree).
color_flag:

This field is used to specify the algorithm used to set facets' colors.

If color_flag==0 then all facets are painted using the color index defined by flag(1) (see above).

If color_flag==1 then all facets are painted using the color index proportional to z. The minimum z value is painted using the index 1 color while The maximum z value is painted using highest color index.

If color_flag==2 then all facets are painted using the color index given in the surface_color property (one color per facet).

This option is available only with Fac3d entity type.

If color_flag==3 then facets painting results of interpolation of facet boundary colors. The facet boundary colors indices are given in the surface_color property (one color per facet boundary).

This option is available only with Fac3d entity type.

surface_color:

If color_flag is equal to 2 or 3 this property contains the index of the color used to paint facets.

If color_flag==2 then the property value is a vector of indices. One color index per facet.

If color_flag==3 then the property value is a matrix of indices. One column per facet and for each facet one color index is given for each boundary.

parent: This property contains the handle of the parent. The parent of the surface entity should be of the type "Axes".

Examples



   set("figure_style","new") //create a figure


   t=[0:0.3:2*%pi]'; z=sin(t)*cos(t');[xx,yy,zz]=genfac3d(t,t,z);
   plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)]))

   h=get("hdl") //get handle on current entity (here the surface)

   h.rotation_angles=[40,70];


    h.flag=[2 5 4]; //boundaries given by data_bounds
    h.data_bounds=[-6,6;6,-1;0,5];
    h.flag=[2 5 0]; //axes are hidden

 
   f=get("current_figure");//get the handle of the parent figure    
   f.color_map=hotcolormap(64); //change the figure colormap

   h.color_flag=1; //color according to z
   h.flag=[-2 5 0]; //remove the facets boundary
   h.flag=[-2 2 0]; //boundaries computed using the given data 

   h.color_flag=2; //color according to given colors
   h.surface_color=[modulo(1:400,64),modulo(1:400,64)];

   f.color_map=hotcolormap(512);
   h.color_flag=3; //shaded
   c=[1:400,1:400];
   h.surface_color=[c;c+1;c+2;c+3];


 
  

See also

set, get, delete, plot3d, plot3d1, plot3d2, graphics_entities

Author

Djalel ABDEMOUCHE