meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:design_guide_align [2020/12/04 23:38]
JSCAD Editor
en:design_guide_align [2021/11/07 07:33] (current)
JSCAD Editor
Line 1: Line 1:
 ==== Align ==== ==== Align ====
  
-Shapes can be aligned across X, Y, and Z axis. In other words, each shape is translated to the requested position, aligning the boundaries of the shapes. The ''modes'' of alignment control which position to use, with values 'center', 'min', 'max', or 'none'. The alignment can also be positioned to a specific point, ''alignTo''.+Shapes can be aligned across X, Y, and Z axis. In other words, each shape is translated to the requested position, aligning the boundaries of the shapes. The ''modes'' of alignment control which position to use, with values 'center', 'min', 'max', or 'none'. The alignment can also be positioned to a specific point, ''relativeTo''.
  
 Defaults: Defaults:
   * modes : ['center', 'center', 'min']   * modes : ['center', 'center', 'min']
-  * group : false /* align all shapes together */ +  * group : false (do not align all shapes as a group) 
-  * alignTo : [0, 0, 0] +  * relativeTo : [0, 0, 0]
  
 +<code javascript>
 +const newshapes = align({modes: ['min', 'none', 'none'], myshape1, myshape2, myshape3) // align shapes at the minimum X
 +const newshapes = align({modes: ['min', 'center', 'none'], relativeTo: [10, null, 10], grouped: true}, myshape1, myshape2, myshape3)
 +</code>