<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn" -->

---
title: I Tried Making a Pen Plotter to Draw Maps of the Moon
description: A hobbyist builds a procedural moon terrain visualization using height maps, shaders, and marching squares for contour generation, then documents the hardware...
canonical: https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Tried Making a Pen Plotter to Draw Maps of the Moon | daily.dev
og:description: A hobbyist builds a procedural moon terrain visualization using height maps, shaders, and marching squares for contour generation, then documents the hardware...
og:url: https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn
og:image: https://api.daily.dev/og/posts/wpodnTXDn.png
og:image:alt: I Tried Making a Pen Plotter to Draw Maps of the Moon
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Tried Making a Pen Plotter to Draw Maps of the Moon

**[Sebastian Lague](https://daily.dev/sources/sebastianlague)** · 30 min read · 3 upvotes · 0 comments

## Summary

A hobbyist builds a procedural moon terrain visualization using height maps, shaders, and marching squares for contour generation, then documents the hardware journey of building a DIY pen plotter from scratch (stepper motors, belts, servos, 3D-printed parts) to physically plot moon, Mars, and Earth terrain maps on paper, including numerous mechanical failures and iterative fixes along the way.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=qyNWDzO6kKQ>

## Questions this post answers

### How does marching squares work for generating contour lines from a height map?

Marching squares processes a height map block by block, checking the values at each block's four corners against a target contour height to determine how the surface slices through that cell. There are 16 possible corner configurations; ambiguous cases, like deciding between a valley or ridge orientation, can be resolved using the averaged center value of the block.

_Generative artists piecing together terrain visualization techniques can find similar builds on daily.dev._

### How does a stepper motor achieve precise rotation using electromagnets?

A stepper motor uses eight electromagnets arranged in two switchable groups around a rotatable permanent magnet with mismatched tooth counts (50 teeth on the rotor versus 48 on the stator). Activating one electromagnet group aligns opposite poles for a stable position; switching to the other group creates a tooth mismatch that forces a small rotation, and reversing current polarity between groups repeatedly produces continuous, precise stepped movement.

_Makers debugging motor control logic for hobby robotics projects often compare notes through daily.dev._

### Why does a plotter pen leave smudges when lifting off the page?

Smudging happens when the pen-lifting mechanism doesn't fully clear the vertical component needed to separate the nib from the paper cleanly, often due to limited space for offsetting the rotation axis or an unstable sliding pen holder. The fix involved redesigning the holder to slide vertically along metal rods via a servo-driven cog, which produced cleaner, closed loops without smudging.

_Builders troubleshooting mechanical plotter or CNC pen-lift issues can track similar fixes on daily.dev._

## Similar posts on daily.dev

- [The Big Moon Plot](https://daily.dev/posts/the-big-moon-plot-n2c73sxvq) · Hackaday · 0 upvotes · 0 comments
- [Put The Moon On Your Desk](https://daily.dev/posts/put-the-moon-on-your-desk-jeovbteli) · Hackaday · 1 upvotes · 0 comments
- [Making holograms with a pen plotter](https://daily.dev/posts/making-holograms-with-a-pen-plotter-wqzsdfqxw) · Hacker News · 1 upvotes · 0 comments
- [Check Out This Surreal Papercraft-Style World Made in Blender](https://daily.dev/posts/check-out-this-surreal-papercraft-style-world-made-in-blender-6dslyiihq) · 80 LEVEL · 0 upvotes · 0 comments
- [You, too, can build this ESP32 3D-printed solar system model, and yes, it spins](https://daily.dev/posts/you-too-can-build-this-esp32-3d-printed-solar-system-model-and-yes-it-spins-po3uvw5aw) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#graphics-programming](https://daily.dev/tags/graphics-programming)

[View this post on daily.dev](https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Tried Making a Pen Plotter to Draw Maps of the Moon","url":"https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn"},"datePublished":"2026-10-01T10:35:27.240Z","dateModified":"2026-10-01T10:35:47.021Z","description":"A hobbyist builds a procedural moon terrain visualization using height maps, shaders, and marching squares for contour generation, then documents the hardware...","image":"https://i.ytimg.com/vi/qyNWDzO6kKQ/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/qyNWDzO6kKQ/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Sebastian Lague","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sebastian Lague","logo":"https://media.daily.dev/image/upload/s--rxa5CpKA--/f_auto/v1727446540/logos/sebastianlague","url":"https://daily.dev/sources/sebastianlague"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"game-development,graphics-programming","timeRequired":"PT30M","video":{"@type":"VideoObject","name":"I Tried Making a Pen Plotter to Draw Maps of the Moon","description":"A hobbyist builds a procedural moon terrain visualization using height maps, shaders, and marching squares for contour generation, then documents the hardware...","thumbnailUrl":"https://i.ytimg.com/vi/qyNWDzO6kKQ/sddefault.jpg","uploadDate":"2026-10-01T10:35:27.240Z","duration":"PT30M","url":"https://api.daily.dev/r/wpodnTXDn","embedUrl":"https://www.youtube.com/embed/qyNWDzO6kKQ"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sebastian Lague","item":"https://daily.dev/sources/sebastianlague"},{"@type":"ListItem","position":3,"name":"I Tried Making a Pen Plotter to Draw Maps of the Moon"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-tried-making-a-pen-plotter-to-draw-maps-of-the-moon-wpodntxdn#faq","mainEntity":[{"@type":"Question","name":"How does marching squares work for generating contour lines from a height map?","acceptedAnswer":{"@type":"Answer","text":"Marching squares processes a height map block by block, checking the values at each block's four corners against a target contour height to determine how the surface slices through that cell. There are 16 possible corner configurations; ambiguous cases, like deciding between a valley or ridge orientation, can be resolved using the averaged center value of the block. Generative artists piecing together terrain visualization techniques can find similar builds on daily.dev."}},{"@type":"Question","name":"How does a stepper motor achieve precise rotation using electromagnets?","acceptedAnswer":{"@type":"Answer","text":"A stepper motor uses eight electromagnets arranged in two switchable groups around a rotatable permanent magnet with mismatched tooth counts (50 teeth on the rotor versus 48 on the stator). Activating one electromagnet group aligns opposite poles for a stable position; switching to the other group creates a tooth mismatch that forces a small rotation, and reversing current polarity between groups repeatedly produces continuous, precise stepped movement. Makers debugging motor control logic for hobby robotics projects often compare notes through daily.dev."}},{"@type":"Question","name":"Why does a plotter pen leave smudges when lifting off the page?","acceptedAnswer":{"@type":"Answer","text":"Smudging happens when the pen-lifting mechanism doesn't fully clear the vertical component needed to separate the nib from the paper cleanly, often due to limited space for offsetting the rotation axis or an unstable sliding pen holder. The fix involved redesigning the holder to slide vertically along metal rods via a servo-driven cog, which produced cleaner, closed loops without smudging. Builders troubleshooting mechanical plotter or CNC pen-lift issues can track similar fixes on daily.dev."}}]}
```

