Constructing a line segment through a point so it has a ratio $1:2$

Question: Let $AOB$ be a given angle less than $180^\circ$ and let $P$ be an interior point of the angular region of $\angle AOB$. Show, with proof, how to construct, using only ruler and compass, a line segment $CD$ passing through $P$ such that $C$ lies on ray $OA$ and $D$ lies on ray $OB$, and $CP : PD=1 : 2$.

My attempt: I thought that constructing a triangle and constructing medians for every side would give me the centroid, which divides the median in the ratio $2:1$.

But how can I construct a triangle?

Let $K$ are point such that $OP:PK=2:1$.
Then $KD||OA$.
$DP$ intersect to $OA$ in $C$
Let $Q$ be a midpoint for $OP$ (you can easly construct it), the reflect $Q$ across $P$ to point $M$ and then reflect line $OA$ across $M$ to line $p$ which cuts $OB$ at $E$. Then reflect $E$ across $M$ to get $C$ (on $OA$) where $CP$ cuts $OB$ is $D$.