The Tesseract – Part 2

It turns out constructing the hypercube from vertexes and extrusions was easier than subtracting cubic areas from the larger solid cube.

Snap1

Since I want the tesseract to be parametric, I first set up my variables for my larger and smaller cubes.

largeWidth = 20;
largeEdge = 3;</p>

<p>smallWidth = 10;
smallEdge = 2;

From these variables I create the large cube’s vertexes and position a cube at each vertex.

frontUpperLeftLarge = [-largeWidth / 2, -largeWidth / 2, largeWidth / 2];
frontUpperRightLarge = [largeWidth / 2, -largeWidth / 2, largeWidth /2];
frontLowerLeftLarge = [-largeWidth / 2, -largeWidth / 2, -largeWidth / 2];
frontLowerRightLarge = [largeWidth / 2, -largeWidth / 2, -largeWidth / 2];</p>

<p>backUpperLeftLarge = [-largeWidth / 2, largeWidth / 2, largeWidth / 2];
backUpperRightLarge = [largeWidth / 2, largeWidth / 2, largeWidth /2];
backLowerLeftLarge = [-largeWidth / 2, largeWidth / 2, -largeWidth / 2];
backLowerRightLarge = [largeWidth / 2, largeWidth / 2, -largeWidth / 2];</p>

<p>translate(frontUpperLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontUpperRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontLowerLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontLowerRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);</p>

<p>translate(backUpperLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backUpperRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backLowerLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backLowerRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);

Snap2

I then extruded a circular strut between all the vertexes

translate(frontUpperLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperLeftLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperRightLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerRightLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerLeftLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerRightLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerRightLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);

Snap3

When the vertex cubes and the struts are combined we have the outer cube.

Snap4

Using the smaller cube parameters I do the same thing for the inner cube.

Snap5

And for the structs that connect the outer cube to the inner cube.

Snap6

When everything is combined you have your complete tesseract.

Snap1

Which when it’s printed out looks like this.

IMG_0479

I still have some work to do with my print and slicer settings since there’s some sag when spanning larger gaps. I’m sure there’s a way to add support struts to hold the tesseract material in place while it’s printing (I can remove the struts after the object is printed). Also, the model is still not completely parametric – with some initial values it’s possible to create “broken” tesseracts. I’ll have to work on that today.

Snap8

Here’s the tesseract script as it stands right now.

largeWidth = 20;
largeEdge = 3;</p>

<p>smallWidth = 7;
smallEdge = 2;</p>

<p>$fn = 100;</p>

<p>// Outer cube</p>

<p>// Create vertexes
frontUpperLeftLarge = [-largeWidth / 2, -largeWidth / 2, largeWidth / 2];
frontUpperRightLarge = [largeWidth / 2, -largeWidth / 2, largeWidth /2];
frontLowerLeftLarge = [-largeWidth / 2, -largeWidth / 2, -largeWidth / 2];
frontLowerRightLarge = [largeWidth / 2, -largeWidth / 2, -largeWidth / 2];</p>

<p>backUpperLeftLarge = [-largeWidth / 2, largeWidth / 2, largeWidth / 2];
backUpperRightLarge = [largeWidth / 2, largeWidth / 2, largeWidth /2];
backLowerLeftLarge = [-largeWidth / 2, largeWidth / 2, -largeWidth / 2];
backLowerRightLarge = [largeWidth / 2, largeWidth / 2, -largeWidth / 2];</p>

<p>// Position vertex cubes
translate(frontUpperLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontUpperRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontLowerLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(frontLowerRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);</p>

<p>translate(backUpperLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backUpperRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backLowerLeftLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);
translate(backLowerRightLarge) color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;) cube(size = largeEdge, center = true);</p>

<p>// Extrude frame
translate(frontUpperLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperLeftLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backUpperRightLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerRightLarge)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerLeftLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(frontLowerRightLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>translate(backLowerRightLarge)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;quot;)
linear_extrude(height = largeWidth, center = false)
circle(diameter = largeEdge);</p>

<p>// Inner cube</p>

<p>// Create vertexes//
frontUpperLeftSmall = [-smallWidth / 2, -smallWidth / 2, smallWidth / 2];
frontUpperRightSmall = [smallWidth / 2, -smallWidth / 2, smallWidth /2];
frontLowerLeftSmall = [-smallWidth / 2, -smallWidth / 2, -smallWidth / 2];
frontLowerRightSmall = [smallWidth / 2, -smallWidth / 2, -smallWidth / 2];</p>

<p>backUpperLeftSmall = [-smallWidth / 2, smallWidth / 2, smallWidth / 2];
backUpperRightSmall = [smallWidth / 2, smallWidth / 2, smallWidth /2];
backLowerLeftSmall = [-smallWidth / 2, smallWidth / 2, -smallWidth / 2];
backLowerRightSmall = [smallWidth / 2, smallWidth / 2, -smallWidth / 2];</p>

<p>// Position vertex cubes
translate(frontUpperLeftSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(frontUpperRightSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(frontLowerLeftSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(frontLowerRightSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);</p>

<p>translate(backUpperLeftSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(backUpperRightSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(backLowerLeftSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);
translate(backLowerRightSmall) color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;) cube(size = smallEdge, center = true);</p>

<p>// Extrude frame
translate(frontUpperLeftSmall)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontLowerLeftSmall)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backUpperLeftSmall)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerLeftSmall)
rotate(a = [0, 90, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backUpperLeftSmall)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backUpperRightSmall)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerLeftSmall)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerRightSmall)
rotate(a = [90, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontLowerLeftSmall)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontLowerRightSmall)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerLeftSmall)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerRightSmall)
rotate(a = [0, 0, 0])
color(&amp;amp;amp;amp;quot;red&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth, center = false)
circle(diameter = smallEdge);</p>

<p>// Create struts to connect outer cube vertexes to inner cube vertexes
translate(frontUpperLeftLarge)
rotate(a = [0, 125, 45])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontUpperRightLarge)
rotate(a = [0, 125, 135])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontLowerRightLarge)
rotate(a = [0, 55, 135])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(frontLowerLeftLarge)
rotate(a = [0, 55, 45])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backUpperLeftLarge)
rotate(a = [0, 125, 315])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backUpperRightLarge)
rotate(a = [0, 125, 225])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerRightLarge)
rotate(a = [0, 55, 225])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);</p>

<p>translate(backLowerLeftLarge)
rotate(a = [0, 55, 315])
color(&amp;amp;amp;amp;quot;green&amp;amp;amp;amp;quot;)
linear_extrude(height = smallWidth - 1, center = false)
circle(diameter = smallEdge);

This entry was posted in Other and tagged . Bookmark the permalink.