A simple thing (in theory): a tile that the player can traverse but that animals can't. I guess it would be an item of craftable flooring. Apparently cattle grids don't work brilliantly well against goats, but one may perhaps allow the realism to slip a little. Horses can't pass them, though. I don't know whether it would be impossible to implement in SDV (or whether someone has already done it), but it would make life a *lot* simpler when planning gates and fences etc!
I don't know if this actually works but you can try using this property on tiles that you don't want your livestock to pass through: NPCBarrier T NPCs won't be able to pass through those tiles, but I don't know if it works with livestock at the moment.