Spherical shell using tikz

How can I draw a spherical shell of a certain thickness using tikz?

I have found this question where somebody was asking about drawing one sphere inside another, which is surely related to this one.

Drawing Sphere to represent a black hole

Any help?

• Welcome to TeX.SX! Can you show us what you have tried so far? (Meaning that you can add a Minimal Working Example). As you have already found the other question with nice answers, you have some starting point already - we would appreciate to see it. – Tom Jan 24 at 14:43
• Can you also make a sketch how the result should look like? – user36296 Jan 24 at 14:50
• I'm working on a first approximation right now so that I can show you. – Marc Jan 24 at 14:53

I can only guess.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
% https://tex.stackexchange.com/a/12033/121799
\tikzset{reverseclip/.style={insert path={(current bounding box.north
east) rectangle (current bounding box.south west)}}}
\begin{document}
\tdplotsetmaincoords{110}{-30}
\begin{tikzpicture}[tdplot_main_coords]
\begin{scope}
[reverseclip];
\end{scope}
\fill[top color=gray!80,bottom color=gray!60]
-- cycle;
-- cycle;
-- cycle;
\end{tikzpicture}
\end{document}


ADDENDUM: Just for fun (because @Raaja teased me). The code is taken from the codes that were used in the 2018 Christmas extravaganza.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\usetikzlibrary{calc,ducks,marmots}
\usepgfmodule{nonlineartransformations}
\makeatletter
% from https://tex.stackexchange.com/a/434247/121799
\tikzdeclarecoordinatesystem{sphere}{
\tikz@scan@one@point\relax(#1)
\spheretransformation
}
%
\def\spheretransformation{% similar to the pgfmanual section 103.4.2
\pgfmathsincos@{\pgf@sys@tonumber\pgf@x}%
\pgfmathsetmacro{\relX}{\the\pgf@x/28.3465}%
\pgfmathsetmacro{\relY}{\the\pgf@y/28.3465}%min(max(
\pgf@x=\myx pt%
\pgf@y=\myy pt%
}
\makeatother

% https://tex.stackexchange.com/a/12033/121799
\tikzset{reverseclip/.style={insert path={(current bounding box.north
east) rectangle (current bounding box.south west)}}}
\begin{document}
\tdplotsetmaincoords{110}{-30}
\foreach \X in {2,1.9,...,-4}
{\begin{tikzpicture}[declare function={
myx(\x,\y,\r)=\r*cos((\y/\r)*(180/pi))*sin((\x/\r)*cos((\y/\r)*(180/pi))*(180/pi));
myy(\x,\y,\r)=\r*sin((\y/\r)*(180/pi));},tdplot_main_coords]
\begin{scope}
[reverseclip];
\end{scope}
-- cycle;
-- cycle;
-- cycle;
\clip
\begin{scope}[tdplot_screen_coords]
\begin{scope}[transform shape nonlinear=true]
\pgftransformnonlinear{\spheretransformation}
\marmot[scale=2.5,xshift=\X*1cm,yshift=-1.2cm];
\end{scope}

• Im working on it myself, if it doesn't work, will come back here. But the marmots gif is awesome!! – Raaja Jan 25 at 5:08