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_mirror [2020/12/01 00:47]
JSCAD Editor
en:design_guide_mirror [2020/12/08 06:53] (current)
JSCAD Editor
Line 1: Line 1:
 ==== Mirror ==== ==== Mirror ====
  
-Shapes can mirror (reflect) about the X, Y, or Z axis.+Shapes can mirror (reflect) about the X, Y, or Z axis, and more specifically about any ''origin''.
  
 //[[http://www.mathsisfun.com/geometry/reflection.html|Learn about reflection at MathIsFun.com]]// //[[http://www.mathsisfun.com/geometry/reflection.html|Learn about reflection at MathIsFun.com]]//
Line 7: Line 7:
 Defaults: Defaults:
   * origin : [0, 0, 0]   * origin : [0, 0, 0]
-  * normal : [0, 0, 1] mirror about the Z axis+  * normal : [0, 0, 1] (mirror about the Z axis)
  
 <code javascript> <code javascript>
-let myshape = cube({size: [5, 20, 5]}) +const myshape = cube({size: [5, 20, 5]}) 
-let newshape = mirror({origin: 3, 3, 3], normal: [1, 0, 1]}, myshape)+const newshape = mirror({origin: 3, 3, 3], normal: [1, 0, 1]}, myshape)
 </code> </code>
  
-There are simple versions of this function to mirror about a single axis.+There are simple versions of this function to mirror a single axis about the origin.
  
 <code javascript> <code javascript>
-let myshape = cube({size: [5, 20, 5]})+const myshape = cube({size: [5, 20, 5]})
 let newshape = mirrorX(myshape) let newshape = mirrorX(myshape)
 newshape = mirrorY(newshape) newshape = mirrorY(newshape)
 newshape = mirrorZ(newshape) newshape = mirrorZ(newshape)
 </code> </code>