Hi Krzysztof and vaifrax,

Thank you. The part that I still don’t understand is the purpose of “desktop coordinate system” that was mentioned (the one that grows upward).

The SVG coordinate seems to be the one that lib2geom depends on most of the time (the one that grows downward). I still don’t understand why Inkscape displays curve in a certain way. I have this very simple code:

    PathVector path_out;
    Path path;
    std::vector<Geom::Point> pts;
    pts.push_back(Point(0,0));
    pts.push_back(Point(100, 50));
    pts.push_back(Point(200, 150));
    pts.push_back(Point(300, 350));

    D2<SBasis> sb;
    bezier_to_sbasis(sb, pts);
    path_out.push_back(path_from_sbasis(sb, LPE_CONVERSION_TOLERANCE, true));

    Point pt1 = path_out[0].initialPoint();
    Point pt2 = path_out[0].finalPoint();
    cout << "path_out[" << 0 << "]:" << endl;
    cout << "endpoints: " << pt1 << " " << pt2 << endl;

If this path is to be displayed on Inkscape, with y-axis going upward in desktop coordinate, we should see an upward parabola right? Something like this:


However, what I notice is that:
1) The output path displayed is inverted and offset by 1052, the width of the canvas (I am using landscape canvas 1052 x 744 here). It seems to ignore desktop coordinate and follow SVG coordinate convention.


2) In XML script editor, the curve would also be encoded in SVG coordinate: M 0,0 C 100,50 200,150 300,350. The print-out in Terminal I get also displays 
endpoints: X: 0  Y: 0 X: 300  Y: 350

So, what is the idea behind desktop coordinate? It doesn’t seem to be used as far as I have seen. Also, is the behavior in 1) to be expected? I mean, why is the path in SVG not “transformed” in coordinate before it’s being displayed on desktop?

Thank you.

_______________________
Papoj "Hua" Thamjaroenporn
pt2277@...3110...





On Apr 26, 2014, at 3:58 PM, Krzysztof Kosiński <tweenk.pl@...400...> wrote:

2014-04-25 21:06 GMT+02:00 vaifrax <inkscape-devel@...2944...>:
Hi Papoj,

if you want more control of the coordinate system you can adjust the values
of the viewbox element accordingly.
There are no gui options for this yet, but this could be used to e.g. invert
the y-Axis.

No, the SVG viewbox does not allow you to invert the Y axis. You can
only use it to scale and offset the coordinate system. Scaling by
factors less than 0 is not supported because negative values for width
/ height are treated as an error.

Regards, Krzysztof

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...842...rceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel