The design of casting process parameters is an indispensable link in the overall casting process design. The accuracy of these parameters directly affects the dimensional precision of the final casting, thereby indirectly influencing production efficiency and cost. In the realm of sand casting services, traditional process design was predominantly manual. Due to the inherent complexity of the craft, this approach not only suffered from low efficiency but also made it difficult to guarantee the accuracy and consistency of the design. The advancement of computer technology has made the development of Computer-Aided Design (CAD) systems for casting processes a tangible reality. By leveraging the speed and accuracy of computers, these systems accelerate data querying and calculation processes. Furthermore, they can reference existing design expertise to optimize the final design results. For providers of sand casting services, such tools are transformative.
Numerous researchers have developed CAD systems to simplify casting process design. Early systems, often developed on platforms like AutoCAD and Visual Basic in a 2D environment, focused on elements like gating systems, riser systems, and process databases for materials like cast iron. Some progress was made into 3D environments for specific applications, such as for ductile iron or shaft-type parts. While these efforts positively promoted design quality and efficiency, a significant gap remained. Most systems operated in 2D, and those in 3D were typically tailored for specialized components. Consequently, their output could not be directly utilized by engineers working with mainstream 3D modeling and simulation software, necessitating redundant redesign work and wasting human and material resources. As 3D modeling theory and application technology mature, 3D casting process CAD is inevitably becoming the mainstream. Therefore, to enhance design quality and user convenience, developing a universal 3D CAD system for casting molds is imperative. This article details our work in developing core modules—shrinkage allowance and draft angle—for a sand casting mold CAD system within a modern 3D environment, a crucial development for advanced sand casting services.

The transition from 2D to 3D CAD is more than a visual upgrade; it represents a fundamental shift in how sand casting services approach manufacturability from the earliest design stages. In a 3D digital prototype, the designer interacts with a complete volumetric model, allowing for direct interrogation of geometry for wall thickness, hot spots, and parting line definition. This immersive environment is ideal for implementing automated checks and applying manufacturing rules, such as our shrinkage and draft modules. The direct manipulation of the 3D geometry ensures that all process modifications are inherently integrated into the master model, eliminating the discrepancies that often arise when translating a 2D drawing section into a 3D mold model. This seamless integration is key to achieving “right-first-time” casting design, reducing costly iterations between design and foundry engineering teams, and solidifying the reliability of sand casting services.
The Critical Need for 3D Integration in Foundry CAD
The limitations of previous CAD systems created a “digital disconnect” in the workflow for sand casting services. A pattern maker or process engineer might use a dedicated 2D casting CAD tool to calculate riser sizes and shrinkage values. These results, often expressed as numerical factors or 2D drawing annotations, then had to be manually re-interpreted and applied by a 3D modeler using separate CAD software (like SolidWorks, CATIA, or NX) to create the actual mold components and core boxes. This multi-step, manual translation process is a prime source of error. A miscommunication or oversight in applying a shrinkage factor to a critical dimension can render an entire batch of castings unusable. Our development philosophy was to bridge this gap by embedding the foundry engineering logic directly into the 3D modeling environment. By making shrinkage and draft application an interactive, model-centric operation, we ensure the design intent is preserved and executed precisely. This integration is vital for complex castings where different sections may require different shrinkage allowances, a task exceedingly cumbersome and error-prone in a 2D workflow.
System Architecture and Development Platform
Our development was carried out within the SolidWorks 2006 environment, a leading 3D parametric modeling software widely used in mechanical design. The programming was accomplished using Microsoft Visual Basic .NET 2003 (VB.NET) as the core language and SolidWorks’ own API (Application Programming Interface) for secondary development, known as SolidWorks API. This combination provides a powerful toolkit: VB.NET offers robust capabilities for building Windows-based applications with complex logic and database connectivity, while the SolidWorks API grants direct, programmatic control over the SolidWorks software itself. We can create geometry, select faces, read dimensions, apply transformations (like scaling and tapering), and modify features—all through code. The modules were built as add-ins that load directly into SolidWorks, appearing as new menu items or toolbar buttons within the familiar interface. This means the casting process designer never has to leave their primary 3D modeling workspace, fostering a smooth, integrated workflow that enhances the efficiency of sand casting services.
Design Principle and Algorithmic Foundation
1. The Shrinkage Allowance Module
The linear shrinkage rate of a casting is the actual contraction rate that accounts for all influencing factors. It depends not only on the alloy’s inherent solidification shrinkage and the temperature at which contraction begins but also on the casting’s geometry (structural complexity), the casting method, the design of the gating and risering system, and the yielding ability of the sand mold and cores. The primary factors, however, are the complexity and the overall size of the casting. To obtain castings with high dimensional accuracy, it is essential to select an appropriate, realistic shrinkage allowance or pattern enlargement factor. For our initial module, we focused on steel castings, compiling a database of empirical linear shrinkage rates for reference during pattern and mold design.
The core function of this module is to apply a uniform scale factor to the entire 3D solid model of the casting pattern. The scaling is centered on the model’s coordinate system origin. The key challenge is determining the correct scale factor $S_{factor}$ based on user input and empirical rules. The final dimension $D_{final}$ on the pattern must satisfy the equation relating it to the desired cast dimension $D_{cast}$ and the shrinkage rate $\varepsilon$ (expressed as a percentage, e.g., 2%):
$$ D_{final} = D_{cast} \times (1 + \varepsilon) $$
Conversely, when starting from a model of the final part (the “as-cast” model), the module must calculate the required enlargement. If the 3D model represents the desired finished casting, the pattern model $M_{pattern}$ is derived from the casting model $M_{casting}$ by applying a uniform scale transformation $T_{scale}$:
$$ M_{pattern} = T_{scale}(M_{casting}) $$
where the scale factor $S_{factor}$ is $(1 + \varepsilon)$. The system workflow is as follows:
- Part Selection: The user selects the solid body representing the casting within the SolidWorks environment.
- Automatic Dimension Analysis: The program automatically retrieves the bounding box dimensions of the part, identifying the major characteristic length $L_{max}$ (e.g., the largest of length, width, or height). This serves as a key input for the rule-based selection of shrinkage rate.
- User Input: The user specifies the Shrinkage Type via a dialog box. This is a critical classification:
- Free Shrinkage: Applied when the casting geometry is simple and symmetrical, offering minimal resistance to contraction from the mold walls and cores.
- Restricted (or Hindered) Shrinkage: Applied when the casting has complex features, internal cores, or intersecting thick sections that physically restrain the natural contraction of the metal, resulting in a lower effective shrinkage rate.
- Database Query: Using the combination of $L_{max}$ and the selected Shrinkage Type, the program queries an internal database. The database contains recommended shrinkage rates $\varepsilon$ for steel, typically categorized into dimensional ranges and constraint conditions. An example structure is shown in Table 1.
- Geometric Transformation: Using the retrieved $\varepsilon$, the module calls the SolidWorks API function `ModelDoc2.Extension.Scale` to apply a uniform scale to the entire selected solid body with the factor $S_{factor} = (1 + \varepsilon/100)$.
| Material | Major Dimension $L_{max}$ (mm) | Shrinkage Type | Recommended Shrinkage Rate $\varepsilon$ (%) |
|---|---|---|---|
| Carbon & Low-Alloy Steel | 0 – 500 | Free | 2.0 – 2.3 |
| 0 – 500 | Restricted | 1.8 – 2.0 | |
| 500 – 1500 | Free | 1.8 – 2.0 | |
| 500 – 1500 | Restricted | 1.5 – 1.8 | |
| 1500 – 3000 | Free | 1.5 – 1.7 | |
| 1500 – 3000 | Restricted | 1.2 – 1.5 |
2. The Draft Angle Module
To facilitate the removal of the pattern from the sand mold (or the core from the core box) without damaging the sand surfaces, a slight taper, known as a draft angle, must be applied to surfaces perpendicular to the parting line. The treatment of this draft varies significantly based on the functional requirements of the casting surface. There are three primary methods, as illustrated in Figure X:
- Increase Dimension Method (Positive Draft): Used on machined surfaces. Material is added to the nominal casting dimension, ensuring the machining operation will clean up the surface and achieve the final specified size.
- Increase & Decrease Dimension Method (Split Draft): Commonly used on non-critical, non-mating internal surfaces. The draft is applied such that the nominal wall thickness at the parting line remains constant, with material added on one side of the mid-plane and removed from the other.
- Decrease Dimension Method (Negative Draft): Used on non-mating external surfaces or where a reduction in weight/stock is desired. Material is removed from the nominal casting dimension.
The algorithm for applying draft is more localized than the global scaling for shrinkage. It operates on selected faces. The mathematical basis involves tilting a planar face about a defined axis. For a face with an initial normal vector $\vec{n}$, applying a draft angle $\alpha$ relative to a pull direction $\vec{d}$ (the direction of pattern removal) results in a new face orientation. The core geometric operation is a rotation of the face (or rather, a taper feature applied to the extrusion that created it). If a face needs the “Increase & Decrease” treatment, an additional offset operation is performed after tapering to shift the face so that the midpoint at the parting plane remains fixed. The required offset distance $O$ for a wall of height $H$ and draft angle $\alpha$ (in degrees) using the split draft method is approximately:
$$ O = \frac{H}{2} \cdot \tan(\alpha \cdot \frac{\pi}{180}) $$
The module’s workflow is interactive:
- Face Selection: The user selects one or more planar faces on the 3D model from which the pattern will be withdrawn.
- Parameter Specification via Dialog: The user populates a dialog with key parameters:
- Draft Type: Increase, Decrease, or Increase & Decrease.
- Pull Direction: Specifies the side of the face from which the pattern is drawn (determines which way the face tilts).
- Pattern Material: Wood or Metal. This influences the recommended angle, as metal patterns can use smaller angles (e.g., 1°) due to their smoother surfaces and strength, while wood patterns require larger angles (e.g., 1.5°-3°) to prevent sand tearing.
- Surface Location: Internal (core print or cavity) or External. Internal surfaces often require slightly larger draft angles.
- Automatic Height Measurement: The program measures the draft height $H$ for the selected face(s), typically the length of the face along the pull direction.
- Database Query: Using the combination of Pattern Material, Surface Location, and $H$, the program queries a second database table to retrieve the recommended draft angle $\alpha$ and, if applicable for the chosen type, a standard “add/remove” dimension. See Table 2 for an example.
- Feature Application: The module calls SolidWorks API functions. First, `FeatureManager.Draft` is used to apply the taper with angle $\alpha$. For the “Increase & Decrease” type, it subsequently uses `Modeler.CreateOffsetSurface` or a similar offset operation to achieve the midpoint shift $O$.
| Pattern Material | Surface Location | Draft Height $H$ (mm) | Recommended Angle $\alpha$ (°) | Typical Increase/Decrease per side (mm) |
|---|---|---|---|---|
| Metal | External | 0 – 50 | 0.5 – 1.0 | 0.2 – 0.5 |
| External | 50 – 200 | 1.0 | 0.5 – 1.0 | |
| Internal | 0 – 50 | 1.0 – 1.5 | 0.5 – 0.7 | |
| Internal | 50 – 200 | 1.5 | 0.7 – 1.5 | |
| Wood | External | 0 – 50 | 1.5 | 0.7 – 1.0 |
| External | 50 – 200 | 2.0 | 1.0 – 2.0 | |
| Internal | 0 – 50 | 2.0 – 3.0 | 1.0 – 1.5 | |
| Internal | 50 – 200 | 3.0 | 1.5 – 3.0 |
Database Integration and Management
A robust, easily manageable database is the backbone of a rule-based CAD system for sand casting services. We selected Microsoft Access 2003 as our database platform. Given that casting process data for these modules has a relatively simple structure and modest volume, a lightweight database management system like Access is perfectly adequate. It simplifies deployment and allows foundry engineers to view or even cautiously modify lookup tables if company-specific standards evolve.
We created two primary tables within the database file: `ShrinkageData` and `DraftAngleData`, structured similarly to Tables 1 and 2 above. To enable flexible, programmatic interaction with these tables from our VB.NET dialog boxes, we employed ODBC (Open Database Connectivity) as the connection methodology. ODBC provides a standardized API for accessing database management systems, ensuring compatibility and ease of maintenance. The programming sequence within the VB.NET code follows a standard protocol, which can be abstracted as the following pseudo-code process:
Step 1: Environment Allocation. $$ \text{SQLAllocHandle}(\text{SQL_HANDLE_ENV}, \text{null}, \rightarrow \text{hEnv}) $$
Step 2: Set ODBC Version. $$ \text{SQLSetEnvAttr}(\text{hEnv}, \text{SQL_ATTR_ODBC_VERSION}, \text{SQL_OV_ODBC3}) $$
Step 3: Connection Handle Allocation. $$ \text{SQLAllocHandle}(\text{SQL_HANDLE_DBC}, \text{hEnv}, \rightarrow \text{hDbc}) $$
Step 4: Connect to Data Source. $$ \text{SQLConnect}(\text{hDbc}, \text{“CastingDB”}, \text{SQL_NTS}, \text{“”, SQL_NTS, “”, SQL_NTS}) $$
Step 5: Statement Handle Allocation. $$ \text{SQLAllocHandle}(\text{SQL_HANDLE_STMT}, \text{hDbc}, \rightarrow \text{hStmt}) $$
Step 6: Prepare and Execute Query. $$ \text{SQLPrepare}(\text{hStmt}, \text{“SELECT ShrinkageRate FROM ShrinkageData WHERE Matl=? AND SizeMin <= ? AND SizeMax > ? AND Type=?”}, \text{SQL_NTS}) $$
Step 7: Bind Parameters. $$ \text{SQLBindParameter}(\text{hStmt}, 1, \text{SQL_PARAM_INPUT}, \text{SQL_C_CHAR}, \text{SQL_CHAR}, 0, 0, \text{@material}, 0, \text{null}) $$ // … bind other parameters for size and type
Step 8: Execute and Fetch. $$ \text{SQLExecute}(\text{hStmt}); \quad \text{SQLFetch}(\text{hStmt}); \quad \text{SQLGetData}(\text{hStmt}, 1, \text{SQL_C_FLOAT}, \rightarrow \varepsilon, 0, \text{null}) $$
Step 9: Cleanup. $$ \text{SQLFreeHandle}(\text{SQL_HANDLE_STMT}, \text{hStmt}); \quad \text{SQLDisconnect}(\text{hDbc}); \quad \text{SQLFreeHandle}(\text{SQL_HANDLE_DBC}, \text{hDbc}); \quad \text{SQLFreeHandle}(\text{SQL_HANDLE_ENV}, \text{hEnv}) $$
This structured approach ensures reliable data retrieval, encapsulating the complex casting knowledge within a maintainable external database rather than hard-coding it into the program logic. This separation of data and logic is a best practice for sustainable software development in sand casting services, allowing rules to be updated without recompiling the application.
Application Case Study and Workflow Demonstration
When the compiled add-in is loaded into SolidWorks, it registers two new custom commands: Apply Shrinkage and Apply Draft Angle. The workflow for a typical steel bracket casting illustrates the power of this integrated system for sand casting services:
- The designer opens the 3D model of the finished steel bracket (the “as-cast” design).
- They run the Apply Shrinkage command. A dialog box appears (similar to the concept in Figure Y). The system auto-populates the “Major Casting Dimension” field (e.g., 450 mm). The user selects “Restricted Shrinkage” from a dropdown due to the bracket’s L-shaped geometry with intersecting ribs. The system queries the database and displays the recommended “Shrinkage Rate” (e.g., 1.9%). Upon clicking “Apply,” the entire 3D model scales uniformly by 101.9%, creating the enlarged pattern model. This one-step, rule-based application eliminates measurement and manual calculation errors.
- Next, the designer runs the Apply Draft Angle command. They select all vertical external faces on the pattern model that are perpendicular to the chosen parting line. In the dialog box, they choose:
- Draft Type: Increase & Decrease (for non-mating surfaces).
- Pattern Material: Metal.
- Surface Location: External.
- The system measures the draft height for each face and, using the database, suggests an angle of 1.0°.
- After clicking “Apply,” the software parametrically modifies the selected faces, applying a 1.0° taper split equally about their mid-planes. The resulting 3D model is now the manufacturable pattern, complete with correct shrinkage and draft, ready for toolpath generation or core box design.
This seamless, in-situ modification is a stark contrast to the traditional method of producing a 2D drawing with notes like “Apply 2% shrinkage” and “Add 1° draft to all vertical walls,” leaving the interpretation and 3D execution to a separate, error-prone manual step.
Conclusions and Impact on Modern Sand Casting Services
The development and implementation of these 3D CAD modules for shrinkage allowance and draft angle within SolidWorks lead to several significant conclusions regarding their impact on sand casting services:
- Intuitive and Direct 3D Design Operation: Performing casting process design through direct manipulation of the 3D casting model is intuitive, straightforward, and practical. It bridges the gap between design intent and manufacturing reality, a core requirement for efficient sand casting services.
- Enhanced Accuracy through Database Management: Utilizing a structured, ODBC-connected database to manage design parameters ensures the consistent application of proven foundry standards. This guarantees design accuracy and significantly improves efficiency by eliminating manual lookups and reducing reliance on individual memory or disparate reference books.
- Stability and Correctness: The modules, built on the robust SolidWorks API and a structured .NET application framework, run stably within the host CAD environment. The results—parametrically modified 3D geometry—are precise and directly usable for downstream applications like mold assembly design, CNC programming, and even as the starting geometry for casting simulation software, creating a fully digital thread.
- Foundation for a Comprehensive System: These modules represent foundational pillars for a complete 3D Casting CAD system. The same architectural principles—interactive 3D selection, rule-based dialog input, database-driven parameters, and API-controlled geometric modification—can be extended to other critical processes. Logical next steps include modules for automated parting line generation, riser and feeder design based on modulus calculation, gating system layout, and machining allowance application. Integrating these into a single, cohesive 3D environment would represent the ultimate digital toolbox for modern sand casting services.
In summary, the move from 2D, standalone casting CAD to integrated, knowledge-based 3D modules is not merely an incremental improvement but a necessary evolution. It aligns process design with the industry’s shift towards full digital product definition and Industry 4.0 practices. By embedding manufacturing intelligence directly into the design environment, we empower engineers to make better decisions faster, reduce costly prototyping cycles, and enhance the overall competitiveness and capability of sand casting services in producing high-quality, dimensionally accurate components. The future of foundry engineering lies in this seamless fusion of design, simulation, and manufacturing preparation within a unified digital space.
