Is there a way in Mac OS X to directly render a shape from a list of paths? I’m currently using Adobe Illustrator, which works, but this creates a dependency that would be nice to remove. Thanks, in advance, for any and all suggestions.
Hello.
It is not very easy, but you can write a Post Script script, and get an eps image, or pdf for that matter as a result.
Google is your friend…
I did a web search before posting and found no useful information related to (apple)scripting a bezier curve. Specifically, I don’t want to generate a file, but render an image using given coordinates. Perhaps this is something better served to do in Processing or Nodebox.
You can do it using AppleScriptObjC.
Hi, Shane. I’ve not dabbled with ASOC because I only recently purchased a machine new enough to use it. Would your explorer guide cover (or introduce) the topic I’m posting about? Thanks.
No, it doesn’t cover NSBezierPath directly. It’s a bit lower-level than the stuff I cover, but it’s also not rocket science. What are you wanting to do, exactly?
Part of what I’m doing is using applescript to generate organic patterns based on various math computations. Here is an image of one of my early results:
Well the actual bezier stuff is pretty similar to PostScript – for example:
set theBez to current application's NSBezierPath's bezierPath()
theBez's setLineWidth:4.0
theBez's moveToPoint:{x:1, y:1}
theBez's lineToPoint:{x:100, y:100}
theBez's curveToPoint:{x:200, y:300} controlPoint1:{x:100, y:300} controlPoint2:{x:200, y:400}
current application's NSColor's redColor()'s setStroke()
theBez's stroke()
But you’d probably want to do that in the content of an ASObjC-based app made in Xcode.
Alternatively, I think you might be able to do some of the is with Satimage.
Thanks, Shane, for the sample code. I will probably end up buying your guide to learn and tinker around some more with this; I’ve only ever used Xcode with ASS.
Mark,
I would take a long look at Smile. It’s designed to do complex renders amongst other things.
I have not used it for this purpose, so the best place to ask would be the Smile-Users-List: sul-subscribe@satimage.fr