the other way of differentiating gems is to specify the materials.
Got it, thanks.
I am doubtful but... Is there any way for stonesense to work out; what base stone a vein came from, after it has been mined out? (Or more precicely, does DF even keep track?)
Yes, as long as you are talking about the tiles, and not some random item stone.
Every single tile has a base layer stone determined by depth under ground and the biome.
Tiles have base materials determined by the tile type number:
Ordinary stone/soil -- uses the geology.
Obsidian -- there are special obsidian tiles for cast obsidian.
Ice -- seemingly obvious, but ice being thawable, the original tile type is preserved in a special structure I call the 'ice vein'. So, you can see what was there before the ice (and having transparent/translucent ice is possible).
Mineral veins -- have a special tile type, combined with special mineral vein objects. Again, it is possible to know what base layer it is overriding. 40d even had multiple mineral veins on a single tile. 31.xx seems to limit that stuff to one mineral vein type per tile to conserve CPU resources.
Feature stone -- this is another set of special tile types, this time combined with local and global features (mostly used for adamantine veins and hell).
Special tiles -- this includes ash, fire, all the 16 types of grass, semi-molten rock (which is actually very, very cold), that blue glowing floor thing and so on.
So, those can be combined just about any way you like... and hell being made out of elephant liver tissue isn't impossible
... or making 100z above-ground spires out of star ruby by hacking adamantine veins.