Syntax
- string assetApproxSize(searchQuery, axisSelector, n )
Parameters
- searchQuery—stringSearch query to apply on list of all files in the workspace. See fileSearch for details about the syntax.
- axisSelector—string{ x | y | z | xy | yz | xyz }—selector of axes for the current scope.
- n—floatNumber (integer >= 1) of assets to consider (one is randomly picked out of the n best assets).
Returns
Asset with one of the best n size fits (according to axisSelector).
Description
The assetApproxSize function returns one of the n best size fitting assets, from the file list specified in string, according to the specified axisSelector.
Note:
assetApproxSize(string, axisSelector, 1) = assetBestSize(string, axisSelector)
Related
Examples
Inserting assets based on their (physical) size
CGA examples with n = 1, n = 2 and n = 3:
The goal is to insert assets from a pool, depending on their (physical) size. The pool of assets is seen in the following image. Colors are (only) used to visually emphasize the size ratio. |
Note:
- The geometry varies in the next three images by using only the n parameter.
- Small parts get blue assets while large parts get red assets.
| |
| |
|