Thinking Inside The Box

Last week, I wrote about NASA’s technology demonstrator projects, and how they’ve been runaway successes – both the Mars rovers and the current copter came from such experimental beginnings. I argued that letting some spirit of experimentation into an organization like NASA is probably very fruitful from time to time.

And then a few days later, we saw SpaceX blow up a rocket and completely shred its launch platform in the process. Or maybe it was the other way around, because it looks like the concrete thrown up by the exhaust may have run into the engines, causing the damage that would lead to the vehicle spinning out of control. SpaceX was already working on an alternative launch pad using water-cooled steel, but it ran what it had. They’re calling the mission a success because of what they learned, but it’s clearly a qualified success. They’ll rebuild and try again.

In comparison, the other US-funded rocket run by Boeing, the SLS suffered years of delays, cost tremendous amounts of money, and has half the lift of SpaceX’s Super Heavy. But it made it to space. Science was done, many of the CubeSats onboard got launched, the unmanned capsule orbited the moon, and splashed down safely back on earth. They weren’t particularly taking any big risks, but they got the job done.

The lore around SpaceX is that they’re failing forward to success. And it’s certainly true that they’ve got their Falcon 9 platform down to a routine, at a lower cost per launch than was ever before possible, and that their pace has entirely shaken up the conservative space industry. They’ll probably get there with their Starship / Super Heavy too. SLS was an old-school rocket, and they had boring old flame diverters on their launch pad, which means that SLS will never take off from Mars. On the other hand, one of the two systems has put a payload around the Moon.

Maybe there’s something to be said for thinking inside the box from time to time as well?

Signed Distance Functions: Modeling In Math

What if instead of defining a mesh as a series of vertices and edges in a 3D space, you could describe it as a single function? The easiest function would return the signed distance to the closest point (negative meaning you were inside the object). That’s precisely what a signed distance function (SDF) is. A signed distance field (also SDF) is just a voxel grid where the SDF is sampled at each point on the grid. First, we’ll discuss SDFs in 2D and then jump to 3D.

SDFs in 2D

A signed distance function in 2D is more straightforward to reason about so we’ll cover it first. Additionally, it is helpful for font rendering in specific scenarios. [Vassilis] of [Render Diagrams] has a beautiful demo on two-dimensional SDFs that covers the basics. The naive technique for rendering is to create a grid and calculate the distance at each point in the grid. If the distance is greater than the size of the grid cell, the pixel is not colored in. Negative values mean the pixel is colored in as the center of the pixel is inside the shape. By increasing the size of the grid, you can get better approximations of the actual shape of the SDF. So, why use this over a more traditional vector approach? The advantage is that the shape is represented by a single formula calculated at many points. Most modern computers are extraordinarily good at calculating the same thing thousands of times with slightly different parameters, often using the GPU. GLyphy is an SDF-based text renderer that uses OpenGL ES2 as a shader, as discussed at Linux conf in 2014. Freetype even merged an SDF renderer written by [Anuj Verma] back in 2020. Continue reading “Signed Distance Functions: Modeling In Math”

My Glasses Hear Everything I’m Not Saying!

There was a time when you saw someone walking down the street talking to no one, they were probably crazy. Now you have to look for a Bluetooth headset. But soon they may just be quietly talking to their glasses. Cornell University researchers have EchoSpeech which use sonar-like sensors in a pair of glasses to watch your lips and mouth move. From that data, they can figure out what you are saying, even if you don’t really say it out loud. You can see a video of the glasses below.

There are a few advantages to a method like this. For one thing, you can speak commands even in places where you can’t talk out loud to a microphone. There have been HAL 9000-like attempts to read lips with cameras, but this is power-hungry and video tends to be data intensive.

Continue reading “My Glasses Hear Everything I’m Not Saying!”

Hackaday Links Column Banner

Hackaday Links: April 9, 2023

When it comes to cryptocurrency security, what’s the best way to secure the private key? Obviously, the correct answer is to write it on a sticky note and put it on the bezel of your monitor; nobody’ll ever think of looking there. But, if you’re slightly more paranoid, and you have access to a Falcon 9, you might just choose to send it to the Moon. That’s what is supposed to happen in a few months’ time, as private firm Lunar Outpost’s MAPP, or Mobile Autonomous Prospecting Platform, heads to the Moon. The goal is to etch the private key of a wallet, cheekily named “Nakamoto_1,” on the rover and fund it with 62 Bitcoins, worth about $1.5 million now. The wallet will be funded by an NFT sale of space-themed electronic art, because apparently the project didn’t have enough Web3.0 buzzwords yet. So whoever visits the lunar rover first gets to claim the contents of the wallet, whatever they happen to be worth at the time. Of course, it doesn’t have to be a human who visits.

Continue reading “Hackaday Links: April 9, 2023”

Generating Instead Of Storing Meshes

The 64kB is a category in the demoscene where the total executable size must be less than 65,536 bytes, and at that size, storing vertexes, edges, and normal maps is a waste of space. [Ctrl-Alt-Test] is a French Demoscene group that has been doing incredible animations for the last 13 years. They’ve written an excellent guide on how they’ve been procedurally generating the meshes in their demos.

It all starts with cubes. By stacking them, overlaying them, reusing them, and tiling them you can get better compression than raw vertexes. Revolution was the next trick, as it uses just a few points, plotting it via Catmul-Rom splines, and revolving around an axis. The numbers are pairs of 32-bit floats and before compression, a detailed pawn on a chess board can weigh in at just 40 bytes. Just these few techniques can take you surprisingly far (as seen in the picture above).

They later worked on deforming cubes and placing them into a semi-randomized column, which happened to look a lot like plants. This isn’t the first generated vegetation we’ve seen, and the demoscene technique focused more on getting the shape and setting the mood rather than being accurate.

Signed distance fields are another useful trick that allows you to generate a mesh by implementing a signed distance function and then running a marching cubes algorithm on it. In a nutshell, a signed distance function just returns the distance to the closest point on a surface from a given point. This means you can describe shapes with just a single mathematical equation. As you can imagine, this is a popular technique in the demoscene world because it is so space efficient in terms of code and data. [Ctrl-Alt-Test] even has a deep dive into one of their projects, Immersion, with a breakdown of where the space is allocated.

There are plenty of other tips and tricks here, such as generating textures and developing a C++ hot reload system for faster iteration. It’s just incredible that the executable that plays the whole video is smaller than just a JPEG screenshot of the video. It’s a reminder that the demoscene is still fascinating with new tricks and experiences even as the hardware stays the same. Continue reading “Generating Instead Of Storing Meshes”

The Keychain 6809

When you think of tiny microcontroller boards, you probably think of a modern surface mount processor. Not [Andreas Jakob]. His 5×5 cm keychain computer rocks a 6809 CPU at a blistering 1 MHz or, if you prefer, a 6309 that runs at 5 MHz. The RAM — all 32K — is in a SMD package to make it fit, but the board also sports a 27C256 EPROM which means that chip and the CPU take up most of the PCB.

As you might expect, there’s not much else on the board. It doesn’t hurt, too, that the PCB is a 6-layer board. The board features a USB C port for power and data, but we didn’t see the USB interface chip on the schematic until we opened it in Easy EDA using the button that says “open in editor.” The schematic says it is sheet 1 or 1, but there are actually two additional “tabs” you can only see in the editor with the apparently missing pieces.

Continue reading “The Keychain 6809”

One Method For Removing Future Space Junk

When sending satellites into space, the idea is to place them into as stable an orbit as possible in order to maximize both the time the satellite is useful and the economics of sending it there in the first place. This tends to become rather untenable as the amount of space junk continues to pile up for all but the lowest of orbits, but a team at Brown University recently tested a satellite that might help solve this problem, at least for future satellite deployments.

The main test of this satellite was its drag sail, which increases its atmospheric drag significantly and reduces its spaceflight time to around five years. This might make it seem like a problem from an economics standpoint, as it’s quite expensive to build satellites and launch them into space, but this satellite solves these problems by being both extremely small to minimize launch costs, and also by being built out of off-the-shelf components not typically rated for spaceflight. For example, it gets its power solely from AA batteries and uses an Arduino for its operation and other research.

The satellite is currently in orbit, and has already descended from an altitude of 520 km to 470 km. While it won’t help reduce the existing amount of debris in orbit, the research team hopes to demonstrate that small satellites can be affordable and economically feasible without further contributing to the growing problem of space junk. If you’re looking to launch your own CubeSat one day, take a look at this primer which goes over most of the basics.