I'm trying to create a 3D Cardioid, for which I would like to control/adjust the thickness along the axis perpendicular to the cusp. Do I use the cardioid's parametric equations for X and Y? What about Z? I'm getting "Error Evaluating Expression."
-
$\begingroup$ Need more details about your setup… $\endgroup$– Markus von BroadyCommented Sep 27, 2023 at 12:47
-
$\begingroup$ If you get an error, show us the error and the code/driver expression which produces the error. Best would be the blend file itself blend-exchange.com $\endgroup$– taiyoCommented Sep 27, 2023 at 14:37
1 Answer
Cardioid with Geometry Nodes
I was able to make a basic cardioid using Blender's Geometry Nodes by following the parametric equations for X and Y on the wikipedia page
- Add a new
Geometry Nodes
modifier to the default cube. - Add a
Curve Circle
node and connect it to theGeometry
output. Increase theResolution
to get a smoother curve. - Insert a
Set Position
node after theCurve Circle
node. - Use a
Spline Parameter
node to get the angle around the unit circle. TheFactor
output gives0.0
to1.0
where1.0
represents a full turn. We want a full turn to be2 * pi
so add aMultiply
node after theFactor
output. You can type2 * pi
and Blender will recognize that. I'll call this parameter t from now on - Use
Math
nodes to to set up simplified parametric equations forX
andY
$$x(t) = 2\cos t - \cos 2t$$ $$y(t) = 2\sin t - \sin 2t$$ - Combine
X
andY
with aCombine XYZ
node and plug that into thePosition
input of theSet Position
node.
Controlling Width
A Multiply
node can be added after the calculation for x(t) to make the whole curve wider along the axis where the cusp sits. This is effectively introducing a back into the parametric equation. $$x(t) = a(2\cos t - \cos 2t)$$
The Z Dimension
Without a specific description of how the final 3D Cardioid should look it's hard to give guidance, but a cool way I found to bring the Z
dimension into it was to add nodes for $$z(t) = \sin t$$ and then mess with the Multiply
nodes on the Spline Parameter Factor.