3D Printing - Slicing 3D objects

Learn about the complete 3D printing slicing process, starting with how 3D models are created using CAD software like OpenSCAD and converted to STL files. Dive into how STL files represent 3D objects as triangular meshes and the algorithms used by slicing software to cut these models into printable layers. We look at the mathematical process of determining triangle-plane intersections at each layer height, organizing line segments into continuous polygons, and finally generating G-code instructions for 3D printers. We conclude with a practical examples showing how filament extrusion amounts are calculated based on nozzle diameter, layer height, and travel distance. Continue reading

3D Printing - Slicing 3D objects

Learn about the complete 3D printing slicing process, starting with how 3D models are created using CAD software like OpenSCAD and converted to STL files. Dive into how STL files represent 3D objects as triangular meshes and the algorithms used by slicing software to cut these models into printable layers. We look at the mathematical process of determining triangle-plane intersections at each layer height, organizing line segments into continuous polygons, and finally generating G-code instructions for 3D printers. We conclude with a practical examples showing how filament extrusion amounts are calculated based on nozzle diameter, layer height, and travel distance. Continue reading

Deconstructing a flashlight

Reverse engineer an Astrolux S1 flashlight to understand how modern flashlights control LED brightness through current regulation and PWM techniques. Learn about the key flashlight components with particular focus on the A17DD-L FET+1 hybrid driver that combines direct drive and linear regulation for optimal efficiency. Dive into advanced topics like voltage monitoring for battery protection, off-time capacitor circuits for mode switching detection. Comes with complete schematics, custom firmware source code and practical instructions for reprogramming the driver's ATTiny13A microcontroller using AVR tools. Continue reading

Marlin 3D printer firmware: Delta inverse kinematics

Unlike traditional Cartesian printers where each axis moves independently, delta printers must coordinate all three tower carriages simultaneously to achieve any XYZ movement of the print head. The post details the coordinate system setup, mathematical formulas for calculating tower positions, and the specific equations used to calculate the Z-height of each carriage to reach a target position. Finally, we see how these calculations are implemented in the Marlin planner to control stepper motor movements. Continue reading

Detecting similar and identical images using perseptual hashes

Explore methods for detecting duplicate and similar images in large photo collections using several perceptual hashing algorithms, including color histograms, average hashing, pHash, and wavelet decomposition for identifying images that are visually similar but differ in exposure, scaling, or compression. We look at the computational challenges of comparing near matches of hashes and show how BK-trees (Burkhard-Keller trees) as a metric space data structure can efficiently find near-matches within hamming distance thresholds. We finally implement a photo organizer tool that uses EXIF data and pHash signatures to automatically detect and mark duplicate images during photo management workflows. Continue reading

Dissecting the 82559 Ethernet controller - From bits to waves

Dissects the Intel 82559 Ethernet controller and its eepro100 Linux driver to understand how Ethernet communication works from software to physical signals. Dive into the hardware architecture and the complete data flow from application-level socket writes through kernel networking layers to hardware transmission, including frame generation, signal encoding (NRZI/MLT-3), and physical layer transmission and reception over Ethernet cables. Continue reading

Dissecting Lucene - The Index format

In this post, we learn how Lucene transforms documents into searchable terms and maintains inverted indexes that map terms to their containing documents and positions. Understand Apache Lucene 3.4's inverted index file format and how the search engine stores and organizes text data for efficient retrieval. We break down the various file types including field information (.fnm), stored fields (.fdx/.fdt), term dictionaries (.tis/.tii), term frequencies (.frq), and position data (.prx), detailing their specific roles in the index structure. The analysis covers optimization techniques like delta encoding for document IDs and term frequencies, skip lists for faster navigation, and prefix compression for term storage. Continue reading

How big of a haystack do you need to hide?

Explore information theory concepts to calculate how much data is needed to uniquely identify a person from the global population. The analysis demonstrates how each personal fact (gender, birthday, ZIP code) reduces the "entropy" of someone's identity by measurable amounts. Common facts like gender provide about 1 bit of information while specific details like ZIP codes can provide 18-24 bits. Finally, we show that approximately 33 bits of information are required to uniquely identify someone from the world's 6.625 billion people as of 2007, showing that combinations of just a few personal attributes like birthday, ZIP code, and gender often provide enough entropy for unique identification. Continue reading