Browse Source

Add tetrahedron

main
raffitz 3 years ago
parent
commit
16c96d1e62
Signed by: raffitz
GPG Key ID: BB3596BD0A31252D
  1. 2
      README.md
  2. 16
      examples/htetra1.solid
  3. 10
      examples/tetrahedron1.solid

2
README.md

@ -44,6 +44,8 @@ The output consists of a series of images, each depicting a layer of the solid, @@ -44,6 +44,8 @@ The output consists of a series of images, each depicting a layer of the solid,
| --- | --- | --- |
| `cube.solid` | Cube | A cube stood on its vertex |
| `hcube.solid` | Hollow Cube | A hollow cube stood on its vertex |
| `tetrahedron1.solid` | Tetrahedron | A tetrahedron stood on its edge |
| `htetra1.solid` | Hollow Teterahedron | A hollow tetrahedron stood on its edge |
| `sphere.solid` | Sphere | A sphere of radius s |
| `torus1.solid` | Torus | A torus with a tube radius of s, and a hole radius of 2 * s |
| `ramp.solid` | Ramp | A spiraling ramp |

16
examples/htetra1.solid

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
# Hollow Tetrahedron
define @ns s - 2
-s < x < s
-s < y < s
-s < z < s
{(x - s) + (y - s) - (z - s) < 0 ∧ \
(x - s) - (y + s) + (z + s) < 0 ∧ \
-(x + s) + (y - s) + (z + s) < 0 ∧ \
-(x + s) - (y + s) - (z - s) < 0} ⊻ \
{(x - @ns) + (y - @ns) - (z - @ns) < 0 ∧ \
(x - @ns) - (y + @ns) + (z + @ns) < 0 ∧ \
-(x + @ns) + (y - @ns) + (z + @ns) < 0 ∧ \
-(x + @ns) - (y + @ns) - (z - @ns) < 0}

10
examples/tetrahedron1.solid

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
# Tetrahedron
-s < x < s
-s < y < s
-s < z < s
(x - s) + (y - s) - (z - s) < 0
(x - s) - (y + s) + (z + s) < 0
-(x + s) + (y - s) + (z + s) < 0
-(x + s) - (y + s) - (z - s) < 0
Loading…
Cancel
Save