You are amazing!
In CS3, the script choked on
b.strokeStyle = app.strokeStyles;
A quick look at Indesign CS3.chm showed that GraphicLines want a strokeType, so I replaced it with
b.strokeType = "Solid";
and it worked perfectly on polygons and outlined text. I haven't examined any curves too closely yet...
Good catch, Noel. My home version is CS, and it seems that has been changed somewhere in time. I included a rather ad hoc fix -- it just might work.
Meanwhile, I was wondering if it was possible to expand or contract the extrusion. Just guess ..
The new version is http://www.jongware.com/binaries/extrude-1.01.zip
By the way, both offsets set to 0 and both scaling to 100% will give you an error from the pathfinder. Well ... in that case you wouldn't get any extrusion anyway, so don't do it.
A quick look at Indesign CS3.chm ...
A week ago I said
... tight curves appear 'copied' rather than extruded along the most extreme curved edge. But the math to get that right is horrible.
and I stand by that. The problem is how to calculate a tangent to a bezier curve at the precise angle (dx/dy), and I'm not that good in math.
Fortunately, many roads lead to Rome (and if you happen to be a true Roman, many roads lead away from it as well). I chose the easier road: I added a piece of code to sub-divide each curve into straight segments and used that to add the drop box segments. Sub-dividing random curves into a fixed number of straight lines sometimes leads to unseemly angles, especially if the entire curve is rather large, or it bends around itself tightly. So I added the 'flatten path' box: a high number will lead to a more precise curve (because more segments are created), but will make the script run slower. Try a higher value if you are not satisfied.
The subdivision code appears courtesy of Maxim Shemanarov, one of my heroes, as he singlehandedly programmed an entire low level antialiased graphics library! It seems he has no problems at all with the required maths... (Do visit www.antigrain.com if that sounds interesting!)
The new script is downloadable from my site: http://www.jongware.com/binaries/extrude-1.02.zip
Please do! I am pretty content with it, and I'd be happy to see the WordArt others can create with it.
My French is rusty ("rusté", perhaps?), but I see your name and Laurent's there, and I'm sure Marc Autret is out there somewhere as well, so it's assured quality all the way. [Unlike some Indian and Chinese sites which I won't mention because I'm mad at them.]
Be sure to post the last version (http://www.jongware.com/binaries/extrude-1.02.zip) as the older ones has a nasty visual bug re: curves.
I am pleased about your answer. Your french is not rusté but "rouillé" ;-)
I will encourage readers to post you comments.
Congrats for your talent and scripting skills, I wish I have time to practicize more :-S
I just tried the script with CS4 and it doesn't seem to do anything. Well, it looks like it's trying (I get a beachball cursor) but there is no result on the page. It works fine for me in CS3. In spite of the CS4 problem, I think it's very cool. Thanks.
Well, that's weird. It works fine for me under CS4. Perhaps there was something odd in the shape you tried? Or did you up the Divisions number a lot? It uses a recursive call to itself, so a high value just may crash ID internally.
That said, it may take a while to render a moderately complicated object, although I get a madly flickering beachball-and-watch, and actually see the progress the script makes. This image took quite a while, on a 3GHz Mac:
It works now! I don't think it was my short attention span since I was only trying to extrude a square, and it goes pretty quick now (nearly instant). Not sure but maybe restarting CS4 helped? I crashed last night and the script works like a charm today. I even enjoy taking apart the pieces of the extrusion to make other weird shapes. Thanks again!