Hacker News new | past | comments | ask | show | jobs | submit login
Pen Plotter Programming: The Basics (2017) (medium.com/fogleman)
98 points by Tomte 16 days ago | hide | past | favorite | 53 comments



Hey, it's me! Fun surprise.

I also collaborated with my coworkers during work-sponsored hackathons on some other fun plotting machines. One that could draw on a huge whiteboard with multiple colors and another whose mechanism was based on the Shaper Origin:

https://twitter.com/FogleBird/status/1549798581409824778

https://twitter.com/FogleBird/status/1018296014585978880

Bonus, my favorite tool-path optimization to draw adjacent circles:

https://twitter.com/FogleBird/status/1204253487703478274


Great stuff! I also have an axidraw that I've been using for christmas cards and the like. I've been getting more advanced each year and I'm resolved to roll up my sleeves and start using your libs for total control. SVG generation is neat, but has a layer of abstraction :)


I’m a huge fan of your RibbonDiagrams bot, so much so that it inspired me to write my own one (using a different protein representation, of course). Thank you!


Nice! Link? I'd like to see what you made.



I love that style from David Goodsell! You did a great job in mimicking it programmatically. Was that tough to get right?


I actually used a slightly modified version of his Illustrate program (https://github.com/ccsb-scripps/Illustrate) for rendering. The toughest part was getting the right pose; the bot tried to pick an optimal one, but in some cases I still had to check the render and adjust manually.


One of my favorite artists using a plotter is Licia He - using python to control brush to apply watercolor.

- https://twitter.com/Licia_He

- https://www.instagram.com/blahblahpaperblah/

- https://www.eyesofpanda.com/

She has 20+ Q&A about how she does it: https://www.eyesofpanda.com/project/plotter_painting_q_a/ and she intends to open source her code someday too I think


I just got an axidraw and I’ve been having a lot of fun with it. Because it can just use SVGs as is, I could plot a “still”[0] from one of my existing generative pieces[1] minutes after bringing it home.

What surprised me is how good some plots look and how “cheap” others come out. I’ve made a few that were fun to watch but the output isn’t nicer than a laser printer.

My current thinking is the more “exotic” the pen and paper is, the better.

[0] https://imgur.com/gallery/5t4lWRT

[1] https://david.app/projects/geo-clock


Yep, I've been experimenting with metallic gel pens on black paper, the result is pretty nice:

https://imgur.com/a/rHHo5c9

The Uni-Ball Signo metallic gel pens have performed pretty well, but can drip on the corner when the piece is done and the arm returns to origin, so you'll want to pay attention to it:

https://www.amazon.com/dp/B01N7SC6SR


You need to run your SVGs through some path optimization! Your Axidraw is doing a lot of unnecessary traveling between lines. Check here: https://github.com/beardicus/awesome-plotters#vector-utiliti...


I know, I just didn't bother to do it for that piece since I actually wanted to film the jumping around of the arm as a demo for friends. I do it for other pieces I actually want to optimize using vpype.


Sakura Gelly Roll White pen is great as well.


Love it, going to try them out. What paper do you use?


Here you go: https://a.co/d/3zuBvyW

Looks like its unavailable for me right now, but there are others you can try.

For white paper, this has worked very well for me: https://a.co/d/9qoDwML


Thanks! Was surprisingly hard to find something that looked good on Amazon. I'm thinking it has to be matte for the full effect. Probably worth checking out an art supply store.


Probably. Its definitely worth investing in good paper and pens for this hobby. There will be some experimentation tax built in too, I've bought pens that ended up being garbage but there's no way to know that until you try.


> My current thinking is the more “exotic” the pen and paper is, the better.

Oh? What makes for 'exotic' materials - like the weight of the paper, cold-vs-hot pressed, and so on?


Right, the less it looks like printer ink and printer paper.


same conclusions from me, lean into what makes the tool different than a regular printer, lean into it's imperfection ( improper inkflow, misregistration if using more than one color/pass, ink bleed, how it reacts to a semi-rough surface ). It is also a very performative tool, I've seen some artists using them in that way as well. Using both cartesian and polar style hanging plotters on gallery wall or glass window. Also hanging polar style plotters as a very cost effective way to create very large works.


Can really recommend the Silhouette Cameo line of vinyl plotters (silhouette sells a pen adapter) for anyone who wants to buy a currently in production plotter that's much cheaper than the axidraw. I can't compare the two on performance as I haven't used an axidraw but my experience with the Silhouette Cameo plus has been positive


Plus, once it's done, you can do all of the other fun things that a Cricut-style tool can do.


hmm, $100 cheaper than the cricut maker 3 which i mentioned elsewhere


Yeah they also come up second hand pretty often. The supplied software works but is a bit of a chore to use However there's a python tool for sending it SVGs that works really well.


Nice intro!

Readers may also appreciate my post “Pen Plotter Art & Algorithms” here:

https://mattdesl.svbtle.com/pen-plotter-1


This post got me to purchase an Axidraw back in 2017 and I had a ton of fun using it to plot neural data I collected during my PhD, as well as messing around with generative art. So much more worthwhile than I expected for an impulse purchase.


I'm just gunna throw this out there: The replacement for the axidraw 8.5x11 thing is $699 - a fully loaded cricut maker 3 is $429, and can, in theory, do actual plotting on sheets longer than 11" - as well as being a vinyl cutting machine. I am unsure what models of cricut can take the pen holder, but it is something to consider, especially since i am sure there are alternatives to the ecosystem that are more open or support different software.

Also the ender series of 3d printers can make use of a pen attachment as well, but those are 8x8 inches. There are larger 3d printers, and the software or whatever to plot with the ender 3 was open source enough. My ender3 was <$200


my main concern with the cricut and silhouette machines is i probably don't want to use the manufacturer's shitted up software, and the open source replacements are hacks that might be janky and could probably be squashed at any time (i'm not actually sure the status of replacement software for each of these machines, because i always get them confused and haven't paid much attention)

generally, though, i do enjoy taking advantage of scaled-up (cheap) commercial products. but i also value supporting an open, small business (EMSL, and now Bantam Tools) that is active in the communities using its products.


The open source tools for the Silhouette work pretty well in my experience, there's a really well documented python library. You're right about the supplied software though, it works but it's unpleasant to use.


bre had such a good run with makerbot .. what could possibly go wrong?...


somewhat fair. i'm not in the market for commercial plotters so i guess i can avoid that purchase decision. regardless, i'm happy to see them running meetups and stuff for plotter folks, and i'm interested in where they take the product/software over the next few years.


I was initially pretty unhappy with the price bump when the Axidraw was re-released by Bantam Tools (who purchased the Axidraw IP from Evil Mad Scientist). It went up $150! However, if you use Archive.org to look at the old prices on EMS's website, it's actually just the price of the Axidraw + the brushless servo upgrade kit (which now comes standard on it); I think they may have also added an auto-home improvement, and possibly other tweaks.

You're really paying for the dedicated use-case design (the pen carriage precision on the Axidraw is excellent) and the active software support both from the company and the community.


Sure - use whatever machine you prefer. I found the axidraw hardware and software to be good value back then, though it looks like the prices are higher now and IP was purchased by Bantam tools?


I made a basic plotter a while ago. You might find it slightly interesting https://www.jake-reich.co.uk/plotter


I like the way it comes together wonderfully on such a beautiful carpet.


That's interesting as a programming exercise, but HP's plotters all had a built-in language called HP-GL. And there's a GPL'ed tool that will emit HP-GL. I just can't recall what it's called. Seems like it was built in to some normal printing tool. HP Laserjet printers also supported HP-GL, so that was a nice way to get your plots without having to buy a more expensive dedicated plotter.


> That's interesting as a programming exercise, but

why is this a "but"? does the existence of HPGL negate the work being presented here somehow? modern plotters seem to have less capable control languages such as whatever the axidraw does, or G-code for most of the open source controllers. I guess folks assume you'll just be programmatically generating or converting to the output format anyways.

inkscape can output HPGL directly. there's also chiplotle which is a python library. i've tried to gather up all the other HPGL-related software i could find here: https://github.com/beardicus/awesome-plotters#hpgl


Ghostscript can target HPGL.


Hah, I was not expecting to open up that page to see an image of a ribbon diagram of alpha-glucosidase.

Also, links to 'Makeblock XY Plotter' seem to no longer work as it has been discontinued? (Don't recommend going to their site - it has an obnoxious number of 'sign up' popups, sadly)


If you like, you can purchase plotter ribbon diagrams from him: https://www.michaelfogleman.com/plotter/


Interesting. Looking at those diagrams I'm trying hard not to evaluate them with the eye of a protein structure expert (which I used to be, not anymore!).

He says "I'm no biologist", which is of course no issue - anyone should make whatever images they want, but I wonder if the pose and detail that he includes are what looks good to him, rather than what is 'most' relevant.

Either way, they do look good like this :)


I’m not sure how is he orienting the camera in his library (https://github.com/fogleman/ribbon), but the usual approach is to maximize what is shown on the X and Y axes by e.g. aligning principal components (as PyMOL does).


Looking at this function:

https://github.com/fogleman/ribbon/blob/master/ribbon/camera...

it's getting the carbonyls (C and O atoms) and then trying to pick a view vector based on maximising some scores ... of some kind. Like the aspect ratio and number of visible points? Not sure.


Definitely didn't expect people on Hacker News to scrutinize this code when I wrote it 7 years ago, hah!

Curious to hear how a "protein structure expert" would prefer to pose the proteins?

I did sell some of these drawings. Two customers stand out in my memory. One wanted drawings as a gift to his father who had spent most of his career working with some specific protein. The other was someone who had a genetic defect in the family and wanted a drawing of the protein responsible for it.


Ok, I don't mean at all to suggest that there is only one 'right' pose or representation. Different orientations and levels of detail would emphasise different things.

For example, it's quite nice that the haemoglobin one is down the central axis of the tetramer, and shows all the haem groups. I would expect almost any image that wanted to show the most parts of that structure to use a similar pose.

I had not realised when I asked the question that the poses were picked in code, which is similar to how PDBsum does it (pretty sure Roman Laskowski told me it did, but I would have to check). Something like maximising the number of atoms in the plane of the screen.

Of course, when it comes to YFP (your favourite protein), individual researchers are likely going to focus on different parts. My interest was always in the topology, so I would want to see all the helices and sheets, but someone else might want to see the active site front and center.

Incidentally, I've heard the term 'molecular porn' used for fancy/shiny looking diagrams - not sure if it applies to these as well :)


He’s using the alpha carbons (CA) adjacent to the carbonyl groups as well as the carbonyl oxygens (O), approximating the peptide plane. In addition he incorporates heteroatoms, so the scoring function takes ligands into account, if present.


If you like this you might also like Nick Fitzgerald's 2019 RustConf talk: Flatulence, Crystals, and Happy Little Accidents.

https://youtu.be/Ho3xr4b60Zg


thanks for this link. i guess i totally missed this five years ago when it was published... fun talk.


Part of me wishes that you could use good 'ol HPGL with these modern plotters, just for the fun of using vintage software. Plot the Joy Division hidden-line 3D graph, or the classic Shuttle AutoCAD example.


If I had a plotter, I'd try a few things with plotter.vision.

It converts a 3D STL file to SVG with "hidden wireframe removal".

There is also an "anaglyph" mode to output red/blue lines to be seen in 3D with red/blue glasses.

The online converter: https://plotter.vision/

More info from Trammell Hudson, the author: https://trmm.net/Plotter-Vision/


I gave up trying to make Axidraw and all that slightly esoteric stuff working and just switched to G-code. (There was something totally wrong in the way snapped Inkscape used Python.)

Also because I also have laser plotter and 3D-printer running on G-code.

Google could not find any G-code interpreter, which is also slightly weird?

https://github.com/timonoko/EBB-Plotteri


Pen plotters are great fun. I set mine up a while ago - a slightly cheaper setup than most https://shahinrostami.com/articles/my-pen-plotter-setup/


Related albeit tiny:

Pen Plotter Programming: The Basics - https://news.ycombinator.com/item?id=16191811 - Jan 2018 (1 comment)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: