Reverse Engineering STL Files With FreeCAD

If you think about it, STL files are like PDF files. You usually create them using some other program, export them, and then expect them to print. But you rarely do serious editing on a PDF or an STL. But what if you don’t have anything but the STL? [The Savvy Engineer] has a method to help you if you need to reverse engineer an STL file in FreeCAD. Check it out in the video below.

The problem is, of course, that STLs are made up of numerous little triangles. The trick is to switch workbenches and create a shape from mesh. That gets you part of the way.

Once you have a shape, you can convert it to a solid. At that point, you can create a refined copy. This gives you a proper CAD file that you can export to a STEP file. From there, you can use it in FreeCAD or nearly any other CAD package you like to use.

Once you have a proper object, you can easily use it like any other solid body in your CAD program. This is one of those things you won’t need every day, but when you do need it, it’ll come in handy.

Want to up your FreeCAD game? We can help. There are other ways to hack up STL files. You can even import them into TinkerCAD to do simple things, but they still aren’t proper objects.

Continue reading “Reverse Engineering STL Files With FreeCAD”

Nanochat Lets You Build Your Own Hackable LLM

Few people know LLMs (Large Language Models) as thoroughly as [Andrej Karpathy], and luckily for us all he expresses that in useful open-source projects. His latest is nanochat, which he bills as a way to create “the best ChatGPT $100 can buy”.

What is it, exactly? nanochat in a minimal and hackable software project — encapsulated in a single speedrun.sh script — for creating a simple ChatGPT clone from scratch, including web interface. The codebase is about 8,000 lines of clean, readable code with minimal dependencies, making every single part of the process accessible to be tampered with.

An accessible, end-to-end codebase for creating a simple ChatGPT clone makes every part of the process hackable.

The $100 is the cost of doing the computational grunt work of creating the model, which takes about 4 hours on a single NVIDIA 8XH100 GPU node. The result is a 1.9 billion parameter micro-model, trained on some 38 billion tokens from an open dataset. This model is, as [Andrej] describes in his announcement on X, a “little ChatGPT clone you can sort of talk to, and which can write stories/poems, answer simple questions.” A walk-through of what that whole process looks like makes it as easy as possible to get started.

Unsurprisingly, a mere $100 doesn’t create a meaningful competitor to modern commercial offerings. However, significant improvements can be had by scaling up the process. A $1,000 version (detailed here) is far more coherent and capable; able to solve simple math or coding problems and take multiple-choice tests.

[Andrej Karpathy]’s work lends itself well to modification and experimentation, and we’re sure this tool will be no exception. His past work includes a method of training a GPT-2 LLM using only pure C code, and years ago we saw his work on a character-based Recurrent Neural Network (mis)used to generate baroque music by cleverly representing MIDI events as text.

BASICODE: A Bit Like Java, But From The 1980s

Those of us ancient enough to remember the time, or even having grown up during the heyday of the 8-bit home computer, may recall the pain of trying to make your latest creation work on another brand of computer. They all spoke some variant of BASIC, yet were wildly incompatible with each other regardless. BASICODE was a neat solution to this, acting as an early compatibility standard and abstraction layer. It was essentially a standardized BASIC subset with a few extra routines specialized per platform.

But that’s only part of the story. The BASICODE standard program was invented by Dutch radio engineer Hessel de Vries, who worked for the Dutch national radio broadcaster Nederlandse Omroep Stichting (NOS). It was designed to be broadcast over FM radio! The idea of standardization and free national deployment was brilliant and lasted until 1992, when corporate changes and technological advancements ultimately led to its decline.

Continue reading “BASICODE: A Bit Like Java, But From The 1980s”

Some assembly code

Programming Space Game For X86 In Assembly Without An Operating System

In this video our hacker [Inkbox] shows us how to create a computer game that runs directly on computer hardware, without an operating system!

[Inkbox] briefly explains what BIOS is, then covers how UEFI replaces it. He talks about the genesis of UEFI from Intel in the late 90s. After Intel’s implementation of UEFI was made open source it got picked up by the TianoCore community who make tools such as the TianoCore EDK II.

[Inkbox] explains that the UEFI implementation provides boot services and runtime services. Boot services include things such as loading memory management facilities or running other UEFI applications, and runtime services include things like system clock access and system reset. In addition to these services there are many more UEFI protocols that are available.

Continue reading “Programming Space Game For X86 In Assembly Without An Operating System”

Where Is Mathematics Going? Large Language Models And Lean Proof Assistant

If you’re a hacker you may well have a passing interest in math, and if you have an interest in math you might like to hear about the direction of mathematical research. In a talk on this topic [Kevin Buzzard], professor of pure mathematics at Imperial College London, asks the question: Where is Mathematics Going?

It starts by explaining that in 2017 he had a mid-life crisis, of sorts, becoming disillusioned with the way mathematics research was being done, and he started looking to computer science for solutions.

He credits Euclid, as many do, with writing down some axioms and starting mathematics, over 2,000 years ago. From axioms came deductions, and deductions became mathematical facts, and math proceeded in this fashion. This continues to be the way mathematical research is done in mathematical departments around the world. The consequence of this is that mathematics is now incomprehensibly large. Similarly the mathematical proofs themselves are exceedingly large, he gives an example of one proof that is 10,000 pages long and still hasn’t been completely written down after having been announced more than 20 years ago.

The conclusion from this is that mathematics has become so complex that traditional methods of documenting it struggle to cope. He says that a tertiary education in mathematics aims to “get students to the 1940s”, whereas a tertiary education in computer science will expose students to the state of the art.

Continue reading “Where Is Mathematics Going? Large Language Models And Lean Proof Assistant”

LLM Dialogue In Animal Crossing Actually Works Very Well

In the original Animal Crossing from 2001, players are able to interact with a huge cast of quirky characters, all with different interests and personalities. But after you’ve played the game for awhile, the scripted interactions can become a bit monotonous. Seeing an opportunity to improve the experience, [josh] decided to put a Large Language Model (LLM) in charge of these interactions. Now when the player chats with other characters in the game, the dialogue is a lot more engaging, relevant, and sometimes just plain funny.

How does one go about hooking a modern LLM into a 24-year-old game built for an entirely offline console? [josh]’s clever approach required a lot of poking about, and did a good job of leveraging some of the game’s built-in features for a seamless result.

Continue reading “LLM Dialogue In Animal Crossing Actually Works Very Well”

Two hands working a TekaSketch

TekaSketch: Where Etch A Sketch Meets Graph Theory

The Etch A Sketch was never supposed to meet a Raspberry Pi, a camera, or a mathematical algorithm, but here we are. [Tekavou]’s Teka-Cam and TekaSketch are a two-part hack that transforms real photos into quite stunning, line-drawn Etch A Sketch art. Where turning the knobs only results in wobbly doodles, this machine plots out every curve and contour better than your fingertips ever could.

Essentially, this is a software hack mixed with hardware: an RPi Zero W 2, a camera module, Inkplate 6, and rotary encoders. Snap a picture, and the image is conveyed to a Mac Mini M4 Pro, where Python takes over. It’s stripped to black and white, and the software creates a skeleton of all black areas. It identifies corner bridges, and unleashes a modified Chinese Postman Algorithm to stitch everything into one continuous SVG path. That file then drives the encoders, producing a drawing that looks like a human with infinite patience and zero caffeine jitters. Originally, the RPi did all the work, but it was getting too slow so the Mac was brought in.

It’s graph theory turned to art, playful and serious at the same time, and it delivers quite unique pieces. [Tekavou] is planning on improving with video support. A bit of love for his efforts might accellerate his endeavours. Let us know in the comments below!

Continue reading “TekaSketch: Where Etch A Sketch Meets Graph Theory”