Geometry

































This group covers meshes, point clouds, and the 3D transform stack.
| Sketch | What it shows |
|---|---|
| PointCloud | A rippling heightfield drawn as an orbiting 3D point cloud. It shows the camera, the depth buffer, and instanced disc splats. |
| StrangeAttractor | A 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). |
| Transforms | The 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. |
| Solids | The closed-solid catalog (box, sphere, cylinder, torus, the Platonics, and more), drawn as colorful clay and shaded by the auto-lit default. |
| CutAndJoin | The 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). |
| Carved | A 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. |
| ShadowArt | A 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:)). |
| ShapeFactory | The parametric and profile mesh set (Möbius, Klein, superellipsoid, supershape, extrude, lathe), morphing on time. |
| SolidType | A 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). |
| Ocean | A 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). |
| Planet | A 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. |
| LoadedMesh | A 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. |
| TexturedMesh | A UV-gridded globe textured with an image, standing over a floor tinted by a base color. Both are lit. |
| Wireframe | Orbiting solids drawn as their triangle edges (wireframe()), so the faces are see-through. |
| FieldLines | A 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). |
| HiddenLines | Ten 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:)). |
| SurfaceScatter | Trees 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. |
| Terrain | Generated 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. |
| Metaballs | Soft spheres that merge as they come close. Every ball adds a bump to one shared field, and isosurface walks that field into a mesh. |
| SharpFields | A 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. |
| MeshGrowth | A surface that grows more than it has room for. Its vertices are pushed apart, faster where the surface is already crowded, until it buckles. |
| SubdivisionSurfaces | A coarse low-poly cage refined into a smooth solid (mesh.subdivided(_:levels:)). |
| SurfaceFromPoints | A surface rebuilt from points, two ways. A knot is sampled into a bare point cloud and then reconstructed from that cloud. |
| HopfFibration | A sphere's worth of circles. No two of them meet, and every two of them are linked exactly once. |
| SweptKnot | A 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. |
| LoftedVessels | A 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. |
| LoadedScene | A 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. |
| SceneExplorer | A read-only viewer for a scene file. Point it at a glTF or USD scene and look around it, part by part. |
| AnimatedScene | A 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. |
| SkinnedScene | A 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. |
| Fabrication | A generated shape written out as a file a 3D printer can build, with a report on whether the printer can build it. |
| SpatialExport | A sketch exported as a model instead of a picture. Ordinary 3D is written out as USDZ. |
| SpatialVideo | A 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.