Posts

Showing posts with the label topology

Triangle wave gyroid

Image
A gyroid is a fascinating geometric structure. It's a three-dimensionally-tileable unit that creates an infinitely connected surface. The surface is triply-periodic, meaning it repeats in all three dimensions. Gyroids also occur naturally in polymer science and biology. For 3D printing, a gyroid is a useful infill pattern. Not only does it fill volume without using much material, but it also provides strength to the final part in all three dimensions. As an added bonus, a gyroid pattern can be built using a toolpath that never crosses itself. In this article I present the traditional gyroid and a couple of alternatives that might work better for 3D printing. Traditional gyroid The gyroid surface can be approximated with trigonometric functions. It's a rather simple equation: $$ \sin x\cos y+\sin y\cos z+\sin z\cos x=0 $$ That is, at every (x,y,z) coordinate value where that equation is zero, that point is on the surface of the gyroid. There isn't any closed-form...

Simulating erosion

Image
I decided to create a procedurally-generated 3D landscape in a CAD program, and wrap it around a globe, which led me to an investigation of erosion algorithms. I include a JavaScript erosion demo at the end of this article for you to play with. As an aside, let me say that I like OpenSCAD in spite of its idiosyncrasies. Other CAD programs can do many things that OpenSCAD can't, but OpenSCAD is the only 3D modelling software I know of that makes it easy to create procedural or algorithmic parametric designs. It runs on all my computers: Windows, macOS, and Linux — and it's freeware. Its main idiosyncrasy is that it uses a declarative language that requires familiarity with functional programming , a different programming mindset in which all values are evaluated at compile-time instead of run-time, meaning that all "variables" are effectively constants. Even so, one still has conditional branching, looping, and recursive functions, so one can get stuff done. For exa...

New approach to screw threads in OpenSCAD

Image
This is an intellectual exercise with a practical end-result. There are better approaches to this problem, but the approach I describe here is interesting. A screw thread from a stack of discs Imagine a stack of 50 coins, stacked so that each coin is slightly offset from the one below it, with the offset moving around in a circle with each new coin. Here is what it looks like for fifty coins 20 mm in diameter and 0.5 mm thick, offset by 2 mm from a center of rotation, and stacked with a rotation offset of 30 degrees per coin ( click to enlarge any image in this article ): Obviously, this is a spiral stack of coins. But it also approximates screw threads. The thread profile looks like a sinewave rather than the trapezoidal profile of machine screw threads. Indeed, others have observed this, and used the freeware parametric CAD program OpenSCAD to make screw threads by extruding an offset circle while twisting it, as in this model on Thingiverse , for example. From a distan...

A hypercube full of rooms

Image
While I'm on the subject of Dungeons & Dragons (see my previous post on ability score probabilities ), I recall something I did involving a tesseract way back in 2007 and posted on the community forum of Wizards of the Coast. WOTC took down their forum in 2015, but fortunately the Wayback Machine has an archived copy. Imagine a cubical room. It has four walls, a ceiling, and a floor (six faces). Each face has a door or opening, to allow you to pass through to the next room. Each cubical room connects to six other rooms — but there are eight rooms interconnected this way. This isn't possible to draw in 3 dimensions without distorting some of the rooms. Imagine a central room with a room connected to each face. So you have the center room, the north, south, east, and west rooms, and the top and bottom rooms. That takes care of seven rooms. The eighth room, we'll call it the "outer" room, is connected to those six rooms surrounding the center. Designating th...

Nonrecursive fractal

Image
A Koch snowflake. CC-BY-SA Wikimedia Commons While thinking about the Koch snowflake it occurred to me that a recursive algorithm to generate one side of the curve would be trivial, but a non -recursive algorithm is pretty simple as well, although it took a lot of thought on my part to get it to work. I don't claim to be an expert at algorithms but I'm pleased when I can figure something out. Here's what I came up with. Your browser does not support the HTML5 canvas tag. Fractal order: ← 0 → (click the arrows) The idea is to start out with the smallest generator unit, calculating its size by scaling per the length of the parent segments, and accumulating the rotation angles. Then draw the generator unit at that scale and rotation. Repeat for the total number of smallest generator units, which would be the number of segments in the unit to the power of (fractal order − 1). Here's the code including the graphics scaling. // display initialization and sca...

Popular posts from this blog

Syncing Office 365 Outlook to Google calendar using Power Automate

Whose hands are biggest? You may be surprised.

Elliptical-blade NACA airfoil propeller