• New Entry

Spiral Cut Pumpkin

Eric Ludlam on 29 Oct 2022
  • 7
  • 26
  • 0
  • 0
  • 278
% A pumpkin made from a spiral ribbon
%n=300;% Resolution of the sphere
%S=10;% Number of spirals
w=.07;% (1/S)*t; % Thickness of the ribbon as a factor of other vars
% Theta goes around S times, with n verts per round.
%T=linspace(0,20,3000);% (0,S*2,n*S)
T=0:.006:20;
T=[T;T];% top and bottom of ribbon
% Phi slowly goes from -.5 to .5 (top+bottom of sphere) with same # verts
% as theta.
%P=linspace(-.5+w,.5,3000);
P=-.5:.0003:.5;
P=[P;P-w];% top and bottom of ribbon, thickness of w.
% Radius of punkin has bumps. R modulates # of bumps.
%nb=10;% Number of bumps around the sphere.
R=1-(1-mod(T*12,2)).^2/20;
% Make the surface coordinates
c=@cospi;
s=@sinpi;
X=c(P).*c(T);
Y=c(P).*s(T);
Z=(.8+(0-(P*2).^4)*.2).*s(P);
% Draw
surf(R.*X,R.*Y,R.*Z,FaceC='#f71',EdgeC='n');
surface(X/12,Y/12,Z/2+.7,FaceC='#080',EdgeC='n')
light
material([.6
.9
.3
2
.5])
axis equal off
camva(6)
Remix Tree