working on slicer in blender

Powder and inkjet printing
Wonko
Posts: 110
Joined: Sat Aug 15, 2015 8:13 pm

Re: working on slicer in blender

Post by Wonko »

[/quote]
hope you don't mind if I steal some of the code.
[/quote]

That's ok. It's why I put it as OpenSource on GitHub, so others can profit as well. If you do use some of my code, just mention where you got it in your README.

I use mainly FreeCAD because I want numerical precision. It actually offers a Python call that returns a slice along an arbitrary plane. Now if it would support UV texturing, it would be perfect. ;-) . Looking forwar to what you come up with for Blender.
User avatar
mark use blender
Posts: 13
Joined: Mon Aug 01, 2022 2:54 pm
Location: Hong Kong
Contact:

Re: working on slicer in blender

Post by mark use blender »

dragonator wrote: Sat Aug 13, 2022 12:29 pm
question: is it possible to use a teensy2.0 as 5 teensy3.2 is very expensive
User avatar
dragonator
Site Admin
Posts: 595
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: working on slicer in blender

Post by dragonator »

Probably not without massive alterations. The Teensy 3.2 has a DMA and 32 I/O pins. The Teensy 2.0 8 bit, only 16Mhz, has 25 I/O pins and no DMA. The latest version of the firmware needs DMA to work. The 2.0 is already not drop in compatible with the 3.2. I assume you want to use it together with the V3 controller, as you are asking about a Teensy 3.2 and not a Teensy 3.5.

The 25 I/O pins are just about enough to control the basics of the printhead, you needing 22 pins for basic control of an HP45, but you will have no printing speed, and no extra pins. Teensy 2.0 is essentially using an Arduino Nano.
User avatar
mark use blender
Posts: 13
Joined: Mon Aug 01, 2022 2:54 pm
Location: Hong Kong
Contact:

Re: working on slicer in blender

Post by mark use blender »

dragonator wrote: Wed Oct 05, 2022 4:59 pm Probably not without massive alterations. The Teensy 3.2 has a DMA and 32 I/O pins. The Teensy 2.0 8 bit, only 16Mhz, has 25 I/O pins and no DMA. The latest version of the firmware needs DMA to work. The 2.0 is already not drop in compatible with the 3.2. I assume you want to use it together with the V3 controller, as you are asking about a Teensy 3.2 and not a Teensy 3.5.

The 25 I/O pins are just about enough to control the basics of the printhead, you needing 22 pins for basic control of an HP45, but you will have no printing speed, and no extra pins. Teensy 2.0 is essentially using an Arduino Nano.
also the program doesn't fit in onboard flash of 2.0, I guess I just have to spend the buck LOL

update: after stripping all UI-related code and paste into blender, blender can control and connect to the CNC shield, now waiting for the PCBs to arrive at my doorstep.


happy blending
User avatar
mark use blender
Posts: 13
Joined: Mon Aug 01, 2022 2:54 pm
Location: Hong Kong
Contact:

Re: working on slicer in blender

Post by mark use blender »

Wonko wrote: Fri Sep 02, 2022 11:59 am

That's ok. It's why I put it as OpenSource on GitHub, so others can profit as well. If you do use some of my code, just mention where you got it in your README.

I use mainly FreeCAD because I want numerical precision. It actually offers a Python call that returns a slice along an arbitrary plane. Now if it would support UV texturing, it would be perfect. ;-) . Looking forwar to what you come up with for Blender.
do you have a script, library, or program that can turn grayscale jpegs into things that your xaar 128 Arduino thing can understand, or would you kindly explain how it work. thanks

also, updates: my PCBs arrived, can't wait to play with it

happy blending
Wonko
Posts: 110
Joined: Sat Aug 15, 2015 8:13 pm

Re: working on slicer in blender

Post by Wonko »

My board and my testing software are here:

https://github.com/MatthiasWM/Xaar128

You basically send the dot data in 128 bits / 16 bytes in two block of 8 bytes to SPI device 1 and 2 and pull the FIRE pin low IRC. The C++ code is hopefully readable enough. Th get from a PNG image to 128 bits you can use Python or any image library like OpenCV, libpng, or CImg if you stick with C++. They all have functions to load a single pixel. Just read 128 pixels, apply a threshold, and pack them into 16 bytes. It's useful to combine the head x transport signal with the fire signal, so the head moves exactly one step for ever fire command (or whatever else your gearbox needs).
User avatar
mark use blender
Posts: 13
Joined: Mon Aug 01, 2022 2:54 pm
Location: Hong Kong
Contact:

Re: working on slicer in blender

Post by mark use blender »

Wonko wrote: Sun Oct 30, 2022 9:58 pm You basically send the dot data in 128 bits / 16 bytes in two block of 8 bytes to SPI device 1 and 2 and pull the FIRE pin low IRC.
knowing that is very helpful, I can just load in an image that I run through a dither process as a NumPy array and start to disassemble it then feed it to the Arduino

happy blending
Wonko
Posts: 110
Joined: Sat Aug 15, 2015 8:13 pm

Re: working on slicer in blender

Post by Wonko »

mark use blender wrote: Mon Oct 31, 2022 12:52 am I can just load in an image that I run through a dither process as a NumPy array and start to disassemble it then feed it to the Arduino
Pretty much, yes. NumPy is not really needed. The Python Image Library PIL can load an image, dither (defaults to Dither.FLOYDSTEINBERG), and return pixel values (open(filename), convert('1'), getpxiel(x, y))
User avatar
mark use blender
Posts: 13
Joined: Mon Aug 01, 2022 2:54 pm
Location: Hong Kong
Contact:

Re: working on slicer in blender

Post by mark use blender »

dragonator wrote: Wed Oct 05, 2022 4:59 pm Probably not without massive alterations. The Teensy 3.2 has a DMA and 32 I/O pins. The Teensy 2.0 8 bit, only 16Mhz, has 25 I/O pins and no DMA. The latest version of the firmware needs DMA to work. The 2.0 is already not drop in compatible with the 3.2. I assume you want to use it together with the V3 controller, as you are asking about a Teensy 3.2 and not a Teensy 3.5.

The 25 I/O pins are just about enough to control the basics of the printhead, you needing 22 pins for basic control of an HP45, but you will have no printing speed, and no extra pins. Teensy 2.0 is essentially using an Arduino Nano.
As it's harder to get teensy 3.2 as adafruit is slowly reducing production of 3.2 in favor of 4.0, do you plan to update the firmware to support it or if it's even possible to use a teensy 4.0

Thanks in advance
Happy blending
MarkUseBlender00
User avatar
dragonator
Site Admin
Posts: 595
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: working on slicer in blender

Post by dragonator »

I did look at PJRC, the maker of the Teensy and indeed they expect the 3.2 and 3.5 to never fully recover from these shortages.

I do not plan to update the firmware. I have mostly stopped with the inkjet for the time being. The Teensy 4.0 and 4.1 can be made to work, but there are 2 ways. 1. Use the slower way of directly controlling the printhead with digitalWrites and port writes. This binds up the CPU for gaps of 300us, since printing is timing specific and cannot be done together with other tasks well. 2. figure out a way to make the teensy 4 DMA work for this controller. I tried this once but failed, but I am not that good of a programmer. There might be other solutions to the problem, but that is something I do not expect to spend much time on any time soon. The original V3.2 controller firmware shared on hackaday.io, without the DMA hardware added might be able to run Teensy 4 with only changing the pinout, but this I have not tried.

-Yvo
Post Reply