The total kinetic energy of a double pendulum can be calculated as follows: $$L = \frac{1}{2} (m_1 + m_2) {l_1}^2 \dot{\theta_1}^2 + \frac{1}{2} m_2 {l_2}^2 \dot{\theta_2}^2 + m_2 l_1 l_2 \dot{\theta_1} \dot{\theta_2}\cos(\theta_1 - \theta_2) + (m_1 + m_2) g l_1 \cos(\theta_1) + m_2 g l_2 \cos(\theta_2).$$
This works if the double pendulum in question is formed by two masses connected to each other and — one of them — to the point of origin by a "massless" rod. However, I'm interested in expanding this formula to cover systems where two bodies of more complex shapes are the swinging parts of the "double pendulum", if it possible that is.
Say I have a Cartesian plane, and at the origin point there's a cylinder of height $H$ and radius $R$ with the $y$-axis passing through the center of mass. On top of it is a cone placed upside down, with the center of mass also passing through the $y$-axis. Said cone has radius $r$ and height $h$.
The cylinder is then tipped to the right, forming now an angle $\theta_1$ with the $x$-axis. As a consequence, the cone swings as well, producing an angle $\theta_2$ respect to the horizontal. It all happens within time $t$. How can I work out the Lagrangian from the data given?