Home > vbmeg > functions > gui > bm_editor > bm_edit_app_view > bm_edit_app_view3d > bm_edit_app_view3d_plot_surf.m

bm_edit_app_view3d_plot_surf

PURPOSE ^

plot surface

SYNOPSIS ^

function h = bm_edit_app_view3d_plot_surf(obj, axes_h, V, F, face_color, alpha, max_mode)

DESCRIPTION ^

 plot surface
 [USAGE]
    h = bm_edit_app_view3d_plot_surf(...
                         <obj>, <V>, <F>[, face_color][, max_mode]);
 [IN]
           obj : bm_edit_app_view3d object
        axes_h : plotted axes handle
             V : vertex coordinate
             F : patch index
    face_color : face color
         alpha : face alpha
      max_mode : set axis limit
 [OUT]
    h : patch object handle

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h = bm_edit_app_view3d_plot_surf(...
0002                             obj, axes_h, V, F, face_color, alpha, max_mode)
0003 % plot surface
0004 % [USAGE]
0005 %    h = bm_edit_app_view3d_plot_surf(...
0006 %                         <obj>, <V>, <F>[, face_color][, max_mode]);
0007 % [IN]
0008 %           obj : bm_edit_app_view3d object
0009 %        axes_h : plotted axes handle
0010 %             V : vertex coordinate
0011 %             F : patch index
0012 %    face_color : face color
0013 %         alpha : face alpha
0014 %      max_mode : set axis limit
0015 % [OUT]
0016 %    h : patch object handle
0017 %
0018 % Copyright (C) 2011, ATR All Rights Reserved.
0019 % License : New BSD License(see VBMEG_LICENSE.txt)
0020 
0021 %
0022 % --- Previous check
0023 %
0024 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0025 if ~exist('axes_h', 'var'), error('axes_h is a required parameter.'); end
0026 if ~exist('V', 'var'), error('V is a required parameter.'); end
0027 if ~exist('F', 'var'), error('F is a required parameter.'); end
0028 if ~exist('face_color','var') | isempty(face_color), 
0029     face_color = [0.8 0.7 0.6];
0030 end
0031 if ~exist('alpha', 'var')
0032     alpha = 0.9;
0033 end
0034 if ~exist('max_mode','var') | isempty(max_mode), max_mode=0; end;
0035 
0036 %
0037 % --- Main Procedure
0038 %
0039 
0040 set(gcf, 'CurrentAxes', axes_h);
0041 
0042 % 曲面表示
0043 h = patch('Faces',F,'Vertices',V,'FaceColor',face_color,'EdgeColor','none', 'FaceAlpha', alpha);
0044 
0045 lighting phong;
0046 material dull;
0047 axis equal;
0048 
0049 xlabel('X');
0050 ylabel('Y');
0051 zlabel('Z');
0052 
0053 if  max_mode == 1
0054     Vmax = max(V);
0055     Vmin = min(V);
0056     xlim([Vmin(1) Vmax(1)]);
0057     ylim([Vmin(2) Vmax(2)]);
0058     zlim([Vmin(3) Vmax(3)]);
0059 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005