Setting spline deflection through Lua

Applies to 2025.0 Update and later

Repeatably apply externally generated spline coordinates

Prerequisites

Jump to:

Define Modify actions

Create a new support script manually. A support script is a plaintext, human-readable file with a very simple XML-like structure and a SUPPORT filename suffix.

<root>
</root>

For every individual support entity to be deflected along a spline, define a new Modify script action.

<supportaction enabled="1" id="12" supportaction_id="0">
</supportaction>
Top

Support detection parameters

For every <supportaction id="12"> element Netfabb normally creates, these <supportoption> elements are included by default. They may be left out if not used.

<supportoption id="action_description" value="" visible="1"/>
<supportoption id="modify_above_z" value="0" visible="1"/>
<supportoption id="modify_below_z" value="100000" visible="1"/>
<supportoption id="modify_z_range" value="0" visible="1"/>
<supportoption id="modify_min_height" value="0" visible="1"/>
<supportoption id="modify_max_height" value="100000" visible="1"/>
<supportoption id="modify_connections" value="0" visible="1"/>

As for the <supportoption> elements that actually adjust anything in this application, generate these elements to select and modify the entities in question:

<supportoption id="modify_type" value="0" visible="1"/>
<supportoption id="modify_use_position" value="1" visible="1"/>
<supportoption id="modify_position" value="0.00|0.00|0.00" visible="1"/>
<supportoption id="modify_values" value="volume_projection=2;volume_spline_value=2| 0.0|0.0|0.0| 0.0|0.0|0.0| 0.0|0.0|0.0| 0.0|0.0|0.0|" visible="0"/>

Conditions the control point coordinates must satisfy

Top

The Lua script

The example script uses D:\temp\ for all involved files. Make sure to adjust every instance to match your situation.

-- Generate volume support on spline for specific part geometry and apply support modification
-- Load the mesh
local mesh = system:load3mf('D:/temp/technical_part_2_positioned.3mf');

-- Generate support
local support = mesh:createsupport('D:/temp/VolumeSupportOnSpline.support');

-- Create the part
local part = tray.root:addmesh(mesh, 'VolumeSupportOnSpline');
part:assignsupport(support, false);

-- Export
local exporter = system:create3mfexporter();
exporter:add(part);
exporter:exporttofile("D:/temp/Output.3mf");
Top

Example files

Part, support script, and Lua code are available for download here: https://knowledge.autodesk.com/support/netfabb/downloads/caas/downloads/content/example-files-for-spline-deflection-volume-support-through-lua.html

In addition to the modify actions described above, the support script in the example also contains the action that generates the support itself.

Top