Examples of usage and interesting designs.
More...
|
Manifold | TorusKnot (int p, int q, double majorRadius, double minorRadius, double threadRadius, int circularSegments=0, int linearSegments=0) |
|
Manifold | StretchyBracelet (double radius=30.0, double height=8.0, double width=15.0, double thickness=0.4, int nDecor=20, int nCut=27, int nDivision=30) |
|
Manifold | MengerSponge (int n=3) |
|
Manifold | RoundedFrame (double edgeLength, double radius, int circularSegments=0) |
|
Manifold | TetPuzzle (double edgeLength, double gap, int nDivisions) |
|
Manifold | Scallop () |
|
Manifold | GyroidModule (double size=20, int n=20) |
|
Manifold | CondensedMatter (int fn=16) |
|
Examples of usage and interesting designs.
These are mostly 3D-printable designs I've invented over the years, translated from their original OpenSCAD to C++ to demonstrate the usage of this library. You can find the originals here: http://www.thingiverse.com/emmett These also each have tests you can find in test/samples_test.cpp, which have nice parameter choices for making some of the specific designs I print. While the source code is under the Apache License above, I license all of my designs (the output of those tests if you uncomment the export lines) under CC-BY-SA: https://creativecommons.org/licenses/by-sa/2.0/, which means you're welcome to print and sell them, so long as you attribute the design to Emmett Lalish and share any derivative works under the same license.
◆ TorusKnot()
Manifold TorusKnot |
( |
int | p, |
|
|
int | q, |
|
|
double | majorRadius, |
|
|
double | minorRadius, |
|
|
double | threadRadius, |
|
|
int | circularSegments, |
|
|
int | linearSegments ) |
Creates a classic torus knot, defined as a string wrapping periodically around the surface of an imaginary donut. If p and q have a common factor then you will get multiple separate, interwoven knots. This is an example of using the Manifold.Warp() method, thus avoiding any handling of triangles.
- Parameters
-
p | The number of times the thread passes through the donut hole. |
q | The number of times the thread circles the donut. |
majorRadius | Radius of the interior of the imaginary donut. |
minorRadius | Radius of the small cross-section of the imaginary donut. |
threadRadius | Radius of the small cross-section of the actual object. |
circularSegments | Number of linear segments making up the threadRadius circle. Default is Quality.GetCircularSegments(). |
linearSegments | Number of segments along the length of the knot. Default makes roughly square facets. |
◆ StretchyBracelet()
Manifold StretchyBracelet |
( |
double | radius, |
|
|
double | height, |
|
|
double | width, |
|
|
double | thickness, |
|
|
int | nDecor, |
|
|
int | nCut, |
|
|
int | nDivision ) |
My Stretchy Bracelet: this is one of my most popular designs, largely because it's quick and easy to 3D print. The defaults are picked to work well; change the radius to fit your wrist. Changing the other values too much may break the design.
- Parameters
-
radius | The overall size; the radius left for your wrist is roughly radius - height. |
height | Thickness of the bracelet around your wrist. |
width | The length along your arm (the height of the print). |
thickness | The width of the material, which should be equal to your printer's nozzle diameter. |
nDecor | The number of twisty shapes around the outside. |
nCut | The number of cuts that enable stretching. |
nDivision | the number of divisions along the width. |
◆ MengerSponge()
The classic cubic fractal.
- Parameters
-
n | Fractal depth. Warning: scales exponentially, n = 4 has almost 400,000 triangles! |
◆ RoundedFrame()
Manifold RoundedFrame |
( |
double | edgeLength, |
|
|
double | radius, |
|
|
int | circularSegments ) |
A cubic frame with cylinders for edges and spheres at the corners. Demonstrates how at 90-degree intersections, the sphere and cylinder facets match up perfectly.
- Parameters
-
edgeLength | Distance between the corners. |
radius | Radius of the frame members. |
circularSegments | Number of segments in the cylinders and spheres. Defaults to Quality.GetCircularSegments(). |
◆ TetPuzzle()
Manifold TetPuzzle |
( |
double | edgeLength, |
|
|
double | gap, |
|
|
int | nDivisions ) |
A tetrahedron cut into two identical halves that can screw together as a puzzle. This only outputs one of the halves. This demonstrates how redundant points along a polygon can be used to make twisted extrusions smoother.
- Parameters
-
edgeLength | Length of each edge of the overall tetrahedron. |
gap | Spacing between the two halves to allow sliding. |
nDivisions | Number of divisions (both ways) in the screw surface. |
◆ Scallop()
◆ GyroidModule()
Manifold GyroidModule |
( |
double | size, |
|
|
int | n ) |
Creates a rhombic dodecahedral module of a gyroid manifold, which can be assembled together to tile space continuously. This one is designed to be 3D-printable, as it is oriented with minimal overhangs. This sample demonstrates the use of a Signed Distance Function (SDF) to create smooth, complex manifolds.
- Parameters
-
size | Creates a module scaled to this dimension between opposite faces. |
n | The number of divisions for SDF evaluation across the gyroid's period. |
◆ CondensedMatter()
A demonstration of molecular bonding.
- Parameters
-
fn | Number of circular segments. |