Ollin

Geometry

This group covers meshes, point clouds, and the 3D transform stack.

SketchWhat it shows
PointCloudA rippling heightfield drawn as an orbiting 3D point cloud. It shows the camera, the depth buffer, and instanced disc splats.
StrangeAttractorA Lorenz attractor integrated with Runge-Kutta and splatted as a 150k-point cloud. The points are colored by orbit speed and lit additively. Grab and orbit it (StrangeAttractor.lorenz).
TransformsThe 3D transform stack: a sun, planets orbiting it, and a moon orbiting each planet. Nested withState blocks make the orbits within orbits, and one point-cloud blob is placed many ways by translate/rotateY/scale.
SolidsThe closed-solid catalog (box, sphere, cylinder, torus, the Platonics, and more), drawn as colorful clay and shaded by the auto-lit default.
CutAndJoinThe four ways two solids combine, side by side: a cube and a ball united, intersected, and each cut out of the other (union, intersection, subtracting).
CarvedA block rounded by a ball, bored through three ways, and bitten at every corner: twelve cuts stacked into one closed solid you can still print.
ShadowArtA solid carved so that it throws a ring from the front and a cross from the side. The shadow it really throws is drawn beside the shadow that was asked for (shadowArt, shadow(from:)).
ShapeFactoryThe parametric and profile mesh set (Möbius, Klein, superellipsoid, supershape, extrude, lathe), morphing on time.
SolidTypeA word extruded into a solid that catches the light and throws a shadow. The same word is also drawn one letter at a time, and each letter nods about its own center (drawText3D, Mesh.text, Mesh.textGlyphs).
OceanA sea built from its own wave spectrum. One inverse Fourier transform on the GPU makes the surface, which is drawn as water with no geometry anywhere (makeOceanField, drawOcean).
PlanetA world with nothing loaded. Six compute kernels bake its elevation, surface, relief, finish, city lights, and weather once. Spheres are drawn with those maps under one sun, and the terminator decides both where the cities show and where the air glows.
LoadedMeshA mesh loaded from a file (.obj/.usdz/.gltf/…). Point it at your own file with OLLIN_MESH=<path>, or use the bundled crystal. Either way the mesh is recentered, scaled to fit, and lit.
TexturedMeshA UV-gridded globe textured with an image, standing over a floor tinted by a base color. Both are lit.
WireframeOrbiting solids drawn as their triangle edges (wireframe()), so the faces are see-through.
FieldLinesA planet's magnetic field drawn as lines in space, looping pole to pole with a pulse of light along each. The planet hides the far half of every loop, and the weight can be read on screen or in world units (drawPolyline over Vector3 with a color per point, drawGrid, drawAxes).
HiddenLinesTen thousand small boxes turning in a block of air, drawn as a draughtsman would: white faces and, in ink, only the edges each box has, the near boxes hiding the edges of the far ones. The boxes are one instanced draw and their edges one more, and each turns by the looping 3D noise at its own place, so the clip closes (featureEdges, signedNoise(x, y, z, loop:)).
SurfaceScatterTrees standing on a globe. surfacePoints scatters them over the skin by area, and alignment stands each one up. The spread parameter compares an even covering, a plain draw, and the vertex-list shortcut.
TerrainGenerated terrain, then weathered. A heightfield is grown by diamond-square subdivision, then eroded by tens of thousands of simulated raindrops that carve ravines and build sediment fans.
MetaballsSoft spheres that merge as they come close. Every ball adds a bump to one shared field, and isosurface walks that field into a mesh.
SharpFieldsA block with a hole bored through it and a corner bitten out, meshed so the corners stay. isosurface with method: .dualContouring puts each cell's vertex where the field's normals meet, beside marching cubes for the difference.
MeshGrowthA surface that grows more than it has room for. Its vertices are pushed apart, faster where the surface is already crowded, until it buckles.
SubdivisionSurfacesA coarse low-poly cage refined into a smooth solid (mesh.subdivided(_:levels:)).
SurfaceFromPointsA surface rebuilt from points, two ways. A knot is sampled into a bare point cloud and then reconstructed from that cloud.
HopfFibrationA sphere's worth of circles. No two of them meet, and every two of them are linked exactly once.
SweptKnotA star swept round a trefoil knot, turning as it goes (Mesh.sweep along a Curve3D), carriages riding the knot's frames, and a striped ribbon (Mesh.strip) whose rungs a Pace can space by area.
LoftedVesselsA bottle, a horn, and a boat hull, each one surface through several flat shapes placed along a path (Mesh.loft): a polygon foot blending into a round neck, a star rounding into a circle as it turns, and open ribs lofted into a hull with no caps.
LoadedSceneA whole authored scene drawn in place, opening on its own camera and lights. F swaps the glTF stage for its USD version, a sculpture court lit by UsdLux, through the same loadScene call.
SceneExplorerA read-only viewer for a scene file. Point it at a glTF or USD scene and look around it, part by part.
AnimatedSceneA scene file's authored animation played back, with keyframe tracks posing named nodes. F swaps the glTF orrery for a USD kinetic mobile, whose timeSamples play the same way.
SkinnedSceneA scene file's deforming animation: skins that bend meshes and morph targets that blend them. F swaps the glTF tidepool for a USD pond, whose UsdSkel rig is read by Ollin's own parser.
FabricationA generated shape written out as a file a 3D printer can build, with a report on whether the printer can build it.
SpatialExportA sketch exported as a model instead of a picture. Ordinary 3D is written out as USDZ.
SpatialVideoA sketch exported as something you can look into. The scene is built for depth rather than for a flat frame.

Run one with swift run Example-3D-Geometry-<Name>, for example swift run Example-3D-Geometry-PointCloud.

↑↓ move ↩ open