This page has been nominated for deletion.
The given reason is: Abandoned software not in Gentoo
If you disagree with its deletion, do not remove this notice; discuss your objections on the associated discussion page.
Designed by Vincent Sanders and released under MIT license, PNG23D is a command line tool allowing to make a 3d file from a PNG image.
Different picture densities define different heights in 3d file generated. All the hard work is to customize source pictures, accorded to PNG23D settings, to get good printing files.
Many parameters can be set, among others: 3d object sizes, height levels number, output format –for example an .stl file to be printed, or a .scad one to be edited in OpenScad (media-gfx/openscad), etc.
PNG23D is not in Portage tree or Gentoo overlays, so installation is done by compiling sources found on GitHub.
emerge --info libpng
emerge --ask media-libs/libpng
Then clone Git repository, for example in /usr/src:
git clone https://github.com/kyllikki/PNG23D/
Compiling and installing:
make && make install
If ‘STDIN_FILENO’ undeclared error is generated after make…:
[…] bitmap.c:46:25: error: ‘STDIN_FILENO’ undeclared (first use in this function) fp = fdopen(dup(STDIN_FILENO), "rb"); ^ […]
#include <unistd.h> at the beggining of /etc/src/PNG23D/bitmap.c:
[…] #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> /* added line */ #include <png.h> #include "bitmap.h" […]
Then compile again.
Alternatively without git, sources can be downloaded, unziped an compiled in another location.
For the man page to be installed, be sure that /usr/local/share/man/man1 directory exists, create it if needed:
mkdir -p /usr/local/share/man/man1
Then install the man page (which will later be accessed by man png23d):
Simple usage making an .stl file:
png23d -o stl /path/to/input/file.png /path/to/output/file.stl
And making an .scad file:
png23d -o scad /path/to/input/file.png /path/to/output/file.scad