Well, the centre of the wheel is an iron or steel casting - the designer would know the density of the material and could either design to produce the required weight or, less likely, specify the weight requirements and the pattern maker would decide on the final shape. In the early days, elements such as this, and the applied pin striping were niceties that eventually gave way to the economic considerations of mass production. With modern steam locomotives, counterbalancing such as this eventually became insufficient to completely offset the the mass of the reciprocating and rotating parts and cross-counterbalancing was introduced, whereby the rotating masses on one side of the loco were also balanced by those moving on the opposite side.
Wayne