local count = 0\r
for i = 0, length - 1 do\r
-- Calulate radius for this "height" in the cylinder\r
- local radius = radius1 + (radius2 - radius1) * i / (length - 1)\r
+ local radius = radius1 + (radius2 - radius1) * (i + 1) / length\r
radius = math.floor(radius + 0.5) -- round\r
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)\r
\r
local other1, other2 = worldedit.get_axis_others(axis)\r
\r
-- Set up voxel manipulator\r
- local manip, area = mh.init_axis_radius(pos, axis,\r
- height >= 0 and height or -height)\r
+ -- FIXME: passing negative <radius> causes mis-sorted pos to be passed\r
+ -- into mh.init() which is technically not allowed but works\r
+ local manip, area = mh.init_axis_radius(pos, axis, height)\r
local data = mh.get_empty_data(area)\r
\r
-- Handle inverted pyramids\r
- local start_axis, end_axis, step\r
+ local step\r
if height > 0 then\r
height = height - 1\r
step = 1\r