International Journal of Automation and Computing  2018, Vol. 15 Issue (4): 500-512 PDF
STEP-based Feature Recognition System for B-spline Surface Features
Bitla Venu, Venkateswara Rao Komma, Deepanshu Srivastava
Department of Mechanical Engineering, Motilal Nehru National Institute of Technology, Allahabad 211004, India
Abstract: The geometrical and topological information of 3D computer aided design (CAD) models should be represented as a neutral format file to exchange the data between different CAD systems. Exchange of 3D CAD model data implies that the companies must exchange complete information about their products, all the way from design, manufacturing to inspection and shipping. This information should be available to each relevant partner over the entire life cycle of the product. This led to the development of an international standard organization (ISO) neutral format file named as standard for the exchange of product model data (STEP). It has been observed from the literature, the feature recognition systems developed were identified as planar, cylindrical, conical and to some extent spherical and toroidal surfaces. The advanced surface features such as B-spline and its subtypes are not identified. Therefore, in this work, a STEP-based feature recognition system is developed to recognize B-spline surface features and its sub-types from the 3D CAD model represented in AP203 neutral file format. The developed feature recognition system is implemented in Java programming language and the product model data represented in STEP AP203 format is interpreted through Java standard data access interface (JSDAI). The developed system could recognize B-spline surface features such as B-Spline surface with knots, quasi uniform surface, uniform surface, rational surface and Bezier surface. The application of extracted B-spline surface features information is discussed with reference to the toolpath generation for STEP-NC (STEP AP238).
Key words: Feature recognition     3D computer aided design (CAD) model     geometrical information     standard for the exchange of product model data (STEP) AP203     Java standard data access interface (JSDAI)
1 Introduction

2 Literature survey

The exchange of product model data among different CAD systems through initial graphics exchange specification (IGES) neutral format file and STEP files is more popular among different neutral format files. The following paragraph gives the literature review of the feature recognition systems which are using IGES and STEP format files.

3 Programming language and tools used in the development of feature recognition system

The proposed feature recognition system is developed and implemented in Java programming language. Input to the developed system is the STEP AP203 format file of 3D CAD model. The information of the STEP AP203 file is accessed through Java standard data access interface (JSDAI)[34], which is an open source API to read, write and execute runtime manipulation of the EXPRESS-based data model. EXPRESS is a standard data modeling language for representing product data, which is represented as STEP (ISO 10303) model and standardized as ISO 10303-11. EXPRESS is similar to programming languages like Cobol or Pascal, in which a schema of various datatypes can be defined with structural constraints and algorithmic rules. The information related to the 3D CAD models represented in STEP application protocols (APs) can be accessed through JSDAI and the corresponding set of Java class files of the AP schema. A 3D CAD model represented in AP203 format shall be validated against its schema with JSDAI. JSDAI is available as a standalone package as well as a plug-in to the eclipse integrated development environment (IDE) for Java programming language. JSDAI is an alternative to the commercially available ST-developer[35] from STEP-tools Inc. JSDAI provides EXPRESS compiler, which is used to compile AP203 EXPRESS schema and automatically generate the corresponding Java classes. These Java classes of the schema are added to the library of the project, in which the proposed feature recognition system is developed. The algorithm used in this work depends on the geometrical data representation of B-splines in STEP schema. Therefore, it is important to understand the representation of B-splines in STEP. A brief outline representation of B-spline surfaces and B-spline curves according to STEP AP203 schema is described in the following section.

4 Representation of B-spline surfaces and curves in STEP AP203 schema

A bounded face is formed with a bounded surface and a set of boundary curves. The bounded surfaces are further classified as B-spline surfaces, rectangular trimmed surfaces, curve bounded surfaces and rectangular composite surfaces. Out of these surfaces, B-spline surfaces are widely used for product modelling in different applications such as automotive and aerospace industries. Therefore, in this work, B-spline surfaces are selected for recognition. B-spline surface is a general form of rational or polynomial parametric surface, which is represented by control points, basis functions and weights. The type of B-spline surface depends on surface default values or characteristics of the provided values. The subtypes of the B-spline surface are B-spline surface with knots, uniform surface, quasi-uniform surface, rational surface and Bezier surface. Similarly, B-spline curve is a subtype of bounded curve, it is defined as piecewise parametric polynomial or rational curve described in terms of control points and basis functions. This type of curve is the most stable form to represent all types of polynomial or rational parametric curves. The sub-types of B-spline curves are B-spline curve with knots, uniform curve, quasi-uniform curve, rational curve and Bezier curve. The polynomial parametric representation of B-spline surface and B-spline curve is shown in (1) and (2), respectively[2].

 $\sigma(u, v)=\sum_{i=0}^{K_1} \sum_{j=0}^{K_2} {P_{ij} N_i^{d_1} (u) N_j^{d_2}(v)}$ (1)
 $\lambda(u)=\sum^k{P_i N_i^d(u)}.$ (2)

Equation (1): $P_{ij}$ is control point at i-th row and j-th column, $d_1$ & $d_2$ are u & v degrees, $N_i^{d_1}$ & $N_j^{d_2}$ are i-th and j-th normalized B-spline basis functions of $d_1$ , $d_2$ , and $K_1$ & $K_2$ are upper indices on u & v control points. Equation (2): d is degree of the curve, $P_i$ is i-th control point, k is upper limit of control points, $N_i^d$ is i-th normalized B-spline basis function of degree d. The subtype of B-spline surface, B-spline surface with knots and B-spline curve with knots as edge curves are having better control over the other sub-types of B-spline surfaces. Hence, these types are considered for testing the developed feature recognition system. Representation of B-spline surface with knots and B-spline curve with knots as per the AP203 schema is given below.

#ID = B_SPLINE_SURFACE_WITH_KNOTS (u-degree, v-degree, control points list, surface form, u-closed, v-closed, self-intersect, (control points), (u-multiplicities), (v-multiplicities), (u-knots), (v-knots), knot specification).

#ID = B_SPLINE_CURVE_WITH_KNOTS (degree, (control points), curve form, curve closed, self-intersect, (knot multiplicities), (knots), knots specification). The attributes of B-spline surface and additional attributes of subtype B-spline surface with knots as per the STEP AP203 schema are shown in Fig. 2. The attributes of B-spline curve and additional attributes of subtype B-spline curve with knots as per the STEP AP203 schema are shown in Fig. 3.

Section 5 gives the algorithmic steps performed to identify B-spline surface features. The flow chart representation of the algorithmic steps for the recognition of B-spline surface features is shown in Figs. 4(a) and 4(b).

 Download: larger image Fig. 2. Representation of B-spline surface with knots attributes as per AP203 schema

 Download: larger image Fig. 3. Representation of B-spline curve with knots attributes as per AP203 schema

 Download: larger image Fig. 4. Flow chart representation of algorithmic steps to recognize B_spline_surface features

5 Steps performed to identify B-spline surface features

In the development of feature recognition system for identifying B-spline surface features, several user defined Java classes are programmed along with JSDAI classes. The following key steps illustrate the development of the system.

Step 1. The STEP AP203 part 21 file (text format) data is accessed by the following steps.

1) JSDAI session is opened and a transaction is started in read write access mode, then a repository is created in the same JSDAI session for importing clear text encoding file (file name.stp).

2) JSDAI data model is created with imported file with the same repository (If more than one JSDAI data model is required, the data models can be created in the same session).

Step 2. Current JSDAI model is opened (i.e., if there are more than one models) and the instance of advanced B-rep shape representation is accessed from the manifold solid B-rep entity.

Step 3. Closed shell object is obtained with manifold solid B-rep instance, which contains the connected face set of the solid model.

Step 4. All the face entity instances of the closed shell are obtained and checked for the following conditions.

1) Is the face geometry of the face is an instance of bounded surface?

2) If the above step (i.e., Step 1)) is true then check, if the face geometry is the subtype B-spline surface (BSS), then store the face in an array of BSS faces (say, BSS_FACES).

Step 5. Get all the face entity instances of BSS_FACES and perform the following steps.

1) B-spline surface (BSS) is obtained and the information (BSS_INFO) required to define B-spline surface (BSS) geometry is also obtained, such as u-degree (UD), v-degree (VD), list of control points (CP), surface form (SF), u-closed (UC), v-closed (VC) and self-intersect (SI).

2) Further check will be performed, if the face geometry is B-spline surface with knots (BSSK)(i.e., subtype of B-Spline surface), additional information (BSSK_INFO) necessary to define the surface with knots is extracted, such as u-multiplicities (UM), v-multiplicities (VM), u-knots (UK), v-knot (VK) and knot specification (KS).

3) If the face geometry is of other type of sub-types such as quasi uniform (Q-BSS), uniform (U-BSS), rational B-spline (R-BSS) or bezier surface (B-BSS), the related information (XBSS_INFO) to define the surface is extracted.

4) Then, loop of oriented edges are retrieved from the face_outer_bound and B-spline curve object (BSC) is obtained.

Obtain the edge loop instances of each BSC face and perform the following steps.

a) Check for bounded curve type, further check for subtype B-spline curve (BSC), then the curve definition attribute information such as degree (D), list of control points (CP), curve form (CF), curve closed (CC), and self-intersect (SI) is retrieved.

b) Further check for B-spline curve with knots (BSCK), extract the additional information (BSCK_INFO) necessary to define the curve with knots, such as knot multiplicities (KM), knot specification (KS) and knots (K). Then, form the BSSK_FEATURE with BSS_INFO, BSSK_INFO and BSCK_INFO.

c) If the curve is of other type of BSC such as quasi uniform curve (Q-BSC), uniform curve (U-BSC), rational B-spline curve (R-BSC) and Bezier curve (B-BSC), then the relevant information is retrieved, and then XBSS_FEATURE is formed with BSS_INFO, XBSS_INFO and XBSC_INFO.

Close for all the instances of BSS_FACES.

Close for all the instances of BSCs of edge loop.

In the following section, working of the developed feature recognition system is demonstrated for the recognition of B-spline surface features using a realistic 3D CAD model (i.e., impeller of a compressor) as shown in Fig. 5. The application of the output result is also illustrated for toolpath generation.

6 Test case: Results and discussion with a 3D CAD model of an impeller having B-spline surface with knots features

In this test case, a 3D CAD model of an impeller modelled in Pro-Engineer software (shown in Fig. 5) represented in STEP AP203 format file (i.e., 30 000+ lines) is given as input to the developed feature recognition system. The system successfully recognized all the B-spline surface with knots (BSSK) features from the considered 3D CAD model (impeller). The considered 3D CAD model is having 96 BSSK features, since the complete information of the BSSK features are cumbersome. Therefore, sample output of the developed system is given in Tables 1 and 2. The edge curve level data of the selected BSSK features are given Table 3. The output information is represented in accordance with the STEP AP203 schema, which shall be used in downstream applications such as STEP-NC (AP238) and toolpath generation. It has been observed that the recognized surface features are of third degree in u direction (UD) and v direction (VD), and it is also identified that the surface features are open in u and v directions, i.e., logical values are “1” and “1” for UC and VC respectively. The identified surface features are not self-intersecting, i.e., logical value is “1” for SI. The knot specification (KS) of the surface features are “2”, which designates the knots are unspecified.

Table 1
Sample output of B-spline surface with knots features (BSSK) information as per AP203 express schema definition

Table 2
Details of multiplicities and knots of the selected B-spline surface features given in Table 1

Table 3
Details of B-spline curves with knots of the selected B-spline surface features shown in test case

The number of control points (NCP), u-multiplicities (NUM), v-multiplicities (NVM), u-knots (NUK), v-knots (NVK) of feature surfaces are also listed in Table 1. Sample of selected BSSK features, BSSK_16, BSSK_18, and BSSK_20 and its edge curves are shown in Fig. 5. BSSK_16 feature is bounded with B-spline curve with knots (BSCK) IDs BSCK_26, BSCK_84, BSCK_85, BSCK_86 and line IDs L_16 and L_13. Similarly, BSSK_18 is bounded with BSCK_38, BSCK_90, BSCK_87, BSCK_91, C_27 (Circle ID) and L_18 (Line ID) and BSSK_20 feature is bounded with BSCK_84, BSCK_90, L_14 and L_17. Table 2 shows the details of number of control points (NCP) (start point (SP) and end points (EP) of the curves), u-multiplicities (NUM), v-multiplicities (NVM), u-knots (NUK) and v-knots (NVK) of sample BSSK features shown in Fig. 5. The details of edge curve IDs (i.e., BSCKs) of identified sample BSSK features are given in Table 3. It has been observed that all BSCKs are of degree (D) “3”, curve forms (CF) are unspecified (corresponding attribute value is “6”), curves are open type (CC value is “1”) and the curves are not self-intersecting (SI value is “1”). The knot specifications (KS) of the curves are specified as “2” (quasi uniform). The knot multiplicities (KM) and knots (K) of all the BSCK are also given Table 3. Fig. 6 shows the output screenshot of the feature recognition system in Eclipse IDE with STEP AP203 file of impeller as input.

The sample identified features of the considered 3D CAD model is highlighted in the output screenshot (Fig. 6). The extracted output information represents the information required to define the B-spline surface with knots type feature (BSSK). The developed system also extracts the edge curve level information such as advanced curves like B-spline curves with knots (BSCK) type. Due to high volume of data, only sample features are represented (BSSK_16, 18, 20) in Fig. 5 and those sample features are highlighted in Fig. 6 for the verification of the obtained output data from the developed feature recognition system for B-spline surface features. The other type of edge curves information such as lines and circles are not given in this article due to data redundancy.

The recognized B-spline surface features from the developed system should be represented as STEP manufacturing feature for downstream applications. For instance, B-spline surface can be explicitly linked to AP238 (STEP-NC) through unit of functionality (UoF) of manufacturing feature via application object of toolpath_feature. Toolpath_feature is used to represent explicit toolpath of features, which are not covered in implicit representation of manufacturing features of AP238. While linking B-spline surface to toolpath_feature, application interpreted model (AIM) element instanced_feature is used with the defined reference path in AIM mapping tables of AP238. Below is the format for linking of B-spline surface to manufacturing feature of AP238.

#10=INSTANCED_FEATURE (“freeform feature”, “toolpath”, “ ”, “toolpath”, #5, . F.)

#20=PRODUCT_DEFINITION_SHAPE (“ ”, “ ”, #10)

#30=SHAPE_DEFINITION_REPRESENTATION (#20, #40)

#40=SHAPE_REPRESENTATION (“explicit feature shape”, (#100), #200)

#100= B_SPLINE_SURFACE_WITH_KNOTS ()

#200= [ $\cdots$ to geometric context $\cdots$ ]

 Download: larger image Fig. 5. Details of 3D CAD model (impeller) having B-spline surface with knots features

The represented B-spline surface from the entity of instanced_feature is used for generation of cutter contact (CC) or cutter location (CL) data points from the basic equations of B-spline surfaces or B-spline curve. B-spline surface can be represented as advanced_face, in which the following two cases arise:

Case 1. If the face_geometry attribute of the advanced_face is of type surface_of_linear_extrusion having a swept_curve of B_spline_curve_with_knots. The advanced_face formed by linear sweep of B_spline_curve_with_knots ( ${\lambda(u)}$ ) is shown in Fig. 7(a). In Fig. 7(a), toolpaths are shown in dotted lines on this surface. The cutter data points on the tool path are calculated from the equation of ${\lambda(u)}$ and are extruded along the sweep to get multiple numbers of tool passes. The cross product of tangent ( $T_{u}$ ) and direction of linear extrusion ( $D_{l}$ ) gives the normal ( $N_{p}$ ) at particular point (P), which is used to indicate the axis of the tool for milling the surface.

Case 2. If the face_geometry attribute of the advanced_face is of type B_spline_surface_with_knots, the advanced_face formed by B_spline_surface_with_knots ( ${\sigma(u, v)}$ ) is shown in Fig. 7(b). The cutter data points on the surface are calculated from the equation of ${\sigma(u, v)}$ . The cross product of tangent ( $T_{u}$ ), along u direction and tangent ( $T_{v}$ ), along v direction gives the normal ( $N_{p}$ ), for representing tool axis direction.

Surface finish and accuracy are the major criteria for performing milling operation for B_spline surfaces. Tolerance on the toolpath curve (CC or CL) is an important factor for good finish of the machined surface. Scallop height and gouging effect should be minimized for obtaining a smooth surface, free from any tool marks. The calculated toolpath curves and tool axis consisting of data points as Cartesian_point are used for generation of STEP-NC codes in AP238 format using the following representation:

#1744=MACHINING_TOOLPATH (“Tool Path Number 1”, “cutter location trajectory”, “ ”, “ ”)

#1745=MACHINING_TOOLPATH_SEQU ENCE_RELATIONSHIP (“ ”, “ ” #1726, #1744, 1.0)

#1747=ACTION_PROPERTY (“basic curve”, “cutter location trajectory”, #1744)

#1748=ACTION_PROPERTY_REPRESENTATION (“ ”, “cutter location trajectory”, #1747, #1749)

#1749=REPRESENTATION (“ ”, (#1750), #1045)

#1750=POLYLINE (“basic curve”, (#1751, #1752))

#1751=CARTESIAN_POINT (“ ”, (–185.0, –10.0, 140.0))

#1752=CARTESIAN_POINT (“ ”, (–185.0, –10.0, 100.0))

#1757=ACTION_PROPERTY (“tool axis”, “milling”, #1744)

#1758=ACTION_PROPERTY_REPRESENTATION (“ ”, “ ”, #1757, #1759)

#1759=REPRESENTATION (“ ”, (#1760), #1045)

#1760=POLYLINE (“Tool Axis curve”, (#1761, #1762))

#1761=CARTESIAN_POINT (“ ”, (0.0, 0.0, 1.0))

#1762=CARTESIAN_POINT (“ ”, (0.0, 0.0, 1.0))

Following paragraph briefs the novelty of the present work in comparison with the recent existing work.

The methodologies developed by Shivakumar and Dhanalaxmi[24], Li et al.[25], Niu et al.[28] identified the features of cylindrical surface geometry and aircraft structural parts ribs, which are formed with planar surfaces and to some extent toroidal surface geometries. Identification of B-spline surface geometry features was not considered in their article. The output of the feature recognition systems discussed in the literature section was also not considered for representation as per the requirement of the downstream applications. Xu et al.[30], Zhang and Li[31], Harik et al.[32] and Zhang et al.[33] attempted to identify non-planar elementary surface features of basic shapes like cube, wedge, cylinder, cone and sphere and the approaches have not considered STEP format file. Their approaches could not present the feature data as per the data needed for the downstream applications, whereas the developed system in this article addresses the issues noticed in the literature section. The work also addressed the application of output information for toolpath generation of STEP NC. Section 7 gives the concluding remarks and future scope of the present work.

 Download: larger image Fig. 6. Output screenshot of the developed system in Eclipse IDE with impeller as test case