# Understanding 2D Coordinate Systems in MIDILLI Tools

Applicable on: [SVG Generator](https://docs.midilli.tech/books/midilli-svg-generator "MIDILLI SVG Generator"), [G-Code Generator](https://docs.midilli.tech/books/midilli-g-code-generator "MIDILLI G-Code Generator"), [STL Generator](https://docs.midilli.tech/books/midilli-stl-generator-for-3d-printers "MIDILLI STL Generator for 3D Printers")

In the *MIDILLI Tools*, a 2D coordinate system is used for the parts and components. The box height is also specified to enable assembling the generated sides into a finished box structure.

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-the-coordinate-syste"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image"><figure class="aligncenter size-large is-resized">![](https://mlg8ybik0dvi.i.optimole.com/w:243/h:139/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/01/2d-coordinates-1024x586.png)<figcaption class="wp-element-caption">The coordinate system with direction of increase and direction of rotation in the MIDILLI SVG Generator.</figcaption></figure></div></div></div>Each side of the shape has its local origin starting at the top-left corner (x = 0, y = 0). The default rotation of the added components is set to zero (0) degrees, with rotation occurring clockwise. For example, a 90-degree rotation will rotate the component 90 degrees to the right. All coordinates and locations in the JSON file are given in centimeters (cm), and the rotation is measured in degrees. This is how the final box without any components may look like if all sides are exported:

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-the-dots-represent-t"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image wp-duotone-000000-abb8c3-1 align-center"><figure class="aligncenter size-large is-resized">![](https://mlg8ybik0dvi.i.optimole.com/w:594/h:469/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/01/box-sides-top-3d-1024x809.png)<figcaption class="wp-element-caption">*The dots represent the local origins (top-left) of each side.*</figcaption></figure></div></div></div>The two images below show how each side appears in the 2D view. Imagine pressing the 3D box above and flattening it to see this perspective:

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-sizing-summary-if-in"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image align-center"><figure class="aligncenter size-large is-resized">![](https://mlg8ybik0dvi.i.optimole.com/w:594/h:302/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/02/2d-inner-sizing-1024x521.png)<figcaption class="wp-element-caption">*Sizing summary if inner-sizing option is used (by default).*</figcaption></figure></div></div></div>If the inner-sizing option is used (enabled by default), the left and right sides will have a greater height/length to cover the back and front sides. Additionally, the left, right, back, and front will be slightly taller to maintain the specified inner volume. The top and bottom will then fit in accordingly. The components on sides (except top and bottom) will be repositioned considering these changes. For example, if you put a component at <code>x &#61; 0&#44; y &#61; 0</code> for right side, this component will be located at <code>x &#61; b&#44; y &#61; b</code>.

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-sizing-summary-if-ou"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image align-center"><figure class="aligncenter size-full is-resized">![](https://mlg8ybik0dvi.i.optimole.com/w:594/h:403/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/02/2d-outer-sizing.png)<figcaption class="wp-element-caption">*Sizing summary if outer-sizing option is used (can be enabled with command-line argument).*</figcaption></figure></div></div></div>If the outer-sizing option is enabled (via <code>&#45;&#45;outer&#45;sizing</code> command-line argument), the front and back sides will be slightly shorter to align with the width of the left and right sides. Similarly, all four sides (left, right, front, and back) will be slightly adjusted to maintain the specified outer volume. The top and bottom will then fit precisely on top of and beneath the other sides. In this case, unlike inner-sizing, components will be placed exactly as you specify it without any adjustments. Below, both variations for the sizing are shown in 3D:

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-sizing-with-inner-si"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image align-center"><figure class="aligncenter size-full">![](https://mlg8ybik0dvi.i.optimole.com/w:740/h:295/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/02/3d-inner-sizing.png)<figcaption class="wp-element-caption">*Sizing with inner-sizing (default) options.*</figcaption></figure></div><div class="wp-block-image align-center"><figure class="aligncenter size-full">![](https://mlg8ybik0dvi.i.optimole.com/w:740/h:259/q:mauto/dpr:1.3/f:best/ig:avif/https://midilli.info/wp-content/uploads/2025/02/3d-outer-sizing.png)<figcaption class="wp-element-caption">  
*Sizing with outer-sizing options.*</figcaption></figure>  
</div></div></div><p class="callout info">Tip: If you want the overall size to be exactly as you specify in the JSON file, use the <code>&#45;&#45;outer&#45;sizing</code> option. If you want the usable inner area to be the same as you define, leave it as default.</p>

<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex" id="bkmrk-"><div class="wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image align-left">  
</div></div></div>