{'fraction_non_alphanumeric': 0.030801413835389164, 'fraction_numerical': 0.00461660535237683, 'mean_word_length': 5.112874779541446, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Multi-scale model retrieval for case recommendation in manufacturability optimization

This paper proposed a multi-scale retrieval framework to help optimize manufacturability. The case based workflow integrates both geometry and rules with model-based definition. At conceptual stage, defect models are categorized and global retrieval is initialized to narrow down cases as defects references. At detail stage, local feature retrieval finds similar defect feature with pre-defined rules, to adapt to manufacturability optimization. Intersection feature detection and decomposition are explored to improve generality.


Introduction
Similar to simulation that optimizes structural performance, manufacturability analysis could optimize manufacturing feasibility. Optimized model would reduce cost and repetition of manufacturing. Thus such tool is essential to industry. While there are lots of engineering failures cases, managing these resources is valuable to industry companies. Similar cases could be references to decide how failures portion on the target model should be fixed. Given that medium of engineering design upgrade to model based definition (MBD) [1], which is composed of geometric and non-geometric information, like product and manufacturing information (PMI), existing retrieval method should adapt to the case recommendation task. To retrieve proper reference portions, recommender systems need to find out critical face geometry, and to compare relationship and/or the properties of local elements, which is different from existing search system or feature recognition system. Given that there might be intersection features in practice, handling intersection features is also needed for generality.

Related Work
If design is modelled by valid machining features, it is of good manufacturability and is fit for principle of design for manufacturing (DFM). Tools like DFMpro [2] were proposed to reduce workload of manual check. Machining feature library is predefined like hole etc., and text based semantic rules are coded to recognized features. Similar to DFMpro, Siemens NX Checkmate [3] aims at standard validation, including formatting and company standards, and general best practices. Definition of rules is also text-based not link to models. Configuration space(C-space) modeling [4] approach validates space relationship of setup between product and tools. Wang et al. [5] proposed slice of cavity for cutting tool selection, but it cannot adapt to other manufacturability analysis task. Fox et al. proposed split of light weight model and combine manufacturability of each part to a degree, heat map was introduced to visualize how different regions affect cost [6], which is apparent to users.
Case based reasoning(CBR) is to solve new problems by remembering previous similar situation and by using information and knowledge of that situation. For example, Jiang et al. [7] proposed a fuzzy similarity-based rough set method for case-based reasoning and explore its application in  [9] proposed a case-based reasoning approach to design machining fixture.
Since retrieval is the first step of CBR, similarity assessment is essential. There are many approaches in content based similarity assessment, such as histogram based [10], feature based [11], graph based [12] etc.. In this paper, a multi-scale retrieval approach was proposed to solve the MBD case recommendation problem for manufacturing optimization.

Overview
Framework is illustrated in figure 1. Given a new design model, global retrieval identifies which class it belongs to where repository was indexed in advance. Then, defects are located in the specific class by local feature retrieval. Optimization rule stored on referenced MBD model are returned, parsed to driven target model update, to optimize manufacturability. If the updated model is of reusing value, it could be stored in the repository to enlarge the capacity of the framework. In short, it contains conceptual and detail stage and follows the CBR principle, related to model reuse and knowledge fusion. This paper focuses on the locating stage, not interactive definition and adaptation of rules.
For every defect, it could be geometry defect, non-geometry defect or combination, since the MBD model may contain geometry model and PMI information (figure 2). These defects are based on geometry faces because solid model spaces are defined by face boundaries (B-rep), and PMI are attached to faces. The geometry basis could be a single face, multiple faces, or discrete faces with some relationship. For example, a drilling simple hole is of ill manufacturability if the length-diameter ratio is larger than a threshold, the geometry basis is a single face. An intersection feature like milling non-rectangle slot, however, is composed of multiple faces, where the manufacturability requirement is related to all of the faces and the depth value of slot should not be too large to be accessible. If the turning corner radius is smaller than bottom corner radius, it is of ill manufacturability, where the geometry basis are discrete cylindrical faces. Therefore, precise face locating is required.

Initial Filtering and Detailed Retrieval
Assume that in the same class similar parts could share more probability of similar defect feature, a classified defect parts repository could automate the class identification of the target model by evaluating MBD similarity. The process is as follows: 1. Collect typical models, mark class information of each model, to initialize the model repository.
2. Set similarity assessment algorithm to be the distance function of classifier.
3. Adopt k-nearest neighbour (KNN) algorithm to mark the target model. Since MBD model is mainly composed of solid model (B-rep) and PMI, the global similarity should be composed of these two kinds of information. We extend hierarchical partition graph (HPG) [13] to measure MBD similarity, which conform to rotational, transformation and rotational invariant.
Main idea of HPG is to partition a model into several parts. Each partition is a maximum set of faces with coherent concave/convex connections, which can be organized in a hierarchy. If two 3 models are similar, the similarity will distributed on description in level of detail. For example (figure 3), the hierarchy is composed of a tree of resolution level (see dashed lines) and some adjacent graph (see solid lines). While the tree preserves global topology consistency by "parent-children" relationship between each resolution level, the adjacent graph preserves local topology consistency by "sibling" relationship between each partition node. Connections of part node are called "seed wire". Detail of the seed wire recognition, partitioning, assembling algorithms, and matching process please refer to [13].
Since non-geometry information is also defined on faces, it can be stored as face property in the detail similarity calculation stage. For example, distance between the numerical value-based property like dimensions, tolerance etc. (which should be of the same PMI type) can be measured by normalizing the Euclidean distance, which is absolute ratio between target-reference value difference, and maximum-minimum difference with in the PMI type. Engineering notes are treated as structured XML [14] for comparison. Since the MBD model are defined from the design platform like Siemens NX, where PMI are stored as XML, the values and sub-XML can be extracted and parsed using NX Open API. After considering non-geometry similarity, formula 2 in [13] could be extended as follows: ∑ (1) Where represents non-geometry similarity influence leaf partition of HPG, is the ratio between matched faces" area of node and total matched faces" area of all nodes in this resolution. is non-geometry similarity where PMI defined on all faces of each partition. and are weights for geometry and non-geometry similarity, respectively. It requires . In the same model class, locating relevant case to check manufacturability is to find relevant faces. We explored face properties matching to tackle this problem [15]. The main idea is increase matching accuracy by extending highly detailed local symmetry transition of around faces. Since B-rep can be represented as winged-edge data structure [16], every edge has two "wing" faces, each of which has two "wing" edges. Convexity change of these two edges, is used to define symmetry of the wing face: 1. Convex symmetry : both "wing" edges are convex 2. Concave symmetry: both "wing" edges are concave 3. Non-symmetry: convexities of two "wing" edges are different.
As illustrated in figure 4, there are two evaluating edges. The edge convexity is convex (left) and concave (right). Each edge is intersected by two highlighted adjacent faces ("wing" faces). For each wing face, two connected edges ("wing" edges) sharing the same loop with the evaluating edge. Because convexities of both wing edges are convex, symmetry of face related to the evaluating edge can be defined as convex symmetry. And the symmetry across evaluating edge is unchanged.  Figure 4: Edge symmetry While convexity can be defined on every edge, so as the symmetry to all the faces, therefore the matching criteria of targeting face could be strictly set to be matched both the face property, its boundary edge properties and even the intersection point properties. The basic properties for matching can be parsed in advance. Such as the face normal, centre point, solid face type (plane, cylindrical, spherical etc.), edge orientation (forward or reverse), solid edge type (liner, circular etc.). In addition, the relational property can be extended by the edge convexity and face symmetry. The matching rules: 1. Rules for faces: Basic solid face type and extended property like face symmetry. 2. If face rules meets, further check whether its boundary edges rules meet to edge properties. 3. Edge rules: solid edge type, edge convexity and extended edge symmetry changes (next section).

Handling Intersection Features
We explored geometric reasoning based intersection detection and decomposition for reusing existing defect cases on simple feature to optimize intersection features" manufacturability [15]. Based on the observations that features are around concave edges, we further define edge symmetry change to distinguish intersection feature hint, which is defined as concave edges whose symmetry changes along its "wing" faces. As illustrated in figure 5, there are four concave edges. The bottom two edge"s adjacent faces" symmetry are unchanged, the top two edges" are changed, therefore the latter two edges are intersection feature hints, which can be used for intersection feature decomposition.  Figure 6. Feature decomposition. In figure 6, selecting one splitting edge from intersection feature hint, the larger face of the two highlighted "wing" edge is base face(defined as a face that has at least two splitting edges), and the smaller one is seed face. 1-degree faces are defined as one-step expanding faces of seed face, and adjacent to the base face. 2-degree faces are one-stop expanding faces of 1-degree faces adjacent to base face. Replacing face is selected from 2-degree faces. For multiple 2-degree faces, the selection criteria is maximizing the dot product value between seed face normal and a vector, which isfrom seed face centre to replacing face centre. The "replace face" operation would preserve 1-degree adjacent relationship between seed face and replacing face, which can be implemented with NX direct modelling API. Updated model will reduce complexity of intersection feature hint. Iteratively perform the "replace face" until the rest concave edges are not splitting edges. The intersection feature could be divided into multiple single features, which could enlarge the reusability of existing repository.

Experimental setup and initial results
While defining manufacturability defects and optimization rules are based on Siemens NX RDDV module in .prt format, repository for identifying class type is composed of 101 engineering MBD files classified in 11 categories, like flange, socket, brick etc. every class contains multiple typical defects.
Initial filtering contains offline indexing and online matching stage. Since the extended properties like symmetry and symmetry change are also related to the face properties, they are initialized as exploring of the B-rep topology. As illustrated in figure 7, after initial filtering, the target model get its class type of bracket, and the further searching of defects are in a most relevant defect cases. Figure 7: Manufacturability case. After detailed retrieval, highlighted defect areas are found to be with relation to three recommended cases, where through hole is related to one face, thickness of wall is related to two faces,  5 and chamfer is related to multiple discrete faces. Taken chamfer as an example, optimizing rule is "the radius of turning corner should be larger than radius of bottom corner", which is defined on the defect case with NX RDDV module. Similarly, while length of hole should be less than 5 times of diameter in best practice, wall thickness should be larger than 5 mm. After retrieve requirement rule defined on related faces, target models" face parameters are optimized after approve of the recommendations.

Conclusion
In this work, a multi-stage case recommendation approach combining initial filtering and detailed retrieval are proposed. Geometric reasoning is used to implement the proposed method. A case based manufacturing framework is supported by MBD model retrieval, and implementation demonstrated its effectiveness. Based on the preliminary study, we would like to further explore intersection feature recommendation, to help automate the complex manufacturability optimization.