Cylinder volume at BDC divided by Cylinder volume at TDC will generally get you close enough without having to work out any voids around spark plugs etc.
As an example I just had a look at my ball hopper engine drawings.
Crankshaft ctr line to top of cylinder head is 8.00″, less 0.375″ spigot on head = 7.625″
Crank throw 1″ plus conrod length 4.625″ plus gudgeon pin to piston crown 1.25″ = 6.875″
7.625 – 6.875 = 0.75″ theoretical gap between head and piston crown at TDC.
You don’t really need to use volume both lengths will be getting multiplied by pi so just us elengths
Length at BCD = 2″ stroke plus teh 0.75″ = 2.75″ / 0.75″ head gap = 3.66:1 comp ratio
It is actually more like 3.3:1 as there is a valve box on the side of the head but whose counting!