Lua Scripting - How to set antialiased value

Lua Scripting - How to set antialiased value

Anonymous
Not applicable
648 Views
2 Replies
Message 1 of 3

Lua Scripting - How to set antialiased value

Anonymous
Not applicable

I am trying to set antialiasing level in Netfabb through lua script, How to set that value. What syntax I can use

0 Likes
649 Views
2 Replies
Replies (2)
Message 2 of 3

steffen_anders_adsk
Autodesk Support
Autodesk Support

Hello, @Anonymous,

 

Welcome to the Netfabb forum!

 

This bit in the documentation is outdated, thank you for bringing this to our attention.

antialiased is not supported anymore. Instead, you must use the properties filtertype, filterradius, and filtersigma. Filter types are int from 0 to 4 for None, Gaussian, Oversampling, AntiAliased, and OversamplingEnhanced, respectively. filterradius is float in pixels. filtersigma is float and a sharpness value of sorts. The larger the value, the shallower the smoothing. Sensible values are between 0 and 10. filterradius and filtersigma are only used for Gaussian, filterradius is also used for OversamplingEnhancedOversampling halves the specified resolution when averaging, AntiAliased keeps the original resolution, and OversamplingEnhanced divides the original resolution by filterradiusAntiAliased has no parameters.

 

 

Best regards,

Steffen

Steffen Anders
Autodesk Netfabb team

Netfabb resources: Online helpSystem requirementsKnowledge baseForumsHomepageYouTube

How to get Netfabb Basic: VideoHelpDownload

0 Likes
Message 3 of 3

steffen_anders_adsk
Autodesk Support
Autodesk Support

Here's a working example script:

 

savepath = "c:\\luasliceimageexport";

system:logtofile(savepath .. "\\lualog.txt");
imageexporter = slice:createimagerenderer(slice.layercount, slice.layersize)

resolution = {}; resolution.x = 1280; resolution.y = 1024; size = {}; size.x = slice.maxx; size.y = slice.maxy; size.z = slice.maxz; imageexporter.left = 0; imageexporter.top = 0; imageexporter.width = resolution.x; imageexporter.height = resolution.y; imageexporter.dpix = resolution.x * 25.4 / size.x; imageexporter.dpiy = resolution.y * 25.4 / size.y; imageexporter.minx = 0; imageexporter.maxx = size.x; imageexporter.miny = 0; imageexporter.maxy = size.y; imageexporter.minz = 0; imageexporter.maxz = size.z; imageexporter.writehatches = true; imageexporter.fillclosedcontours = true; imageexporter.dofillingbooled = true; imageexporter.backgroundcolor = 0; imageexporter.hatchcolor = 0xFFFFFF; imageexporter.closedcontourcolor = 0xFFFFFF; imageexporter.opencontourcolor = 0xFFFFFF; imageexporter.fillpolygons = true; function writetofile(tt, rr, ss) system:log("calling export with parameters tt " .. tt .. ", rr " .. rr .. ", ss " .. ss .. " ..."); imageexporter.filtertype = tt; imageexporter.filterradius = rr; imageexporter.filtersigma = ss; imageexporter:exportpngmulticore (savepath .. "\\export-" .. tt .. "-" .. rr .. "-" .. ss ..".zip"); end; writetofile(1, 1, 6.6);

Steffen Anders
Autodesk Netfabb team

Netfabb resources: Online helpSystem requirementsKnowledge baseForumsHomepageYouTube

How to get Netfabb Basic: VideoHelpDownload

0 Likes