Message Boards Message Boards

Plot a Clebsch surface?

Posted 4 years ago

Hello Dear Mathematica Community,

I am in a desperate need for help, since I am not able to model a surface. Thing is that in the school project we have to model 2 surfaces and 3D print them. My background, when It comes to modeling is from Blender usage and I was able to get the surface for the first body we need (Whitney's Umbrella) and that is fine. But many tries at going for Clebsch have failed. Yesterday I downloaded a trial version of Mathematica and hoping it would help me. I have watched some tutorials but something seems to be wrong with my software, because shift+return (I am using Windows 10), does not give me any graph, either 2D nor 3D.

Could someone please give me some hints? The deadline is really close.. and I feel stuck

Clebsch surface formula should be this one:

81 (x3 + y^3 + z^3) - 9 (x^2 + y^2 + z^2) - 189 (x^2 y + x^2 z + x y^2 + x z^2 + y^2 z + y z^2) + 54 x y z - 9 (x + y + z) + 126 (x y + x z + y z) - 1 = 0

Any kind of help is extremely appreciated!

POSTED BY: Meigo Mõttus
9 Replies

Dear Meigo,

the problem in your notebook is that you start your input with an " = ", so it is interpreted as some "free text" instead of commands (the error message says it all!). Just copy-and-past the following code into your notebook (an improved version):

clebsch[x_, y_, z_] := 
 81 (x^3 + y^3 + z^3) - 
  189 (x^2*y + x^2 z + y^2 x + y^2 z + z^2 x + z^2 y) + 54 (x y z) + 
  126 (x y + x z + y z) - 9 (x^2 + y^2 + z^2) - 9 (x + y + z) + 1

ContourPlot3D[clebsch[x, y, z] == 0, {x, y, z} \[Element] Ball[{0, 0, 0}, 1], RegionBoundaryStyle -> None]
(* or: *)
ContourPlot3D[clebsch[x, y, z] == 0, {x, y, z} \[Element] Ball[{0, 0, 0}, 1], 
 RegionBoundaryStyle -> None, PlotTheme -> "ThickSurface", Axes -> False, Boxed -> False, PlotPoints -> 50]

enter image description here

PS: What kind of export do you have in mind?

POSTED BY: Henrik Schachner
Posted 4 years ago

That is perfect! Thank You so much, Henrik!

I am trying to export for Blender. So basically 3DS, STL- I guess these would work fine. Though I am not sure if It is good to give it the thickness here or in Blender. I would like to scale it to be printed and it would fit in a cube 100x100x100mm and the wall thickness 3-4mm. I tried to export by this command export["TestPlot3D.3ds"] But I am not sure where did the result go as far as searching in the Wolfram Mathematica folder, I didn't get any results. Probably the command is wrong.

POSTED BY: Meigo Mõttus

Glad to help!

For export try:

s3D = ContourPlot3D[
  clebsch[x, y, z] == 0, {x, y, z} \[Element] Ball[{0, 0, 0}, 1], 
  PlotTheme -> "ThickSurface", Axes -> False, Boxed -> False, 
  PlotPoints -> 50, RegionBoundaryStyle -> None]

Printout3D[Graphics3D[s3D[[1, 1]]], RegionSize -> Quantity[10, "Centimeters"]]

This will throw some error messages, but it seems to work, though! I have no idea on how to adjust the wall thickness.

Using s3D[[1, 1]] instead of simply s3D (i.e. extracting GraphicsComplex) was the only workaround I could find to make it work on MMA V12.1 - the new introduced RegionBoundaryStyle seems to be the problem (at least for me ("12.1.0 for Linux x86 (64-bit) (March 14, 2020)")).

Addendum: Case reported [CASE:4546899]

POSTED BY: Henrik Schachner
Posted 4 years ago

I can not thank You enough for what You have done for me Henrik!

It is truly amazing to find so helpful people.

If there's anything I can do for You please let me know!

Danke schön!

Best regards,

Meigo

POSTED BY: Meigo Mõttus
Posted 4 years ago

On this link they have gotten the shape to look like this: https://www.shapeways.com/product/GPREQQ9WR/clebsch-surface

Would You know how to get this kind of result?

enter image description here

POSTED BY: Meigo Mõttus

On the mentioned website they are using a different formula! And to get the same shape you can do:

clebsch[x_, y_, z_] := 81 (x^3 + y^3 + z^3) - 
  189 (x^2*y + x^2 z + y^2 x + y^2 z + z^2 x + z^2 y) + 54 (x y z) + 
  126 (x y + x z + y z) - 9 (x^2 + y^2 + z^2) - 9 (x + y + z) + 1
ContourPlot3D[clebsch[x, y, z] == 0, {x, y, z} \[Element] Ball[{0, 0, 0}, 1]]

enter image description here

POSTED BY: Henrik Schachner
Posted 4 years ago

Thank You Henrik!

You are a true lifesaver.

That's exactly the shape I was hoping for. Sadly I am not sure how to get the result. I tried to enter the commands, I guess something is wrong. Could You explain what did I do wrong and how could I export the mesh afterward?

I can not express my gratitude enough!!

enter image description here

POSTED BY: Meigo Mõttus

Hello Meigo,

assuming there is a typo and your equation reads 81 (x^3 + y^3 + ... then you can plot it like so:

clebsch[x_, y_, z_] := 
 81 (x^3 + y^3 + z^3) - 9 (x^2 + y^2 + z^2) - 
  189 (x^2 y + x^2 z + x y^2 + x z^2 + y^2 z + y z^2) + 54 x y z - 
  9 (x + y + z) + 126 (x y + x z + y z) - 1

ContourPlot3D[clebsch[x, y, z] == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

enter image description here

POSTED BY: Henrik Schachner
Posted 4 years ago

Thank You so much Henrik!

So weird that I didn't see that. The other mistake I made: I wasn't on Alpha-Mode Notebook, but a regular one. I would like to increase the range for plotting, so I tried to enter this formula, but it can't understand what I am saying

plot3D 81 (x^3 + y^3 + z^3) - 9 (x^2 + y^2 + z^2) - 189 (x^2 y + x^2 \ z + x y^2 + x z^2 + y^2 z + y z^2) + 54 x y z - 9 (x + y + z) + 126 \ (x y + x z + y z) - 1 = 0, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}]

Then I tried to increase the limits in the formula You gave, but still there is some error.

EDIT: I got the limits fixed. Thnk You!

enter image description here

Though I was hoping it would look something like this:

POSTED BY: Meigo Mõttus
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