Entry points are the functions called by the main application. The entry points must exist in order to be able to compile the post-processor.
Note on parallel processing: Special script entry-points are executed by the system in parallel.
This affects the following functions:
With this the overall calculation speed is distinctly improved. But some things have to be considered while implementing these functions:
The order in which the layer sections of a part are processed is undetermined.
Every execution instance has its own local function context an also its own global context. E.g. global variables are affected by this: If a global defined counter variable would be used to count the number of processed layer sections then each execution instance would only create its own sum of processed sections which would not be a correct sum in total.
An example for a correct total sum is the exposure time estimation which is summed up by calling bsHatchInfo.addExposureTimeSeconds().

main application calling entry functions
The post-processor declares parameters which then can be set by the main application while using the post-processor. E.g. these parameters could be used to assign different parameters to individual parts on a test build set-up.
Links: bsBuildParam
The post-processor declares export filters. With this the main application is extended by additional export formats which are implemented within the post-processor.
Links: bsExportFilter, void exportToFile(exportFile, sExportFilter, modelData, exportProgress)
The post-processor defines attributes of the machine, the supported materials and the exposure style. By linking to a certain machine the usage of the post-processor is limited to that machine. The same implies for materials and layer thickness’s.
Links: bsMachineConfig
The post-processor defines exposure data attributes. With this any kind of parameter can be assigned to the exposure vectors while creating them. Later on these parameters are available again e.g. while exporting the data to a machine-specific file.
Links: bsBuildAttribute
The post-processor defines which additional features are needed to calculate exposure data. Those features are disabled by default. These capabilities are those who require additional resources and are not required in general.
Links: bsModelFeatures
This function allows to define arbitrary additional properties. These properties can be read by the host program (e.g. ATU or Netfabb) directly. There are predefined properties located within adsk_main:
lower_layers_dependence : How many additional layers below influence the toolpath result of a current layer. E.g. if overhang calculation is applied then the toolpathes of a current layer would depend on one or more layers below. This information is important to ATU and Netfabb for creating a correct toolpath preview for individual layers.
upper_layers_dependence : How many additional layers above influence the toolpath result of a current layer.
var properties = {
"adsk_main": {
"upper_layers_dependence": 0,
"lower_layers_dependence": 0
}
};sMaterial : Material name string
nThickness : Layer thickness
properties : Property object
Here the post processor can provide general information about itself. E.g. Copyright, Version.
Links: bsAboutInfo
The post-processor writes previously calculated exposure data from modelData to the export directory exportDir. sExportFilter is the unique identifier of the selected export filter. exportProgress is used to report the current progress of exporting.
Links: bsDirectory, void declareExportFilter(exportFilter), bsModelData, bsProgress
exportDir : bsDirectory, interface for access to a directory
sExportFilter : String, unique identifier of the selected export filter
modelData : bsModelData, interface to access the geometric data of all parts on the current platform
exportProgress : bsProgress, interface for reporting the calculation progress for potentially long lasting calculations
sFileName : String, Base filename to be used as a prefix to derive individual filenames in given directory
The post-processor writes previously calculated exposure data from modelData to the export file exportFile. sExportFilter is the unique identifier of the selected export filter. exportProgress is used to report the current progress of exporting.
Links: bsFile, void declareExportFilter(exportFilter), bsModelData, bsProgress
exportFile : bsFile, interface for access to a single file
sExportFilter : String, unique identifier of the selected export filter
modelData : bsModelData, interface to access the geometric data of all parts on the current platform
exportProgress : bsProgress, interface for reporting the calculation progress for potentially long lasting calculations
Before the exposure calculation begins this function enables a preparation of the affected part. model provides an interface to access the actual part. Any kind of information can be stored or reset within the part.
Links: bsModel
The post-processor creates exposure data for a layer section of the current part.
the parts on the platform are processed one after another while multiple threads are calling this function for all layers. Therefore the given bsModelData instance always contains one model which is the currently processed part.
Additionally an estimation of the exposure time for that layer should be added to bsHatchInfo.
This function underlies the limitations of parallel processing.
An alternative way of creating the exposure data is defining a processing graph with the function buildProcessingGraph which would replace the makeExposureLayer function. Therefore only one of these functions (either buildProcessingGraph or makeExposureLayer) is allowed to be defined.
Links: bsHatch, bsModelData, addExposureTimeSeconds(fSeconds), Integer LayerNr
modelData : bsModelData, interface to the geometry input data.
resultHatch : bsHatch, receiving the exposure result vectors.
nLayerNr : Integer, number of layer to create exposure data for.
The post-processor preprocesses the input data (modelDataSrc). The result (modelDataTarget) will be the input for the calculation of the exposure data. In preprocessing step it is possible to change the geometry data. E.g. subtract the part from the supports or unify part and supports or add new geometry. The preprocessing function is optional. If no preprocessing is required then remove this function from the script. If the function exists then it has to add data to modelDataTarget, otherwise the preprocessing result is empty and nothing is processed further on. Preprocessing is called once for each part on the platform. Therefore modelDataSrc always contains one model.
Links: bsModelData
modelDataSrc : bsModelData, interface to the geometry input (source) data.
modelDataTarget : bsModelData, interface to the geometry output (target) data.
progress : bsProgress, interface for reporting the calculation progress for potentially long lasting calculations
The post-process function can be used to configure the previously generated toolpaths on a layer stack. With the modelData argument the function has access to all the layers of all the parts on a build platform. The post-process function is called after makeExposureLayer is completed for all layers. The main purpose of this function is to give an opportunity to sort the toolpaths in an efficient way considering multiple parts at different positions on the platform. The post-process function is optional. If no post-processing is required then remove this function from the script. Normally makeExposureLayer is called for all layers of all parts on the platform and after that postprocessLayerStack is called with layer_start_nr and layer_end_nr set to the first and last layer of the layer stack. Nevertheless for calculating a toolpath preview the application is allowed to calculate only a certain range of layers. In this case layer_start_nr and layer_end_nr specify a smaller range of layers which should be processed by the post-process function. Another aspect of a toolpath preview is that the toolpath calculation may have skipped certain layers within the specified range (e.g. skipping every second layer). Therefore it may happen that there are no exposure toolpaths present on some of the layers within the specified layer range.
Links: bsModelData
modelData : bsModelData, interface to the layer stack input data.
progress : bsProgress, interface for reporting the calculation progress for potentially long lasting calculations
layer_start_nr : Integer, the number of the first layer to process
layer_end_nr : Integer, the number of the last layer to process
The buildProcessingGraph function can be used to configure a processing graph with custom processing nodes to generate the toolpaths. This graph replaces the makeExposureLayer function. Therefore only one of these functions (either buildProcessingGraph or makeExposureLayer) is allowed to be defined.
Links: bsProcessingGraph, bsProcessingNode
The configurePostProcessingSteps function can be used to configure a series of functions which will be called in the post-processing stage. these functions will then be called instead of the default post-processing script function “postprocessLayerStack”.
It is not allowed to have both functions (configurePostProcessingSteps and postprocessLayerStack) defined at the same time.
Links: bsPostProcessingConfig
Unit tests for buildstyle projects are an optional feature of the Advanced Toolpath Utility. The development environment calls this method to start buildstyle related unit tests. All test results are logged using a test information object (testInfo), which is passed to the function.
Links: bsTestInfo