[/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.
working on slicer in blender
- mark use blender
- Posts: 13
- Joined: Mon Aug 01, 2022 2:54 pm
- Location: Hong Kong
- Contact:
Re: working on slicer in blender
question: is it possible to use a teensy2.0 as 5 teensy3.2 is very expensive
- dragonator
- Site Admin
- Posts: 607
- Joined: Fri Aug 14, 2015 4:48 pm
- Location: The Nethelands
- Contact:
Re: working on slicer in blender
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.
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.
- mark use blender
- Posts: 13
- Joined: Mon Aug 01, 2022 2:54 pm
- Location: Hong Kong
- Contact:
Re: working on slicer in blender
also the program doesn't fit in onboard flash of 2.0, I guess I just have to spend the buck LOLdragonator 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.
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
- mark use blender
- Posts: 13
- Joined: Mon Aug 01, 2022 2:54 pm
- Location: Hong Kong
- Contact:
Re: working on slicer in 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. thanksWonko 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.
also, updates: my PCBs arrived, can't wait to play with it
happy blending
Re: working on slicer in blender
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).
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).
- mark use blender
- Posts: 13
- Joined: Mon Aug 01, 2022 2:54 pm
- Location: Hong Kong
- Contact:
Re: working on slicer in blender
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 ArduinoWonko 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.
happy blending
Re: working on slicer in blender
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))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
- mark use blender
- Posts: 13
- Joined: Mon Aug 01, 2022 2:54 pm
- Location: Hong Kong
- Contact:
Re: working on slicer in blender
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.0dragonator 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.
Thanks in advance
Happy blending
MarkUseBlender00
- dragonator
- Site Admin
- Posts: 607
- Joined: Fri Aug 14, 2015 4:48 pm
- Location: The Nethelands
- Contact:
Re: working on slicer in blender
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
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