Inkscape.org
Beginners' Questions beginner's question: center of document at (0,0)
  1. #1
    Umako Umako @Umako

    I want to make a new document with page-size a square of 140mm sides. In addition, the center of the square should be at (0,0). Setting the sides is easy, but I don't succeed to put the origin to the center of the square.

    (And what is the purpose of the "view box" setting?. Even if I set x and y to -70 each, the origin remains at the upper-left corner)

  2. #2
    Polygon Polygon @Polygon🌶

    To my knowledge we just can have the origin set at bottom- or upper-left side - changes needs restart though.

    (good old Freehand allows to drag to where you need it) Not sure if there any changes planned.

  3. #3
    Aero Aero @Aero◻️

    In Inkscape, if you change the viewBox back to 0 for x and y in my attached .svg, the content (circle) is shifted to reflect your changes to the origin.

    Other SVG editors may also reflect this on the ruler and other places. One example is the online editor Boxy SVG.
    https://boxy-svg.com/app

     

    140Mm
  4. #4
    Umako Umako @Umako
    *

    I made that with your file and result is clearly visible. Thanks also for the Link. very powerful prog indeed. I am also impressed by the tutorial there. (I use Notepad++, after all it is better than a pure text-editor)

    Notepad++  is fine to view all kinds of source code.

  5. #5
    Umako Umako @Umako

    When I make a new doc with display units px and page-size also in px and draw a rectangle, the coordinates of viewBox and the rectangle in Notepad++ are in mm. Why not in px-Units?

    Attached the File

    Rectangle 40X20Mm In Px
  6. #6
    Aero Aero @Aero◻️

    Display units do not make changes to your viewBox. Scale is used for this in Inkscape.

  7. #7
    Umako Umako @Umako
    *

    If I put the page-size in mm, Scale is 1, so ViewBox is in mm.

    If I put the page-size in px (For width of 210mm, it is 793.70081 in Pixel), Scale is 0.26458.

    793.7 x 0.265 = 210.

    Also in SVG/XML, the ViewBox is always in mm. 

    The second question is, why Coordinates of Rectangle in XML are always in mm, even if I set the Doc-Properties to px.

     

    Should I open a new thread, as the topic has changed?

    Coord Rect Xml
    Rect 40X20 Px
  8. #8
    Aero Aero @Aero◻️
    *
    Umako

    Also in SVG/XML, the ViewBox is always in mm.

    Yes, the viewBox in Inkscape default template is in mm. Scale must be changed to 1.00 user unit per pixel.

     

    Rect 40X20 Px
    Screenshot 105
  9. #9
    Umako Umako @Umako
    *

    ok. fine. But the question is, where scale is stored?

    Want to learn a bit about svg now Found nice tutorial..

  10. #10
    Aero Aero @Aero◻️
    Umako

    ok. fine. But the question is, where scale is stored?

    Scale is not stored. Scale is the calculated result of width, height and viewBox on outer svg.

    Scale
  11. #11
    Umako Umako @Umako

    I set scale to 1, as you wrote it. So widh and viewBox are equal. But how does Inkscape know, if viewBox is in px or in mm?

  12. #12
    Aero Aero @Aero◻️
    Umako

    But how does Inkscape know, if viewBox is in px or in mm?

    By reading the unit identifier for width and height on outer svg. (No unit identifier = pixels)

Inkscape Inkscape.org Inkscape Forum Beginners' Questions beginner's question: center of document at (0,0)