Pattern Mode Script


Per your nudge…

Pattern mode has its uses, especially when you need to precisely control the micro mirrors. This is most useful for sub-pixel resolution control when attempting to achieve dimensionally accurate parts with sharp or straight features, such as straight walls.

Pattern Mode is not very useful for parts with curved surfaces normally printed with Anti Aliasing.

In any case, I have been taking a deep dive into the website in an attempt to do one thing:
reduce the amount of work currently required to utilize the PadSlicesForPatternMode code already provided here

My main beef is that you if you work in and office and share the design workload, you likely have a set file / folder structure that is used for saving your work (usually a network) In order to use the Pattern Mode you have to follow these steps:

  1. Export the slices from PS
  2. Unzip the file (in your normal file / folder structure)
  3. Copy all the image slices to the "/input" folder located in the directory that you saved the Processing Code to. In my case a local drive.
  4. Run the program
  5. Open the "output" folder located in that same parent directory.
  6. Cut and Paste all the image files back into your original working directory.
  7. Open the "printsettings" file and add a line of code:
    "UsePatternMode": 1,

It would seem ideal that once you have the files un-zipped, you could just run the program and point it to your working directory and have it do the work there, no extra copy and paste.

The trouble I have run into is that Processing does not work that way. It wants all the files in ITS working directory - hence the copy>paste>cut>paste. It seems to be a limitation within JAVA, since it’s main function is web based applications vs. the traditional desktop centric applications I am used to dealing with.

I have a forum thread over in for those who might be interested. As of now, I still don’t have a solution, but I am hopeful…

Netfabb ha?

Missed a couple of steps…

  1. ZIP all the files back up.
  2. Load via Ember Web


Scott, thank you for sharing your work flow !

Am I correct in assuming that even when you streamline it, you are still left with only a small portion of printed area of the original envelope? Or you are able to cover the full 64 x 40mm area?


Currently you are limited on the smaller area. It may be possible (I think) to recover this but only of you have a way to slice the file PRE-ROTATED. What seems to happen is the when the image is rotated internally, it truncates the image that falls off the imager.
I think that if I was to slice a model rotated 45° in NetFAB on a custom build head, then when the image rotates in the firmware, all the area would be exposable.
Have not tried this yet…



Thank you for this post. It has been very helpful form me.

One question: How do you uploaded your final 7zip folder with the final PNG files? When I try using or Print Studio I only get them to accept .STL files and I still haven’t figured out how to import the 7zip folder.

Also, have you tried the Netfabb version where you can just automatically select pattern mode without going through this process?


To upload files directly to the printer, you will need it’s IP address. Open a browser window and type the IP address into the address bar at the top. It will pull up a web page for your printer with a few buttons, one will allow you to upload a ZIP or tar.gz file.


Awesome, thanks!


I did obtain an error displaying “Error loading file” in my Ember after loading it. I do get successful results if I just load the folder before I make any changes to it. Just wondering in case other people went through the same issues.


Make sure you’re zipping just the files (the PNGs + printsettings file), not the folder they’re inside of.


That solved it! Yesterday I was a bit all over trying to do different things and maybe I didn’t pay attention at how I zipped the files back up. Thanks a lot :slight_smile:


Another question:

I am printing my 0.5 in cube in pattern mode. Since it is small, I do not have the need to rotate the part 45 degrees in order to cover the entire build area. However, I think that by turning the part 45 degrees I may be able to get the best resolution, since in that case the micromirrors in the DMD would be aligned with the sharp edges of my model. That’s just a thought. Has anyone had any experiences with this?


Actually, leave it in the normal X/Y rotation in PS. The reason is that the image file pixels need to be as sharp as possible. If you rotate the model, then any geometry not on a straight line gets anti-alias treatment.

See here


Thanks! However, doesn’t this disagree with the last post by @OwenSmithyman in the last post of the Pattern Mode thread where he suggests to align rectilinear parts with micromirrors by rotating part 45 degrees?


I may have just gotten confused about the rotation. Scott has much more experience with Pattern Mode than I do, so I would just trust what he says.


Great. I also got confused about the need of rotation. I am right now printing my first pattern mode specimen, hoping to get a more exact print than with video mode (fingers crossed!) I might also try with the rotation later and see if I get better results!


Awesome! Let us know how it goes.


This article by Karl Guttag is an excellent resource for understanding what’s actually happening.

The best way I can think to describe it is when you zoom into an image to the pixel level, all current imaging software places everything a nice square grid. However, the Ember DLP is in the diamond pattern.
In order to align pixel by pixel, Pattern Mode ‘rotates’ the image to map each pixel to its corresponding micro mirror address. If you pre-rotate the model, it will rotate it another 45 degrees, now placing the pixels out of true alignment.

Hope this helps. It took me several attempts to wrap my mind around this.


This video may also be very helpful to people learning about pattern mode.


Great find! Thanks for sharing!



Thank you for sharing this post! It has been very useful form me.