Source and output

Project Files

(Right-click on projects to save)
How to Compile and Run

Build Sample Part With Geometry

The GEOMETRY sample program shows how to construct product structure with a shape representation to hold some geometry. This program builds all of the STEP backbone entities needed for a product with geometry, then it makes several B-rep boxes and assigns some presentation color information to them.

The product structure is common to all of the STEP application protocols. Depending on the AP, the product may also need some configuration management information, like a design owner, approvals, category, etc. For simplicity, we do not create any of that in this sample, but a real application would.

This program creates the data set and saves it as a STEP Part 21 file called "output_file.stp". This is a text file, so you can look at it with a text editor or the STEP Part 21 file browser to see how the information is represented.

The geometry.cxx file contains the main function. It builds the product structure and creates and empty shape representation. The make_box.cxx and make_const_box.cxx files contain functions to build a simple box by making six rectangular planar faces and connecting them together to form a b-rep solid. There are two versions of the box making functions. One only makes a 10 by 5 by 3 rectangular box aligned along the XYZ axes. The other also makes a box, but is parameterized so that you can pass in the dimensions and the location coordinates.