• Remix
  • Share
  • New Entry

on 15 Oct 2022
  • 11
  • 32
  • 0
  • 0
  • 280
% Pencils
% Compute ideal # of vertices so we get sharp points
%nb = 8; % number of bumps
%vpb = 100; % vertices per bump. Odd makes tops flat, even sharp
%n = nb*vpb+1 % total number of vertices. +1 for last vertex matching the first.
t=linspace(0,2*pi,801);% linspace(0,2*pi,n);
% Mesh
r=linspace(0,1,2);
[R,T]=ndgrid(r,t);
% Unit Wave function (7=nb)
M=(1-mod(T*8,2*pi)/pi);
W=rescale(1-(M.^2-1/3).^3,.2,1);
% Apply wave to R
S=R.*W;
% Vertices for a disk with wave applied
X=S.*cos(T);
Y=S.*sin(T);
surface(X,Y,X*0,R,FaceC='i',EdgeC='k',FaceA='i',AlphaData=M.^2,Mesh='r');
% Re-use r from the 'radius' computation to create a pinkish colormap.
colormap([.1 .1 .1
.8 .7 0
.8 .7 0
1 1 0]);
alphamap(.5:.01:1);
axis equal off
Remix Tree