addmesh problems

i’m trying to built a script to do polar parabola

and using the addmesh

now there are 3 problems here

1 - the location of the object seems to be function of the cursor location
how can i change that to always have the origin at the global origin x=0 y=0 z=0

2 - with this type of gui is it possible to add a menu button and do different functions
in relation to the selection inf the menu

3 - how can i ad only edges not faces?

and is there an example of this type of coding in python?


 
#!BPY
"""
Name: 'Arch / polar Paraboloid'
Blender: 2.48a
Group: 'AddMesh'
"""
import BPyAddMesh
import Blender
from math import sqrt, sin, cos, pi
 
def add_paraboloid(segments,rings,radius,height):
v=[]
f=[]
#Creating the verticies
 
dtd=5 # DELTA DEGRESS
dtr=dtd*pi/180
pr=1.6
z=0
 
for i in range(1,rings+1):
 
an1=dtr*i # angle in radians
 
r1=pr/(1+cos(an1))
rx=r1*cos(an1)
ry=r1*sin(an1)
print 'I = ',i,' Ang = ',an1*180/pi ,' degrees radius = ',r1, 'x = ',rx,' y = ',ry
v.append([rx,z,ry])
v.append([rx,z,-ry])
 
 
#adding the central vertex
 
# angle is zero degrees
an2=0
r1=pr/(1+cos(an2))
rx=r1*cos(an2)
ry=r1*sin(an2) 
v.append([rx,z,ry])
 
 
 
 
return v,f
 
 
 
def main():
 
# segments=Blender.Draw.Create(32) # number segment in 3 D around 
# if segment = 1 do 1/2 parabola - if segment= 2 do full parabola 
segments=Blender.Draw.Create(2) 
rings=Blender.Draw.Create(10)
height=Blender.Draw.Create(1.0)
radius=Blender.Draw.Create(1.0)
 
# if segment = 1 do 1/2 parabola - if segment= 2 do full parabola 
 
if not Blender.Draw.PupBlock('Add Polar Paraboloid',[\
('segments:',segments,1,500,'number of segments per ring'),\
('rings:',rings,2,500,'number of rings'),\
('height:',height,0.0,10.0,'height of paraboloid'),\
('radius:',radius,0.0,10.0,'radius of paraboloid'),\
]):
return 
 
v,f = add_paraboloid(segments.val,rings.val,radius.val,height.val)
BPyAddMesh.add_mesh_simple('Paraboloid',v,[],f)
main()
 

Thanks

Ed may have solved some of your problems in the parametric object script?:rolleyes:

Here:
http://www.blinken.com/blender-plugins.php

i’ll test it later on

but for the time being i’m trying to get this little script to work as is

because later on i want ot add more curves of the sane sort

easier to use and fun to learn more about python too

so can you help with this script

Thanks