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!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Lithophane Workbench

Post by furti »

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
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Lithophane Workbench

Post by chrisb »

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

Is your workbench similar to mario52's Macro Texture?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Lithophane Workbench

Post by furti »

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
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Lithophane Workbench

Post by chrisb »

Thanks for analysis and explanation.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Lithophane Workbench

Post by sliptonic »

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
Veteran
Posts: 3623
Joined: Thu Jul 09, 2015 9:34 am

Re: Lithophane Workbench

Post by easyw-fc »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Lithophane Workbench

Post by sgrogan »

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.
"fight the good fight"
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Lithophane Workbench

Post by furti »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Lithophane Workbench

Post by triplus »

Hi @furti

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

Re: Lithophane Workbench

Post by easyw-fc »

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
Locked