Accumulated experience & knowledge from craftsmen and Masters via trial & error over an enough long time scale.
Math, Geometry, Physics & Engineering came later when people came to study & describe these experienced rules to write them down and formalize them.
"Action came before Theory"
