Structure and density of cometary nuclei