Message Boards Message Boards

Export a 3D heart equation?

Posted 6 years ago

Hello, I'm new to Mathematica and I've been trying to export the heart equation as a STL file. Below is the equation of the 3D heart

 (x^2+9/4y^2+z^2-1)^3-x^2z^3-9/(80)y^2z^3=0 

I've tried 3DPlot, but it doesn't seem to work.

Please help. How do you plot this graph and export it as STL file?

Thanks

POSTED BY: Shu Takahashi
2 Replies

I have to mention, that I know nothing about the STL format. But here is what I tried. First you have to get used to Mathematica formula conventions. Expecially "=" is used as assignment. You are looking for "==" which is equality. To plot your function I chose ContourPlot3D:

ContourPlot3D[(x^2 + 9/4 y^2 + z^2 - 1)^3 - x^2 z^3 - 9/(80) y^3 z^3 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

enter image description here Then I use Export to get the STL file:

Export["<insert path>\\heart.stl", %]

Replace the "\" with "/" if you are on a linux/unix system. I can't check the contents of the STL file - it might be neccessary to fine-tune the settings of ContourPlot3D to get the desired result. The "%" is an abbreviation for the last output.

POSTED BY: Markus Roellig
Posted 6 years ago

Hi, You can get it by

h = RegionPlot3D[(x^2 + 9/4 y^2 + z^2 - 1)^3 - x^2 z^3 - 9/(80) y^2 z^3 <= 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]; Export["f:\heart.stl", h]

and find it at your F disk.

POSTED BY: Nan Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract