meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
en:design_guide_translate [2020/11/28 02:57] JSCAD Editor created |
en:design_guide_translate [2020/12/08 06:52] (current) JSCAD Editor |
||
|---|---|---|---|
| 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 | + | Shapes can be translated (moved) to another location. In other words, every point in the shape is moved by a fixed distance |
| // | // | ||
| Defaults: | Defaults: | ||
| - | * offset : 0 or [0,0,0] | + | * offset : [0, 0, 0] |
| <code javascript> | <code javascript> | ||
| - | let obj = sphere(5) | + | const myshape |
| - | obj = translate([0,0,10],obj) | + | const newshape |
| </ | </ | ||
| - | 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]) | + | const myshape = sphere([radius: 5}) |
| + | let newshape = translateX(3, myshape) | ||
| + | newshape = translateY(7, newshape) | ||
| + | newshape = translateZ(-10, newshape) | ||
| </ | </ | ||
| - | |||