Manifold 1.0
Robust computational geometry
 
Loading...
Searching...
No Matches
Samples

Examples of usage and interesting designs. More...

Functions

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)
 

Detailed Description

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.

Function Documentation

◆ 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
pThe number of times the thread passes through the donut hole.
qThe number of times the thread circles the donut.
majorRadiusRadius of the interior of the imaginary donut.
minorRadiusRadius of the small cross-section of the imaginary donut.
threadRadiusRadius of the small cross-section of the actual object.
circularSegmentsNumber of linear segments making up the threadRadius circle. Default is Quality.GetCircularSegments().
linearSegmentsNumber 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
radiusThe overall size; the radius left for your wrist is roughly radius - height.
heightThickness of the bracelet around your wrist.
widthThe length along your arm (the height of the print).
thicknessThe width of the material, which should be equal to your printer's nozzle diameter.
nDecorThe number of twisty shapes around the outside.
nCutThe number of cuts that enable stretching.
nDivisionthe number of divisions along the width.

◆ MengerSponge()

Manifold MengerSponge ( int  n)

The classic cubic fractal.

Parameters
nFractal 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
edgeLengthDistance between the corners.
radiusRadius of the frame members.
circularSegmentsNumber 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
edgeLengthLength of each edge of the overall tetrahedron.
gapSpacing between the two halves to allow sliding.
nDivisionsNumber of divisions (both ways) in the screw surface.

◆ Scallop()

Manifold Scallop ( )

A smoothed manifold demonstrating selective edge sharpening with Manifold.Smooth(). Use Manifold.Refine() before export to see the curvature.

◆ 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.