How To Reuse External CAD
When you have a large number of files or they are simply heavy in size, we encourage to use some external container to store your files. Not only because you can have any amount of files, but also because in every publish of a DynaMaker product configurator every file needs to be copied, thus the product configurator file size limit of 50 MB to avoid long publishing times.
Although we recommend to use Google Buckets due to being a standard integration, you can use any cloud file storage solution or bucket. For the examples below the storage solution will provide you a URL with customized limited access.
Let's say that your Google Bucket URL is:
const bucketUrl = 'https://storage.googleapis.com/MY_DYNAMAKER_BUCKET'
Then for:
- images: you can create the following function (where the default
fileTypeis e.g.png), so that they can be used for layouts:
function getImage(fileName: string, { fileType = 'png' } = {}) {
const image = new Image()
image.crossOrigin = 'anonymous' // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin
image.src = `${bucketUrl}/${fileName}.${fileType}`
return image
}
- 3D models:
SKYCAD.MeshModel(same type as a static model) are to be used and the following function can be created:
function getStaticModel(fileName: string, { fileType = 'glb' } = {}) {
const modelUrl = `${bucketUrl}/${fileName}.${fileType}`
const sourceUrl = `${bucketUrl}/${fileName}.step`
return new SKYCAD.MeshModel(modelUrl, { sourceUrl })
}