New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link to 3d-printer spec files #168
Comments
How can I help with this? I got some experience :) |
@spotrh and @ryanlerch have been talking about it/working on it. The latest update was on the badges mailing list -> https://lists.fedoraproject.org/pipermail/badges/2013-August/000010.html |
I was able to create this by thresholding the image in GIMP to just black and white and than processing the png with png23D. I believe that if higher resolution is used (and all the badges comes from SVG, right?) and we require also monochromatic variant when a new badge is proposed, we can automate this process (some polishing is still needed trough). |
I played with One badge I tried that did not work out was one from the copr series: The colors in the rainbow, and especially the gradient in the background gave png23d a really hard time. Question - @hroncok, could you get it to work with multiple levels of depth at all? That would probably make for the most interested 3d printed badges (ones that actually have depth and texture). |
Well I think it might be possible to get grey-scale translated to highmap. At least should be pretty simple to script it with input like png (with vector it might be harder). This looks ok http://www.thingiverse.com/thing:11981 |
other than the shadow... I bet we can automate that! This is going to be amazing :D |
Do you know you can find (almost all) of the svgs and pngs here: https://git.fedorahosted.org/cgit/badges.git |
I don't know if using the GIMP plugin is possible to automate, but other things can be automatic. The shadow can stay, if we intersect the badge with other shape, the shadow would go away anyway.
|
And the GIMP plugin can be rewritten to be standalone script, of course. |
This generates a nice badge. badge-shape.dat is the shape of the badge (white on black). |
But even with a resolution 200x200 the geneartion of the badge eats a lot of resources (few gigs of ram and few minutes). I was not able to generate 1000x1000 badge :( |
which process eats the memory? gimp? or openscad? |
Opensacd. Ok, so here it is: #!/bin/python
from __future__ import print_function
import sys
import png
image = png.Reader(sys.argv[1])
width, height, pixels, metadata = image.asRGBA()
for row in pixels:
for pixel in range(0, width*4, 4):
gray = (row[pixel] + row[pixel+1] + row[pixel+2]) / 3
norm = (gray-127.5)/255.0
print(' ', end='')
print(norm, end='')
print() #!/bin/bash
inkscape --export-png=badge.png --export-width=$1 --export-height=$1 badge.svg
inkscape --export-png=badge-shape.png --export-width=$1 --export-height=$1 badge-shape.svg
python png2highmap.py badge.png > badge.dat
python png2highmap.py badge-shape.png > badge-shape.dat
openscad badge.scad -o badge.stl Put the badge.svg and badge-shape.svg (white badge on white bg) to the same folder and run tha bash script with resolution as argument. Watch the magic. |
And badge.scad from the previous comment as well. |
Adding
to the end of the script reduces the filesize a lot. |
#281 has the code to add this to the web interface. |
Oo.. we have a process and code to do this. Can we close this issue as done? |
I guess so. |
Let's do it then :) |
In addition to "export to open badges" we need an "export to reality" button if and only if a 3d-printing spec file for the badge exists.
We can cook up a way to mostly script the creation of such spec files from .svg files, but it may take some manual intervention. Once they are created, verified and vetted, they should be uploaded to thingiverse, and the link to that object should be recorded in our tahrir DB by hand (or automatically?) so users can have easy access.
The text was updated successfully, but these errors were encountered: