HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
WillAdams
gcodepreview
TeX2022–2026
WillAdams / gcodepreview

gcodepreview

OpenPythonSCAD library for moving a tool in lines and arcs so as to model how a part would be cut using G-code or described as a DXF.

2Distinct people
96Mentions
0Explicit recommenders
86GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

OpenPythonSCAD library for moving a tool in lines and arcs so as to model how a part would be cut using G-code or described as a DXF.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 4:00:59 PM UTC.

Is there a 'right amount' of AI? direct repository linkDebated

Participants debate whether AI-generated code constitutes meaningful creativity or merely derivative plagiarism, with some arguing it crowds out human artistry while others view it as a natural evolution of tool-assisted development. The discussion also highlights a sharp divide between those who see AI ethics as comparable to other industrial harms and those who emphasize its unique capacity to disrupt creative labor.

36 readable replies · Supporting reply 1 · Supporting reply 2 · Supporting reply 3 · Supporting reply 4

Mentions over time

HN mentions by year96 dated mentions

Observed mentions: 2022-08-04 14:51:26 UTC to 2026-10-26 10:41:34 UTC.

0102030402022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 40 mentions; 0 submissions, 40 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 28 mentions; 0 submissions, 28 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 22 mentions; 0 submissions, 22 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC303
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC303
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC40040
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC28028
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC22022

What Hacker News says

28 sources
I've been trying to model joints for woodworking, and in traditional tools, the shapes I wish to arrive at verge on nightmarish, while I was able to knock them out in OpenSCAD in pretty short order --- except that when I sent a 1" x 2" x 1" test joint to a CAM program, it took some 18 minutes and generated a ~140MB G-code file, hence my working on: https://github.com/WillAdams/gcodepreview
In OpenSCAD is kinda neat
There are lot of texts which were left out of this post --- I've been trying to collect literate programs published as books here: https://www.goodreads.com/review/list/21394355-william-adams... Not sure where the author got the contention that there are only a few tools for literate programming --- it's a straight-forward enough task that many programmers do this --- heck, even I managed to (w/ a bit of help on tex.stackexchange): https://github.com/WillAdams/gcodepreview/blob/main/literati... --- if it were more complex, and wasn't so implementation-specific (filenames need to be specified in multiple places), I'd write it up as a Literate Program and put it up on CTAN as a package. One classic bit of advice for writing is, ‘It is perfectly okay to write garbage as long as you edit brilliantly.’ --- the great thing about a Literate Prog
Read the rest
ram is that it makes the act of editing far simpler, which has made feasible every program I've ever written which got past the 1K lines mark --- including an AppleScript for InDesign which Olav Martin Kvern, then the "Scripting Evangelist" for Adobe Systems declared to be impossible (my boss had promised a system for creating a four-level deep index from XML embedded in the text of pages in an InDesign document, while OMK averred that it was impossible to create an index entry for more than the main level of the index --- one has to have code which tracks the existence of an entry at each level of the index and where it does not exist, starting at the top-level, insert it, then work down and add the sub-index-entry to the index-entry it is beneath).
In What is “literate programming”? (2024)
Anyone using this for Literate Programming? A quick search found: https://github.com/litProgTypst/ (which I'm mystified by) and https://github.com/denkspuren/typst_programming (which hasn't been updated in two years) Not seeing anything specific at: https://typst.app/docs/reference/scripting I need to re-write my current project https://github.com/WillAdams/gcodepreview again --- maybe this would be a good fit? The unique feature I am taking advantage of is writing out code blocks in separate files, then concatenating them using .lua so there's no differentiation betwixt tangle/weave, both happen, and since it's Python, no need for a compile step either.
In Typst 0.14
I read SICP a long while back, so the video lecture was a useful review. For the balance, I managed to get a working version of my project pretty quickly when the Python version of OpenSCAD first became available: https://pythonscad.org/ but I quickly hit a plateau and was having trouble adding features and improving it, so I began researching and trying to learn what I needed for: https://github.com/WillAdams/gcodepreview Been collecting lists of the books I've been using at: https://www.goodreads.com/review/list/21394355-william-adams... https://www.goodreads.com/review/list/21394355-william-adams... I will note that my preference (as a person coming at this from (La)TeX is for Literate Programming: http://literateprogramming.com/ so have also put together: https://www.goodreads.com/review/list/21394355-william-adams...
In A 37-year-old wanting to learn computer science
My current project for a while was in a state where it was necessary to keep code in 3 separate files: - gcodepreview.py (gcpy) --- the Python functions and variables - pygcodepreview.scad (pyscad) --- the Python functions wrapped in OpenSCAD - gcodepreview.scad (gcpscad) --- OpenSCAD modules and variables as explained in: https://github.com/WillAdams/gcodepreview/blob/main/gcodepre... and it worked quite well (far better than the tiled set of three text editor windows which I was using at first) and I find the ability to sequence the code for the separate files in a single master file very helpful.
In Literate programming tool for any language
This is why I use LuaLaTeX for this: https://github.com/WillAdams/gcodepreview/blob/main/literati... which allows me to have an ordinary .tex file: https://github.com/WillAdams/gcodepreview/blob/main/gcodepre... which outputs multiple .py and .scad files and generates a .pdf with nice listings-based code blocks, ToC, index, hyperlinks, &c.: https://github.com/WillAdams/gcodepreview/blob/main/gcodepre... The notable downsides are that the .sty and .tex files have to be customized for the filenames which one can output, and I haven't been able to get auto-line numbering working between code blocks, so one has to manually manage the counters.
In Literate programming tool for any language
For me, it's Bézier curves --- Freya Holmér has a wonderful video on them: https://www.youtube.com/watch?v=jvPPXbo87ds and I've been trying to read through _METAFONT: The Program_ and https://pomax.github.io/bezierinfo/ and I keep wondering if I shouldn't just try scripting Inkscape.... I want to do a couple of different things, and not sure if they all fit in one project or no: - implement a single line font in my current project: https://github.com/WillAdams/gcodepreview - implement a way to convert arbitrary curves into smooth arcs (for DXFs or G2/G3 arcs for G-code) - work up an interactive version of METAFONT/METAPOST which allows both programming and drawing
In Ask HN: What cool skill or project interests you, but feels out of reach?
I've been trying to make this sort of thing more tractable by modeling the movement of tooling in a CNC machine so as to make 3D parts using Python in OpenSCAD (https://pythonscad.org/): https://github.com/WillAdams/gcodepreview That said, the only 3D CAD tool where I was able to follow the tutorial (after a fashion) was Dune 3D: https://dune3d.org/ --- if you haven't tried that, I'd highly recommend it. The usual way to get started w/ molding is to make a vacuum molding machine: https://makezine.com/projects/diy-injection-molding (I remember one such plan page where the first project was to make a handle to make the machine more comfortable to use...)
In Ask HN: What cool skill or project interests you, but feels out of reach?
Yeah, that sums things up well --- the problem of course is what happens when one works on a project which blurs boundaries. I had to drop into BlockSCAD to rough out an arc algorithm for my current project: https://github.com/WillAdams/gcodepreview (see the subsubsection "Arcs for toolpaths and DXFs") Jupyter Notebooks come close to allowing a seamless blending of text and algorithm, but they are sorely missing on the graphic design and vector graphics front --- which now that I write that, makes me realize that that is the big thing which I miss when trying to use them. Makes me wish for JuMP, a Jupyter Notebook which incorporates METAPOST --- if it also had an interactive drawing mode, it would be perfect.... (for my needs).
In Bill Atkinson has died
I've actually been using OpenPythonSCAD for this sort of thing: https://pythonscad.org/ paired with: https://www.blockscad3d.com/editor/ it lets me rough out an algorithm (see the section on arcs in: https://github.com/WillAdams/gcodepreview/blob/main/gcodepre... ) interactively, seeing the result on-screen --- then once I have the rough concept, I can re-write it in Python, retaining this interactivity. EDIT: next step is to work up a batch file which has me running OpenSCAD on a series of files to output .png and .svg files to read them back in and place the output at the appropriate places in the document.
In Simple programming language with offline usable browser IDE

Showing the 15 most recent of 28 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.