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”

A Miniature MNT For Every Pocket

Last time Hackaday went hands on with a product from German company MNT, it was the Reform laptop; a full size computer with a full feature set and fully open source design. Now they’re back with the same value proposition and feature set crammed into a much more adorable (and colorful!) package with the MNT Pocket Reform. If you want the big Reform’s open source philosophy in a body fit for a coat pocket, this might be the computing device for you.

To refresh your memory, MNT is a company that specializes in open source hardware and the software to support it. They are probably best known for the Reform, their first laptop. Its marquis feature is a fully open design, from the mechanical components (designed with OSS tools) to the PCBAs (designed with KiCad) to the software (designed with, uh, software). When originally shipped that product packed a DIMM-style System On Module (SOM) with a default configuration containing a quad core NXP i.MX8M Quad and 4GB of RAM, as well as mini PCIe Card and M key m.2 2280 slots on the motherboard for storage and connectivity. That computer was designed to be easily serviceable and included a plethora of full sized ports along with easy to source cylindrical battery cells. The Pocket Reform takes the same intent and channels it into a much smaller package.

Continue reading “A Miniature MNT For Every Pocket”

The Real John Wick-Style Bullet Proof Suit

If you’ve seen the John Wick movies, you’ve probably had to suspend your disbelief about many things, but the bulletproof suits are perhaps the hardest thing to swallow. They look like stylish suits but are impervious to just about anything at any range. What’s more is when you are hit, they seem to absorb all impact with no effect on the wearer at all.

You can keep running, firing, or karate kicking while the suit takes all of the bullets. You can even pull your jacket up over your face if you want to protect that million-dollar smile. Physics, of course, tells us that a suit like this is pretty much impossible. Except that they actually exist. Granted, the real-life suits don’t have the magic physics-defying powers of Mr. Wick’s suit, but if you have the cash, you can get a smart-looking suit that protects you from getting killed by a bullet.

Real Life, Part I

In the movies, the suits supposedly have Kevlar in them just like a real piece of ballistic body armor. The problem is, Kevlar is bulky. However, most of the real body armor you see — like a vest on a SWAT team operative — is made from Kevlar or similar ballistic fibers like Twaron, Goldflex, or Dyneema. They also have plates made of metal or ceramic. Continue reading “The Real John Wick-Style Bullet Proof Suit”

Share Your Projects: Take Pictures

Information is diesel for a hacker’s engine, and it’s fascinating how much can happen when you share what you’re working on. It could be a pretty simple journey – say, you record a video showing you fixing your broken headphones, highlighting a particular trick that works well for you. Someone will see it as an entire collection of information – “if my headphones are broken, the process of fixing them looks like this, and these are the tools I might need”. For a newcomer, you might be leading them to an eye-opening discovery – “if my headphones are broken, it is possible to fix them”.

There’s a few hundred different ways that different hackers use for project information sharing – and my bet is that talking through them will help everyone involved share better and easier. Let’s start talking about pictures – perhaps, the most powerful tool in a hacker’s arsenal. I’ll tell you about all the picture-taking hacks and guidelines I’ve found, go into subjects like picture habits and simple tricks, and even tell you what makes Hackaday writers swoon!

To start with, here’s a picture of someone hotwiring a car. This one picture conveys an entire story, and a strong one.

Continue reading “Share Your Projects: Take Pictures”

If They Fire The Nukes, Will They Even Work?

2022 was a harrowing year in a long line of harrowing years. A brutal war in Europe raised the prospect of nuclear war as the leaders behind the invasion rattled sabers and made thinly veiled threats to use weapons of mass destruction. And all this as we’re still working our way through the fallout of a global pandemic.

Those hot-headed threats raise an interesting question, however. Decades have passed since either Russia or the United States ran a live nuclear weapons test. Given that, would the nukes even work if they were fired in anger?

Continue reading “If They Fire The Nukes, Will They Even Work?”

How Tattoos Interact With The Immune System Could Have Impacts For Vaccines

Tattoos are an interesting technology. They’re a way of marking patterns and designs on the skin that can last for years or decades. All this, despite the fact that our skin sloughs off on a regular basis!

As it turns out, tattoos actually have a deep and complex interaction with our immune system, which hold some of the secrets regarding their longevity. New research has unveiled more insight into how the body responds when we get inked up.

Continue reading “How Tattoos Interact With The Immune System Could Have Impacts For Vaccines”

The Liquid Trees Of Belgrade: The Facts Behind The Furore

Historically, nature has used trees to turn carbon dioxide back into oxygen for use by living creatures. The trees play a vital role in the carbon cycle, and have done so for millennia. Recently, humans have thrown things off a bit by getting rid of lots of trees and digging up a lot more carbon.

While great efforts are underway to replenish the world’s tree stocks, Belgrade has gone in a different direction, creating artificial “liquid trees” to capture carbon dioxide instead. This has spawned wild cries of dystopia and that the devices are an affront to nature. Let’s sidestep the hysteria and look at what’s actually going on.

Continue reading “The Liquid Trees Of Belgrade: The Facts Behind The Furore”