| | | | | I would like to share my sticker generating tool, that I created to convert
bitmap images into flat part files (stickers / decals) for use in ldraw based
CAD programs and rendering programs.
Here is an example of what it can do:
<http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2637508>
Here is a screenshot of the program:
<http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2637509>
If you'd like to try it, I would really appreciate comments and suggestions for
improvement. Also, I have included source code, so you can make your own
changes or make sure that it is indeed a safe program to use. If you do make
changes, I would really appreciate you sending them to me.
Download in zip format from here:
<http://www.scottwardlaw.com/sticker_generator.zip>
Thanks,
Scott
| | | | | | | | | | | | |
In lugnet.cad, Scott Wardlaw wrote:
Very cool! May I add a link to this from my Bitsticker page? I suspect the desktop program does not have the size/speed
restrictions that limit my script.
Jim
| | | | | | | | | | | | | | | | | | | In lugnet.cad, Jim DeVona wrote:
|
In lugnet.cad, Scott Wardlaw wrote:
Very cool! May I add a link to this from my
Bitsticker page? I suspect the desktop
program does not have the size/speed restrictions that limit my script.
Jim
|
Jim,
I searched and searched for a program that would do this and never found one. I
was surprised that there wasnt something, but it looks like I was wrong.
You can absolutely put a link from you page to my download page. Ill have to
actually create a real page on my site and send it to you.
It looks like you have done more with colors and such. Would you mind if I
incorporate some of your code into mine? If I have any thing that you can use,
please use it.
Have you asked LDRAW.org to include a link to your site?
Thanks again,
Scott
BTW, awesome truck!
| | | | | | | | | | | | | | | | | | | | | | | | | In lugnet.cad, Scott Wardlaw wrote:
|
I searched and searched for a program that would do this and never found one.
I was surprised that there wasnt something, but it looks like I was wrong.
|
Dont feel bad - the same thing happened to me when I wrote my script (except I
didnt really think to search much first). Shortly after releasing it, I
discovered an even earlier effort on
Lugnet. I think each implementation has its advantages, so we can be excused.
|
You can absolutely put a link from you page to my download page. Ill have
to actually create a real page on my site and send it to you.
|
Sounds good.
|
It looks like you have done more with colors and such. Would you mind if I
incorporate some of your code into mine? If I have any thing that you can
use, please use it.
|
Sure, youre welcome to use anything you like from my code. If I ever get around
to updating it again, Ill definitely see if theres anything I can use from
yours!
|
Have you asked LDRAW.org to include a link to your site?
|
No, not specifically. I did put a link to it in the
LDraw
wiki, but I think thats sort of an experimental system so its not
particularly visible.
|
Thanks again,
Scott
BTW, awesome truck!
|
Thanks! Its a far cry from your rebuilt Camaro, but I like it. What I like to
tell people now is that my next car is 60 years old - I have a 47 project car.
Progress is slow, but building it from the ground up is going to be lots of fun.
Jim
| | | | | | | | | | | | | | | | | | | | | | | | | | In lugnet.cad, Scott Wardlaw wrote:
>
> Have you asked LDRAW.org to include a link to your site?
you can add download links by yourself. just login, go to the download section,
click on the [Add Download] link and fill in. don't worry if it doesn't show up
immediately - I have to authorize it.
w.
Ldraw Content Manager
| | | | | | | | | | | | | | | | | | | | | In lugnet.cad, Jim DeVona wrote:
|
In lugnet.cad, Scott Wardlaw wrote:
Very cool! May I add a link to this from my
Bitsticker page? I suspect the desktop
program does not have the size/speed restrictions that limit my script.
|
Both of these applications are very cool, and I intend to begin using them
immediately.
Do you guys mind if I ask a dumb question? That is, another dumb question after
these two?
Are these applications an evolution of the various BMP2DAT programs Ive played
around with over the years? It seems that what youve got here is greaty more
sophisticated, but the idea seemed similar enough to be worth asking about.
Anyway, great stuff. Thanks for sharing!
Dave!
| | | | | | | | | | | | | | | | | | | | In lugnet.cad, Dave Schuler wrote:
|
Are these applications an evolution of the various BMP2DAT programs Ive
played around with over the years? It seems that what youve got here is
greaty more sophisticated, but the idea seemed similar enough to be worth
asking about.
|
So, I know of at least four tools to convert images to LDraw stickers:
- BMP2DAT
- img2sticker (*)
- Bitsticker
- Sticker Generator
Plus you can make stickers from text with
txt2dat.
I think this is a case of convergent evolution, not direct descent from BMP2DAT.
In fact, I wasnt really aware of BMP2DAT or img2sticker before writing
Bitsticker.
So in conclusion, I dont think there is a direct relation between any of these
tools, just a similarity as you note. Take your pick!
Jim
| | | | | | | | | | | | | | | |
| |
| I have just tested your prog.
It seems to me that you put for every pixel one quad. This produces an
enormous amount of bytes in a file. There was already a prog that was
called bmp2dat.
If you could rearrange the quads that are direct beside into one bigger
quad, then I would use your prog also for official files. But in the way
it is now I can't do that (3MB filesize for example).
cu
mikeheide
Scott Wardlaw schrieb:
> I would like to share my sticker generating tool, that I created to convert
> bitmap images into flat part files (stickers / decals) for use in ldraw based
> CAD programs and rendering programs.
>
> Here is an example of what it can do:
> <http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2637508>
>
> Here is a screenshot of the program:
> <http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2637509>
>
> If you'd like to try it, I would really appreciate comments and suggestions for
> improvement. Also, I have included source code, so you can make your own
> changes or make sure that it is indeed a safe program to use. If you do make
> changes, I would really appreciate you sending them to me.
>
> Download in zip format from here:
> <http://www.scottwardlaw.com/sticker_generator.zip>
>
> Thanks,
> Scott
| | | | | | | | | | | | | | | | | | &tIn lugnet.cad, Michael Heidemann wrote:
It seems to me that you put for every pixel one quad. This produces an
|
enormous amount of bytes in a file. There was already a prog that was
called bmp2dat.
|
This is the approach also used by Bitsticker. It is certainly not optimal.
|
If you could rearrange the quads that are direct beside into one bigger
quad, then I would use your prog also for official files. But in the way
it is now I cant do that (3MB filesize for example).
|
Tim Goulds img2sticker script uses a
different strategy; you may want to
give it a try. It does edge
detection and then triangulates surfaces to fill the uniform areas. Im not sure
if thats appropriate for official parts, either, but it should generate smaller
files than these raster techniques.
Jim
| | | | | | | | | | | | | | | | | | > It seems to me that you put for every pixel one quad.
Almost...I combine pixels of the same color that are on the same horizontal
line. So, if pixels 1 through 5 are the same color, they become a line that
ocupies 1 through 5.
Most of my stickers have been about 1MB.
I wasn't aware of the other programs when I wrote mine. I don't think that
there is a good programmatic way to make official files.
I'll try to combine the vertical lines together, where possible, so that should
reduce file size.
Look for another release tomorrow.
Thanks for all of the suggestions and ideas!
Scott
| | | | | | | | | | | | | | | | | In lugnet.cad, Scott Wardlaw wrote:
> > It seems to me that you put for every pixel one quad.
>
> Almost...I combine pixels of the same color that are on the same horizontal
> line. So, if pixels 1 through 5 are the same color, they become a line that
> ocupies 1 through 5.
>
> Most of my stickers have been about 1MB.
>
> I wasn't aware of the other programs when I wrote mine. I don't think that
> there is a good programmatic way to make official files.
>
> I'll try to combine the vertical lines together, where possible, so that should
> reduce file size.
>
> Look for another release tomorrow.
>
> Thanks for all of the suggestions and ideas!
> Scott
Hi Scott,
It will be better if you put adjacent horizontal pixels into a long quad
rather than a line.
The renderer POV-Ray does not support the concept of lines, so they are tossed
when L3P converts you LDraw file to a POV file.
Kevin
| | | | | | | | | | | | | | | | | > Hi Scott,
> It will be better if you put adjacent horizontal pixels into a long quad
> rather than a line.
>
> The renderer POV-Ray does not support the concept of lines, so they are tossed
> when L3P converts you LDraw file to a POV file.
>
> Kevin
Sorry, long quads is really what I meant by a line. So, that's exactly what the
program does.
I should have an update out later today or tomorrow that combines pixels
vertically as well.
Thanks,
Scott
| | | | | | | | | | | | | | | | | In lugnet.cad, Scott Wardlaw wrote:
> I should have an update out later today or tomorrow that combines pixels
> vertically as well.
Keep in mind that doing it both ways is probably a lot more difficult than just
doing it one way. For example, if you have a 1-pixel thick plus sign, you need
at least 3 quads (to avoid overlap), and your algorithm needs to deal nicely
with this. Then too, a 2x2 pixel square would be nice as a single quad, but
doing this generically is likely to be a lot of work.
--Travis
| | | | | | | | | | | | | | | | | In lugnet.cad, Travis Cobbs wrote:
> In lugnet.cad, Scott Wardlaw wrote:
> > I should have an update out later today or tomorrow that combines pixels
> > vertically as well.
>
> Keep in mind that doing it both ways is probably a lot more difficult than just
> doing it one way. For example, if you have a 1-pixel thick plus sign, you need
> at least 3 quads (to avoid overlap), and your algorithm needs to deal nicely
> with this. Then too, a 2x2 pixel square would be nice as a single quad, but
> doing this generically is likely to be a lot of work.
>
> --Travis
If you can work out regions of identical colour I believe there is a theory that
says you can fill it with no more than 2N (where N is the number of corners)
triangles. This is probably a good way of doing it for complex shapes.
If I ever get a chance to update my sticker creator I intend to use this
algorithm (I believe Ross uses it for txt2dat) as well as better smooth edge
finding.
Tim
| | | | | | | | | | | | | | | | | | Sorry that it has taken me so long. In fact, I am still working on creating
quadrilaterals and triangles to fill the largest spaces possible. My main
hang-ups are:
reducing processing time
a working point-in-polygon test
I have found two different methods for testing if a point is inside a polygon,
but both have flaws (or my implimentation of them has flaws)
I did create a webpage for the sticker generator. Does anyone have a better
name for it, other than sticker generator?
The ldraw primary colors is now working, and the preview for ignoring background
colors is now more accurate.
Please checkout the website, download the program, and let me know what other
changes that I can make:
<http://www.scottwardlaw.com/sticker_generator/>
I will continue to work on the polygon problem.
Thanks again for all of your help and suggestions,
Scott
| | | | | | | | | | | | | | | | | | | | | In lugnet.cad, Scott Wardlaw wrote:
> I have found two different methods for testing if a point is inside a polygon,
> but both have flaws (or my implimentation of them has flaws)
There is C code for a point in polygon implementation here:
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
It's only 8 lines of code for the whole thing, but it supports arbitrary
polygons, including ones with holes. UNDERSTANDING the algorithm might take a
little work, but the page contains good documentation about the whole thing.
--Travis
| | | | | | | | | | | | | | | | | | |
| |
| In lugnet.cad, Timothy Gould wrote:
> In lugnet.cad, Travis Cobbs wrote:
> > In lugnet.cad, Scott Wardlaw wrote:
> > > I should have an update out later today or tomorrow that combines pixels
> > > vertically as well.
> >
> > Keep in mind that doing it both ways is probably a lot more difficult than just
> > doing it one way. For example, if you have a 1-pixel thick plus sign, you need
> > at least 3 quads (to avoid overlap), and your algorithm needs to deal nicely
> > with this. Then too, a 2x2 pixel square would be nice as a single quad, but
> > doing this generically is likely to be a lot of work.
> >
> > --Travis
>
> If you can work out regions of identical colour I believe there is a theory that
> says you can fill it with no more than 2N (where N is the number of corners)
> triangles. This is probably a good way of doing it for complex shapes.
>
> If I ever get a chance to update my sticker creator I intend to use this
> algorithm (I believe Ross uses it for txt2dat) as well as better smooth edge
> finding.
Wow, I can't believe I only just found this thread!
txt2dat uses Jonathan Richard Shewchuk's Triangle library to triangulate
polygons generated by Truetype fonts. All you need to do is supply a list of
verteces, and it will generate the triangles to fill it. It's written in C, is
very fast, and can handle all weird types of polygons, including ones with
"holes" in them. And best of all it's free. Get it here:
http://www.cs.cmu.edu/%7Equake/triangle.html
And there's lots of great information there about the theory and how it works
too.
ROSCO
| | | | | | |