vector graphic generation programming language

Started by
3 comments, last by jwezorek 11 years, 8 months ago
Does there exist a programming languange or a module for an existing language that lets you create vector graphics objects and then modify the objects but have the the underlying objects maintain their semantic relationships after you modify them?

For example

1.) Create a cubic bezier curve A that starts an p1 and ends at p2 and is tangent to such-and-line at p1 and such-and-such line at p2 and passes through p3.

2.) Give me a set S of 10 points evenly distributed on A.

3.) Create circles of such-and-such radius at each point in S.

4.) Now, move p1 and p2 from 1. to other locations having the side-effect of updating the circles in 3.

5.) Render to SVG.

I haven't been able to find anything like this...
Advertisement
Any particular reason you can't just use a good SVG library for your language of choice?

You could try AGG maybe?
[size="1"]
Well, I could write something that would do the above on top of a vector graphics library, yes, but as far as I can tell I would have to implement the dynamic-ness that I am looking for myself which in full generality is seriously non-trivial.

In other words, say I have a vector graphics library that let's me create a bar bell shape by unioning together two ellipses and a rectangle, and then let's me change the stroke and fill etc. on the bar bell shape. What if I then want to change the underlying rectangle connecting the two ellipses and have that change the bar bell shape?

Does something like this exist? Seems like it should but I can't find anything. Anyway, I named this thread what I named it because if you think about what I am asking I think it's pretty clear that the way an object in such a system would have to be represented is as a program for generating it.
Did you try scripting a vector graphics program? You might be able to do something like that from an Illustrator script.

Did you try scripting a vector graphics program? You might be able to do something like that from an Illustrator script.


I've never tried scripting Illustrator but scripting Blender is one of the things that got me thinking about this ... (That and the fact that I have an idea for an application that would require this functionality)

See, I've never been able to really get over the learning curve of using Blender's UI but I can get around that fact because my needs from Blender are pretty meager. I use Blender to render backgrounds for puzzle games that I write which are usually pretty simple in terms of models: boxes, frames, shadowbox type things, like geometric still-lifes. Since I don't know how to use Blender's UI I do everything using the Python interface. If I need a model of a picture frame on a wall, I write a Python script that has a function that generates the wall and a function that generates the picture frame, etc. I started thinking about how those functions are like representations of the objects and what it would be like if there was a programming environment that allowed you to interact with geometry represented this way. Blender itself and its programming environment is something like this but not really because most operations generate output and consume their input; meaning from Blender's python interface you can't do reflection on an arbitrary object and see "Oh, this thing was made by a extruding a rectangle and unioning it with a sphere" or whatever, but if you look at a function in a script that does that you can, etc.

Anyway, now I'm rambling...

This topic is closed to new replies.

Advertisement