%% examples/mechanics-block-pulley.tex
%%
%% Demonstrates block and pulley from tikzphysics.mechanics,
%% composed with a wedge from tikzphysics.surface.  A classic
%% inclined-plane-with-pulley setup.

\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{tikzphysics.surface, tikzphysics.mechanics}

\begin{document}

\begin{tikzpicture}
  %% wedge (inclined plane)
  \node[wedge,
        wedge angle=30,
        wedge width=6]
    (W) at (0,0) {};

  %% block sitting on the slope, at the mid-point of the hypotenuse
  \node[block,
        physics block width=1,
        physics block height=1,
        rotate=30,
        anchor=south]
    (B) at (W.slope-mid) {$m$};

  %% Put the pulley just beyond the right end of the slope. Its centre is
  %% offset normally by half the block height minus the pulley radius
  %% (0.5 - 0.3 cm), so the parallel string touches the upper rim.
  \coordinate (pulley-center) at ($(W.top)+(30:0.5)+(120:0.2)$);
  \node[pulley,
        physics pulley diameter=0.6]
    (P) at (pulley-center) {};

  %% hanging block on the other side
  \node[block,
        physics block width=0.8,
        physics block height=0.8]
    (H) at ($(P.east)+(0,-2.5)$) {$M$};

  %% One physical string: both straight portions are computed tangents,
  %% joined by the exact circular contact arc around the pulley.
  \physicsstringoverpulley{B.east}{P}{H.north}
\end{tikzpicture}

\end{document}
