From the course: Creating a Captive Sphere with OpenSCAD

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Centering the cube

Centering the cube

- When we first create this cube, it comes out with the corner lining up with this intersection. Now, we want to have this cube centered on that intersection, so it'll align with the sphere we create later. And in order to center it, all we have to do is to tell OpenSCAD that that's what we want to do. So let's click inside the brackets that define the cube, after the 30 that defines the size of it. We'll type a comma, to tell OpenSCAD we're typing a new instruction, and now we type center=true, and that tells OpenSCAD to center the cube on the axes. To view that, we can again either choose Preview from the Design menu, use the shortcut F5, or in fact, use either of the buttons located in the editor on the bottom of the preview window. And there is our cube now centered within these axes. We can always return to our default view by hitting the Reset View button.

Contents