In the field of metal forming, the design of casting processes has always been a critical link between product requirements and manufacturability. For steel castings produced by sand casting foundry techniques, the mold parameters directly influence dimensional accuracy, surface quality, and the soundness of the final component. Traditional methods of process design often rely heavily on empirical charts, manual calculations, and the experience of individual engineers. This approach is not only time-consuming but also prone to inconsistency and errors, especially when dealing with complex geometries and multiple process variables. To address these challenges, I have undertaken the development of a specialized computer-aided design software package dedicated to the determination and visualization of sand casting foundry mold parameters for steel castings.
The core objective of my research was to create a practical tool that operates within a three-dimensional modeling environment, allowing engineers to interactively assign process parameters such as machining allowances, shrinkage allowances, draft angles, and minimum cored hole dimensions. The software integrates a relational database containing standardized data from casting handbooks and industrial practice, and it directly modifies the solid model of the casting to reflect these parameters. Throughout this thesis, I will describe the systematic development process, the selection of programming platforms, the implementation of individual modules, and the validation of the software through practical examples. The ultimate goal is to demonstrate how the integration of computer-aided design with sand casting foundry knowledge can significantly enhance the efficiency and reliability of casting process planning.
1. Introduction to Sand Casting Foundry Process Design
Sand casting foundry technology remains one of the most versatile and widely used methods for producing metal components, particularly for large and complex steel castings. The process involves creating a mold from sand, which is shaped by a pattern that is a replica of the desired casting. The pattern must account for various allowances and contractions to ensure that the final machined part meets its specifications. The design of these mold parameters is a crucial step in sand casting foundry engineering. It determines not only the geometry of the pattern but also the feasibility of the casting process itself.
In my work, I focused on four fundamental parameter categories for steel castings produced in a sand casting foundry: machining allowance, shrinkage allowance, draft angle (also known as pattern taper), and minimum cored hole dimensions. Each of these parameters is influenced by factors such as the size and complexity of the casting, the molding method (manual or machine molding), the type of sand, and the cooling conditions. The traditional approach to determining these parameters involves consulting extensive tables and applying empirical rules. However, this manual process is tedious and can lead to errors. By developing a software tool that automates the retrieval of these data and applies them directly to a three-dimensional model, I aimed to streamline the entire design workflow in a sand casting foundry environment.
The significance of this research extends beyond mere automation. A well-designed computer-aided system can serve as a repository of knowledge, capturing the expertise of experienced process engineers and making it accessible to less experienced users. Furthermore, by visualizing the effects of parameter changes on the solid model, the software facilitates better communication among design, manufacturing, and quality assurance teams. This is particularly important in sand casting foundry operations where the interplay between pattern design, mold making, and casting solidification is complex and multidimensional.
2. Selection of Development Environment and Tools
The success of any computer-aided engineering software depends heavily on the choice of the underlying platform, programming language, and database system. For this project, I evaluated several available options and selected a combination that offered robustness, compatibility with three-dimensional modeling applications, and ease of database integration.
First, the operating system chosen was a widely adopted Microsoft Windows platform, known for its stability and security. This provided a reliable foundation for running the required design software and development tools. The main application platform was a well-known computer-aided design (CAD) package that supports both two-dimensional and three-dimensional modeling. This CAD software, which is extensively used in mechanical engineering, offers an open architecture that allows third-party developers to create custom modules and extend its functionality.
For the development of the custom software, I had to choose among several application programming interfaces (APIs) provided by the CAD system. The available options included a scripting language, a Visual Basic for Applications (VBA) interface, and a C++ class library known as ObjectARX. After careful comparison, I selected the C++ class library because it provides the highest performance, the most robust functionality, and direct access to the core database and graphics system of the CAD application. The following table summarizes the comparison:
| Development Language | Language Type | Functionality | Efficiency | Speed |
|---|---|---|---|---|
| Scripting language | Interpreted | Limited | Low | Slow |
| Visual Basic for Applications | Object-oriented | Moderate | Moderate | Moderate |
| C++ (ObjectARX) | Object-oriented | Stable and powerful | High | Fast |
By leveraging ObjectARX, I was able to create custom commands and user interfaces that behave as native parts of the CAD environment. This object-oriented approach allowed me to define classes for dialog boxes, process parameter handlers, and geometric modification routines. The use of ObjectARX also facilitated the integration of the software with the CAD system’s undo/redo features, which is essential for an interactive design tool. Ultimately, the chosen platform and development environment provided the perfect balance between performance, flexibility, and user experience for a sand casting foundry process design tool.
For data storage and retrieval, I selected a simple yet powerful database system based on Microsoft Access. This database is easily managed through a visual environment, and it supports standard SQL queries. In the developed software, I used the Open Database Connectivity (ODBC) interface to establish a link between the CAD application and the database files. The database was organized to store standardized parameter tables for machining allowances, shrinkage rates, draft angles, and minimum cored hole sizes. This approach allowed the software to read up-to-date data without hardcoding the values, making it easy to update or extend the database as new standards or internal company specifications emerge.
3. Architecture and Implementation of the Software Modules
The developed software system comprises four main modules, each dedicated to a specific type of sand casting foundry mold parameter. These modules are integrated into the CAD environment through custom toolbars and menu items. The following sections describe the design, data structures, and implementation details of each module.
3.1 Machining Allowance Module
The machining allowance is the additional metal layer that is intentionally added to the casting surfaces that require subsequent machining. This allowance ensures that the machined part achieves its final dimensions and surface finish, while removing any surface defects from the sand casting foundry process. The national and international standards define several grades of machining allowance, denoted as A, B, C, D, E, F, G, H, J, and K. For steel castings produced in sand casting foundry, manual molding typically requires grades D to F, while machine molding requires grades E to G. The standard data are organized according to the maximum dimension of the casting and the selected grade.
In my software, the machining allowance module is designed to operate on selected faces of the three-dimensional model. The user can choose one or more faces, and the module determines the appropriate allowance value based on the face type (flat, cylindrical, or other) and the overall dimensions of the casting. The following table shows a representative excerpt of the machining allowance data used in the database:
| Maximum Dimension (mm) | Grade D (mm) | Grade E (mm) | Grade F (mm) | Grade G (mm) |
|---|---|---|---|---|
| Over 100 to 160 | 2.0 | 2.5 | 3.0 | 3.5 |
| Over 160 to 250 | 2.5 | 3.0 | 3.5 | 4.0 |
| Over 250 to 400 | 3.0 | 3.5 | 4.0 | 5.0 |
| Over 400 to 630 | 3.5 | 4.0 | 5.0 | 6.0 |
The module includes several dialog boxes that guide the user through the selection process. The first dialog asks the user to choose the location of the machined surface (e.g., top, side, bottom, or curved surface). The second dialog applies specifically to cylindrical surfaces, asking whether the dimension is to be added radially or axially. The third dialog lets the user select the machining allowance grade. Finally, the last dialog displays the calculated allowance value and previews the resulting offset surface on the model. The core functions implemented in this module include a function to add machining allowance to cylindrical faces and another function to handle all other face types. The underlying algorithm projects the selected face along its normal direction by the calculated allowance amount, creating a new solid body that includes the additional material.
The development of the machining allowance module was a significant challenge because of the need to recognize the geometry type and orientation of each face. In many cases, faces are not perfectly planar or cylindrical, but are composed of splines and trimmed surfaces. My implementation uses some of the geometric analysis tools provided by the CAD kernel to identify the approximate shape of the face. For cylindrical faces, the module detects the axis and radius, while for planar faces, it determines the normal vector. This information is then used to generate the appropriate offset features. The result is a visually appealing and geometrically accurate representation of the casting with the machining allowance applied.
3.2 Shrinkage (Contraction) Allowance Module
All metals contract during solidification and subsequent cooling. The pattern used in a sand casting foundry must therefore be made larger than the desired casting by a certain percentage to compensate for this contraction. This percentage is called the shrinkage allowance or pattern shrink. For steel castings, the shrinkage allowance depends primarily on the resistance to contraction offered by the mold and the overall length of the casting. A free contraction condition occurs when the mold offers little resistance, while a restrained contraction occurs when the sand core or mold geometry restricts the free movement of the cooling metal.
The following table provides typical values of linear shrinkage for steel castings used in my database:
| Pattern Length (mm) | Shrinkage (%) – Free Contraction | Shrinkage (%) – Restrained Contraction |
|---|---|---|
| Up to 500 | 2.0 | 1.5 |
| Over 500 to 1000 | 1.8 | 1.3 |
| Over 1000 to 2000 | 1.6 | 1.2 |
| Over 2000 | 1.5 | 1.0 |
The shrinkage allowance module is designed to scale the entire solid model of the casting uniformly or non-uniformly within the CAD environment. The user is prompted to select the casting body, and the software automatically obtains the overall dimensions from the model. Then, the user chooses the contraction type (free or restrained). Based on the largest dimension of the casting, the module searches the database for the corresponding shrinkage value. The scaling operation is then performed about the origin or a user-defined reference point. In my implementation, the scaling factor is calculated as:
$$k = 1 + \frac{\epsilon}{100}$$
where $\epsilon$ is the shrinkage percentage read from the database. The entire solid is scaled by this factor, effectively creating an enlarged pattern. For typical steel castings, the shrinkage allowance varies from 1% to 2.5%, and using the correct value is essential to avoid rejected parts. The module includes a preview function that highlights the original part and the enlarged pattern, allowing the user to visually verify the difference.
One of the challenges encountered during the development of this module was the handling of assemblies. In some cases, a single casting may be modeled as an assembly of multiple solid bodies to simplify the creation of complex features. The scaling operation must then be applied to all bodies, but the reference point for scaling may differ. To address this, I implemented an option for the user to choose whether to scale the entire assembly as a single unit or to scale each body individually. In the latter case, the software calculates the centroid of each body and scales it about its own centroid, which yields a more accurate result when the shrinkage is uniform in all directions.
3.3 Draft Angle (Pattern Taper) Module
Draft angle, also known as pattern taper or release angle, is the slight slope added to vertical surfaces of the pattern that are parallel to the mold opening direction. This slope allows the pattern to be removed from the sand mold without tearing the edges of the mold cavity. In a sand casting foundry, the draft angle can be applied in three different ways, as illustrated in the standard: (a) by adding material to the casting, (b) by adding and subtracting material, or (c) by subtracting material from the casting. The choice depends on whether the surface is a machined surface, a non-machined surface that does not mate with other parts, or a non-machined surface that does mate with other parts. Additional material is typically added to machined surfaces, while non-machined internal surfaces may require subtracting material to maintain the nominal wall thickness.
The data for draft angles in my software are organized by the height of the measured surface and the type of pattern material (metal or wood), as well as whether the surface is an exterior or interior pattern surface. The following table presents a condensed version of the draft angle data:
| Surface Height (mm) | Metal Pattern – Exterior (degrees) | Metal Pattern – Interior (degrees) | Wood Pattern – Exterior (degrees) | Wood Pattern – Interior (degrees) |
|---|---|---|---|---|
| Up to 20 | 0.5 | 0.5 | 1.0 | 1.0 |
| 20 to 50 | 0.5 | 0.5 | 1.0 | 1.5 |
| 50 to 100 | 0.5 | 1.0 | 1.0 | 1.5 |
| 100 to 200 | 1.0 | 1.0 | 1.5 | 2.0 |
The draft angle module is more geometrically complex than the previous two modules because it modifies the orientation of faces rather than simply offsetting or scaling them. The implementation begins by allowing the user to select one or more faces, and then asks for the pull direction (the direction in which the pattern will be withdrawn from the mold). In my software, the pull direction is automatically determined from the selected face orientation, but it can also be manually specified by the user. Next, the user chooses whether the draft is to be added (increase material), removed (decrease material), or a combination of both. The module then identifies all edges that lie on the boundary between the selected face and the adjacent faces, and rotates those edges by the appropriate angle around the line of intersection between the face and a plane perpendicular to the pull direction.
To achieve this operation in the CAD system, I used the underlying geometry kernel’s functionality to create a “draft” feature. The algorithm first computes the draft angle from the database based on the face height and pattern material. Then, it creates a transformation matrix that applies a rotation to the face about the intersection line. In cases where the face is not a single plane but a compound surface, the module subdivides the face into smaller facets and applies the draft transformation to each facet individually. This ensures that the resulting geometry remains watertight and manufacturable. The module also includes a preview feature that shows the before and after positions of the draft surfaces, allowing the user to confirm that the draft is applied in the correct direction.
One of the most challenging aspects of implementing the draft module was handling faces that are not axis-aligned or that have complex curvature. In such situations, the standard draft command of the CAD system may fail due to geometry constraints. To overcome this, I developed a custom algorithm that extrudes or tapering the selected faces by creating new temporary solids and performing boolean operations with the original model. Although this approach is computationally more intensive, it proves to be more robust for the diverse geometry encountered in sand casting foundry patterns.
3.4 Minimum Cored Hole Module
The decision of whether to core a hole or leave it to be machined is an economic and quality issue in sand casting foundry practice. Large holes are usually cast to save material and machining time, while small or deep holes are often better machined directly. A hole that is too small or too deep to be cast reliably would cause core shifting or breakage, and it is preferable to omit the core. The minimum cored hole diameter depends on the wall thickness of the casting adjacent to the hole and the hole depth. The following table shows the relationship used in my software:
| Hole Depth (mm) | Wall Thickness < 10 mm | Wall Thickness 10-20 mm | Wall Thickness 20-40 mm | Wall Thickness > 40 mm |
|---|---|---|---|---|
| Up to 50 | 12 mm | 15 mm | 18 mm | 22 mm |
| 50 to 100 | 15 mm | 18 mm | 22 mm | 25 mm |
| 100 to 200 | 18 mm | 22 mm | 25 mm | 30 mm |
| 200 to 300 | 22 mm | 25 mm | 30 mm | 35 mm |
The minimum cored hole module works by asking the user to select one face of the hole, such as the cylindrical wall of a blind hole or the edge of a through hole. The software then estimates the hole depth by identifying the geometric extent along the hole axis. The user is also prompted to measure the wall thickness in the vicinity of the hole; this can be done by selecting the face of the casting adjacent to the hole. Alternatively, the software can automatically compute the average wall thickness using a ray-casting technique from the hole axis to the nearest outer surface. Once both the hole depth and wall thickness are known, the module queries the database for the minimum permissible hole diameter for a sand casting foundry.
If the actual hole diameter is smaller than the minimum required value, the module recommends that the hole should not be cored and proceeds to fill the hole in the solid model, effectively making it a solid block. This simulation of removing the hole provides the user with a clear visualization of the recommended change. Conversely, if the hole diameter meets the minimum requirement, the module confirms that the hole can be cored without modifications. For multiple holes that share the same depth and wall thickness, the user can apply the same decision to all holes at once, saving time and effort.
I implemented the minimum cored hole module with two main functions: one for the standard operation on a single hole, and another for batch processing of selected holes that are identical in size. The challenging part was to identify the boundaries of the hole and to replace its solid geometry with a seamless plug. By performing a boolean union operation between the solid block and the casting body, the module creates a modified casting without the hole. The undo functionality of the CAD environment ensures that the operation can be easily reverted if the user changes their mind.
4. Database Integration and Connectivity
All the standardized data for the four modules are stored in a relational database. The database structure consists of several tables, each representing a set of parameters. For example, the machining allowance table contains columns for the dimension ranges, the allowance grades, and the corresponding values. The shrinkage table stores the contraction factors for different length ranges and resistance types. The draft angle table contains the angle values for different surface heights and material types. Finally, the minimum cored hole table includes the hole depth ranges, wall thickness ranges, and the minimum hole diameters.
The software establishes a connection to the database at startup through the Open Database Connectivity (ODBC) interface. This requires that a named data source is configured in the operating system’s administrative tools. In my user instructions, I provided two methods for setting up the data source. The first method involves opening the Control Panel, navigating to Administrative Tools, and selecting Data Sources (ODBC). The second method involves directly running the odbcad32 command. Once the data source is created, the software uses standard SQL queries to retrieve the parameter values as needed. For example, when the user selects a face and specifies the machining allowance grade, the software executes a query such as:
$$ \text{SELECT } value \text{ FROM } machining\_allowance \text{ WHERE } grade = ‘F’ \text{ AND } max\_dimension > 250 \text{ AND } min\_dimension \leq 400 $$
This query returns the allowance value that is then applied to the selected face. The database approach offers significant advantages: it centralizes the parameter data, makes updates easy, and allows for the incorporation of company-specific standards without recompiling the software. Furthermore, the database can be extended with additional parameters for other casting alloys or sand casting foundry processes, making the software a versatile tool for future developments.
A critical issue in the database connection is the stability of the ODBC driver, especially when the software is run on different versions of the operating system. To mitigate this, I implemented a fallback mechanism that reads the necessary data from an embedded local file if the database connection is unavailable. This ensures that the software remains functional even in an environment where the ODBC configuration is not properly set up. The fallback file is a simple comma-separated text file that contains the same data tables, and the software can switch between the database and the file seamlessly.
5. Demonstration and Practical Application
To validate the functionality and usability of the developed software, I conducted two practical examples using three-dimensional models of typical steel castings. These examples were designed to test all four modules in an integrated workflow within the CAD environment.

The first example was a bracket-shaped casting that consisted of a cylindrical boss, an inclined rib, four circular holes, and a flat base. The workflow began with the draft angle module, applied to the cylindrical boss and the inclined rib. The user selected the faces to be drafted, specified the pull direction (upwards, according to the mold opening direction), and then selected the draft type as “increase material” for the outer surfaces. The module automatically retrieved the draft angle from the database based on the height of the surfaces, which was approximately 30 mm for the boss and 25 mm for the rib. The software displayed the resulting tapered surfaces on the model, and the visual difference was noticeable in the local zoomed view.
Next, the minimum cored hole module was applied to the four circular holes. Each hole had a diameter of 10 mm and a depth of 20 mm, with a wall thickness around the hole of approximately 15 mm. The database query indicated that the minimum cored hole diameter for these conditions was 15 mm. Since the actual diameter was smaller, the module recommended not casting the holes. The user accepted the recommendation, and the software filled all four holes, effectively converting the casting into a solid bracket with no cored holes. This operation illustrates a common cost-saving decision in sand casting foundry practice: small holes are left to machining rather than being cored.
Subsequently, the machining allowance module was used on the bottom face of the bracket. This face was designated as a machine surface, and the user selected a machining allowance grade of E. The largest overall dimension of the bracket was about 150 mm, so the allowance was retrieved as 2.5 mm. The module offset the bottom face downward by 2.5 mm, creating a thicker layer of metal at the base. The preview clearly showed the offset face, and the user could confirm the operation. This feature is particularly useful for sand casting foundry engineers who need to ensure that sufficient material is present for post-casting machining.
Finally, the shrinkage allowance module was applied to the entire bracket. The largest dimension was 150 mm, and the user selected “free contraction” as the contraction type. The database returned a shrinkage value of 2.0%. The software then scaled the entire solid model by a factor of 1.02, enlarging the bracket to produce the required pattern size. The user could toggle between the original and scaled models to inspect the differences. This final step simulated the patternmaker’s process, ensuring that the pattern accounts for solidification shrinkage.
The second example was a more complex valve body casting, which had several surfaces requiring selected operations. I chose this example to test the robustness of the face selection and the ability to handle non-planar geometry. The software performed all operations without errors, and the resulting modified model accurately reflected the desired mold parameters. The possibility of applying the same draft angle to multiple faces at once, as well as the batch processing of identical holes, greatly reduced the number of user interactions.
These demonstrations confirmed that the developed software operates stably in the three-dimensional environment of the CAD system, providing intuitive user interfaces and immediate visual feedback. The integration of the parameter database ensures that the design values are accurate and consistent with established sand casting foundry practice. The software not only speeds up the design process but also reduces the risk of human error caused by frequent manual table lookups.
6. Conclusions and Future Work
In this research project, I successfully developed a computer-aided design package for determining mold parameters in sand casting foundry production of steel castings. The software consists of four independent yet integrated modules: machining allowance, shrinkage allowance, draft angle, and minimum cored hole. Through the use of the C++ class library and a relational database, the software operates seamlessly within a well-known three-dimensional CAD environment, providing a user-friendly interface for process engineers.
The main achievements of this work can be summarized as follows:
1. The developed modules enable the design of casting process parameters in a full three-dimensional environment, significantly improving the visualization of design intent over traditional two-dimensional drawings. This is a major step forward for sand casting foundry design, as it allows engineers to better understand the implications of the added or removed material before the pattern is manufactured.
2. The object-oriented class design resulted in clean code with high maintainability. The use of ObjectARX made it possible to leverage the existing functionality of the CAD system, including undo/redo, visual management, and file operations. The code is organized into well-defined classes for each dialog and operational component, which facilitates future enhancements and the addition of new modules.
3. The integration of a relational database for storing and retrieving process parameters proved to be an effective approach. It ensures data accuracy, simplifies the process of updating parameter values, and allows the software to adapt to different company standards. The software successfully reads the required data through SQL queries and applies the values to the three-dimensional model programmatically.
There are several directions for future work that could further improve the software. First, the current modules focus on individual parameters. A natural extension would be to develop an integrated module that automatically proposes all required parameters for a given casting based on an analysis of its geometry, material, and production conditions. This would require more sophisticated rules and possibly an expert system. Second, the software currently uses a single database for standard values. Future versions could include features for editing and expanding the database through a graphical user interface, enabling users to add custom parameters or new materials easily. Third, the geometric algorithms for face recognition and modification could be enhanced to handle more complex freeform surfaces, which are increasingly common in modern castings.
In conclusion, the software developed in this thesis is a practical and valuable tool for engineers working in the sand casting foundry industry. It reduces the tediousness of manual parameter lookup, minimizes errors, and provides a clear three-dimensional representation of the pattern design. The successful implementation of the four modules demonstrates the feasibility of creating specialized, high-performance design tools using object-oriented programming and database integration within a commercial CAD platform. I believe that this work contributes to the ongoing digitalization of casting process design and paves the way for more advanced computer-aided engineering tools in the field of sand casting foundry technology.
