First Build makes an impression

MATLAB model to CNC-carved Modulan mold

MATLAB model to CNC-carved Modulan mold

FirstBuild is helping make a molded plastic diffuser for the Trilife cellular computing project.

The MATLAB file (rainbow colored inset) got CNC milled into a Modulan tool for vacuum forming thanks to Jeremy Turner and Randy Reeves at First Build.
We are looking at PETG for the plastic that will be formed over this mold, because PETG is paintable and can also be laser cut. These diffusers will create the triangular light reflectors that we currently get from folding paper. The paper works great, except it crumples up a lot in transit.

The MATLAB code to create the diffuser surface is…

%PuffyTri
%Generate XYZ coords for a puffy triangle
%For Trilife Diffuser

Nz=30;%Number of terraces to draw
Rmax=1;%Distance from center to point
Zmax=Rmax/3;%Height at center of thing
NBaseSeg=50;%Number of segments along the base
theta=linspace(0,2*pi,NBaseSeg*3+1);%the angle
theta=theta+(theta(2)-theta(1))/2;%shift it off 0 a bit
zed=(0:(Nz-1))*Zmax/(Nz-1);%vector of z-coords
[t,Z]=meshgrid(theta,zed);
rotator=(1-(1-(Z/Zmax))).^1.5*pi/2;%spin each subsequent triangle a bit, increase spin rate toward top
%rotator=zeros(size(Z));%No rotation if you set rotator to 0
R=cos(pi/3)./(cos(mod(t+rotator,2*pi/3)-pi/3))*Rmax.*(Zmax-Z)/Zmax;%triangle
sucker=R.^-0.2;%suck in the sides to make room for a fastener or tape, larger negative exponent for more suckage
R=R.*cos(mod(t+rotator,2*pi/3)-pi/3).^((Z/Zmax)); %Gets more & more rounded as you get to the top
R=R./sucker;
[X Y]=pol2cart(t,R);

%Give it a more domed shape
zed=Zmax*(1-(1-zed/Zmax).^4);
[t,Z]=meshgrid(theta,zed);

closedx=[X X];
closedy=[Y Y];
closedz=[Z zeros(size(Z))]; %create a lid by copying everything down to z=0
surf(closedx,closedy,closedz)
axis equal
%hold on
%surf(-X+2*min(min(X)),-Y,Z)%see what it looks like with a near neighbor
axis tight
shading flat
%86.36 mm is the "radius" of the Trilife diffuser
stlwrite('closedBIGtwist.stl',86.36*closedx,86.36*closedy,86.36*closedz,'mode','ascii','triangulation','b'); %Readable by ReplicatorG
%backwards triangulation seems best at getting rid of unsightly ridges

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? Do the math: * Time limit is exhausted. Please reload CAPTCHA.