mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-16 21:12:59 +00:00
Starbeamrainbowlabs
10c9d6f886
First up: test that our initial basic dynamic brushes work as intended with the //sculptlist [preview] command. Also on the todo list: document it in the chat command reference!
13 lines
598 B
Lua
13 lines
598 B
Lua
|
|
--- Returns a smooth gaussian brush.
|
|
-- @param size Vector3 The target size of the brush. Note that the actual size fo the brush will be different, as the gaussian function has some limitations.
|
|
-- @param sigma=2 number The 'smoothness' of the brush. Higher values are more smooth.
|
|
return function(size, sigma)
|
|
local size = math.min(size.x, size.y)
|
|
if size % 2 == 0 then size = size - 1 end
|
|
if size < 1 then
|
|
return false, "Error: Invalid brush size."
|
|
end
|
|
local success, gaussian = worldeditadditions.conv.kernel_gaussian(size, sigma)
|
|
return success, gaussian, { x = size, y = size }
|
|
end
|