A UNITY Sketch Based Modelling Environment for Virtual Assembly and Machining to Evaluate DFMA Metrics

Current tools used to carry out design for manufacture and assembly (DFMA) evaluations are time consuming to use. This increases the cost of bringing a product to market by extending the length of the design process. The steps that comprise the design, analysis and redesign process are typically carried out in series over long periods of time using different tools. Introducing concurrent engineering practices could significantly reduce the time taken to complete this process and improve workplace DFMA learning. An opportunity exists to create and test an integrated real-time DFMA tool using the UNITY game engine, which could potentially address these problems. If this approach can be achieved it has the potential to decrease the time taken for the design process and enable a greater number of solutions to be considered potentially leading to a more optimal design solution. Having a more optimal design could lead to major cost reduction in later stages of product development by reducing the work needed to plan and carry out the manufacturing process and creating a product that is easier and less costly to maintain. This paper reports on a pilot haptic sketch-based system to investigate its feasibility to conduct concurrent DFMA. .


INTRODUCTION
One of the principal ways to deliver innovation and to advance production is through Design for Manufacture and Assembly (DFMA). An increasing challenge for manufactures is how to evaluate different product design options and how to compare one set of solutions with another. Currently available software implementations of DFMA methods have utilized a WIMP (windows, icons, menus, and pointing) based approach to user interaction.
A widely investigated alternative approach to user interaction is that of a sketch based interface combined with gestural commands. This type of approach has been seen to provide a faster and more intuitive way of translating concepts into designed geometry. [1] The aim of this research is to determine if an integrated haptic enabled sketch based modelling environment can be combined with virtual assembly and machining to evaluate DFMA metrics as products are being designed in real-time. The initial focus is on design for Assembly (DFA) prior to embedding in a full fledge haptic sketch-based DFMA system.

BACKGROUND
DFA facilitates the design of discrete products by analysing key assembly attributes to determine how the number of parts and associated assembly operations can be reduced with respect to cost and lead time. Two well known approaches to DFA analysis are the Lucas [2] and the Boothroyd and Dewhurst's [3] methods. Both methods have been extended into a number of areas with a variety of technological support, which are briefly covered in this section.
The first stage in software solutions for DFA analysis was the computerized version of Boothroyd and Dewhurst handbook [4]. This approach while removing the user from manual calculations still requires a lengthy analysis process consisting of forty-nine questions per part [5].
Improving on these new DFA software solutions saw the implementation of automatic feature extraction directly from CAD models. Early examples include IDEARS [6] which used a feature based approach to extract some basic geometrical features. A similar approach was taken by Li and Hwang [7]. Despite being semi-automated both of these were still heavily reliant on user input for most DFA criteria. Advances in research began to see systems such as DFAES [8], an approach based on a series of expert systems, begin to appear. Fuzzy-based approaches such as FuzzyDFA [9] [10] allowed DFA analysis to be performed earlier in the design process as it is less reliant on details of part design.
Dalgleish et. al. [11] proposed an approach to DFA analysis to be used in the early stages of design. Unique here was feedback being provided to users as they are defining the product structure and designing the part geometry within an embedded CAD modeller. The system incorporated an expert system support for DFA [12], interactive evaluation of the assembly sequence [13] and automatic symmetry detection [14]. Further developments using this approach focus on analysing complexity [15] and the incorporation of manufacturability assessment [16].
The background findings suggest that more enhanced intuitive interaction capability can benefit DFA. In light of this, a research question is raised: Can haptic virtual reality with sketch-based interactivity provide new methods for evaluating and automating DFA criteria while capturing associated DFA knowledge in a unique fashion? This paper now describes a pilot platform which will be investigated to determine the benefits, if any, of such systems.

SKETCH BASED INTERFACES
Sketch based interfaces for modelling can be roughly split into two main types of systems; those that use offline recognition and those that use online recognition. Offline recognition systems use sketches prepared in advance, e.g. those made during a design meeting, as an input to an automated or humanassisted modelling process [17]. The latter has the advantage where the user interacts with the system as they would sketch with a pen and paper. Online recognition in contrast is where the user sketches the model incrementally while the computer interprets this input as or soon after each part is drawn. There is greater interactivity, which opens up the possibility of rapidly creating a model, carrying out a simulation of the properties of the model (e.g. finite element analysis [18]) and rapidly iterating on the model to produce better conceptual designs. Most online recognition systems use simple operations, and having users resolve ambiguities enables more complex models to be produced. While the modelling methods between offline and online system do not vary greatly they require the user to learn a set of operations before being able to create a model. This could increase the cognitive load as users focus more on how they are modelling rather than what they are modelling.
Surveys on modelling techniques undertaken by Cook [19] and Olsen [20] highlight a significant gap in sketching systems which combine drawing function with structured relational geometries and forms to support downstream evaluation and analysis. However, Olsen et al. emphasizes the need for a hybrid approach combining drawing and human like understanding and interpretation. Their categorization of model creation methods and system attributes are relevant to the study involving DFMA reported here.
Despite the volume of research in the area of sketch based interfaces for modeling (SBIM) no method has been devised that address the functionality needed for DFMA.
SBIM applications generally use either reconstruction or extrusion approaches. Extrusion approaches involve the user sketching profiles and extruding or sweeping those profiles along a path, e.g. [21]- [24]. Reconstruction approaches involve the user sketching a 2.5D representation, which the system then interprets the intended 3D shape, e.g. [25]- [27]. A variation on this approach allows the user to utilize a more interactive method of creation where the model is sketched in sections and the reconstruction algorithm is applied allowing the user to see how the system is interpreting their input sketches [28]. In GIDeS++ [29] the dimensions of sketched features in the model can be altered allowing the user precise control. This feature facilitates the creation of more detailed models suitable for further design and analysis activities.
Interfaces typically found in sketch based modelling systems have moved away from a WIMP style interface, where the user primarily interacts with the program via menus and buttons, instead favouring gestural and suggestive approaches. Table 1 lists sketch based modelling systems in 3D space, excluding systems exclusively dealing with pure sketching in 3D space. Of these reviewed 5 out of 8 include passive haptic feedback. This was accomplished in two different ways; the first being the use of a desk / table to sketch [1], [30] ,and the second being the use of a see through portable panel to sketch on (or select menu items on) as if it were a sketchpad being moved in the virtual space [31][32] [33]. None of the systems include any active haptic feedback. However, Wesche and Seidel [34] stated that the addition of active haptic feedback would be a useful addition to their systems. The use of a SBIM can provide several advantages over more traditional WIMP based CAD modelling interfaces. Research shows they are more intuitive to use, take less time to learn, allow for faster modelling times [1]. However, the findings indicate that SBIM has not yet been used to conduct DFMA analysis. This is the aim of this reported work. [35][36]

SYSTEM OVERVIEW
A proposed concept for a haptic SBIM is illustrated in Figure 1. The sketch based modelling module allows the user to create and edit imported geometry. A combination of reconstruction and extrusion methods then translates sketches into 3D shapes. Once completed DFMA criteria (Table 1) are automatically generated for use by the assembly and manufacturing evaluation modules. The user can continue to edit the model and successive analysis performed. This approach is analogous to the FEA (finite element analysis) informed design tool mentioned in [18] where FEA details are available to the designer as they alter their model using a sketch-based interface. The final output of the modelling module is the geometry of the parts that comprise the model assembly. The assembly module presents the user with all of the parts in the model and allows the user to fit them together to form the final assembly. Logging techniques [38][39] capture interaction information needed to create the assembly plan in addition to factors necessary to perform DFA (design for assembly) analysis such as the number of times the assembly needs to be reorientated and the potential for certain parts to be combined. The DFA criteria used follows Boothroyd and Dewhurst [37, pp. 85-146].
The machining module presents the user with a billet of raw material with the final model embedded in it along with a range of work holding options and tools for machining. The user can test and compare different work holding setups to find an optimum setup. They can also test and compare different machining sequences and processes. As before the system automatically captures information needed for the DFM (design for machining) analysis. The DFM criteria follows Boothroyd and Dewhurst [37, pp. 267-337].

IMPLEMENTATION
A prototype platform was developed using the Unity3D game engine, which includes support for physics interactions and graphical rendering (Figure 2). It also provides multi platform targeting and support for the use of different input devices.
The haptic device chosen for the system is the Phantom Omni. This device allows 6DOF input for the user and provides 3DOF haptic feedback, providing the user with a sense of weight, surface texture stiffness and 3D shape. This has been shown to be useful for the design of products in virtual space [40].
Open Haptics library [41] is used alongside a plug-in to allow successful UNITY integration [42] as UNITY has no native support of haptic devices.
To provide import and export of model files in STEP format a wrapper was developed for the Open Cascade libraries [43]. This is also used for modelling operations and the generation of mesh models as none of these features are natively supported by UNITY.

MODELLING WITH THE HAPTIC SBIM
An overview of the steps involved in the conversion of the captured movements of the haptic pen into sketched lines useable in the modelling process is shown in Figure 3. Drawing capture -With the haptic pen the user draws on a 2d plane within the scene. The process of the user sketching is broken down into strokes. A stroke is considered as the path taken by the tip of the pen from the time when the pen tip makes contact with the drawing plane until the pen tip ceases to make contact with the drawing plane. Tracking the pen tip at regular time intervals during drawing captures the motion of the pen tip. After the stroke is drawn these points are resampled, filtered and then beautified and stored as either open or closed strokes in the scene.
Filtering -A point refinement algorithm [44] is used to filter the sketched profile. This removes extra points from hand jitter during drawing and significantly reduces the number of points required to represent the shape of the line drawn without significant loss of the user's intended shape profile. The removal of these extra points also serves to make later stages of the shape recognition process significantly faster.

Shape recognition & beautification -Sketch strokes are first classified as either closed (the stroke is connected at both ends)
or open (both ends do not connect). It is then checked for selfintersection. If the stroke does self intersect it is split at the point of intersection creating two sub line segments which will be treated as separate strokes from this point onwards (Figure 4). After all intersections have been removed each of the new individual strokes can be beautified in a process similar to the one demonstrated in [1]. The beautification process splits each of the strokes into linear and curved segments after which all of the linear segments are checked for similar lengths, parallel and perpendicular segments, and adjusted accordingly. The beautified shapes are then compared against a set of rules that define a set of commonly drawn shapes using a fuzzy logic approach similar to the one used in [45] This classification can be used to further refine the stroke, e.g. if a circle is found it can be redrawn using the drawn centre and diameter as a guide. It can also be used in subsequent modelling operations to form the base of more complex features, e.g. if the stroke is classified as circular and later in the editing process this stroke is extruded, this new feature would be classified as a cylindrical feature.
The user can also change the classification of the feature if it is interpreted incorrectly.
Extrusion is performed when the user selects a closed stroke with the haptic pen. Using a push or pull motion while the stroke is selected will displace the stroke profile along a direction parallel to the plane on which the stroke lies. Using this technique the user can create new extruded features, protrusions from existing parts and holes in existing parts. The same basic principle can be extended to the creation of featured extruded along a non-linear path with the additional selection of another stroke that defines the extrusion path.

ASSEMBLY AND DFA ANALYSIS
To allow the assembly of the model parts in real time it is essential to have an appropriately detailed collision mesh with concave and convex features. However, the underlying physics engine in UNITY only supports convex hulls. Within the unity environment this problem is usually addressed by either an approximation made from primitive collision shapes (created manually by the user) or with the use of automatically generated convex hull collision meshes. The convexFT [46] technique is implemented here.
Assembly with haptic feedback is logged within the system to create an assembly plan.
Concurrently, DFA principles rank the assembly and highlight areas in which the design of the assembly could be improved. This process begins on importing the model into the UNITY sketch-based modeling platform. Key geometric and other parameters related to the Boothroyd and Dewhurst criteria are set within a DFA matrix, e.g. symmetry/asymmetry, scale, relative position, parts count, fasteners (stock part types), mass, etc. However, there are still some criteria needed for the DFA analysis that cannot be evaluated automatically, e.g. these features need to be manually set by the user. This is achieved by annotating the parts and sub assembly models with attributes and to generate build sequences/ plans the latter in a manner similar to [47] These are subsequently used by the system to derive the missing DFA criteria e.g. tangling, thermal/electrical isolation, power tool use/manual assembly, need for special handling, dynamic/stationary, function, etc. All of these inputs are fed into an Excel DFA matrix spreadsheet to produce the necessary results. This is illustrated in Figure 5 with detail of a typical results matrix shown later in Figure 9 and Figure 10.

MACHINING ANALYSIS
Machining will be implemented at a later stage of this work and is the final module of the haptic SBIM DFMA system. The only current relevant work being that by Fletcher et. al [47] on haptic computer aided process planning is adapted here for manufacturing analysis.

RESULTS & DISCUSSION
The results presented here are the preliminary trials of the proposed haptic based integrated DFMA system combining features of sketch based modelling, virtual assembly, and virtual machining.  Figure 6 shows the refinement of points associated to a sketch of a rectangular shape. Point reduction and beautification is achieved via the Ramer-Douglas-Peucker algorithm on sketched input (Figure 7). The process is fast and takes between 16ms and 100ms depending on the speed of sketching and the complexity of the shape drawn. STEP imports allow premade assemblies or part models to be redesigned using the haptic SBIM system. The assembly and machining sequences are logged while the user is interacting and manipulating the part/assembly models. The system automatically gathers and updates key features of the parts, assembly operations and machining processes ready for performing DFMA analysis.
Once the user has completed this initial setup process they are presented with the results of the initial DFMA analysis. Figure 8 shows the graphical user interface after the initial DFMA. All of the parts contained within the assembly can be viewed alongside the number of each part required and whether this part has been identified as a candidate for merging / deletion. Any feedback on potential design improvements to the parts will also be displayed here; e.g. areas where the part could be modified to improve handling time.
On the right the assembly operations can be viewed. A brief description of the operation is displayed, for instance an insertion operation would display "Insertion", a reorientation operation "reorientation". Alongside the calculated operation time is presented to the user, colour coded to indicate which operations are taking up the most time. Any feedback regarding potential design improvements to improve assemblability is displayed here; e.g. "this operation is lengthy due to mismatched tolerance".
The centre panel contains the modelling environment where the user can create, alter and merge parts using sketch based modelling techniques. As the user receives feedback they are free to make changes to the design and as they do the parameters will be updated automatically and feedback given. This allows the user to immediately assess the impact of changes to the design. Figure 9 and Figure 10 illustrate the 'before' and 'after' DFA case study example with corresponding spreadsheet analysis.
Suggestions   The timings for each operation are reported back to the user and the parts with potential to be merged are highlighted. Additional feedback on the design is given, e.g. "this part is asymmetrical. For easier handling consider either making symmetrical or making it pronounced asymmetrical".
As the user adds or deletes parts, the system automatically gathers the information needed to analyse the model, which is derived from both the geometry of the individual parts and the way in which the user assembles the parts. Using this information the parts and operations are classified using methods from Boothroyd and Dewhurst and then the time taken for each operation is calculated using this data. Additionally parts that will be combined are identified and the theoretical minimum part count is calculated. Figure 11 shows the system being used to assemble the bracket assembly. The real-time visualisation and feedback during the DFMA evaluation provides workplace problemsolving learning. The process of design engineering and requirements for optimizing design is more easily understood and appreciated.

CONCLUSION
This paper has demonstrated the potential to use haptic virtual reality as a means of evaluating product designs by carrying out DFA analysis using currently available techniques, in this case the classic Boothroyd and Dewhurst analysis. Using the flexibility of the UNITY engine it will be possible to automatically and semi-automatically define the DFA criteria associated with a specific assembly design, populate a DFA array and then analyse this to output English syntax recommendations regarding how a product can better designed to be assembled. This system architecture and associated methodology will provide an ideal experimental platform from which to expand and test haptic DFMA. Indeed, embedding haptic sketching and annotation into the process also points to the capability to provide effective, intuitive support and instructions for the redesign of a product, although a more complex form of sketching will be required to facilitate full non-CAD package modification to any design concept.
The integration of DFA combined with the ability to actually virtually assemble the product and taking advantage of the already proven benefits of haptic interaction during such an assembly process points to significant potential benefits for more intuitive product design tools in the future.
Future work will focus on incorporating design for manufacture [47] (DFM) within the system based on previously successful virtual process planning work and then rigorously testing the system both from functionality and user perspectives via a series of proven DFMA case studies.

ACKNOWLEDGMENTS
The work presented herein is partially funded under the European H2020 Programme BEACONING project, Grant Agreement nr. 687676.