How to create a 3D object from a specific equation I realize this has been asked before, so I apologize for the "repeat". I saw this answer, and it mostly solved my issue. However, I can't figure out how to generate my specific equation. This is my equation:



This works from the range -1 &lt;= x &lt;= 1. For the really big equation, the "x" should actually be z, and the "h" should be x (I had to use those to graph it on Desmos). In any case, I tried inputting the first half of the equation with the Blender Add Mesh: Extra Objects > Math Function > Z Math Surface by typing this:

(sqrt(-16*fabs(x)+40*sqrt(fabs(x))*y-16*pow(x,2)-25*pow(y,2)+16)+15*x)/15


The result is an error evaluating the expression. Do I have to set the range somehow? Would it be better to use XYZ Math Surface? (and if so, how?). Or am I just doing something wrong? Thank you in advance.
The problem that prevents your equation from working with the Add Mesh: Extra Objects &gt; Math Function &gt; Z Math , is that you're using a sqrt function which is undefined for negative values.

When the math function operator tries to evaluate different values for X and Y, it raises an exception the first time that evaluation fails due to an attempt to sqrt a negative value.

Another option is to write a script of your own to generate the mesh only where the equation provides valid results. I wrote a quick script to do that below. It's incomplete as it only calculates vertices coordinates (result in the image above), and does not generate edges and faces, but it's a start:

import bpy, bmesh
import numpy     as np
from   math      import sqrt
from   itertools import product

# Define X and Y values lower bound, upper bound and number of points
lb, ub, n = ( -30, 30, 1000 )

# Calculate all the possible X-Y combinations and convert to a numpy array
xy = np.array( list( product( np.linspace( lb, ub, n ), np.linspace( lb, ub, n ) ) ) )

# Split X and Y to different arrays and initialize Z array
xs = xy[:,0]
ys = xy[:,1]
zs = []

# Iterate over every x and y value, and try to calculate the z.
# Append result if successful, and nan if not
for x, y in zip( xs, ys ):
    try:
        zs.append(
            ( 
                sqrt( 
                    -16 * abs(x) + 40 * sqrt( abs(x) ) * y - 16 * pow( x, 2 ) - 25 * pow( y, 2 ) + 16 
                ) + 15 * x 
            ) / 15 
        )
    except:
        zs.append( np.nan )

# Drop nan values from all axes
mask = np.logical_not(np.isnan(zs))
xs = xs[ mask ]
ys = ys[ mask ]
zs = np.array( zs )[ mask ]

# Generate mesh
bm = bmesh.new()

# Add vertices
for x, y, z in zip( xs, ys, zs ):
    bm.verts.new( (x,y,z) )

m = bpy.data.meshes.new( "equation" )

bm.to_mesh( m )

o = bpy.data.objects.new( "equation", m )
bpy.context.scene.objects.link( o )


This script uses external, non built-in libraries (namely numpy). You can achieve the same result without numpy, but it makes some of the calculations quicker and easier.