I am trying to create a parametric 'petal' surface with a vertical cross section defined by an arbitary bezier curve, and bounded by the area enclosed by a polar curve in the x-y plane.
I can achieve this by defining a cross section implicity in terms of $r$. For instance, if I want a cross section $r^2$ and a polar curve $sin^2 2\theta$, I can define the following:
$r = {t\sin^2 2\theta}$
$x = {t\sin^2 2\theta \cos\theta}$
$y = {t\sin^2 2\theta \sin\theta}$
$z = {r^2}=({t\sin^2 2\theta})^2$
Where $r = \sqrt{x^2+y^2}$
Visualisation here : Each 'petal' is lifted along the curve $z = {r^2}$.
Suppose I would like to do the same using a 2-D bezier curve ${B(t)}$ as the cross section; I know how to create a surface 'sweeping' a full revolution i.e:
$x=B_r(t)\cos\theta$
$y=B_r(t)\sin\theta$
$z=B_z(t)$
Where $r = \sqrt{x^2+y^2}$
However, I am not sure how to make it bounded by a polar curve such as $r = {\sin^2 2\theta}$.
Thanks!
If you want your petal to be "lifted" on the sphere with center $(0,0,R)$ and radius $R$, therefore with equation
$$\underbrace{x^2+y^2}_{r^2=\sin^2(2 \theta)}+(z-R)^2=R^2,\tag{1}$$
it suffice to extract $z$ from (1) under the form:
$$(z-R)^2=R^2-\sin^2(2 \theta) \ \implies \ z=R\color{red}{-}\sqrt{R^2-\sin^2(2 \theta)} \tag{2}$$
(please note that we have taken the $\color{red}{minus}$ sign in order to have the initial point at the origin (0,0,0))
(with the meaning that any point (x,y,0) defined by polar equation $r=\sin(2 \theta)$ on (x,y) horizontal plane, is "lifted at height given by (2).