overwrite-AssetGenerator_Overview
The Asset Generator service is designed to generate the following assets according to predefined specifications and parameters:
- mockups
- designs
- images
Currently, only the generation of 3D mockups for packaging is supported.
Tenant management
Asset generation is performed on behalf of a tenant. Therefore, the tenant is an integral part of the Asset Generator service. The ability to generate certain assets is determined by the tenant settings. To enable the packaging mockup generation, the AllowedSpecGroups array must contain the Packaging type.
Generation of mockups
3D mockups are generated according to the MockupSpecDto specifications from a backend library.
Since the values of all specification parameters are hard-coded, this API only allows you to read the available specifications and their parameters MockupSpecParamDto and apply them to mockups.
The 3D mockup generation is implemented through the following steps.
1. Get a specification
To get the list of all available specifications, use the endpoint GET /api/asset-generator/v1/mockups/specifications. To find a specification by name, use GET /api/asset-generator/v1/mockups/specifications/{name}.
This endpoint returns a list of supported parameters and the rules for filling them in. You can pass their values when generating a mockup or validating the parameters.
2. Validate input data
The data validation, including checking for a mockup with the specified name in Asset Storage, is performed before the generation by using the endpoint POST /api/asset-generator/v1/mockups/specifications/{name}/parameters/validate.
This helps you avoid re-generating the same drawing and skip generating for incorrect input data.
3. Generate a drawing
The drawing is generated based on the specification by using a backend solution and the endpoint [GET /api/asset-generator/v1/mockups/specifications/{name}/images/{imageName}](/dev-center/api/asset-generator#tag/mockupgenerator/GetSpecificationImage.
By default, the drawing contains only one element. For a composite box, for example, a box with a lid, the drawing will include two elements: one for the box and another for the lid.
Each drawing element can include the following files:
- The main drawing file in the DXF format.
- Optional 3D drawing file in the DXF format.
- A file with information about bending lines (creases) in the CSV format.
4. Generate and save the mockup
The generation of a 3D mac is performed based on the drawing by using the endpoint POST /api/asset-generator/v1/mockups/generate.
The result of the generation is an M3D mockup file, which is saved in the Asset Storage. In the endpoint response, you can find the mockup ID, which can be used to download the M3D file from Assets Storage.
Api Clients
.Net Client
You can install it from Nuget as follows:
Install-Package Aurigma.AssetGenerator.ApiClient
Angular Client
This client is compatible with Angular applications only. It won't work with NodeJS or other frontend JS frameworks. You can install the package to your Angular application as follows:
@aurigma/ng-asset-generator-client
NodeJS Client (Axious)
This client can be used in a wide range of JavaScript applications. To make API calls, it uses Axios - a popular HTTP library. Although it is possible to use it in both frontend and backend projects, the primary target platform for this library is NodeJS.
Install the package as follows:
npm install @aurigma/axios-asset-generator-api-client
PHP Client
PHP client for this API is coming soon.