Live data from Hacker News

3D-printed book turns its own G-code into raised lettering

designboom.com

11–20 of 34 posts

Re: 3D-printed book turns its own G-code into raised lettering

#11
post #2

> Manual contains only 2.5 percent of its own G-code in its first version. That low figure is part of the point. Current FFF 3D printing resolution and text scale place limits on how much code can fit onto the object while also describing the volume of the object itself. A fully self-contained version would enter an endless loop, since every printed mark would add more data to be described. The fact that quines exist…

"This prompt, when fed to a sufficiently capable LLM, will generate the G-code to produce a 3D printed model of a book containing this quote, verbatim, in raised letters."

Re: 3D-printed book turns its own G-code into raised lettering

#13
post #10

Earlier quoted context omitted.

There's probably a way to make an xz file that decompresses to g-code for itself. But plain g-code is not powerful enough because it's just a list of movements due the tool head to perform - no computation.

`M98` allows for essentially function calls (nested or not.) If you had a part of a machine that could save state (say.. turning on a coolant pump..) I wonder how much more of a turing machine you could wrastle into it. (or you could just cheat and use one of the hundreds of gcode variants that have computational stuff stapled into them like the Fanuc equivalents, but that's sorta dishonest for the exercise)

_If_ one is using a firmware which supports that.

Grbl, which many of the 3D printer firmwares are based on, does not (and no variables, or loops, or branching).

Re: 3D-printed book turns its own G-code into raised lettering

#15
post #8

I'm sure the idea here was a physical quine, although since it only contains 2.5% of its own G-code it's not really a quine, any more than a "Hello World" program is a quine since the string "Hello World" is in the program text. It would be trivial to generate something like this depending on which part of the G-code you pick.

Many G-code dialects contain subprogram calls, loops, and conditionals that seem like they'd permit a physical quine. The standard RepRap firmware breaks the rules by taking input:

https://reprap.org/wiki/G-code#M98:_Call_Macro.2FSubprogram

but Fanuc and other dialects allow M97 to call a subroutine chained to the end of a program.

Re: 3D-printed book turns its own G-code into raised lettering

#16
post #10

Earlier quoted context omitted.

`M98` allows for essentially function calls (nested or not.) If you had a part of a machine that could save state (say.. turning on a coolant pump..) I wonder how much more of a turing machine you could wrastle into it. (or you could just cheat and use one of the hundreds of gcode variants that have computational stuff stapled into them like the Fanuc equivalents, but that's sorta dishonest for the exercise)

_If_ one is using a firmware which supports that. Grbl, which many of the 3D printer firmwares are based on, does not (and no variables, or loops, or branching).

And weirdly, neither does Klipper, despite having all the resources in the world to do so. Just not a priority since slicers don't produce code like that, and 99.999% of Klipper's job is to eat whatever a slicer sends it.

So suppose I attached an extruder to a Haas mill or something...

Re: 3D-printed book turns its own G-code into raised lettering

#17

Is anyone else confused by thier cookie consent banner? The switches start out gray and become black when toggled. which position means consent? It feels intentionally misleading.

> The switches start out gray and become black when toggled.

Rant: That type of slider-switch is an inferior usurper of the classic tickbox, that rode in on a wave of touch-screen-ification. Oh, it can be done well, sometimes, but it's just far-too-easy to do it badly.

In this case (useless colors, no intrinsic text labels, etc.) I think the remaining rule/clue is "Move the dot-nub towards whatever you want." So moving right is indicating you like the "We track you" text, while moving left indicates some kind of disagreement.

_____________________

> It feels intentionally misleading.

The "Accept All" button is worse:

1. It abuses UI conventions of position and color that belong to a "Proceed with what is shown" button.

2. Likewise, the text-label is ambiguous: It could mean "Accept All [of the choices which I've made and can see]"... But instead it means "Reject whatever is on-screen, and replace all choices with 'accept' cookies."

3. When it does erase/reset all choices made, it does so in a secretive way by also submitting and vanishing the dialog. The user never has any opportunity to realize that the machine implicitly flipped all choices to the right-most position.

Any one of these might be an innocent mistake, but all three sins together are a dark-pattern.

Re: 3D-printed book turns its own G-code into raised lettering

#18
post #8

I'm sure the idea here was a physical quine, although since it only contains 2.5% of its own G-code it's not really a quine, any more than a "Hello World" program is a quine since the string "Hello World" is in the program text. It would be trivial to generate something like this depending on which part of the G-code you pick.

Many G-code dialects contain subprogram calls, loops, and conditionals that seem like they'd permit a physical quine. The standard RepRap firmware breaks the rules by taking input: https://reprap.org/wiki/G-code#M98:_Call_Macro.2FSubprogram but Fanuc and other dialects allow M97 to call a subroutine chained to the end of a program.

G-code is like assembly language for CNC. It’s human readable, you can write it by hand if necessary, most machines will compile it internally to machine instructions, and there are a million different flavors with incompatible macros, etc. The flavor I’m most familiar with is Klipper’s interpreter, which will let you write macros, but that would technically be cheating since you could just stuff an entire program into a macro.

Re: 3D-printed book turns its own G-code into raised lettering

#20

Cool idea for printing braille. I bet I could vibe code a program to convert .epub files to braille then to printable copies.

I've also been idly contemplating 3D printing braille. Somewhat annoying that that's the cheap+easy option, but if it works...
Post reply on HN