Code covered by the BSD License  

Highlights from
geom3d

image thumbnail

geom3d

by

 

19 Jun 2009 (Updated )

Library to handle 3D geometric primitives: create, intersect, display, and make basic computations

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

demoRevolutionSurface

Contents

function demoRevolutionSurface(varargin)
%DEMOREVOLUTIONSURFACE  One-line description here, please.
%   output = demoRevolutionSurface(input)
%
%   Example
%   demoRevolutionSurface
%
%   See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@nantes.inra.fr
% Created: 2007-04-20
% Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.

Draw a torus with horizontal axis as revolution axis

circle  = circleToPolygon([10 0 3], 50);
[x y t] = revolutionSurface(circle, linspace(0, 4*pi/3, 50));

figure;
surf(x, y, t);
axis equal;

Draw a torus with vertical axis as revolution axis

circle  = circleToPolygon([10 0 3], 50);
revol   = [0 0 0 1];
[x y t] = revolutionSurface(circle, revol, linspace(0, 4*pi/3, 50));

figure;
surf(x, y, t);
axis equal;

Contact us