Skip to content

SDF primitive library

2D Primitives

sCircle.m

Image title

sCircle(); % circle with radius R = 1 at (0,0)

sCircle(R); % circle with radius R at (0,0)

sCircle(R,[x,y]); % circle with radius R at (x,y)

sRectangle.m

Image title

sRectangle(); % square with width W = 1 at (0,0)

sRectangle(R); % circle with radius R at (0,0)

sRectangle([x1,y1],[x2,y2]); % circle with radius R at (x,y)

sStrut.m

Image title

sStrut(); % strut of width 1 from (0,0) to (1,1);

sStrut([x1,y1], T); % strut of width T from (0,0) to (x1,y1);

sStrut([x1,y1], [x2,y2], T); % strut of width T from (x1,y1) to (x2,y2);

sLine.m

Image title

sLine(); % line from (0,0) to (0,-1);

sLine([x1,y1]); % line from (0,0) to (x1,y1);

sLine([x1,y1], [x2,y2], T); % line from (x1,y1) to (x2,y2);

sCup.m

Image title

sCup(); % square with width W = 1 at (0,0)

sCup(R); % cup with radius R at (0,0)

sCup(R,L); % cup with radius R and length L

sSchwartz2D.m

Image title Image title

sSchwartzD2(); % Schwartz-D surface from (0,0)

sSchwartzD2(N,T); % Schwartz-D with period N*2*pi and thickness T

sSchwartzD2(N,T,'rotated',true); % rotated variation

sGyroid2.m

Image title

sGyroid2(); % Gyroid surface from (0,0)

sGyroid2(N,T); % Gyroid with period N*2*pi and thickness T

sGyroid2(N,T,'rotated',true); % rotated variation

3D Primitives

sSphere.m

Image title

sSphere(R); % sphere with radius R at (0,0,0)

sSphere([x,y,z],R); % sphere with radius R at (x,y,z)

sSphere([x,y,z],R,T); % shell sphere with radius R at (x,y,z) with thickness T

sCube.m

Image title

sCube(W); 
sCube(W, L, H);

sCube([x1, y1, z1], W, L, H);
sCube([x1, y1, z1], [x2, y2, z2]);

sCylinder.m

Image title

sCube(W); 
sCube(W, L, H);

sCube([x1, y1, z1], W, L, H);
sCube([x1, y1, z1], [x2, y2, z2]);

sTorus.m

Image title

sCube(W); 
sCube(W, L, H);

sCube([x1, y1, z1], W, L, H);
sCube([x1, y1, z1], [x2, y2, z2]);