For more than one month now, I’ve been working on a daily basis on Printrun, one of the most used 3D printer host softwares (the thing that sends G-Code to your printer and lets your monitor how things are going). I had already given it a bit of love in the past, doing some internationalization and translation work, splitting the GUI code into a more manageable class-based patchwork or reworked the serial connection bits, but this batch of changes has much more influence on the user side.
Just to boast a little bit, let me quote Kliment, of RepRap/Sprinter/4pi/Printrun fame, who created and maintains Printrun:
13:52:12 < Kliment> On the sixth day, Kliment created the pronterface and the pronsole, and saw that it was…pretty crap. Then iXce came and helped out.
So, here are the main changes:
Cleanup of G-Code parsing
I initially came back to hacking Printrun because I thought loading G-code files was really too slow, and I quickly figured out that it was mostly due to the fact that we were parsing the G-code several times (there were at least 6 different G-code parsers in the code, and loaded G-code was parsed at least three times immediately upon loading). By rewriting and merging all those parsers, I was able to reduce the startup plus file loading plus visualization preparation time from about 13 seconds to 4.5 seconds on average, using a 3.8MB G-code file of about 140000 lines, while the new parser is also doing more things than the old ones.
Improvement of the remaining print time estimation
The previous remaining print time estimation was simply doing a cross-multiplication between elapsed time, number of sent G-code lines and number of remaining G-code lines, which happened to be very wrong in many cases: the early estimations were completely biased by the fact that we usually print the first few layers at a much slower speed than the other ones, and average G-code time means pretty much nothing (a long line can be 1 single G-code, while a tiny circle can be 50, while printing the line can take 20 seconds and the tiny circle less than 2, so you can have some G-codes which take 500 more time than some others). Thanks to the fact that we now have a complete understanding of the G-code (or actually just because we store more meta-information), we can now compute a much smarter estimate, based on the estimated total duration (the one you see after loading the file) computed on a per-layer basis, which we correct by incorporating a bias computed between this estimation and the actual print time for the elapsed layers. This way at any time the ETA should be within 10% of the actual ETA (unless you have a very, very weird machine), and should get closer and closer over time.
Optimization of the 2D print visualization
The 2D print visualization was really slow, and was even known for slowing down prints because screen refreshes were taking too much time. The drawing code was indeed redrawing every single line on each refresh, which would happen once for each sent G-code. We now buffer drawings as much as possible: complete redraws only occur when changing layers or resizing the canvas, every other refresh is done by updating a buffered bitmap with the newly added lines and drawing it to the screen. Visually, not much has changed except that the print bed extents should appear in a cleaner way (the yellowish background color does not leak anymore), that the grid should correctly start in the bottom left corner, and that thanks to other interface changes the resizing behavior should be much nicer.

The optimized 2D viewer, with proper resizing behavior, correct grid and different colors for background and build area
Addition of a 3D viewer
Even better than optimizing the 2D viewer, we added a proper and very fast 3D viewer, based on tatlin, a standalone G-code and STL viewer originally built on GtkGLExt and PyOpenGL, which we ported to Pyglet so as not to add another dependency, and adapted it to use our already parsed G-code. As it uses the GPU to do most of the drawing (we store the model to display in GPU memory if possible, so that the CPU only has to tell “print from this vertex to this vertex with this color or GPU-stored color array”), it’s super light for the CPU, and as it’s done in 3D we can zoom (and zoom to point of interest), pan and rotate in 3D almost for free.
Addition of a clean, tabbed options dialog
Another nice improvement was the addition of a clean options dialog, with options grouped in different tabs and being displayed with appropriate widgets: checkboxes for boolean options, combo boxes for multiple-choices options, spin buttons for numbers, text fields for text options.
Addition of a part excluder tool
This is probably the most original addition: a G-code based part extruder. How many times have you had a single part fail on a big build plate and had to stop everything just because the plastic was not being correctly deposited on the failed part and started messing up the whole print? Well, this tool is designed for stopping this kind of situations from happening. Just hit the Excluder entry of the File menu and draw a few rectangles over the area you want to stop printing, and you’re done (you can also do that to exclude parts of already sliced plates you don’t want to fully print nor reslice without the extra objects). It basically avoids going into the defined rectangles, resetting E values if needed instead of extruding, and seems to work fairly well with Slic3r-generated G-codes (I haven’t tested with any other slicing engine, and it could break because layer changes have to happen independently of X/Y moves for now).

Failed part excluder tool (right) and print simulation (left) where I stopped printing two of the four objects after a few layers
Addition of new interface layouts
Based on the GUI code modularization from last year, we added two new interface layouts. The first one differs from the default one by placing the log viewer below the printer controls on the left side of the program, freeing more space for the print visualization:
The second mode is much more different. It splits the interface into two tabs, the first one holding all the printer controls, while the second one holds the print viewer and the log box. This makes it super compact and very well fit for tiny screens (it should fit in 700×600 pixels), especially when using wxWidgets 2.9 where it will use an appropriate widget for the main toolbar which wraps around automatically.
Addition of a bigger temperature graph visualization
Last, you can now click on the small temperature graph (which can also optionally be disabled and complemented or replaced by the old temperatures gauges) to open a new window showing a much larger version of the temperatures graph for easier monitoring. Not the biggest thing ever, but still handy
December 1st, 2022 at 4:53 pm
fortnite Kostenlose v Bucks
iXce’s blog » Blog Archive » Printrun changes
December 2nd, 2022 at 3:21 am
inbursa autos
iXce’s blog » Blog Archive » Printrun changes
December 2nd, 2022 at 4:57 am
balenciaga adidas shoes
blog topic
December 2nd, 2022 at 8:48 am
fortnite v bucks kostenlose bekommen
iXce’s blog » Blog Archive » Printrun changes
December 2nd, 2022 at 6:27 pm
trade forex binary option ae
iXce’s blog » Blog Archive » Printrun changes
December 3rd, 2022 at 10:47 am
gmb seo
iXce’s blog » Blog Archive » Printrun changes
December 3rd, 2022 at 10:12 pm
prenatal massage contraindications
blog topic
December 4th, 2022 at 1:51 am
https://Openlibrary.org
blog topic
December 8th, 2022 at 8:20 pm
customers reviews platform
iXce’s blog » Blog Archive » Printrun changes
December 9th, 2022 at 1:35 am
Internet Providers
blog topic
December 9th, 2022 at 7:28 am
Check This Out
blog topic
December 9th, 2022 at 12:09 pm
military uniforms
iXce’s blog » Blog Archive » Printrun changes
December 10th, 2022 at 8:40 pm
business website hosting
blog topic
December 13th, 2022 at 7:14 pm
luk88 club
iXce’s blog » Blog Archive » Printrun changes
December 13th, 2022 at 8:02 pm
บอลเต็ง1000
iXce’s blog » Blog Archive » Printrun changes
December 16th, 2022 at 7:22 am
gucci flip socks suck a nigga dick through a sock
blog topic
December 19th, 2022 at 9:04 am
burberry black label tie made when
blog topic
December 19th, 2022 at 9:05 am
pre-owned chanel clothes
blog topic
December 19th, 2022 at 6:24 pm
interrnet providers Halifax
blog topic
December 23rd, 2022 at 3:25 am
твердотопливные котлы
iXce’s blog » Blog Archive » Printrun changes
December 23rd, 2022 at 7:37 am
slot server kamboja
iXce’s blog » Blog Archive » Printrun changes
December 23rd, 2022 at 11:42 pm
Joker123 สล็อตออนไลน์ที่เร็วที่สุดในไทย Joker123ok
blog topic
December 24th, 2022 at 4:44 am
betmatik
iXce’s blog » Blog Archive » Printrun changes
December 25th, 2022 at 11:34 am
купить диплом частного охранника
iXce’s blog » Blog Archive » Printrun changes
December 30th, 2022 at 6:41 am
rb88
iXce’s blog » Blog Archive » Printrun changes
January 4th, 2023 at 7:23 am
htvront htv vinyl rolls heat transfer Vinyl – 12\” x 35ft reviews
blog topic
January 5th, 2023 at 3:27 pm
w88
iXce’s blog » Blog Archive » Printrun changes
January 7th, 2023 at 2:12 pm
top movies this week
iXce’s blog » Blog Archive » Printrun changes
January 9th, 2023 at 3:53 am
cuan123
iXce’s blog » Blog Archive » Printrun changes
January 21st, 2023 at 6:04 pm
bandar roulette
iXce’s blog » Blog Archive » Printrun changes
January 23rd, 2023 at 12:57 pm
طراحی ویلا مدرن
iXce’s blog » Blog Archive » Printrun changes
January 26th, 2023 at 11:40 am
kaufen Sie gefälschte britische Pfund in großen Mengen
blog topic
January 26th, 2023 at 6:52 pm
1firefox
February 2nd, 2023 at 8:01 am
yves saint laurent shoes size 12
blog topic
February 3rd, 2023 at 1:32 am
แทงหวยฮานอย
blog topic
February 3rd, 2023 at 1:45 pm
Nikole Abbitt
I found a great…
February 5th, 2023 at 12:24 pm
coursework help university https://brainycoursework.com/
February 5th, 2023 at 2:15 pm
coursework writing https://courseworkninja.com/