Meshing a spherical shell

This small function meshes a spherical shell and returns to unique vertices and proper faces matrix
429 Downloads
Updated 1 Nov 2012

View License

% mesh_sph meshes the given spherical shell which is defined bu rho the
% radius theta the azimuth angle and phi the polar angle. For more info
% type doc sph2cart. Theta is 0<theta<2*pi and pi/2<phi<pi/2
% rho is always positive double. In order to determine the mesh size
% choose an increment for each angle as shown in the examples
% Returns to vertices matrix `vert` and faces matrix `faces`
%Examples:
% Meshing a full sphere with radius 1, 8 faces along theta and 4 faces
%along phi
%[v f] = mesh_sph(1,0:pi/4:2*pi, -pi/2:pi/8:pi/2)
%
% Meshing an upper hemi-sphere with 4 faces along theta and 8 faces along
% phi
%[v f] = mesh_sph(1,0:pi/2:2*pi, 0:pi/16:pi/2)

Cite As

Bilen Oytun Peksel (2024). Meshing a spherical shell (https://www.mathworks.com/matlabcentral/fileexchange/38873-meshing-a-spherical-shell), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0