Jump to:
A schema is a name for a set of restrictions, requirements, or properties of toolpath data. It is a string like com.autodesk.powderbed-1.0.0.
Toolpath calculation (e.g. an EBPA file) can be tagged with a schema ("it produces output data according to the schema XYZ").
Also, an exporter (e.g. export filters declared by an EBPA file) can be tagged with a schema ("it requires input data according to schema XYZ").
The schema string can be used to check the compatibility of toolpath calculation and exporter.
The toolpath calculation can be tagged with a schema in the declareMachine entry point function using the setSchema function. Here is an example how to set the schema for the toolpath calculation:
/** * Declare machine configuration * * @param machineConfig bsMachineConfig */ exports.declareMachine_exporter = function(machineConfig, a_material_name, a_material_thickness) { machineConfig.setSchema("com.autodesk.powderbed-1.0.0"); … };
The data export can be tagged with a schema in the declareExportFilter entry point function using the argument object of the function declareFilterEx. Here is an example how to set the schema for the data export:
/** * The buildstyle declares its export filters to the main application * "filter-id", "display string", "file extension" * * @param exportFilter bsExportFilter */ exports.declareExportFilter = function(exportFilter) { exportFilter.declareFilterEx({ 'sFilterId' : 'SLM-4f018734-edd1-45e8-8c54-2736b853ef22', 'sFilterName' : 'SLM File', 'sFilterExtension' : 'slm', 'nVersionMajor' : 1, 'nVersionMinor' : 10, 'isMultifile' : false, 'sSchema' : 'com.autodesk.powderbed-1.0.0', 'custom' : { } }); };
Schema com.autodesk.powderbed-1.0.0
The com.autodesk.powderbed-1.0.0 schema is intended as a basis for powder bed related toolpath data.
In order to be compatible with the com.autodesk.powderbed-1.0.0 schema, toolpath data must have an integer attribute bsid attached to every toolpath element (polygon, polyline, hatching) in the result bsHatch object. The bsid integer attribute should be used to typify a toolpath element (e.g. bsid set to 3 for Border - Volume toolpath elements).
Here is an example of how to declare the bsid attribute:
/** * Declare attributes to be stored within exposure vectors * * @param buildAttrib bsBuildAttribute */ exports.declareBuildAttributes = function(buildAttrib) { buildAttrib.declareAttributeInt("bsid"); };
Here is an example of how to set the bsid integer value for toolpath elements:
/** * Calculate the exposure data / hatch vectors for one layer of a part * @param modelData bsModelData * @param hatchResult bsHatch * @param nLayerNr int */ exports.makeExposureLayer = function(modelData, hatchResult, nLayerNr) { let island_it = modelData.getFirstIsland(nLayerNr); while(island_it.isValid()) { let hatch_paths = new HATCH.bsHatch(); island_it.getIsland().hatch(hatch_paths, 0.3, 45, 0); // Set the bsid 7 for all elements // in the bsHatch object (island hatching) hatch_paths.setAttributeInt("bsid", 7); hatchResult.moveDataFrom(hatch_paths); island_it.getIsland().borderToHatch(hatch_paths); // Set the bsid 8 for all elements // in the bsHatch object (border) hatch_paths.setAttributeInt("bsid", 8); hatchResult.moveDataFrom(hatch_paths); island_it.next(); } let polyline_it = modelData.getFirstLayerPolyline( nLayerNr, POLY_IT.nLayerOpenPolylines); while(polyline_it.isValid()) { let polyline_hatch_paths = new HATCH.bsHatch(); polyline_it.polylineToHatch(polyline_hatch_paths); // Set the bsid 9 for all elements // in the bsHatch object (polylines) polyline_hatch_paths.setAttributeInt("bsid", 9); hatchResult.moveDataFrom(polyline_hatch_paths); polyline_it.next(); } };
In addition to typifying a toolpath element with the bsid integer attribute, it is also necessary to supply laser parameter values for the toolpath element types via a customTable attribute attached to every model.
The customTable is an array of toolpath element type information objects. There must be a toolpath element type information object for every used toolpath element type (bsid integer value) in a model. A single toolpath element type information object must contain the associated bsid integer value and the laser parameters focus (mm), power (watt), speed (mm/s), and laserIndex (integer).
Here is an example of how to fill the customTable array and attach it to a model:
/** * Prepare a part for calculation. Checking configuration * and adding properties to the part * @param model bsModel */ exports.prepareModelExposure = function(model) { // Create custom table let customTable = []; // Create an object let bsid_obj = new Object(); // Set members of the object bsid_obj.bsid = 7; bsid_obj.power = 207.0; bsid_obj.focus = 0.0; bsid_obj.speed = 1070.0; bsid_obj.laserIndex = 1; // Add object to custom table customTable.push(bsid_obj); bsid_obj = new Object(); bsid_obj.bsid = 8; bsid_obj.power = 208.0; bsid_obj.focus = 0.0; bsid_obj.speed = 1080.0; bsid_obj.laserIndex = 1; customTable.push(bsid_obj); bsid_obj = new Object(); bsid_obj.bsid = 9; bsid_obj.power = 209.0; bsid_obj.focus = -1.0; bsid_obj.speed = 1090.0; bsid_obj.laserIndex = 1; customTable.push(bsid_obj); // Attach the custom table to the model model.setAttribEx("customTable", customTable); };Top
Schema com.autodesk.powderbed.renishaw-1.0.0
The com.autodesk.powderbed.renishaw-1.0.0 schema extends the com.autodesk.powderbed-1.0.0 schema by additional laser parameters for the Renishaw machines.
Additional laser parameters pointDistance (micrometer) and pointExposureTime (microseconds) can be given. If pointDistance and pointExposureTime is needed by the exporter and the two parameters are not given, then the exporter has to try to automatically derive the parameter from power and speed. However, it is recommended that the toolpath calculation provides pointDistance and pointExposureTime. It is possible that the automatic derivation from power and speed produces unwanted results and the user does not know how to make it work as expected.
Here is an example of how to fill the customTable array for the com.autodesk.powderbed.renishaw-1.0.0 schema and attach it to a model:
/** * Prepare a part for calculation. Checking configuration * and adding properties to the part * @param model bsModel */ exports.prepareModelExposure = function(model) { // Create custom table let customTable = []; // Create an object let bsid_obj = new Object(); // Set members of the object bsid_obj.bsid = 7; bsid_obj.power = 260.2; bsid_obj.focus = 0.0; bsid_obj.speed = 400.5; bsid_obj.pointDistance = 4.2342; bsid_obj.pointExposureTime = 0.3471; bsid_obj.laserIndex = 1; // Add object to custom table customTable.push(bsid_obj); bsid_obj = new Object(); bsid_obj.bsid = 8; bsid_obj.power = 290.1; bsid_obj.focus = 1.2; bsid_obj.speed = 350.0; bsid_obj.pointDistance = 2.0112; bsid_obj.pointExposureTime = 0.9284; bsid_obj.laserIndex = 1; customTable.push(bsid_obj); bsid_obj = new Object(); bsid_obj.bsid = 9; bsid_obj.power = 260.2; bsid_obj.focus = 0.0; bsid_obj.speed = 400.5; bsid_obj.pointDistance = 4.2342; bsid_obj.pointExposureTime = 0.3471; bsid_obj.laserIndex = 1; customTable.push(bsid_obj); // Attach the custom table to the model model.setAttribEx("customTable", customTable); };Top