[Closed] Script to trace lines on an image?
Just wondering whether there is a script/plug-in that I could use for a task I am working on… I have 2D images of building outlines (fairly simple ones) from the top view and rather than tracing them all manually with the Line tool and extruding them I would like to use a script that does that automatically for me to save time… I would imagine that there are people that had to do this before me, there’s a large number of buildings to do and tracing them one by one is more or less out of the question… Is there any script like that readily available, I would appreciate any sort of help on this as it is a major headache for me at the moment!
I am pretty sure that there is no such script and your best bet would be to use a vectorizing program. I had to do a large piece of terrain from a tiff, and I’ve vectorized it in Illustrator then exported as a dwg then import those lines in max. It worked pretty smooth, but it all depends on the quality of your inital image.
Hope this helps!
Anton
Historically speaking, you are wrong. Technically speaking, you are right.
It was one the very early scripts I wrote. It was encrypted and I am pretty sure I lost the source. And it had its problems. But it was a nice proof of concept and I traced pretty crazy stuff with it. On another historical note, that script prompted John Wainwright to send me an email with congratulations on the creative usage of the language for things it wasn’t designed for…
Here is the page – DO NOT try to use it, it will probably not work in anything but Max 2.0…
http://www.scriptspot.com/bobo/mxs2/shapescape/
Thanks, that script looks amazing Bobo! It doesn’t work sadly and its a shame you don’t have the source code for it but awesome stuff nonetheless (as usual!)…
Is there are a reason as to why tracing lines on a .bmp or .jpeg image in Max doesn’t exist in script form though? I would imagine that many people would like to automate this process, if you are doing architectural modelling for example this could prove out extremely useful… I would like to bypass using something as Illustrator for example and surely it can all be done under the Max environment? Btw, do you remember which process you used Bobo to create this script?
There are multiple professional applications to do the job, so I never bothered investigating further.
What I did was first finding pixels with a color change above a certain threshold and generating a white pixel for any pixel where the color changes abruptly relatively to the surrounding pixels. The result was the black and white image shown on the page.
Then I took the first white pixel and started following the white countour, creating a vertex for any pixel where the direction would change abruptly. The result was a bunch of splines representing the black&white version of the image.
The first stage (conversion to b&w) was relatively fast and I could play with the thresholds to get the desired tracing material. Then I could let the machine run for several minutes (on a Pentium Pro !!! ;)) to get the actual splines…
Just when I think I’m getting good Bobo you show me just how far behind I really am, and you did that in Max 2, Wow!
Wow! That’s awesome Bobo! Didn’t know you did that!
There is a discusion on the Vray forum about creating geometry leaves to replace the Opacity Mapped ones in the geometry plants or trees (Vray doesn’t like too many objects with opacity maps) and they were gouing on the same thought pattern but nobody actually wrote it…
When I get some time I’ll try it!