Translating an Object

Most of the times you will translate your Object in the builder by using location objects in a locations list. (See also: Rotating an Object)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from build123d import *
from ocp_vscode import *
set_defaults(reset_camera=Camera.KEEP, black_edges=True,center_grid=True)

with BuildPart() as TestPart:
    # Creates TWO locations in the Locations LIST
    with Locations(Location((0,0,0)),Location((10,10,0))):
        # Creates a cube at EACH Location in the Location LIST 
        Box(6,5,3)

show_all()

This can be written in short:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from build123d import *
from ocp_vscode import *
set_defaults(reset_camera=Camera.KEEP, black_edges=True,center_grid=True)

with BuildPart() as TestPart:
    # Creates TWO locations in the Locations LIST
    with Locations((0,0,0),(10,10,0)):
        # Creates a cube at EACH Location in the Location LIST 
        Box(6,5,3)

show_all()

Other ways to change postion is:

Pos(): Description needed
move: Description needed
offset: Description needed