Physics
[Desktop Automation]
This is the Lua interface to Physics (or Gravity) packing available in Netfabb. It uses the Project Chrono physics engine to simulate gravity on the parts in the buildroom (https://projectchrono.org/).
Physics packing only packs parts fully and strictly above the build platform and within the boundaries in X and Y. Parts partly or fully beyond this area are ignored regardless of other qualifiers such as selection.
An instance of this object is returned by a function of the LUATray:
local tray = netfabbtrayhandler:gettray(id)
local packer = tray:createpacker(tray.packingid_physics)
Properties
Property | Read/write | Type | Description |
---|---|---|---|
itemrotation | read/write | Number | Restrict the rotation of the packed objects. Valid values are 0, 1, and 2, meaning no restriction, only rotate around the Z-Axis, and no rotation, respectively. |
minimaldistance | read/write | Number | Spacing between individual parts. Note that the border spacing and minimal distance between parts influence each other. |
onlyselected | read/write | Boolean | When true , only the selected parts of the build room are packed. Non-selected parts are regarded as static objects. |
timestep | read/write | Number | The Project Chrono physics engine is step-based. This property sets the step size in seconds. Typical values are 0.01, 0.015, and 0.02 for accurate, balanced, and fast, respectively |
borderspacingxy | read/write | Number | Spacing between the parts and the outer walls of the buildroom. Note that the border spacing and minimal distance between parts influence each other. |
borderspacingz | read/write | Number | Spacing between parts and the build platform ceiling of the buildroom. Note that the border spacing and minimal distance between parts influence each other. |
voxels | read/write | Number | Used for shape analysis. The higher the voxel count, the more accurate the calculation but the slower the process. Typical values are 100000, 50000, and 15000 for accurate, balanced, and fast, respectively. |
Notes on minimal part distance and border spacing
The physics packer achieves the minimal distance between the individual parts by creating a larger representation of the objects in the build room. This leads to a larger distance from the build room walls. This must be considered when adjusting these values.
Methods
Name | Syntax | Description |
---|---|---|
pack | Result = packer:pack() | Pack the tray with the physics packer |