The location and size of the cabinet’s top surface will be calculated based on the body’s rectangular prism.
To add the cabinet top:
Select one of the Rectangular Prism Body wrapper node copies, and enter the Name “Rectangular Prism Top” in the Object Info palette.
Insert the following nodes to create a network as illustrated.
● Get XYZ node: the X and Y locations of the top of the cabinet are based on those of the body, and are altered by the two sub nodes to provide a defined offset. The bottom surface of the cabinet top is located at the same Z value as the top of the body, so the Body Height node can bypass the Get XYZ node and be wired directly into the Z port of the new Point 3D node.
● Dim node: This will specify an overhang offset. Name this node Overhang. Because the offset will be the same on all sides, the same overhang node connects to both sub nodes; the value of this node is defined later.
● Two Sub nodes: these nodes subtract the dimension provided by the Overhang node from the X and Y locations to help define the top’s offset.
● Point 3D node: The X, Y, and Z locations for the top are calculated based on those of the cabinet body; if the dimensions of the body change, the top automatically updates as well.
Connect the wires to the Rectangular Prism Top wrapper as illustrated.
To make the top of the cabinet wider and deeper than the body, multiply the overhang dimension by two.
● Add an Int node and assign it a Value of 2.
● Add a Multiply node to serve as the multiplier.
Connect the wires.
Add the multiplier to the Width and Depth of the top of the cabinet by creating Add nodes. To control the height of the top, add a Dim node named Top Thickness to the top height. Connect the wires.
Enter a value of 1.5” for the Overhang and 1” for the Top Thickness.
Select a node and click Run from the Object Info palette.
A rectangular prism displays at the assigned origin with the prescribed dimensions to add a top to the cabinet base.
You can download the tutorial at this stage here (internet access required).
~~~~~~~~~~~~~~~~~~~~~~~~~