# Wire Mesh Generator

Version:
v1.04
Date Updated:
07/31/2014

Updated to version 1.04!

Script to generate a wire mesh.

Changelog
[v1.04 current version]
- Added few parameters for bend ends.
- Fix small bug.

## Comment viewing options

### ...

Thank you all!

breh. the labryinth maker is really useful.

Will be playing with this one as well. :D

All your scriptz are belong to me!

Another great script, your work is immense, thanks for sharing, + and commented

### Very cool, thanks!

Very cool, thanks!

### ...

Yep. It represents best way to operate on odd and even items in array ei

```oeData = dataPair odd:#() even:#()
oeData.odd = for i = 1 to 10 collect
(
if mod i 2 != 0 then i else (append oeData.even i ; dontcollect)
)```

barigazy

### ...

Oo, good. I forgot about the function "mod()".
Just I almost never used this function.

### ...

I changed a bit your code, nothing special but this way U can avoid some repetitions

```-- ........................... 78 line
local inv = (-1) -- for invert position of points
local tmpArr = deleteItem (deepcopy pointArr[1]) 1

for i = 2 to HalfTurn do
(
tmpArr = deepCopy tmpArr
for j in tmpArr do
(
j.x *= inv
j.y *= inv
j.z += (CellSize)
)
join pointArr[1] tmpArr
)

for i = 1 to (Rows - 1) do
(
tmpArr = deepCopy pointArr[1]
for j in tmpArr do
(
-- if i is odd number then multiply with inv value
if mod i 2 != 0 do (j.x *= inv ; j.y *= inv)
j.x += ((CellSize - (Radius * 4)) * i)
)
append pointArr tmpArr
)

delete \$TempGrid*
local sp = splineshape name:(uniquename "TempGrid") sides:Sides thickness:(Radius * 2) \
render_displayRenderMesh:DisplayRM render_displayRenderMesh:DisplayRM

for i in pointArr do
(
for j in i do (addknot sp (numSplines sp) #smooth #line j)
)```

barigazy

Thanks

### @barigazy

Thanks big for thread of Forum. I think it's useful to me.
If interested, here's a basic piece of code (function without "bend ends"). But I think it needs to be redone for wrapping around cylindrical or spherical mesh as you suggest.