[Bf-extensions-cvs] [42704d63] master: update add curves galore

jimmyhaze noreply at git.blender.org
Wed May 31 02:04:54 CEST 2017


Commit: 42704d63a52c38ad51fcd4c67a5937d2b1fe0e47
Author: jimmyhaze
Date:   Wed May 31 10:04:31 2017 +1000
Branches: master
https://developer.blender.org/rBA42704d63a52c38ad51fcd4c67a5937d2b1fe0e47

update add curves galore

===================================================================

M	add_curve_extra_objects/add_curve_aceous_galore.py

===================================================================

diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py
index a20dbd67..14402e31 100644
--- a/add_curve_extra_objects/add_curve_aceous_galore.py
+++ b/add_curve_extra_objects/add_curve_aceous_galore.py
@@ -598,8 +598,8 @@ def CycloidCurve(number=100, type=0, R=4.0, r=1.0, d=1.0):
         # Cycloid
         while i < number:
             t = (i * step * pi) * a
-            x = (t - sin(t) * b)
-            y = (1 - cos(t) * b)
+            x = (t - sin(t) * b) * 0.5
+            y = (1 - cos(t) * b) * 0.5
             z = 0
             newpoints.append([x, y, z])
             i += 1
@@ -684,12 +684,12 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5, scale=[0.5,0.5,0.5], oc
     step = (length / number)
     i = 0
     if type is 1:
-        # noise circle / arc
+        # noise circle
         while i < number:
             t = i * step
             v = vTurbNoise(t, t, t, 1.0, size, octaves, 0, basis, seed)
-            x = sin(t * pi) * 2.0 + (v[0] * scale[0])
-            y = cos(t *pi) * 2.0 + (v[1] * scale[1])
+            x = sin(t * pi) + (v[0] * scale[0])
+            y = cos(t *pi) + (v[1] * scale[1])
             z = v[2] * scale[2]
             newpoints.append([x, y, z])
             i += 1
@@ -697,17 +697,20 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5, scale=[0.5,0.5,0.5], oc
         # noise knot / ball
         while i < number:
             t = i * step
-            v = vTurbNoise(t, t, t, scale[2], 1.0, octaves, 0, basis, seed)
-            newpoints.append([v[0], v[1], v[2]])
+            v = vTurbNoise(t, t, t, 1.0, 1.0, octaves, 0, basis, seed)
+            x = v[0] * scale[0] * size
+            y = v[1] * scale[1] * size
+            z = v[2] * scale[2] * size
+            newpoints.append([x, y, z])
             i += 1
     else:
         # noise linear
         while i < number:
             t = i * step
             v = vTurbNoise(t, t, t, 1.0, size, octaves, 0, basis, seed)
-            x = t + v[0] * (scale[0] / length)
-            y = v[1] * (scale[1] / length)
-            z = v[2] * (scale[2] / length)
+            x = t + v[0] * scale[0]
+            y = v[1] * scale[1]
+            z = v[2] * scale[2]
             newpoints.append([x, y, z])
             i += 1
     return newpoints
@@ -938,418 +941,358 @@ class Curveaceous_galore(Operator):
     align_matrix = None
 
     # general properties
-    ProfileTypes = [
-                ('Profile', 'Profile', 'Profile'),
-                ('Arrow', 'Arrow', 'Arrow'),
-                ('Rectangle', 'Rectangle', 'Rectangle'),
-                ('Flower', 'Flower', 'Flower'),
-                ('Star', 'Star', 'Star'),
-                ('Arc', 'Arc', 'Arc'),
-                ('Cogwheel', 'Cogwheel', 'Cogwheel'),
-                ('Nsided', 'Nsided', 'Nsided'),
-                ('Splat', 'Splat', 'Splat'),
-                ('Cycloid', 'Cycloid', 'Cycloid'),
-                ('Helix', 'Helix (3D)', 'Helix'),
-                ('Noise', 'Noise (3D)', 'Noise')
-                ]
     ProfileType = EnumProperty(
-                name="Type",
-                description="Form of Curve to create",
-                items=ProfileTypes
-                )
-    SplineTypes = [
-                ('POLY', 'Poly', 'POLY'),
-                ('NURBS', 'Nurbs', 'NURBS'),
-                ('BEZIER', 'Bezier', 'BEZIER')
-                ]
+        name="Type",
+        description="Form of Curve to create",
+        items=[
+            ('Profile', 'Profile', 'Profile'),
+            ('Arrow', 'Arrow', 'Arrow'),
+            ('Rectangle', 'Rectangle', 'Rectangle'),
+            ('Flower', 'Flower', 'Flower'),
+            ('Star', 'Star', 'Star'),
+            ('Arc', 'Arc', 'Arc'),
+            ('Cogwheel', 'Cogwheel', 'Cogwheel'),
+            ('Nsided', 'Nsided', 'Nsided'),
+            ('Splat', 'Splat', 'Splat'),
+            ('Cycloid', 'Cycloid', 'Cycloid'),
+            ('Helix', 'Helix (3D)', 'Helix'),
+            ('Noise', 'Noise (3D)', 'Noise')
+            ]
+        )
     outputType = EnumProperty(
-                name="Output splines",
-                description="Type of splines to output",
-                items=SplineTypes
-                )
-
+        name="Output splines",
+        description="Type of splines to output",
+        items=[
+            ('POLY', 'Poly', 'POLY'),
+            ('NURBS', 'Nurbs', 'NURBS'),
+            ('BEZIER', 'Bezier', 'BEZIER')
+            ]
+        )
     # Curve Options
-    shapeItems = [
-                ('2D', '2D', '2D'),
-                ('3D', '3D', '3D')
-                ]
     shape = EnumProperty(
-                name="2D / 3D",
-                description="2D or 3D Curve",
-                items=shapeItems
-                )
+        name="2D / 3D",
+        description="2D or 3D Curve",
+        items=[
+            ('2D', '2D', '2D'),
+            ('3D', '3D', '3D')
+            ]
+        )
     use_cyclic_u = BoolProperty(
-                name="Cyclic",
-                default=True,
-                description="make curve closed"
-                )
+        name="Cyclic",
+        default=True,
+        description="make curve closed"
+        )
     endp_u = BoolProperty(
-                name="use_endpoint_u",
-                default=True,
-                description="stretch to endpoints"
-                )
+        name="use_endpoint_u",
+        default=True,
+        description="stretch to endpoints"
+        )
     order_u = IntProperty(
-                name="order_u",
-                default=4,
-                min=2,
-                soft_min=2,
-                max=6,
-                soft_max=6,
-                description="Order of nurbs spline"
-                )
-    bezHandles = [
-                ('VECTOR', 'Vector', 'VECTOR'),
-                ('AUTOMATIC', 'Auto', 'AUTOMATIC')
-                ]
+        name="order_u",
+        default=4,
+        min=2,
+        max=6,
+        description="Order of nurbs spline"
+        )
     handleType = EnumProperty(
-                name="Handle type",
-                default='AUTOMATIC',
-                description="bezier handles type",
-                items=bezHandles
-                )
-
+        name="Handle type",
+        default='AUTOMATIC',
+        description="bezier handles type",
+        items=[
+            ('VECTOR', 'Vector', 'VECTOR'),
+            ('AUTOMATIC', 'Auto', 'AUTOMATIC')
+            ]
+        )
     # ProfileCurve properties
     ProfileCurveType = IntProperty(
-                name="Type",
-                min=1,
-                soft_min=1,
-                max=5,
-                soft_max=5,
-                default=1,
-                description="Type of ProfileCurve"
-                )
+        name="Type",
+        min=1,
+        max=5,
+        default=1,
+        description="Type of ProfileCurve"
+        )
     ProfileCurvevar1 = FloatProperty(
-                name="var_1",
-                default=0.25,
-                description="var1 of ProfileCurve"
-                )
+        name="var_1",
+        default=0.25,
+        description="var1 of ProfileCurve"
+        )
     ProfileCurvevar2 = FloatProperty(
-                name="var_2",
-                default=0.25,
-                description="var2 of ProfileCurve"
-                )
-
+        name="var_2",
+        default=0.25,
+        description="var2 of ProfileCurve"
+        )
     # Arrow, Rectangle, MiscCurve properties
     MiscCurveType = IntProperty(
-                name="Type",
-                min=0,
-                soft_min=0,
-                max=3,
-                soft_max=3,
-                default=0,
-                description="Type of Curve"
-                )
+        name="Type",
+        min=0,
+        max=3,
+        default=0,
+        description="Type of Curve"
+        )
     MiscCurvevar1 = FloatProperty(
-                name="var_1",
-                default=1.0,
-                description="var1 of Curve"
-                )
+        name="var_1",
+        default=1.0,
+        description="var1 of Curve"
+        )
     MiscCurvevar2 = FloatProperty(
-                name="var_2",
-                default=0.5,
-                description="var2 of Curve"
-                )
+        name="var_2",
+        default=0.5,
+        description="var2 of Curve"
+        )
     MiscCurvevar3 = FloatProperty(
-                name="var_3",
-                default=0.1,
-                min=0,
-                soft_min=0,
-                description="var3 of Curve"
-                )
-
+        name="var_3",
+        default=0.1,
+        min=0,
+        description="var3 of Curve"
+        )
     # Common properties
     innerRadius = FloatProperty(
-                name="Inner radius",
-                default=0.5,
-                min=0,
-                soft_min=0,
-                description="Inner radius"
-                )
+        name="Inner radius",
+        default=0.5,
+        min=0,
+        description="Inner radius"
+        )
     middleRadius = FloatProperty(
-                name="Middle radius",
-                default=0.95,
-                min=0,
-                soft_min=0,
-                description="Middle radius"
-                )
+        name="Middle radius",
+        default=0.95,
+        min=0,
+        description="Middle radius"
+        )
     outerRadius = FloatProperty(
-                name="Outer radius",
-                default=1.0,
-                min=0,
-                soft_min=0,
-                description="Outer radius"
-                )
-
+        name="Outer radius",
+        default=1.0,
+        min=0,
+        description="Outer radius"
+        )
     # Flower properties
     petals = IntProperty(
-                name="Petals",
-                default=8,
-                min=2,
-                soft_min=2,
-                description="Number of petals"
-                )
+        name="Petals",
+        default=8,
+        min=2,
+        description="Number of petals"
+        )
     petalWidth = FloatProperty(
-                name="Petal width",
-                

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list