sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
lsmoura lsmoura is offline
Member
 
Join Date: Jul 2007
Location: Brazil
Posts: 23
Hello, everyone. I was doing some playing around with blender, and I found this site on blendernation about creating new primitives using python. I then created a new pipe (a hollow cylinder), to speed things up to some folks (including me).
Please, let me know what you guys think.

link: ls_pipe.txt
Since I can't host any .py files, i have uploaded it as txt, just change the extension.
One of the ways to install, you can just copy it to .blender/scripts folder inside your blender folder.

Regards,
- Sergio Moura
#1   Old 25-Jul-07, 11:38   
Reply With Quote


daredemo's Avatar
daredemo daredemo is offline
Member
 
Join Date: Apr 2006
Posts: 686
why not use the cylinder mesh object and just leave the "end cap" unselected?

re-inventing the wheel, eh?
#2   Old 25-Jul-07, 11:56   
Reply With Quote
Conz3D's Avatar
Conz3D Conz3D is offline
Member
 
Join Date: Mar 2007
Posts: 248
Nice little script. Could you add divisions to the hight, too?

@daredemo: This tube has an inner circle. Not only the outer faces.
#3   Old 25-Jul-07, 12:09   
Reply With Quote
lsmoura lsmoura is offline
Member
 
Join Date: Jul 2007
Location: Brazil
Posts: 23
Actually...
Last things first: I was not reinventing the wheel. I was just trying to do something useful in python so I dont get too rusty...

Next, about the end caps, it won't do the trick. You would need to grab the end edges, extrude/scale inside, create some faces... It would be faster to do it with the circle... Anyway, here's the shot of the created pipe along with the dialog:



Regards,
- Sergio
#4   Old 25-Jul-07, 12:10   
Reply With Quote
lsmoura lsmoura is offline
Member
 
Join Date: Jul 2007
Location: Brazil
Posts: 23
Quote:
Originally Posted by Conz3D View Post
Nice little script. Could you add divisions to the hight, too?
Thanks! I will add it... It will be a little tricky, but... I don't have an engineer degree for nothing, right?

I'll post back as soon as I have it.

@edit:
Height divisions are now a reality. =) Check the script here. The version is 0.2.
The normals are also corrected. =)
The 0.1 version can be found here.

Regards,
- Sergio

Last edited by lsmoura; 25-Jul-07 at 13:30.
#5   Old 25-Jul-07, 12:16   
Reply With Quote
macouno's Avatar
macouno macouno is offline
Member
 
Join Date: Jan 2002
Location: netherlands
Posts: 2,540
Lovely.... though I think it should say "Lay pipe" in stead of "Create pipe"... hehe... but seriously thanks.. thats quite usefull.
............................................
http://www.macouno.com
#6   Old 25-Jul-07, 14:09   
Reply With Quote
Conz3D's Avatar
Conz3D Conz3D is offline
Member
 
Join Date: Mar 2007
Posts: 248
Thank you for this update!
Maybe it's better to set the default "hight division" to 1.
#7   Old 25-Jul-07, 14:30   
Reply With Quote
lsmoura lsmoura is offline
Member
 
Join Date: Jul 2007
Location: Brazil
Posts: 23
Quote:
Originally Posted by Conz3D View Post
Thank you for this update!
Maybe it's better to set the default "hight division" to 1.
ok, I will. Let me just finish the section division and I'll make the modification.
Btw... Does anyone has a good idea for the name "section division"? It is the number of divisions between the inner radius and outer radius...

Regards,
- Sergio
#8   Old 25-Jul-07, 15:30   
Reply With Quote
Lord of the Rings Junkie's Avatar
Lord of the Rings Junkie Lord of the Rings Junkie is offline
Member
 
Join Date: Jan 2006
Location: P3X-439
Posts: 3,896
Radial divisions?
............................................
"Et Earello Endorenna utulien.
Sinome maruvan ar Hildinyar
tenn' Ambar-metta!"
#9   Old 25-Jul-07, 18:12   
Reply With Quote
animatinator's Avatar
animatinator animatinator is offline
Member
 
Join Date: Nov 2006
Location: C:\Program Files\Animatinator\
Posts: 1,781
Quote:
Does anyone has a good idea for the name "section division"? It is the number of divisions between the inner radius and outer radius...
Radial divisions? (EDIT: Argh, LOTRJ beat me too it) Assuming I'm right in thinking that they're the divisions between the inner and outer tubes, anyway.
Nice script so far. I think it would probably look better if you capitalized the variable names (not the ones within the script, I mean the ones in the GUI) - like Inner radius, Outer radius, Divisions, etc...
Just a minor crit really though Nice work on the script itself, I see complicated maths there
............................................
My music page
My Blog
#10   Old 25-Jul-07, 18:21   
Reply With Quote
lsmoura lsmoura is offline
Member
 
Join Date: Jul 2007
Location: Brazil
Posts: 23
Radial divisions is great! Thanks for the suggestion.
The 0.3 version can be obtained from the same link now.

I've removed some left-over debug codes and added radial divisions. The code has grown considerably.

Download 0.3

A little screenshot of a pipe generated with the 0.3 version (normals are drawn)



Version history:
0.3 (latest so far)
0.2
0.1


Let me know your comments.

Regards,
- Sergio
#11   Old 25-Jul-07, 21:38   
Reply With Quote
Conz3D's Avatar
Conz3D Conz3D is offline
Member
 
Join Date: Mar 2007
Posts: 248
It's a nice addition to the primitives now.
Thank you for sharing.

Last edited by Conz3D; 26-Jul-07 at 07:35.
#12   Old 26-Jul-07, 07:32   
Reply With Quote
Hoehrer's Avatar
Hoehrer Hoehrer is offline
Member
 
Join Date: Nov 2005
Posts: 442
Very nice and versatile script - saves some time when working with circular shapes.

The only (minor) thing I would change is to make the outer diameter the same as it is for the default cylinder/circle/etc... (radius=1BU) and the inner diameter 0.5 or something like that. But that's just me trying to keep it consistent

Many thanks for posting this
Werner
............................................
UFO: Alien Invasion
Tutorials: Modelling a dice | Create a heightmap from a plane | Fill faces | Mix Materials via Nodes
#13   Old 31-Jul-07, 07:03   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 23:31.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists