Lithophane Workbench

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
furti
Posts: 287
Joined: Mon Nov 27, 2017 5:27 pm

Lithophane Workbench

Postby furti » Sat Aug 25, 2018 9:15 am

Hi,

some time ago I stumbled across this page (http://3dp.rocks/lithophane/) that lets you create lithophanes by uploading a image to the side. Recently the idea to print some images came to my mind again.

As I am a programmer myself ( Not python. This was the first time I really did something in python. So please go easy on me :D ) and FreeCAD is a really powerful tool ( And fairly easy to extend) I decided to combine Lithophanes with the power of FreeCAD.

I started this workbench https://github.com/furti/FreeCAD-Lithophane that lets you import images into FreeCAD and create a Lithophane Mesh from it.

Maybe this Workbench can be useful for other FC Users too :)

The Readme on GitHub should document the currently available features well enought to get started I think. If something is unclear please let me know.
chrisb
Posts: 16941
Joined: Tue Mar 17, 2015 9:14 am

Re: Lithophane Workbench

Postby chrisb » Sat Aug 25, 2018 10:08 am

This could be an interesting application for 3D surface in Path workbench too.

Is your workbench similar to mario52's Macro Texture?
User avatar
furti
Posts: 287
Joined: Mon Nov 27, 2017 5:27 pm

Re: Lithophane Workbench

Postby furti » Sat Aug 25, 2018 11:10 am

Hi Chris,

thank you for pointing me to this macro. Didn't know about this.

Unfortunately I can't test it right now. Tried to convert Images to greyscale in gimp and Export them to bmp. Even a simple Image in Gimp in 1 bit black and white mode does not work. I get the following message all the time:

Code: Select all

Bits_pixel 1 unrecognized format
The differences I can see on a quick look are:

Texture macro Can only guess some things as i can't get it to work right now
  • Only works with bmp files with 256 colors
  • Simply creates the Image plane itself not an actual solid?
  • Uses some higher Level Tools to create the geometry (Bsplines)?
Lithophane Workbench
  • Should work with every file Format QtGui.QImageReader(imagePath) can read
  • Creates an acutal soid mesh. Mesh -> Analyze -> Check solid Mesh reports it as a solid
  • Works on meshes for Performance reasons right now. There is a Option to convert the mesh to a Part object but this needs clearly some polish
The aim of my workbench is to get a adjustable and ready to print Lithophane with little effort. Don't know how one can use the Macro as it does not work for me right now.
chrisb
Posts: 16941
Joined: Tue Mar 17, 2015 9:14 am

Re: Lithophane Workbench

Postby chrisb » Sat Aug 25, 2018 1:04 pm

Thanks for analysis and explanation.
User avatar
sliptonic
Posts: 1552
Joined: Tue Oct 25, 2011 10:46 pm

Re: Lithophane Workbench

Postby sliptonic » Sat Aug 25, 2018 2:05 pm

Looks like fun.
I made a very simple lithophane a while back but this is next - level stuff.

https://youtu.be/sik5elnSge0
User avatar
easyw-fc
Posts: 2589
Joined: Thu Jul 09, 2015 9:34 am

Re: Lithophane Workbench

Postby easyw-fc » Sat Aug 25, 2018 3:38 pm

furti wrote:
Sat Aug 25, 2018 9:15 am
Hi,

some time ago I stumbled across this page (http://3dp.rocks/lithophane/) that lets you create lithophanes by uploading a image to the side. Recently the idea to print some images came to my mind again.

As I am a programmer myself ( Not python. This was the first time I really did something in python. So please go easy on me :D ) and FreeCAD is a really powerful tool ( And fairly easy to extend) I decided to combine Lithophanes with the power of FreeCAD.

I started this workbench https://github.com/furti/FreeCAD-Lithophane that lets you import images into FreeCAD and create a Lithophane Mesh from it.

Maybe this Workbench can be useful for other FC Users too :)

The Readme on GitHub should document the currently available features well enought to get started I think. If something is unclear please let me know.
Nice WB!
You should ask to be added to FC Addons list :)
https://github.com/FreeCAD/FreeCAD-addons
User avatar
sgrogan
Posts: 5210
Joined: Wed Oct 22, 2014 5:02 pm

Re: Lithophane Workbench

Postby sgrogan » Sat Aug 25, 2018 4:08 pm

Hi furti,

w/PY3/QT5 I get

Code: Select all

Running the Python command 'Import_Image' failed:
Traceback (most recent call last):
  File "C:\Users\Chris\AppData\Roaming\FreeCAD\Mod\FreeCAD-Lithophane\import_image.py", line 17, in Activated
    fileName = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(), "Open Image", '', "Image Files (*.png *.jpg *.bmp)")[0]

'NoneType' object has no attribute 'activeWindow'
when trying to import an image.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14442 (Git)
Build type: Release
Branch: master
Hash: bb9d737ba1158fdba5d06df45ab3e213065139cd
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

I cloned your repo into my %appdata%/FreeCAD/Mod directory.

Import works with PY2/QT4

Great work on the read.me and issue tracker on your repo. I noticed you already have https://github.com/furti/FreeCAD-Lithophane/issues/11
Let me know if you prefer me to comment on the PY3/QT5 there.
User avatar
furti
Posts: 287
Joined: Mon Nov 27, 2017 5:27 pm

Re: Lithophane Workbench

Postby furti » Sun Aug 26, 2018 7:10 am

Thanks for the kind words. Good to hear that there is some interest in the Workbench :)


easyw-fc wrote:
Sat Aug 25, 2018 3:38 pm
You should ask to be added to FC Addons list
What steps are involved to get added to the Addon list? Do I have to ask somebody on the forum or should I create a pull request in the Github repo?
sgrogan wrote:
Sat Aug 25, 2018 4:08 pm
w/PY3/QT5 I get
Thanks for testing it with a PY3 and QT5 build. Unfortunately I had not the time to try it myself. But the download is running right now ;) I copied your bug description to the Github issue. Will inform you when the bug is fixed.


Feel free to comment on issues or create new ones when you find bugs or have ideas for new features. :)
triplus
Posts: 8465
Joined: Mon Dec 12, 2011 4:45 pm

Re: Lithophane Workbench

Postby triplus » Sun Aug 26, 2018 9:31 am

Hi @furti

Interesting workbench. Thanks for creating and sharing it.
User avatar
easyw-fc
Posts: 2589
Joined: Thu Jul 09, 2015 9:34 am

Re: Lithophane Workbench

Postby easyw-fc » Sun Aug 26, 2018 10:21 am

furti wrote:
Sun Aug 26, 2018 7:10 am
What steps are involved to get added to the Addon list? Do I have to ask somebody on the forum or should I create a pull request in the Github repo?
you have to simply open an issue similar to this
https://github.com/FreeCAD/FreeCAD-addons/issues/48