The 3D Box Tool draws three-dimensional boxes that maintain their perspective when moved over the canvas.
A 3D box is composed of an SVG Group consisting of six closed paths shaded to give the illusion of a three dimensional shape.
With Inscape 1.5 the 3D-box tool has three choices in the Preferences dialogEdit ‣ Preferences ‣ Tools ‣ Shapes ‣ 3D Box Tool for how style is inherited.
Last used style: The 3d box group inherits the current style from the last changed object (in particular, all the faces have the same color - no 3d appearance with this option).
Object type’s last used style: (This is the default behavior.) - Faces initially have 3D shading, but changes are inherited by a subsequently drawn 3D box.
The Tool’s own style: The default behavior is to always draw a 3D shaded box.
Select the 3D Box tool
from the Toolbox on the left side of the window (keyboard shortcut ShiftF4).
Left mouse drag over the canvas. Where the drag starts will be one corner of the front x-y face. And where the drag ends will be the opposite corner.
It is best when first drawing a 3d box to do it somewhere inside the page border. The 3d box can look rather distorted when drawn near the edges or off the page border.
Press Shift at any time after you start drawing the 3D box to extrude it along the z-axis.
Any of the four front face diamond handles can be dragged along the red (x) or blue (y) directions.
The four rear face diamond handles can only be dragged in the yellow (z) direction.
Hold Shift to switch the freedom of movement directions of the front and rear faces.
Hold CtrlCmd to restrict movement of resize handles to lines along the box’s edges or to a diagonal direction.
This allows adjusting just one dimension of a box face in the first case or keeping the aspect ratio fixed in the latter case.
Drag the central x handle to move the whole box, while keeping the vanishing points in the same place. This allows the box to have the proper 3D-simulated perspective, no matter where it is moved.
The 3D-boxes are shaded as if illuminated from a light source positioned lower right.
Drag the rear XYface forward along yellow (z) axis, to pass through front XYface. This gives the illusion of turning the 3D box inside-out.
The former rear XYface now appears invisible. The top XZface appears semi-transparent (Note that this is the appearance only. No changes have occurred to the face fill values).
Drag the right YZface through left YZface, bottom and top faces now appear invisible when viewed from outside.
Various “pass through” actions, such as were just described, can produce a variety of shading combinations. Have fun testing!
An inside-out 3D box with its alternative back-wall shading¶
Select the front XYface and delete it (steps described later, Selecting faces within the 3D box group).
Now we can see the interior of the 3D box, which can look like a room or tunnel.
Alternatively, the rear XYface can be dragged forward until the box appears to be inside-out (No need to delete a face.) This produces a different shading arrangement.
New 3D boxes will share the same vanishing points as the last one drawn or last one selected.
To separate shared vanishing points for selected 3D boxes, hold the Shift key while dragging a vanishing point handle. (Also, selecting a 3D box with the Select tool
and moving the 3D box will break away its vanishing points.)
To merge a separated vanishing point handle with another vanishing point handle, hold Shift and select both 3D boxes, then place the vanishing points in close proximity to each other.
Warning
Separating vanishing points will result in unselected 3D boxes reverting to 2-point perspective boxes with their vanishing points mid way on the pages edges.
Work around - copy and paste 3D box.
(Merge request 7478 could fix this.)
A normal group can be entered by double-clicking the group, but in this case double-clicking a 3D box activates the 3D box tool.
Instead, try one of these three options:
Choose ‘Enter Group’ from the context (right-click) mouse menu.
Choose a face from the Layers and Objects dialog.
Click on a 3d box with any other shape tool, to select a face.
Click to select visible faces
AltOptionClick to select hidden faces
In addition holding the Shift key allows selection of multiple faces.
Change to the Select tool
.
Now you can move the face as desired. For example move all the faces outwards to produce an exploded/opened view of a 3D box.
To delete a face, select it and press Del. For example, delete a front face to see the interior of a 3D box.
Note that neither moving a face or deleting a face affects 3D boxes that are subsequently drawn with the 3D Box tool.
To revert to the original default 3d shading, the preferences.xml file can be either edited or reset.
(If you decide to reset all your preferences, be sure to make a copy of preferences.xml first!)
There are two general ways to approach changing the default colors of the 3D box faces: change the style of the group, or change the style of the individual faces. The next sub-sections explain the details.
To change the style of a 3D box, select it with Selection tool
.
Then use the Fill and Stroke dialog, or click in the Palette, to change the fill color.
Note that all six sides of the 3D box will become the same color that you clicked.
This technique does not create the 3D illusion. The next section below, Change the style of individual faces, explains how to do that.
If you want the next 3D box you draw to use the current style, then go to Inkscape Preferences ‣ Tools ‣ Shapes ‣ 3D Box Tool, and tick the ‘Last used style’ option.
You can create a “wireframe” appearance by adding a stroke (if there is not one already): Fill and Stroke dialog ‣ Stroke tab ‣ Solid Fill button second from the left.
And then remove the fill: Fill and Stroke dialog ‣ Fill tab ‣ large X button top-left.
Individual face colors can be changed, and the last face changed will become the new current style for subsequently drawn 3D boxes.
Also, these individual face style changes will be inherited, if you change Inkscape Preferences ‣ Tools ‣ Shape Tools ‣ 3D Box Tool, to ‘Object type’s last used style’.
See the next section for more about changing face colors.
If you want the next 3D box you draw, to have the same color faces as the last object you drew,
then go to Inkscape Preferences ‣ Tools ‣ Shapes ‣ 3D Box Tool and tick the ‘Object type’s last used style’ option.
This option most closely matches the default behavior in earlier versions of Inkscape.
Initially, by default blue 3d-shaded 3D boxes will be drawn, however,
changes to any 3D box face styles will be inherited in option 2 by any newly drawn 3D box.
And as we’ve learned, if you click in the palette while a 3D box is selected, all the faces of that box will change to the color you clicked.
So it is quite easy to loose the original 3d shading in subsequently drawn 3D boxes.
Newly drawn 3D boxes will now inherit these new face styles.
Note
If retaining the 3d shading is important, consider using the third option ‘The Tool’s own style:’.
Tip
If you should want to restore the original default blue-shaded appearance of 3D boxes, here are those colors.
You just need to select each face as indicated, and change the color using the Fill and Stroke dialog > Fill tab.
The third option for giving 3D boxes a style when you draw them, is ‘This tool’s own style:’.
If you have a preferred 3D box style that will be created each time and ignore any modifications made, this is the option to use.
By default it draws blue 3D-shaded 3D boxes, and will continue to do so until an alternative style is saved with the Take from selection button.
For example, changing the 3D-shaded color.
If you want to maintain the original 3D shaded appearance of the box,
choose HSLuv from the style of color selection menu,
in the Fill and Stroke dialog. Then change only the Hue value, using the same value for each face.
(Default blue shade HSLuv Hue: 266°)
After creating your preferred 3D box coloration, click once with the Selection tool. Then go to Edit menu ‣ Preferences ‣ Tools ‣ Shapes ‣ 3D Box Tool, choose the option ‘This tool’s own style:’ and click the Take from selection button.
The change is recorded.
Tip
Create a collection of different 3D boxes with colors that you often use, in a special SVG file. Now when required, you can copy and paste the desired color 3D box into a working file. The colors are now part of that document’s XML and will not affect preferences.xml. They will otherwise behave as normal 3D boxes.
In Inkscape, the 3D Box tool utilizes Sodipodi attributes to define group and face properties.
These parameters are stored using XML attributes prefixed with sodipodi: and inkscape: within the Inkscape SVG code.
When the SVG is loaded into Inkscape these attributes are used to regenerate the SVG path d=”” attributes.
If exported as Plain SVG only the path will be saved (same as if Object to Path were applied).
If the same Plain SVG file were loaded into Inkscape, the original 3D box will no longer be editable using the 3D Box tool, because it had been changed into a regular path.