Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Meyer <florianfelix@web.de>2010-09-26 05:00:22 +0400
committerFlorian Meyer <florianfelix@web.de>2010-09-26 05:00:22 +0400
commitb7bb4134062e77f58c508c9875324144beb01d8c (patch)
treeeb4cbd64823b3a02ceac198cd4858482b828a0c0 /add_curve_aceous_galore.py
parent212a9312393781839d016532ba6e340b45387ee8 (diff)
== Curve Galore ==
- added rounded rectangle to miscCurve (with some minor enhancements) - some spell checking and cleanup
Diffstat (limited to 'add_curve_aceous_galore.py')
-rw-r--r--add_curve_aceous_galore.py65
1 files changed, 45 insertions, 20 deletions
diff --git a/add_curve_aceous_galore.py b/add_curve_aceous_galore.py
index 0b120d07..5c2284f0 100644
--- a/add_curve_aceous_galore.py
+++ b/add_curve_aceous_galore.py
@@ -181,9 +181,9 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
##------------------------------------------------------------
# 2DCurve: Miscellaneous.: Diamond, Arrow1, Arrow2, Square, ....
-def MiscCurve(type=1, a=1.0, b=0.5, c=90.0):
+def MiscCurve(type=1, a=1.0, b=0.5, c=1.0):
"""
- MiscCurve( type=1, a=1.0, b=0.5, c=90.0 )
+ MiscCurve( type=1, a=1.0, b=0.5, c=1.0 )
Create miscellaneous curves
@@ -205,28 +205,51 @@ def MiscCurve(type=1, a=1.0, b=0.5, c=90.0):
newpoints = []
a*=0.5
b*=0.5
- if type ==1:
+ if type == 1:
## diamond:
newpoints = [ [ 0.0, b, 0.0 ], [ a, 0.0, 0.0 ], [ 0.0, -b, 0.0 ], [ -a, 0.0, 0.0 ] ]
- elif type ==2:
+ elif type == 2:
## Arrow1:
newpoints = [ [ -a, b, 0.0 ], [ a, 0.0, 0.0 ], [ -a, -b, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
- elif type ==3:
+ elif type == 3:
## Arrow2:
newpoints = [ [ -1.0, b, 0.0 ], [ -1.0+a, b, 0.0 ],
[ -1.0+a, 1.0, 0.0 ], [ 1.0, 0.0, 0.0 ],
[ -1.0+a, -1.0, 0.0 ], [ -1.0+a, -b, 0.0 ],
[ -1.0, -b, 0.0 ] ]
- elif type ==4:
+ elif type == 4:
## Rounded square:
newpoints = [ [ -a, b-b*0.2, 0.0 ], [ -a+a*0.05, b-b*0.05, 0.0 ], [ -a+a*0.2, b, 0.0 ],
[ a-a*0.2, b, 0.0 ], [ a-a*0.05, b-b*0.05, 0.0 ], [ a, b-b*0.2, 0.0 ],
[ a, -b+b*0.2, 0.0 ], [ a-a*0.05, -b+b*0.05, 0.0 ], [ a-a*0.2, -b, 0.0 ],
[ -a+a*0.2, -b, 0.0 ], [ -a+a*0.05, -b+b*0.05, 0.0 ], [ -a, -b+b*0.2, 0.0 ] ]
+ elif type == 5:
+ ## Rounded Rectangle II:
+ newpoints = []
+ x = a / 2
+ y = b / 2
+ r = c / 2
+
+ if r > x:
+ r = x - 0.0001
+ if r > y:
+ r = y - 0.0001
+
+ if r>0:
+ newpoints.append([-x+r,y,0])
+ newpoints.append([x-r,y,0])
+ newpoints.append([x,y-r,0])
+ newpoints.append([x,-y+r,0])
+ newpoints.append([x-r,-y,0])
+ newpoints.append([-x+r,-y,0])
+ newpoints.append([-x,-y+r,0])
+ newpoints.append([-x,y-r,0])
+ else:
+ newpoints.append([-x,y,0])
+ newpoints.append([x,y,0])
+ newpoints.append([x,-y,0])
+ newpoints.append([-x,-y,0])
- #elif type ==15:
- ## :
- #newpoints = [ [ x,y,z ] ]
else:
## Square:
newpoints = [ [ -a, b, 0.0 ], [ a, b, 0.0 ], [ a, -b, 0.0 ], [ -a, -b, 0.0 ] ]
@@ -814,18 +837,19 @@ class Curveaceous_galore(bpy.types.Operator):
#### MiscCurve properties
MiscCurveType = IntProperty(name="Type",
min=1, soft_min=1,
- max=5, soft_max=5,
+ max=6, soft_max=6,
default=1,
- description="Type of ProfileCurve")
+ description="Type of MiscCurve")
MiscCurvevar1 = FloatProperty(name="var_1",
default=1.0,
- description="var1 of ProfileCurve")
+ description="var1 of MiscCurve")
MiscCurvevar2 = FloatProperty(name="var_2",
default=0.5,
- description="var2 of ProfileCurve")
- MiscCurvevar3 = FloatProperty(name="var_3", # doesn't seem to do anything
- default=90.0,
- description="var3 of ProfileCurve")
+ description="var2 of MiscCurve")
+ MiscCurvevar3 = FloatProperty(name="var_3",
+ default=0.1,
+ min=0, soft_min=0,
+ description="var3 of MiscCurve")
#### Common properties
innerRadius = FloatProperty(name="Inner radius",
@@ -973,7 +997,7 @@ class Curveaceous_galore(bpy.types.Operator):
# general options
col = layout.column()
col.prop(self, 'GalloreType')
- col.label(text=self.GalloreType+" Options")
+ col.label(text=self.GalloreType + " Options")
# options per GalloreType
box = layout.box()
@@ -983,9 +1007,10 @@ class Curveaceous_galore(bpy.types.Operator):
box.prop(self, 'ProfileCurvevar2')
if self.GalloreType == 'Miscellaneous':
box.prop(self, 'MiscCurveType')
- box.prop(self, 'MiscCurvevar1')
- box.prop(self, 'MiscCurvevar2')
- #box.prop(self, 'MiscCurvevar3') # doesn't seem to do anything
+ box.prop(self, 'MiscCurvevar1', text='Width')
+ box.prop(self, 'MiscCurvevar2', text='Height')
+ if self.MiscCurveType == 5:
+ box.prop(self, 'MiscCurvevar3', text='Rounded')
if self.GalloreType == 'Flower':
box.prop(self, 'petals')
box.prop(self, 'petalWidth')