meta data for this page
  •  

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
en:design_guide_translate [2020/11/28 02:57]
JSCAD Project created
en:design_guide_translate [2020/12/01 00:27]
JSCAD Project
Line 1: Line 1:
 ==== Translate ==== ==== Translate ====
  
-Shapes can be translated (moved) to another location. In other words, every point in the shape is moved by a fixed distance in the same direction. The offset can be positive or negative.+Shapes can be translated (moved) to another location. In other words, every point in the shape is moved by a fixed distance as given by the ''offset''. The ''offset'' can be positive or negative.
  
 //[[http://www.mathsisfun.com/geometry/translation.html|Learn about translation at MathIsFun.com]]// //[[http://www.mathsisfun.com/geometry/translation.html|Learn about translation at MathIsFun.com]]//
  
 Defaults: Defaults:
-  * offset : 0 or [0,0,0]+  * offset : [0, 0, 0]
  
 <code javascript> <code javascript>
-let obj = sphere(5) +let myshape = sphere([radius: 5}
-obj = translate([0,0,10],obj)+let newshape = translate([37, 10], myshape)
 </code> </code>
  
-The CSG library functions can also be used. //NOTE: Deprecated in the V2 API//+In addition, there are simple versions of the same function for translating about a single axis.
  
 <code javascript> <code javascript>
-obj.translate([0,0,10])+let myshape = sphere([radius: 5}) 
 +let newshape = translateX(3myshape) 
 +newshape = translateY(7newshape) 
 +newshape = translateZ(10, newshape)
 </code> </code>
-