Non-linear transform (via displacement map?)

Post questions on how to use or achieve an effect in Inkscape.
dr

Non-linear transform (via displacement map?)

Postby dr » Fri Oct 15, 2010 2:50 am

I want to apply a transform that isn't captured by translate + rotate + skew. Something more similar to rectangular -> polar type transformation. I think this can be done with the displacement map if I generate an a map intelligently (i.e. via a program). However, I can't figure out how the displacement map is even supposed to work. It doesn't help that I don't know Inkscape very well and this is the first filter I've ever used. The most information I can find is this:

http://tavmjong.free.fr/INKSCAPE/MANUAL ... acementMap

which doesn't remotely cover it (nor does "the stereoscopic example in the next section"). Is this documented somewhere that Google hasn't found it or can someone help me out? For instance, what order do I select the objects in to make them "source" and "background"? No matter which I do, I don't get anything useful as output. Is the bug mentioned at the link above for version 0.46 still operative in 0.47 (which I'm running)? Do I need to use an *image* source? Do I put that in another layer or what? Etc.

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Non-linear transform (via displacement map?)

Postby prkos » Sat Oct 16, 2010 1:08 am

Cartesian to Polar is a linear transformation right? You can use Matrix tab on the Transform dialogue.

I don't think you'll get far with Displacement map, it's a filter primitive that helps achieve raster effects, not maths in a more narrow sense.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

dr

Re: Non-linear transform (via displacement map?)

Postby dr » Sat Oct 16, 2010 2:35 am

Oh, you are right. For some reason I was thinking a matrix would only let me translate/rotate/skew but I could do something like a rect->polar the same way. My thing isn't actually rect->polar, but the nature is similar enough that a matrix might work. I'll try that and <strike>blame</strike>ask again if it doesn't work. Thanks!

dr

Re: Non-linear transform (via displacement map?)

Postby dr » Thu Oct 21, 2010 9:49 am

prkos wrote:Cartesian to Polar is a linear transformation right? You can use Matrix tab on the Transform dialogue.


This only lets me enter constants. I need variables. E.g. "skew by a value dependent on the x coordinate of the point" or whatever. Can I do this via an API somehow?

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Non-linear transform (via displacement map?)

Postby prkos » Thu Oct 21, 2010 5:48 pm

I thin you have to create an extension and enter the formula you want to apply. The extension would read the coordinates and apply the matrix formula you calculated (you have to calculate the matrix parameters).
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

dr

Re: Non-linear transform (via displacement map?)

Postby dr » Fri Oct 22, 2010 11:18 pm

prkos wrote:I thin you have to create an extension and enter the formula you want to apply. The extension would read the coordinates and apply the matrix formula you calculated (you have to calculate the matrix parameters).


I just realized this isn't going to be sufficient. For instance, draw a rectangle. Even if I use a 4-corner method, it is still just defined by 4 points. I want to treat the paper like rubber and stretch the middle out so the sides get fat (say). There's no coordinate transform *of the drawing* that will do that. I need to change the shape of the paper. Is that possible in Inkscape?

I think the displacement map basically does this, which is why I started there (only I only now realized WHY that's where I started). Except I bet I end up with a bitmap and I need the end product to still be a vector graphic.

This might not be possible.


Return to “Help with using Inkscape”