# Spiral polar array script

Heya,

Here’s a new my script making polar arrays. It is also capable to make spirals from the objects to rotate…

How it works? + some instructions of use and ideas of application:

Script works in 2 modes - Mode_1: when no object is selected and Mode_2: when one of more objects are selected in Blender. The script basically does what polar array function in Autocad does + it can be arranged not only in one plane but also as a spiral. Rotation/spirals are around Z axis or an axis parallel to Z.

Mode_1: As soon as no object is selected, the script creates a cube, then re-shapes it, then rotates it as per the parameters entered. The interface in that case looks like this:

Default values are suitable to making “spiral stairs” so I will explain this as an example.

CX,CY,CZ are coordinates of rotation center. A cube is used as an object to rotate and populate the polar array, so Size_X,Y,Z values are used to re-shape the default cube. With size values of 3.0,1.0,0.2 the cube is re-shaped to a more wide and flat object which can be used as a step of a spiral stairs RX,RY,RZ give preliminary rotation of the object on its X,Y,Z axes. In case of spiral stairs it is no practical to rotate the step. If somebody likes - he/she may use some small angle of rotation on Z… Then you set-up the number of steps. By default it is = 18. “Angle to fill” sets the angle of polar array. By default it is = 360 degrees, i.e. this is 1 full turn. The range is (-10800,10800) degrees, which covers 30 full turns. Internal radius sets up the value for inner space (cylinder). This value together with size values is used to position the steps. For the first step CZ is used to determine the beginning. Last parameter is Delta Z. It gives the increment on Z. Should there is 0.0 entered => a polar array in one plane is produced. By default, the value is such that there will be 0.1 units on Z between the “steps” (0.5 = 2*Size_Z+0.1). Soooo pressing “OK” will produce “the stairs” Setting negative for the angle to fill, will produce a “negative” spiral - rotated clockwise. Using negative value for Delta Z => stairs go downwards. Here’s the stairs using the default values:

Setting up Delta Z = 0, may produce water-mill propellers like this:

Using some values for initial object’s rotation result in this:

So script helps producing turbine-like objects. While using a better shaped object to rotate, better results may be achieved, but for that you need to use Mode_2.

Mode_2: Script runs automatically into its Mode_2 when one of more objects are selected. The idea is to rotate the selected object(s). In comparision to the BLENDER built-in function Spin function, the benefit is that several objects can be rotated simultaneously. Virtually, there is no restriction of the number of objects to rotate at a time. The interface in that case is very much simplified:

The uppermost toggle button provides opportunity to use the 3D cursor as rotation point. In fact, there is a need of rotation axis which is determined by the rotation point and a prime line parallel to Z. By the default the “Use 3D cursor” is pressed so that the 3D cursor will define the rotation axis. If you switch off this option, you’d need to enter coordinates CX,CY of the rotation point. CX,CY values take effect ONLY when the toggle button “Use 3D cursor” is switched off. The other values suggest that 6 objects (groups of objects) are to get obtained after running the script, the “Angle to fill” field works as in Mode_1, and “Delta Z” - same as before. Now Delta_Z is 0.0 by default. This means that all selected objects will be rotated using their Z coordinate around the rotation axis. Should you like to obtain a spiral - you’d need to set some different value for Delta_Z. It takes effect over all objects to populate the polar array. When two or more objects are selected, script preserves relative distances between them - quite expected, right?

I’ll leave it to your imagination what you can produce by using Mode_2 of the script!

Regards,

i wish all the stairs script where put inside one big script!

would it be possible to have another way to do it like in real life
i mean normally you know the size of the space where the staircase will be
you spec the height of steps , depth thickness ect…
then draw it

i know this is a completely new way of doing it but may be more naturel
from a practical point of view!

any way it’s only a suggestion

Happy blendering

@ Ricky - in Autocad there is such alternative: to specify Angle to fill and Angle between objects (steps). So in that case the number of objects to use is being calculated… This would be subject to an update of the script - to run in 3-rd mode for doing this. Also: I can imagine another useful issue… It is to set the size of steps (lets take it like a stair) and the total height of the stair, then 2 options: (1) given the number of steps, to distribute them evenly withing the total height; and (2) given the number of steps and Delta Z -> to fill the total height with steps but no MORE than the given number… In option (1) Delta Z needs to vary

The above would require changing the interface cause more than 2 toggle buttons would need to be dependent and I havent found a way to control this (i.e. redraw the interface) within a PupBlock…

I think I can do it this way too… As soon as I have a new update, I will post it here :spin:

now as another suggstion

you could try to integrate the other stairs script into a big one

may be by calling other script so that we end up with one script for all the stairs

i know there would be some of redundancy but still we would not have to run 3 independant scripts to get stairs straight or circular form!

there is another sinmpler script for simple circular steps
don’t know have you seen it ?

Keep up the good work

Happy blendering

It is possible to integrate everything… Again a matter of a more complicated interface… + that the other script(s) are not mine, but…

I’ve been thinking also that in case of stairs, steps should be connected somehow. Only if it is to be a “metal” stair steps should be just supported with a “stronger” object. In case of “concrete” stairs - steps are not really rectangles but have trapezoid form to cover the entire space between the edge of the lower step to the base of the upper one. Then steps need to be connected by a vertical plane… and finally - inside and outside spiral border of stair should be also covered by planes extending down to the Z of the first step, right?

begin something and then we might try to help make it more realistic

it’s very difficult to describe it without dwg or model

but the problem here is that i cannot upload pic or file to show things

may be you should open a WIP where it can ge done

Thanks

Ok, I’ll see what I can do

On “uploading” issue - you cannot upload images directly here, in the FORUM… You need to upload images somewhere else, then put here only a link to their place in the WWW. I use YAHOO, but they will soon close the service… Im now looking what Google propose in respect to hosting images. The same procedure is for the scripts, .blend files. But at some servers scripts are NOT allowed!!! I use orbitfiles.com for the scripts… It works somehow - not very perfect, but at least they dont say that scripts are restricted

Regards,

well there is a way by asking a new authorisation level

but nor certain where i can ask for it

cause i got this here in python and also in news & discussion forum

hope to see new version soon
and be glad to help debug it and gives some C & C

Thanks

I just tried the spiral script in 2.49 and it keeps erroring out with a divide by zero. Even if I make all the input values non-zero.

any idean when it will be converted in 2.5 ?

may be waiting for the new Space for scripting next summer ?

Thanks

@ Atom - Errgh, I have developed the script in Blender 2.46 with Python 2.5.2 and I dont know what may the error in Blender 2.49b??? Could you please tell me/us where exactly such an error occurs at you? I have just tried it under 2.49b in script’s two options - with and without previously selected object - and it worked just brilliantly good in its default menus for both cases (i.e. without making any specific further settings)…

Regards,