I would like to make a 3D heart with openscad.
I found the equation https://mathworld.wolfram.com/HeartSurface.html
How can I make a polyhedron from it ?
Why not just do this?
mmm That's a great idea! it's very simple!
It looks even better with scale([1, .7, 1.7])
The one with the equation looks much better.
and I would like to try to make a polyhedron from an equation, that would be a great a achievement.
I made a thing from your replies, thanks guys! https://www.thingiverse.com/thing:5635344
You can choose cube or sphere as voxels
I hope it will be useful as a base for other things, it's full openscad code so it can be include in another project and be use in the customizer.
I'm still looking for a smoother version (not voxels).
the sources are here: https://github.com/yannickbattail/openscad-models/tree/main/VoxelHeart
I improved my code:
Thank you everybody for you help and ideas!
You have 1 like :)
I'm still working on my surface renderer btw, maybe i will publish something as well.
This is not exactly what you asked but here is a fast approximation generated from the SVG in the link you gave.
This one is a full computed polyhedron but not good enough to release the code :)
I'd say you have to solve for one of the parameters so you have a set of functions to iterate over.
You could also iterate over the existing parameters and use the equation as boundary condition on whether to plot a voxel or not, but that will give you a voxel heart.
thank you for your code,
here is mine, I made fully functional model from your code and you can choose cube or sphere as "voxel"
if you reduce the size of the cube, it takes a lot of time to process.
if somebody have a solution to make it smooth, that would be great (even if I like voxel design).
I gave this a go yesterday and really didn't finish. Using Wolfram Alpha, I converted the equation from cartesian to spherical coordinates. The radius is then a function of the altitude and azimuth angles. For any set of input angles you get a 6th order polynomial for the radius which you solve for a positive real root. I was able to solve for the positive real root using a recursive function, but it's quite slow. The result didn't look right and I haven't slogged back through the math to find if or where I made a mistake.