Two sources: (See end result there as well)



http://paulbourke.net/geometry/toroidal/ (scroll down)

Trying to get a handle on the process of converting readily available math formulas into mesh.

The formula (from the first source):

name = Pisot Triaxial;

comments = Charles Pisot (1910-1984).;

a1_min = 0;
a1_max = 6.28318530718;
a1_steps = 50;

a2_min = 0;
a2_max = 6.28318530718;
a2_steps = 50;


X = 0.5 * 0.655866 * cos(deg(1.03002 + A1)) * (2 + cos(deg(A2)));
Y = 0.5 * 0.74878 * cos(deg(1.40772 - A1)) * (2 + 0.868837 * cos(deg(2.43773 + A2)));
Z = 0.5 * 0.868837 * cos(deg(2.43773 + A1)) * (2 + 0.495098 * cos(deg(0.377696 - A2)));

I'm guessing A1 and A2 translate to U and V respectively. Some of the other variables may perhaps translate to a, b, c, etc variables.

After that, I'm lost.


Based on Batfinger's input below, I put together this:

Literal copy paste.

Pisot Triaxial Surface

Math Function XYZ

X = 0.5 * 0.655866 * cos((1.03002 + u)) * (2 + cos((v)))
Y = 0.5 * 0.74878 * cos((1.40772 - u)) * (2 + 0.868837 * cos((2.43773 + v)))
Z = 0.5 * 0.868837 * cos((2.43773 + u)) * (2 + 0.495098 * cos((0.377696 -v)))

U Min = 0
U Max = 6.28
U Step = 50

V Min = 0
VMax = 6.28
V Step = 50

That works!

Pisot Triaxial Surface

There just seems to be so much out there that readily translates. Useful to know.

  • 2
    $\begingroup$ Appears the equation on (legendary) Paul Bourke site are already in parameterized to u, v. Do not use degrees. $\endgroup$ – batFINGER Dec 22 '20 at 3:34
  • $\begingroup$ Are you writing a script to generate the mesh? $\endgroup$ – HISEROD Dec 22 '20 at 4:37
  • $\begingroup$ Nope. That's another endeavor for another time. This is using the XYZ Math Function. I'm guessing there are some differences in the code and the process. The XYZ functions would still be filtered through Blender Python wouldn't they? Or not? $\endgroup$ – unkerjay Dec 22 '20 at 4:46
  • 1
    $\begingroup$ @BatFINGER re: "(legendary) Paul Bourke" indeed $\endgroup$ – unkerjay Dec 22 '20 at 4:48

Make a Script.

Seems you have already got there, started answer, thought I'd post as crunching in the equation via the text editor is IMO way simpler

enter image description here

The equations are in parametric form on the Paul Bourke site linked to question.

To make them python expressions only requires adding an asterisk * to represent multiplication.

I find crunching formulas into blender's text boxes a little tedious, so have written as a script. Enable the Add Mesh Extra Objects addon to have the operator available.

Note: This is the script to run in object mode to create the Pisot Surface (Equations from Paul Bourke link in question) Simply copy script, paste into text editor and press run script.

enter image description here

import bpy
from math import pi

# run in object mode
if context.mode != 'OBJECT':

        x_eq="0.655866 * cos(1.03002 + u) * (2 + cos(v))",
        y_eq="0.754878 * cos(1.40772 - u) * (2 + 0.868837 * cos(2.43773 + v))",
        z_eq="0.868837 * cos(2.43773 + u) * (2 + 0.495098 * cos(0.377696 - v))",
        range_u_max=2 * pi, 
        range_v_max=2 * pi, 

Notes. The defaults of the operator on first run can also be seen by bpy.ops.mesh.primitive_add_xyz_function_surface(Tab in blenders python console. There is no need to add a value to call above that is already a default.

The code below is the (expanded) result of auto completing the operator in the python console. It shows the default settings of the operator that create the sea shell. It is not the Tisot surface

>>> bpy.ops.mesh.primitive_xyz_function_surface(
Add a surface defined defined by 3 functions:
x=F1(u,v), y=F2(u,v) and z=F3(u,v)

Tip to more easily change some of the constants eg 0.868837 could assign them to a helper method.

    x_eq="A + u",
  • $\begingroup$ I plugged in the code, all but the part that begins "Add a surface" into the XYZ presets in 2.92a, and it bombed: imgur.com/a/6rQfLvF I'm going to try it in 2.91 stable and see if there's a difference. Not sure if I should be including the "Add a surface" code. Not sure how to incorporate the "Tip". It plugs into the presets fine, shows up, click on it, error. $\endgroup$ – unkerjay Dec 23 '20 at 6:28
  • $\begingroup$ All I did was copy the code into blender and save it as a preset under "Application_Support/Blender/2.9x/Operator/Presets/XYZ_Surfaces" (might've fudged the exact location, don't have it in front of me). You get the idea. $\endgroup$ – unkerjay Dec 23 '20 at 6:35
  • $\begingroup$ Simply copy code above, paste into text editor, and press run script. It is not a preset. $\endgroup$ – batFINGER Dec 23 '20 at 6:40
  • $\begingroup$ I see the difference, the code in presets is formatted different. "x_eq" in the preset is "op.x_eq". Going to try reformatting the code. See if that works. $\endgroup$ – unkerjay Dec 23 '20 at 6:44
  • $\begingroup$ Yeah, I tried that. I get a syntax error: imgur.com/a/VfIzpWB -- I copied and pasted all of it as shown above. Should I not have? If not, what to leave out? $\endgroup$ – unkerjay Dec 23 '20 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.