.meb geometry in plain language
This chapter explains the coordinate system as simply as possible. The formal rules are in the specification, but here the point is practical understanding: where
xis, whereyis, wherezis, wherepositioncomes from and why rotation sometimes looks counterintuitive.
In short
In .meb, every panel has its own small coordinate system.
Before rotation, a panel always lies flat:
length = X
width = Y
thickness = ZSo a 400 × 300 × 18 panel without rotation occupies:
X: 0..400
Y: 0..300
Z: 0..18If we set its position:
"position": { "x": 18, "y": 0, "z": 0 }the whole panel moves 18 mm to the right:
X: 18..418
Y: 0..300
Z: 0..18This is a typical cabinet bottom.
The cabinet coordinate system
A cabinet has this coordinate system:
X+ = right
Y+ = back
Z+ = up
cabinet front = usually Y-You can picture it like this:
Z+ up
│
│ Y+ back
│ /
│ /
│ /
└──────── X+ rightThe point 0,0,0 is the conventional starting corner of the cabinet. In practical examples we treat it as the left, bottom, front corner of the coordinate system, from which we place the panels.
A panel without rotation
A panel without rotation lies flat.
Example:
{
"dimensions": { "length": 400, "width": 300, "thickness": 18 },
"position": { "x": 18, "y": 0, "z": 0 },
"rotation": { "x": 0, "y": 0, "z": 0 }
}Location in the cabinet:
X: 18..418
Y: 0..300
Z: 0..18This means:
- the length of 400 mm goes to the right,
- the width of 300 mm goes to the back,
- the thickness of 18 mm goes up.
This is a horizontal panel, e.g. a bottom.
What position means
position does not mean the center of the panel.
position means the place where the panel's local zero point is located.
For a panel without rotation, this zero point is at the corner:
X minimum
Y minimum
Z minimumTherefore:
"position": { "x": 18, "y": 0, "z": 0 }means:
start the panel at X=18, Y=0, Z=0And not:
place the center of the panel at X=18, Y=0, Z=0A bottom resting against a side
Suppose we have a left cabinet side 18 mm thick.
The left side occupies:
X: 0..18
Y: 0..300
Z: 0..500The bottom is to fit between the sides and touch the left side with its edge face.
We place the bottom like this:
X: 18..418
Y: 0..300
Z: 0..18Then the contact is on the plane:
X = 18And it has the area:
Y: 0..300
Z: 0..18So the 300 × 18 edge face of the bottom touches the side exactly.
How to make a vertical side
A panel lies flat by default, so to make a side out of it, you have to rotate it.
We want a side:
X: 0..18
Y: 0..300
Z: 0..500That is:
- thickness 18 mm along X,
- width 300 mm along Y,
- length 500 mm along Z.
In the file we write:
{
"dimensions": { "length": 500, "width": 300, "thickness": 18 },
"position": { "x": 0, "y": 0, "z": 500 },
"rotation": { "x": 0, "y": 90, "z": 0 }
}Why is z equal to 500?
Because after the Y=90 rotation the dimension length=500 goes vertically down. So we set the starting point at the top, so that after rotation the panel ends at the bottom at Z=0.
Result:
X: 0..18
Y: 0..300
Z: 0..500Why rotation can be counterintuitive
This is the most important thing to remember:
A panel rotates around its local zero point.
It does not rotate around its center.
It does not rotate around the center of the cabinet.
It does not rotate around the corner that looks most convenient to a human after rotation.
It rotates around its own position.
That is why for a vertical side position.z sometimes looks strange. This is normal, because position is the pivot point.
The second side
If the bottom has a length of 400 mm and starts at X=18, it ends at:
X = 418So the right side should start at X=418 and be 18 mm thick:
X: 418..436
Y: 0..300
Z: 0..500Written as:
{
"dimensions": { "length": 500, "width": 300, "thickness": 18 },
"position": { "x": 418, "y": 0, "z": 500 },
"rotation": { "x": 0, "y": 90, "z": 0 }
}The top
The top works the same way as the bottom, only it is moved up.
If the cabinet is 500 mm high and the top is 18 mm thick, the top occupies:
Z: 482..500Written as:
{
"dimensions": { "length": 400, "width": 300, "thickness": 18 },
"position": { "x": 18, "y": 0, "z": 482 },
"rotation": { "x": 0, "y": 0, "z": 0 }
}Range:
X: 18..418
Y: 0..300
Z: 482..500The back panel
The back panel is at the rear of the cabinet, that is on the Y+ side.
If the cabinet has:
X: 0..436
Y: 0..300
Z: 0..500then a 3 mm HDF back panel that covers the whole rear may occupy:
X: 0..436
Y: 300..303
Z: 0..500To stand the 436 × 500 × 3 panel up as the back panel, we rotate it around X:
{
"dimensions": { "length": 436, "width": 500, "thickness": 3 },
"position": { "x": 0, "y": 303, "z": 0 },
"rotation": { "x": 90, "y": 0, "z": 0 }
}After rotation:
length=436goes along X,width=500goes along Z,thickness=3goes along Y.
Result:
X: 0..436
Y: 300..303
Z: 0..500How to check for yourself that it is right
The simplest way is not to look at position first, but at the ranges after assembly.
For each panel, it is worth being able to answer:
from which X to which X?
from which Y to which Y?
from which Z to which Z?Example of a correct simple cabinet:
left side: X 0..18 Y 0..300 Z 0..500
bottom: X 18..418 Y 0..300 Z 0..18
top: X 18..418 Y 0..300 Z 482..500
right side: X 418..436 Y 0..300 Z 0..500
back panel: X 0..436 Y 300..303 Z 0..500If two parts are to touch, one range should end exactly where the other begins.
For example:
left side ends at X=18
bottom starts at X=18This means they touch.
If there is a gap:
left side ends at X=18
bottom starts at X=20there is 2 mm of clearance between them.
If they overlap:
left side ends at X=18
bottom starts at X=16the parts overlap by 2 mm.
A practical rule
When writing examples by hand, it is best to think like this:
- First determine what
X/Y/Zrange the panel should have after assembly. - Only then choose
dimensions,positionandrotation. - After a change, calculate the ranges and check the contacts.
The example used for testing is:
docs/examples/01-korpus.mebThis is a deliberately small file that shows a side, a bottom, a top, a second side and a back panel.