Calculating LST from DXF

This document describes, how to use the Technology Adapter API to calculate an LST file for given DXF files. The DXF files can either contain

  • single parts or

  • a complete sheet layout.

To try it out, you can use our API reference or our Postman collection (import JSON).

Currently, we support two workflows:

Product Workflow

Creates an LST file from a DXF file containing a single part/product. See Product workflow.

Sheet Workflow

Creates an LST file from a DXF file containing a sheet with nested parts/products (sheet layout). See Sheet workflow.

For all following requests you will need to provide an AUTHORIZATION header containing the access token from the response body cross origin login. The token itself is a bearer-authentication token.

Authorization: Bearer <Token>

See also authentication.

1. Product Workflow

1.1. Convert DXFs to Products

Convert your DXF parts into products by sending them to the Drawing Converter Service.

The Drawing Converter Service converts the DXF in our internal shape representation. This representation is equivalent to our product’s shape representation. For simplicity you can consider this step as a conversion from a DXF file to a product.

1.2. Upload Products

Upload the products (JSONs) received in the previous step as job resources (see Job Resource Services). For every uploaded product you will get a TRUMPF Resource Name (TRN) in the response. This TRN references the product and will be used in the next steps.

1.3. Upload Sheets

The sheets should also be uploaded as job resources for further usage (see Job Resource Services). The shape of the sheet should be provided in the request body. In the response body you will find the corresponding TRN.

1.4. Select a Material

There are several TRUMPF materials available. You can list them all by using this endpoint (see API reference: Material Service). In the response every material has a TRN, e.g. trn://materialservice/material/v2/materials/7cf33926-e341-49d0-9920-0c88906219a6.

With this TRN you can create a raw material by using this endpoint (see API reference: Material Job Resources).

Example import request:
{
  "materialTrn": "trn://materialservice/material/v2/materials/7cf33926-e341-49d0-9920-0c88906219a6",
  "thickness": 2,
  "hasTopFilm": true
}

This will create a raw material which is 2 mm thick and is made of the material with the id 7cf33926-e341-49d0-9920-0c88906219a6.

The TRN from the import response, e.g.

{
  "trn": "trn://contentaddressedstorage/cas/v1/documents/SVxznzrIJcGvjxAEQODSDY6efAaZRR9Lyw-MtbRuL3A",
  "url": "https://ta.api.trumpf.com/cas/v1/documents/SVxznzrIJcGvjxAEQODSDY6efAaZRR9Lyw-MtbRuL3A"
}

can be used to start a calculation.

1.5. Select a Machine Instance

Get the available machines instances from the Machine Instance Service V2 by using this endpoint. Select one machine instance by its ID, e.g. b3e36fab-b372-4411-9fcc-7430c551ece2.

To create a job resource for this machine and get a TRN for it you have to import it. Import it as a job resource by using this endpoint.

1.6. Create and start Calculation Job

This is where the actual calculation starts. You should provide

  • the TRNs of the products uploaded in the previous steps and their desired quantities as attributes,

  • the TRN of the selected material,

  • the TRN of the machine instance,

  • the selected laser technology table (LTT) and

  • the corresponding laser rule.

In the response body you will get the calculation ID along with a stateHref - an URL, with which you can check the state of the calculation (see the next step).

1.7. State of the Calculation

Keep track of the calculation with the calculation ID from the previous step by polling the state. See our API reference on how to get the current state.

If the calculation succeeded, you can find an URL of the resulting LST file (base64-encoded) in the response body. The occurring issues and errors, if any, are also written to the response.

2. Sheet Workflow

2.1. Convert Sheet DXF

Convert your sheet layout DXF by sending the file content to the Drawing Converter Service.

The response contains the sheet geometries, product layouts and the products along with occurred issues, if any.

2.2. Upload Sheet and Products

Upload sheets and products obtained in the previous step. See Upload Sheets and Upload Products.

2.3. Upload Product Layout

You already have got the product layout after the sheet conversion. To upload it, you will have to replace product names by TRNs obtained after uploading the products, see Upload Sheet and Products.

2.4. Select a Material

2.5. Select a Machine Instance

2.6. Start the Calculation Job

The request for calculation start looks similar to the one in the product workflow, see Create and start Calculation Job. Instead of the product TRNs and quantity attributes, you will need the TRN of the previously uploaded sheet layout.

2.7. State of the Calculation