Creating an Icosphere with python

Hi

Does anyone know a way to create an Icosphere through code. I want to create one similar to the one created from the menu but I have to place it at a specific location and rotation.

Sorry that I ask so many questions, I am just starting to get a handle on this python business.

Thanks

Chris

Mmmm… don’t know if you can access to the Iconsphere creation, but here’s the solution:

1 - Download
a) from my site the Polyhedron generation script (www.selleri.org) or
b) search for the geodesic dome script.

Case a)

Grab the Icosahedron code, hack it by recursive subdivision of each triangular face into 4 triangular faces (locate new vertices smartly)

Case b)

Grab the code, destroy the fancy stuff, keep the bare skeletron of the iconsphere creation. It creates half abn iconsphere, so you have to hack this too.

Stefano

Thanks Stefano

I have download the script, looks intresting, unfortunately it does not do exactly as I need but it has certainly given me some ideas.

Chris

If the only difference is the requirement to place it at a specific location and rotation, then blender can already do that.

Create your icosphere anywhere, and with it selected press N-KEY. It will open up a menu where you can adjust the location, rotation, and size to exact measurements.

Hi RipSting

Thanks for the tip, I was aware of the N-Key, unfortunately I am writing a script that is an extension to the modeller as well as an exporter, I have a requirement to create objects at very specifc locations.

What I was thinking is creating all the objects on layer 20 and then making a copy of them on layer 1, however I have run into a couple of problems with that. So far I haven’t worked out how to copy an object, and also when I export the scene I need to know if the object is on a layer that is visible.

Thanks

Chris