From BlenderWiki

Jump to: navigation, search
3D Function Surface
Add 3D Function Surface
UI location Group: AddMesh
Version 0.3.6 Author(s) Buerbaum Martin (Pontiac)
Blender 2.56 Rev:#34093 License GPL


Executable information
File name add_mesh_3d_function_surface.py
Current version download https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/add_mesh_extra_objects/


Links script on gitorious, blenderartists thread



Installation

  • This is now (2.64 Dec 2012) incorporated into Add Mesh: Extra Objects. i.e. You probably do not need it.
  • The script linked to here has \'\'\' before and after the bl_info entry which will cause python to reject it.
  • If you edit them out, the script will not activate although you can install it.
  • This script is in Blender 2.5 Add-Ons menu.
  • In User Preferences you can see the Add-Ons menu.
  • You can activate the script here.
  • The script will now show up in the Shift/A Add/Mesh Menu.

Introduction

Scripts Add Mesh Function Surface.jpg

Create 3D Function Surface

  • This Script creates a 3D Function Surface Primitive.
  • Press the Shift/a.
  • Then Add.
  • Then Mesh.
  • On the bottom of the list there are now two new entries: Z function surface and Xyz function surface
  • Click on on one of them to create the New Mesh.
  • You can change the script parameters in the Toolbar menu.
  • Currently you need to set script parameters before doing any transforms or using modifiers.
  • This script makes use of math calculations.
  • You can edit the code in the script interface or change parameters with the sliders.


Instructions

Interface/Menu Overview

  • The interface for this script is found in the Tool Shelf > Object Tools
  • Features: Sliders, Numeric Input.
  • Equation Add a math value.
  • X subdivisions
  • Y subdivisions
  • X size
  • Y size


Known Issues

  • In Blender 2.5 the scripts currently show up in the toolbar.
  • Currently you need to set script parameters before doing any transforms or using modifiers.

Additional Information


  • In the Wiki writer's opinion always have Python Installed on your computer when using scripts. http://www.python.org/

Support



XYZ Function Surface Examples

Bonbon

Parameter Value
Bonbon
x u
y cos(u)*sin(v)
z cos(u)*cos(v)
Umin 0
Umax 2*pi
Uwrap False
Vmin 0
Vmax 2*pi
Vwrap False

Catalan

Parameter Value
Catalan
x u-sin(u)*cosh(v)
y 4*sin(1/2*u)*sinh(v/2)
z 1-cos(u)*cosh(v)
Umin -pi
Umax 3*pi
Uwrap False
Vmin -2
Vmax 2
Vwrap False

Catenoid

Parameter Value
Catenoid
x 2*cosh(v/2)*cos(u)
y v
z 2*cosh(v/2)*sin(u)
Umin -pi
Umax pi
Uwrap True
Vmin -pi
Vmax pi
Vwrap True

Cosinus

Parameter Value
Cosinus
x u
y sin(pi*((u)**2+(v)**2))/2
z v
Umin -1
Umax 1
Uwrap False
Vmin -1
Vmax 1
Vwrap False

Enneper

Parameter Value
Enneper
x u-u**3/3+u*v**2
y u**2-v**2
z v-v**3/3+v*u**2
Umin -2
Umax 2
Uwrap False
Vmin -2
Vmax 2
Vwrap False

Helicoidal

Parameter Value
Helicoidal
x sinh(v)*sin(u)
y 3*u
z -sinh(v)*cos(u)
Umin -pi
Umax pi
Uwrap False
Vmin -pi
Vmax pi
Vwrap False

Helix

Parameter Value
Helix
x (1-0.1*cos(v))*cos(u)
y 0.1*(sin(v)+u/1.7-10)
z (1-0.1*cos(v))*sin(u)
Umin 0
Umax 4*pi
Uwrap False
Vmin 0
Vmax 2*pi
Vwrap False

Hexaedron

Parameter Value
Hexaedron
x cos(v)**3*cos(u)**3
y sin(u)**3
z sin(v)**3*cos(u)**3
Umin -pi/2
Umax pi/2
Uwrap False
Vmin 0
Vmax 2*pi
Vwrap False

Hyperhelicoidal

Parameter Value
Hyperhelicoidal
x (sinh(v)*cos(3*u))/(1+cosh(u)*cosh(v))
y (cosh(v)*sinh(u))/(1+cosh(u)*cosh(v))
z (sinh(v)*sin(3*u))/(1+cosh(u)*cosh(v))
Umin -pi
Umax pi
Uwrap False
Vmin -pi
Vmax pi
Vwrap False

Klein

Parameter Value
Klein
x (3*(1+sin(v))+2*(1-cos(v)/2)*cos(u))*cos(v)
y (-2*(1-cos(v)/2)*sin(u))
z (4+2*(1-cos(v)/2)*cos(u))*sin(v))
Umin 0
Umax 2*pi
Uwrap True
Vmin 0
Vmax 2*pi
Vwrap True

Shell

Parameter Value
Shell
x 1.2**v*(sin(u)**2 *sin(v))
y 1.2**v*(sin(u)*cos(u))
z 1.2**v*(sin(u)**2 *cos(v))
Umin 0
Umax pi
Uwrap True
Vmin pi/4
Vmax 5*pi/2
Vwrap True

Torus

Parameter Value
Torus
x (1+0.5*cos(u))*cos(v)
y 0.5*sin(u)
z (1+0.5*cos(u))*sin(v)
Umin 0
Umax 2*pi
Uwrap True
Vmin 0
Vmax 2*pi
Vwrap True

Version Informtation


""" Z Function Surface

This script lets the user create a surface where the z coordinate is a function of the x and y coordinates.

   z = F1(x,y)

X,Y,Z Function Surface

This script lets the user create a surface where the x, y and z coordinates are defined by a function.

   x = F1(u,v)
   y = F2(u,v)
   z = F3(u,v)

Usage: You have to activated the script in the "Add-Ons" tab (user preferences). The functionality can then be accessed via the "Add Mesh" -> "Z Function Surface" and "Add Mesh" -> "X,Y,Z Function Surface" menu.

Version history: v0.3.8 - Patch by Elod Csirmaz

   Modified the "Add X,Y,Z Function Surface" part:
   Changed how wrapping is done to avoid
   generating unnecessary vertices and make the result more intuitive.
   Added helper functions the results of which can be used in
   x(u,v), y(u,v), z(u,v).
   The script can now close the ends of an U-wrapped surface.
   It's now possible to create multiple objects with one set of formulae.

v0.3.7

   Removed the various "edit" properties - not used anymore.
   Use generic tracker URL (Blender-Extensions r1369)
   bl_addon_info now called bl_info
   Removed align_matrix
   create_mesh_object now doesn't handle editmode. (See create_mesh_object)
   This script is now used by the "Extra Objects" script

v0.3.6 - Various updates to match current Blender API.

   Removed recall functionality.
   Better code for align_matrix
   Hopefully fixed bug where uMax was never reached. May cause other stuff.

v0.3.5 - createFaces can now "Flip" faces and create fan/star like faces. v0.3.4 - Updated store_recall_properties, apply_object_align

   and create_mesh_object.
   Changed how recall data is stored.

v0.3.3 - API change Mathutils -> mathutils (r557) v0.3.2 - Various fixes&streamlining by ideasman42/Campbell Barton.

   r544 Compile expressions for faster execution
   r544 Use operator reports for errors too
   r544 Avoid type checks by converting to a float, errors
   converting to a float are reported too.
   Fixed an error Campbell overlooked (appending tuples to an
   array, not single values) Thamnks for the report wild_doogy.
   Added 'description' field, updated 'wiki_url'.
   Made the script PEP8 compatible again.

v0.3.1 - Use hidden "edit" property for "recall" operator.

   Bugfix: Z Function was mixing up div_x and div_y

v0.3 - X,Y,Z Function Surface (by Ed Mackey & tuga3d).

   Renamed old function to "Z Function Surface".
   Align the geometry to the view if the user preference says so.
   Store recall properties in newly created object.

v0.2.3 - Use bl_info for Add-On information. v0.2.2 - Fixed Add-On registration text. v0.2.1 - Fixed some new API stuff.

   Mainly we now have the register/unregister functions.
   Also the new() function for objects now accepts a mesh object.
   Changed the script so it can be managed from the "Add-Ons" tab
   in the user preferences.
   Added dummy "PLUGIN" icon.
   Corrected FSF address.
   Clean up of tooltips.

v0.2 - Added security check for eval() function

   Check return value of eval() for complex numbers.

v0.1.1 - Use 'CANCELLED' return value when failing.

   Updated web links.

v0.1 - Initial revision. More Links: http://gitorious.org/blender-scripts/blender-3d-function-surface http://blenderartists.org/forum/showthread.php?t=179043 """