diff --git a/source/__init__.py b/source/__init__.py index 7b43ff6..b6f8c23 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -35,6 +35,7 @@ if "bpy" in locals(): importlib.reload(Blocks) importlib.reload(Wallfactory) importlib.reload(add_mesh_triangles) + importlib.reload(install_presets) else: from . import add_mesh_star from . import add_mesh_twisted_torus @@ -57,6 +58,7 @@ else: from . import Blocks from . import Wallfactory from . import add_mesh_triangles + from . import install_presets from .add_mesh_rocks import __init__ from .add_mesh_rocks import rockgen @@ -407,6 +409,7 @@ def register(): register_class(cls) add_mesh_rocks.register() + install_presets.register() # Add "Extras" menu to the "Add Mesh" menu and context menu. bpy.types.VIEW3D_MT_mesh_add.append(menu_func) diff --git a/source/install_presets.py b/source/install_presets.py new file mode 100644 index 0000000..46f788f --- /dev/null +++ b/source/install_presets.py @@ -0,0 +1,35 @@ +import os +import shutil + + +addon_folder = os.path.dirname(os.path.realpath(__file__)) + +repository_folder = os.path.dirname(addon_folder) +extensions_folder = os.path.dirname(repository_folder) +version_folder = os.path.dirname(extensions_folder) +presets_folder = os.path.join(version_folder, 'scripts', 'presets') + + +### PRESETS INSTALL #### + +source_directory = os.path.join(addon_folder, "presets") +destination_directory = os.path.join(presets_folder, "operator") + + +def copy_subfolders(source_dir, destination_dir): + if not os.path.exists(destination_dir): + os.makedirs(destination_dir) + + for item in os.listdir(source_dir): + source_path = os.path.join(source_dir, item) + destination_path = os.path.join(destination_dir, item) + + if os.path.isdir(source_path): + if os.path.exists(destination_path): + continue + + shutil.copytree(source_path, destination_path) + + +def register(): + copy_subfolders(source_directory, destination_directory) diff --git a/source/presets/mesh.primitive_round_cube_add/Capsule.py b/source/presets/mesh.primitive_round_cube_add/Capsule.py new file mode 100644 index 0000000..c758377 --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Capsule.py @@ -0,0 +1,8 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 0.5 +op.arc_div = 8 +op.lin_div = 0 +op.size = (0.0, 0.0, 3.0) +op.div_type = 'CORNERS' diff --git a/source/presets/mesh.primitive_round_cube_add/Clay_Bar.py b/source/presets/mesh.primitive_round_cube_add/Clay_Bar.py new file mode 100644 index 0000000..421fc8d --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Clay_Bar.py @@ -0,0 +1,8 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 0.4 +op.arc_div = 8 +op.lin_div = 0 +op.size = (1.5, 3.0, 1.0) +op.div_type = 'ALL' diff --git a/source/presets/mesh.primitive_round_cube_add/Cube.py b/source/presets/mesh.primitive_round_cube_add/Cube.py new file mode 100644 index 0000000..4b30b5b --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Cube.py @@ -0,0 +1,9 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 0.0 +op.arc_div = 1 +op.lin_div = 0 +op.size = (2.0, 2.0, 2.0) +op.div_type = 'CORNERS' +op.odd_axis_align = False diff --git a/source/presets/mesh.primitive_round_cube_add/Grid_3D.py b/source/presets/mesh.primitive_round_cube_add/Grid_3D.py new file mode 100644 index 0000000..248c7f2 --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Grid_3D.py @@ -0,0 +1,7 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 0 +op.size = (2, 2, 2) +op.lin_div = 5 +op.div_type = 'ALL' diff --git a/source/presets/mesh.primitive_round_cube_add/Octahedron.py b/source/presets/mesh.primitive_round_cube_add/Octahedron.py new file mode 100644 index 0000000..4685cfc --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Octahedron.py @@ -0,0 +1,9 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 1.0 +op.arc_div = 1 +op.lin_div = 0 +op.size = (0.0, 0.0, 0.0) +op.div_type = 'CORNERS' +op.odd_axis_align = True diff --git a/source/presets/mesh.primitive_round_cube_add/Quadsphere.py b/source/presets/mesh.primitive_round_cube_add/Quadsphere.py new file mode 100644 index 0000000..0a7ad4e --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Quadsphere.py @@ -0,0 +1,8 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 1.0 +op.arc_div = 8 +op.lin_div = 0 +op.size = (0.0, 0.0, 0.0) +op.div_type = 'CORNERS' diff --git a/source/presets/mesh.primitive_round_cube_add/Rounded_Cube.py b/source/presets/mesh.primitive_round_cube_add/Rounded_Cube.py new file mode 100644 index 0000000..b1660b8 --- /dev/null +++ b/source/presets/mesh.primitive_round_cube_add/Rounded_Cube.py @@ -0,0 +1,8 @@ +import bpy +op = bpy.context.active_operator + +op.radius = 0.25 +op.arc_div = 8 +op.lin_div = 0 +op.size = (2.0, 2.0, 2.0) +op.div_type = 'CORNERS' diff --git a/source/presets/mesh.primitive_xyz_function_surface/bonbon.py b/source/presets/mesh.primitive_xyz_function_surface/bonbon.py new file mode 100644 index 0000000..b464e76 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/bonbon.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'u' +op.y_eq = 'cos(u)*sin(v)' +op.z_eq = 'cos(u)*cos(v)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/boy.py b/source/presets/mesh.primitive_xyz_function_surface/boy.py new file mode 100644 index 0000000..2537883 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/boy.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '2/3* (cos(u)* cos(2*v) + sqrt(2)* sin(u)* cos(v))* cos(u) / (sqrt(2) - sin(2*u)* sin(3*v))' +op.y_eq = 'sqrt(2)* cos(u)* cos(u) / (sqrt(2) - sin(2*u)* sin(3*v))' +op.z_eq = '2/3* (cos(u)* sin(2*v) - sqrt(2)* sin(u)* sin(v))* cos(u) / (sqrt(2) - sin(2*u)* sin(3*v))' +op.range_u_min = 0.0 +op.range_u_max = 3.1415927410125732 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 3.1415927410125732 +op.range_v_step = 64 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/catalan.py b/source/presets/mesh.primitive_xyz_function_surface/catalan.py new file mode 100644 index 0000000..8c87675 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/catalan.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'u-sin(u)*cosh(v)' +op.y_eq = '4*sin(1/2*u)*sinh(v/2)' +op.z_eq = '1-cos(u)*cosh(v)' +op.range_u_min = -3.1415927410125732 +op.range_u_max = 9.42477798461914 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -2.0 +op.range_v_max = 2.0 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/catenoid.py b/source/presets/mesh.primitive_xyz_function_surface/catenoid.py new file mode 100644 index 0000000..98e12ba --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/catenoid.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '2*cosh(v/2)*cos(u)' +op.y_eq = 'v' +op.z_eq = '2*cosh(v/2)*sin(u)' +op.range_u_min = -3.1415927410125732 +op.range_u_max = 3.1415927410125732 +op.range_u_step = 32 +op.wrap_u = True +op.range_v_min = -3.1415927410125732 +op.range_v_max = 3.1415927410125732 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/clifford_torus.py b/source/presets/mesh.primitive_xyz_function_surface/clifford_torus.py new file mode 100644 index 0000000..7e14f55 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/clifford_torus.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(u+v)/(sqrt(2.)+cos(v-u))' +op.y_eq = 'sin(v-u)/(sqrt(2.)+cos(v-u))' +op.z_eq = 'sin(u+v)/(sqrt(2.)+cos(v-u))' +op.range_u_min = 0.0 +op.range_u_max = 3.140000104904175 +op.range_u_step = 8 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/cochlea.py b/source/presets/mesh.primitive_xyz_function_surface/cochlea.py new file mode 100644 index 0000000..0e9ed68 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/cochlea.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'v*cos(u)' +op.y_eq = 'v*sin(u)' +op.z_eq = '0.4*u' +op.range_u_min = 0.0 +op.range_u_max = 12.566370964050293 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 2.0 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/cosinus.py b/source/presets/mesh.primitive_xyz_function_surface/cosinus.py new file mode 100644 index 0000000..a8b3e5d --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/cosinus.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'u' +op.y_eq = 'sin(pi*((u)**2+(v)**2))/2' +op.z_eq = 'v' +op.range_u_min = -1.0 +op.range_u_max = 1.0 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -1.0 +op.range_v_max = 1.0 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/dini.py b/source/presets/mesh.primitive_xyz_function_surface/dini.py new file mode 100644 index 0000000..aef4591 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/dini.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'a*cos(u)*sin(v)' +op.y_eq = 'a*sin(u)*sin(v)' +op.z_eq = '(cos(v)+log(tan(v/2)+1e-2)) + b*u' +op.range_u_min = 0.0 +op.range_u_max = 12.566370964050293 +op.range_u_step = 128 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 2.0 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '1' +op.b_eq = '0.2' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/enneper.py b/source/presets/mesh.primitive_xyz_function_surface/enneper.py new file mode 100644 index 0000000..ebeb4d7 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/enneper.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'u -u**3/3 + u*v**2' +op.y_eq = 'u**2 - v**2' +op.z_eq = 'v -v**3/3 + v*u**2' +op.range_u_min = -2.0 +op.range_u_max = 2.0 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -2.0 +op.range_v_max = 2.0 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/helicoidal.py b/source/presets/mesh.primitive_xyz_function_surface/helicoidal.py new file mode 100644 index 0000000..d6c4bf1 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/helicoidal.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'sinh(v)*sin(u)' +op.y_eq = '3*u' +op.z_eq = '-sinh(v)*cos(u)' +op.range_u_min = -3.1415927410125732 +op.range_u_max = 3.1415927410125732 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -3.1415927410125732 +op.range_v_max = 3.1415927410125732 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/helix.py b/source/presets/mesh.primitive_xyz_function_surface/helix.py new file mode 100644 index 0000000..ba22cac --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/helix.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '(1-0.1*cos(v))*cos(u)' +op.y_eq = '0.1*(sin(v) + u/1.7 -10)' +op.z_eq = '(1-0.1*cos(v))*sin(u)' +op.range_u_min = 0.0 +op.range_u_max = 12.566370964050293 +op.range_u_step = 128 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/hexahedron.py b/source/presets/mesh.primitive_xyz_function_surface/hexahedron.py new file mode 100644 index 0000000..d532eb6 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/hexahedron.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(v)**3*cos(u)**3' +op.y_eq = 'sin(u)**3' +op.z_eq = 'sin(v)**3*cos(u)**3' +op.range_u_min = -1.2999999523162842 +op.range_u_max = 1.2999999523162842 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/hyperhelicoidal.py b/source/presets/mesh.primitive_xyz_function_surface/hyperhelicoidal.py new file mode 100644 index 0000000..74feb2c --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/hyperhelicoidal.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '(sinh(v)*cos(3*u))/(1+cosh(u)*cosh(v))' +op.y_eq = '(cosh(v)*sinh(u))/(1+cosh(u)*cosh(v))' +op.z_eq = '(sinh(v)*sin(3*u))/(1+cosh(u)*cosh(v))' +op.range_u_min = -3.1415927410125732 +op.range_u_max = 3.1415927410125732 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -3.1415927410125732 +op.range_v_max = 3.1415927410125732 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/klein.py b/source/presets/mesh.primitive_xyz_function_surface/klein.py new file mode 100644 index 0000000..cc568d7 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/klein.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '(3*(1+sin(v)) + 2*(1-cos(v)/2)*cos(u))*cos(v)' +op.y_eq = '(4+2*(1-cos(v)/2)*cos(u))*sin(v)' +op.z_eq = '-2*(1-cos(v)/2)*sin(u)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 32 +op.wrap_u = True +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/moebius.py b/source/presets/mesh.primitive_xyz_function_surface/moebius.py new file mode 100644 index 0000000..020ddbc --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/moebius.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(v)+u*cos(v/2)*cos(v)' +op.y_eq = 'u*sin(v/2)' +op.z_eq = 'sin(v)+u*cos(v/2)*sin(v)' +op.range_u_min = -0.4000000059604645 +op.range_u_max = 0.4000000059604645 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/pseudo_catenoid.py b/source/presets/mesh.primitive_xyz_function_surface/pseudo_catenoid.py new file mode 100644 index 0000000..b21df38 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/pseudo_catenoid.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '2.2*(2*cosh(v/2)*cos(u)) ' +op.y_eq = '1.51166 * (2*cosh(v/2)*sin(u) * sin((2.2*(2*cosh(v/2)*cos(u)) - -11.0404)*2*pi*1/22.0513) + 1.8*(v) * cos((2.2*(2*cosh(v/2)*cos(u)) - -11.0404)*2*pi*1/22.0513)) ' +op.z_eq = '1.51166 * (2*cosh(v/2)*sin(u) * cos((2.2*(2*cosh(v/2)*cos(u)) - -11.0404)*2*pi*1/22.0513) - 1.8*(v) * sin((2.2*(2*cosh(v/2)*cos(u)) - -11.0404)*2*pi*1/22.0513)) ' +op.range_u_min = -3.1415927410125732 +op.range_u_max = 3.1415927410125732 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -3.1415927410125732 +op.range_v_max = 3.1415927410125732 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/pseudosphere.py b/source/presets/mesh.primitive_xyz_function_surface/pseudosphere.py new file mode 100644 index 0000000..2bcb373 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/pseudosphere.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(u)*cos(v)+sin((sin(u)+1)*2*pi) ' +op.y_eq = '4*sin(u) ' +op.z_eq = 'cos(u)*sin(v)+cos((sin(u)+1)*2*pi) ' +op.range_u_min = -1.5707963705062866 +op.range_u_max = 1.5707963705062866 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/ridged_torus.py b/source/presets/mesh.primitive_xyz_function_surface/ridged_torus.py new file mode 100644 index 0000000..96cddfc --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/ridged_torus.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'a*cos(u)+(b*sin(f*u)+c)*cos(u)*cos(v)' +op.y_eq = 'a*sin(u)+(b*sin(f*u)+c)*sin(u)*cos(v)' +op.z_eq = '(b*sin(f*u)+c)*sin(v)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 128 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '5' +op.b_eq = '0.6' +op.c_eq = '2' +op.f_eq = '10' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/shell.py b/source/presets/mesh.primitive_xyz_function_surface/shell.py new file mode 100644 index 0000000..d2437bb --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/shell.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(v)*(1+cos(u))*sin(v/8)' +op.y_eq = 'sin(u)*sin(v/8)+cos(v/8)*1.5' +op.z_eq = 'sin(v)*(1+cos(u))*sin(v/8)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 32 +op.wrap_u = True +op.range_v_min = 0.0 +op.range_v_max = 12.566370964050293 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/sine.py b/source/presets/mesh.primitive_xyz_function_surface/sine.py new file mode 100644 index 0000000..d6b9fa5 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/sine.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'sin(u)' +op.y_eq = 'sin(v)' +op.z_eq = 'sin(u+v)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 128 +op.wrap_u = True +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = True +op.close_v = True +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/snake.py b/source/presets/mesh.primitive_xyz_function_surface/snake.py new file mode 100644 index 0000000..b2c4269 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/snake.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '1.2*(1 -v/(2*pi))*cos(3*v)*(1 + cos(u)) + 3*cos(3*v)' +op.y_eq = '9*v/(2*pi) + 1.2*(1 - v/(2*pi))*sin(u)' +op.z_eq = '1.2*(1 -v/(2*pi))*sin(3*v)*(1 + cos(u)) + 3*sin(3*v)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 64 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/sterosphere.py b/source/presets/mesh.primitive_xyz_function_surface/sterosphere.py new file mode 100644 index 0000000..366b81c --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/sterosphere.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '2.*u/(u*u+v*v+1.)' +op.y_eq = '(u*u+v*v-1.)/(u*u+v*v+1.)' +op.z_eq = '2.*v/(u*u+v*v+1.)' +op.range_u_min = -2.0 +op.range_u_max = 2.0 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = -2.0 +op.range_v_max = 2.0 +op.range_v_step = 32 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/torus.py b/source/presets/mesh.primitive_xyz_function_surface/torus.py new file mode 100644 index 0000000..82b5923 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/torus.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = '(1+0.5*cos(u))*cos(v)' +op.y_eq = '0.5*sin(u)' +op.z_eq = '(1+0.5*cos(u))*sin(v)' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 32 +op.wrap_u = False +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 128 +op.wrap_v = False +op.close_v = False +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0' diff --git a/source/presets/mesh.primitive_xyz_function_surface/twisted_torus.py b/source/presets/mesh.primitive_xyz_function_surface/twisted_torus.py new file mode 100644 index 0000000..b94eff6 --- /dev/null +++ b/source/presets/mesh.primitive_xyz_function_surface/twisted_torus.py @@ -0,0 +1,22 @@ +import bpy +op = bpy.context.active_operator + +op.x_eq = 'cos(u)*(6-(5./4. + sin(3*v))*sin(v-3*u))' +op.y_eq = '(6-(5./4. + sin(3*v))*sin(v-3*u))*sin(u)' +op.z_eq = '-cos(v-3*u)*(5./4.+sin(3*v))' +op.range_u_min = 0.0 +op.range_u_max = 6.2831854820251465 +op.range_u_step = 128 +op.wrap_u = True +op.range_v_min = 0.0 +op.range_v_max = 6.2831854820251465 +op.range_v_step = 32 +op.wrap_v = True +op.close_v = True +op.n_eq = 1 +op.a_eq = '0' +op.b_eq = '0' +op.c_eq = '0' +op.f_eq = '0' +op.g_eq = '0' +op.h_eq = '0'