//! Assembly views shown in the instructions can be large or small and this is deduced by looking at the size of the printed parts involved and if any routed
//! parts are used.
//! This heuristic isn't always correct, so the default can be overridden by setting the ```big``` parameter of ```assembly``` to ```true``` or ```false```.
//!
//! The example below shows how to define a vitamin and incorporate it into an assembly with sub-assemblies and make an exploded view.
//! The resulting flat BOM is shown but heirachical BOMs are also generated for real projects.
functionbom_mode(n=1)=$_bom>=n&&(is_undef($on_bom)||$on_bom);//! Current BOM mode, 0 = none, 1 = printed and routed parts and assemblies, 2 includes vitamins as well
functionexploded()=is_undef($exploded_parent)?$exploded:0;//! Returns the value of ```$exploded``` if it is defined, else ```0```
functionshow_supports()=!$preview||exploded();//! True if printed support material should be shown
moduleno_explode()let($exploded_parent=true)children();//! Prevent children being exploded
moduleno_pose()let($posed=true)children();//! Force children not to be posed even if parent is
moduleexplode(d,explode_children=false,offset=[0,0,0]){//! Explode children by specified Z distance or vector ```d```, option to explode grand children
modulepose(a=[55,0,25],t=[0,0,0],exploded=undef)//! Pose an STL or assembly for rendering to png by specifying rotation ```a``` and translation ```t```, ```exploded = true for``` just the exploded view or ```false``` for unexploded only.
modulepose_hflip(exploded=undef)//! Pose an STL or assembly for rendering to png by flipping around the Y axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only.
modulepose_vflip(exploded=undef)//! Pose an STL or assembly for rendering to png by flipping around the X axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only.
moduleassembly(name,big=undef){//! Name an assembly that will appear on the BOM, there needs to a module named ```<name>_assembly``` to make it. ```big``` can force big or small assembly diagrams.
modulestl_colour(colour=pp1_colour,alpha=1){//! Colour an stl where it is placed in an assembly. ```alpha``` can be used to make it appear transparent.