Post-processing feature-mapping topology optimisation designs towards feature-based CAD processing

Feature-mapping (FM) optimisation frameworks have received much attention for structural topology optimisation with explicit geometric parameters. This paper presents a methodology for constructing parametric feature-based CAD models from designs generated using Moving Morphable Components (MMC). Emphasis is placed on constructing feature-based CAD models that conform to conventional modelling practices, where individual parameterised features are modelled using feature templates and united through Boolean union operations. This involves the use of algorithms to facilitate feature clean-up and identify connexions between features. The progression through several examples demonstrates how the developed algorithms can realise a feature-based CAD model from the results of an FM optimisation. Integration with a commercial CAD system provides a wide range of modelling capabilities to the designer for downstream design tasks.


Introduction
The importance of parametric solid modelling systems in design is widely recognised.They were described by Hoffmann and Joan-Arinyo as "a key technology to define and manipulate solid models through high-level, parameterised steps" (Hoffmann and Joan-Arinyo 2002).They highlight that tools used to construct and evaluate parametric models are based on defining features and geometric constraints.Feature-based modelling within commercial CAD packages (e.g.Dassault Catia, Siemens NX, PTC Creo) consists of creating an instance of a generic feature that follows a specific arrangement of geometric entities pre-defined by the software vendor.Specification of spatial and geometric constraints tailors a generic instance to the required geometric shape and position.These procedures provide flexibility in the geometry that can be modelled, ease of design modification, and a vital link with CAE disciplines through, for example, the Simulation Intent framework proposed by Nolan et al. (2015).
In the literature, the integration of feature-based geometry parameters has been considered for both shape and topology optimisation (TO) frameworks.Whilst shape optimisation enables design improvements (Upadhyay et al. 2021), a critical limitation is its inability to change the design topology, that is, the structural connectivity.It is recognised that more flexible approaches are required when the topology and geometry of the design are not known a priori.The potential of TO frameworks for these scenarios is widely recognised; however, these optimisation problems are often solved in isolation from feature-based modelling tools.This results in a situation where the power and flexibility of featurebased modelling strategies are lost, hindering subsequent design modifications or idealisation decisions for subsequent analysis.Continued research seeks to establish a firm connexion between TO frameworks and commercial featurebased modelling tools.
The motivation of this work is to develop methods that facilitate the integration of "feature-mapping" methods (Wein et al. 2020) with feature-based parametric models.More specifically, the MMC framework (Guo et al. 2014) is used for TO and Siemens NX is used for feature-based modelling.The aim is to construct parameterised feature-based models from TO designs that conform to conventional modelling practices.The assembly of interconnected features is also considered.

Literature review
The recent review of Subedi et al. (2020) acknowledges feature-based model construction as a major challenge associated with TO.They identify three primary downstream applications which require the conversion of a faceted TO result to a parametric feature-based model: prototyping, design validation, and design exploration.They also provide a comprehensive review of two main technologies that seek to address this challenge: post-processing strategies that are applied to TO results and constrained TO formulations that integrate geometric information in the optimisation formulation.Both strategies can be subdivided into surface-based and feature-based approaches.The primary objective of surfacebased approaches is to produce a boundary representation surface model of the optimised design using, for example, B-spline or NURBS curves and surfaces.Subedi et al. highlight that whilst these techniques have been commonly utilised in commercial systems, they do not include the features and constraints typical of feature-based CAD models.Surface models also introduce limitations for downstream tasks.The resulting CAD representation is often challenging to modify in subsequent design activities where it may be desired to manipulate individual features.Challenges will also be introduced in analysis applications where different idealisations and properties will be attributed to different features.Consequently, this work focuses on feature-based approaches.

Post-processing strategies
Post-processing strategies offer significant potential for the construction of parametric CAD models.Hsu and Hsu (2005) presented an approach that constructs 3D swept features through B-spline cross-sections extracted based on density contours.This required manual selection of an axis for the cross-section extraction.Larsen and Jensen (2009) presented a methodology for constructing swept features through simple two-dimensional (2D) templates.Manual inputs were required to identify the surface facets included in the feature, the number of defining cross-sections, and the guide curve orientation.Stangl and Wartzack (2015) implemented a curve-skeleton extraction process based on mesh contraction.User modification was required for clean-up and cross-section identification.Nana et al. (2017) and Cuillière et al. (2018) presented a fully automated process for extracting skeletons from TO results.Circular cross-sections were assigned to each segment, the radius of which were calculated based on the local mean distance to the 3D surface of the optimised geometry.Gamache et al. (2018) highlighted limitations in previous skeletonisation methods and developed a MATLAB-based approach for deriving truss structures corresponding to TO designs.Yin et al. (2020) utilised skeletonisation algorithms to extract the skeleton of TO results with subsequent layout and size optimisation.The individual cylindrical primitives were assembled within a CAD system using Boolean operations.Watson et al. (2022) presented a skeletonisation algorithm for truss-type structures with the cross-sectional areas initially calculated using the method of joints and refined using shape optimisation.Amroune et al. (2022) also used a skeletonisation process to construct lofted features with B-spline representations of cross-sections at various intervals along the length of each segment.
In summary, most post-processing strategies place a significant emphasis on the assumption that the TO result can be idealised as a beam-or truss-like structure.Whilst some variations have been proposed, these require manual intervention for constructing a feature-based model (Larsen and Jensen 2009;Stangl and Wartzack 2015).In their review, Subedi et al. (2020) highlight that more general implementations are not fully robust.They highlight that automated methods to determine cross-sectional profiles and sweep paths are non-trivial.Furthermore, the generated CAD models do not establish a feature hierarchy, a strategy commonly employed in commercial design.

Constrained optimisation
The alternative to post-processing strategies is constrained optimisation, where the constrained TO formulation can alleviate the challenge associated with CAD model construction.Methods for feature-based model construction take the form of feature-mapping methods that explicitly model solid or void regions with high-level geometric parameters (Wein et al. 2020).A benefit of these methods is the retention of explicit geometric information throughout the optimisation.Typically, an array of geometric features is pre-defined, and the optimisation progresses by perturbing the explicit parameters that define the features.The geometric parameters explicitly express the topology and shape of the resulting design.Several types of geometric features have been considered.Guo et al. (2014) used rectangular features, with variation in feature width introduced by Zhang et al. (2016), and features with curved skeletons by Guo et al. (2016).
The flexibility of curved features was developed through approaches that implemented Bezier skeletons (Zhu et al. 2021).Norato (2018) introduced another class of geometric features using supershapes.Shannon et al. (2022) developed feature types corresponding with swept features in CAD systems, using Bernstein polynomials to control both the shape of spine curves (Bezier curves) and the width variation along slender features.
Constrained approaches superficially appear to be easily integrated with feature-based CAD models, and the possibility of establishing this connexion is suggested by several authors (Hou et al. 2017;Smith and Norato 2019b).However, Wein et al. (2020) highlight that although these methods are often suggested as suitable for integration with CAD systems, there is little practical evidence of this in the literature.Further challenges with constrained approaches have been identified by Subedi et al. (2020).They highlight that imposing additional constraints on the optimisation may compromise the design performance, whilst also increasing computational cost.They also suggest that these strategies often target a particular application and integration with CAD systems is not automated.

Research aims
Based on the literature, this paper will address the challenge of integrating feature-mapping methods with feature-based CAD models.The aim is to automate the transition of TO designs produced by FM frameworks to a feature-based CAD model.
The objectives are to • Construct parametric feature-based models compliant with downstream applications, such as feature suppression and feature idealisation for subsequent analyses.

Methodology
Feature-mapping methods utilise explicit geometric parameters in the optimisation framework.This work uses linear features that correspond with extruded features in CAD systems.
For linear features defined by two control points, p 0 , q 0 and p 1 , q 1 and of fixed width, w , the implicit representation is constructed using a topology description function (TDF) defined as where L is the feature length defined as and (x) = (x, y) represents grid point coordinates in a 2D design domain, m is a penalty parameter, set at 6 (Guo et al. 2014), and D n is the set of feature design variables given by D n = p 0 , q 0 , p 1 , q 1 , w .
The TDF in (1) is combined with a regularised Heaviside function, as used by (Zhang et al. 2016), given as where is set at 0.5 and is set at zero.For TO, a nonzero value of prevents singularities in the structural analysis; however, for the feature clean-up framework developed in this work, structural analysis is not required.A maximum operator is used to unite multiple features as s (x) = max 1 , … , N , where s denotes the aggregated representation of N structural features.Whilst not smooth, this aggregation has not presented issues in the numerical examples considered.The set of design variables for all features is given by D = D n |n ∈ N .
As the number of features required in FM optimisation is not always known a priori, it is common to initiate the design with an array containing multiple features (Guo et al. 2014).Whilst explicit geometric parameters are used to define the features that can be directly represented within a CAD system, the optimised design often contains undesirable geometric phenomena.As an example, a cantilever beam optimisation problem is initiated with 24 linear, constant width features in the design space (Fig. 1a).The objective is to minimise the structure compliance subject to a volume fraction constraint of 0.4.The optimised model (Fig. 1b) portrays why the transition to a feature-based CAD representation is not seamless.The exhibited phenomena, which are not uncommon when using FM, include (1) 1. Small/redundant features.
Norato et al. presented an approach that can help mitigate the issues of small/redundant and overlapping features by introducing a density parameter to each feature (Norato et al. 2015).This has the ability to remove unnecessary features during the optimisation.However, not all unnecessary features may be removed.The present approach presents an alternative where these features are identified and removed subsequent to the optimisation.Watts and Tortorelli (2017) and Smith and Norato (2019a) presented techniques whereby geometric constraints are imposed between feature endpoints during the optimisation with the effect of reducing overlaps and small features.Imposing geometric constraints during the optimisation can also impose design variations as highlighted by (Smith and Norato 2019a).The present approach presents a method for imposing geometric constraints subsequent to the optimisation.
Whilst a direct transition of the design to a CAD system would not be acceptable, the explicit geometric parameters and implicit geometry representations facilitate the feature clean-up algorithms developed in this work.Figure 2a depicts the geometric parameters defining a single feature, whilst Fig. 2b depicts the corresponding implicit representation1 where the feature has been mapped to the analysis mesh.The mapping ranges from 0 to 1, representing void and solid material, respectively.The implicit representation of all the features from Fig. 1b is shown in Fig. 2c.
Geometry assessment metrics that provide the basis for feature clean-up algorithms are calculated from the explicit parameters and implicit representations.The clean-up algorithms identify and correct each of the phenomena identified in Fig. 1b.For simplicity, only linear, constant width features are considered to develop and demonstrate the algorithms.
An estimate of the area of each feature, A n , is calculated as where a e is the element area,2 NE n is a subset of the elements in the design space, NE , given as (4) and v e,n is the element area fraction of element, e , contrib- uted by feature n given by ( 5) where D n is the design variable set for feature n and x i are the coordinates of each node of element, e.
The implicit representation also provides a quantitative measure of overlaps between intersecting features.The overlapping area of feature m and feature n is given by the summation of the subset of elements NE m∩n ⊆ NE n , where the element area fractions for both features n and m are non-zero.This is calculated as where This summation identifies the set of features, I n , which intersect feature n , and the corresponding size of the intersections.The set of features that intersect feature n is expressed as those where the intersection area is non-zero, Equation 4 also calculates the unique area, A unq n , of feature n that does not overlap with any other feature, (i.e. the unduplicated area).The summation is over a reduced set of elements, NE unq n , where the summation of the element area fraction for all other features is zero Two metrics are established for comparing features: (1) The size of each feature relative to the largest feature in the optimised geometry (2) The ratio of the unduplicated area to the total area of each feature The explicit geometric parameters are used to calculate connexions between intersecting features.Linear feature spines are calculated as where t ∈ [0,1] is the parameter range over which the spine is constructed.
The angle of each feature from the horizontal axis (Fig. 2a) is calculated in the interval [− , ] as ( 7) where ̂ h is the horizontal unit vector given by (1,0) and nn is the unit normal vector along the spine of feature n from point p 0 , q 0 n → p 1 , q 1 n , given by Throughout the feature clean-up process, a series of algorithms are used to manipulate features.When an inappropriate manipulation is attempted, for example, replacing two perpendicular features with a single feature, the algorithms can propose geometry that deviates significantly from the original geometry.A measure of this deviation is calculated from the implicit representation as a geometric error, calculated as where v 0 e is the original element area fraction before the feature clean-up process is initiated and v * e is the element area fraction after the feature clean-up process.
Feature changes are discarded if they violate an error threshold, A lim .This metric is implemented in the feature removal algorithm (Sect.3.1) with thresholds set in the range of 0.25-5.0%for the examples in Sect. 4. This threshold can be tailored to the design problem being considered, providing flexibility in the framework.A larger threshold will reduce the total feature count and corresponding design complexity, whilst a lower threshold will limit geometric deviations.
The following sub-sections outline the algorithms developed to manipulate FM optimisation results.The aim is to produce a geometry representation consistent with conventional feature-based modelling practices by removing unnecessary features, which would typically be avoided by a designer, and establishing connexions between features.An overview of the framework is presented in Fig. 3, highlighting the key algorithms and the order in which they are implemented.The first process, feature removal (Sect.3.1), can be implemented in isolation from the other processes if the only aim is to minimise the number of features in the optimised design, equivalent to reducing the design complexity.The following process, establishing feature hierarchy (Sects.3.2, 3.3), ensures the features comply with a hierarchical feature-based model.The final process, feature connexions (Sect.3.4), connects intersecting features to ensure subsequent design changes propagate to dependent features.

Feature removal
The final feature-mapping solution may contain small features that are below the size of interest or that do not contribute to the structural response of the model.The latter category may include features that are fully embedded within larger features or those that are entirely disconnected from the load-bearing structure.These would not naturally be included in a CAD representation of the optimised design and so can be removed from the total set of features, N.

Feature removal algorithm
When a feature is marked for removal, as described below, the geometric parameters of intersecting features must be updated to minimise changes in the geometry representation.This is achieved by constructing a representation of the initial design for the selected feature n and its intersecting features I n with their initial design variables, D 0 , as Feature n is then removed from the design space, and the design is represented by the set of intersecting features I n , only, as where D m is the set of geometric parameters that define fea- ture m.
A non-linear least squares (NLSQ) algorithm3 is used to minimise differences in the implicit geometry representation (i.e. the grid point values of the TDF) by perturbing the design variables of the intersecting features.The NLSQ algorithm is formulated as where NN is the set of mesh nodes and D DV is the aggre- gated set of design variables for each feature in m ∈ I n , given as D DV = D m |m ∈ I n , and s is the cardinality of the set of optimisation variables.

Implementation
In this work, three metrics are used to identify which features to test for removal: 1.The feature size ratio, AR n (Eq. 11).The features are ranked according to ascending size ratio and features less than a threshold AR lim , set at 0.1, are selected for potential removal.2. The feature unique area ratio, UR n (Eq. 12).Features are ranked according to their ascending unique area ratio, UR n and those less than a threshold UR lim , set at 0.3, are selected for potential removal.When a feature has a UR n = 0 , the feature is fully embedded within its inter- secting features I n , indicating the feature is not uniquely responsible for any area within the design domain.Additionally, a feature UR n = 1 indicates that the feature is disconnected from the structure and does not contribute to a structural load path.Both these features can be removed without executing the feature removal algorithm.
(17) H max min 3. Feature orientation, n (Eq.14).The difference in angular orientation of a feature and its intersecting features I n provides a measure of the collinearity between inter- secting features.The possibility of removing feature n is considered for all intersecting features which have a collinearity measure less than a specified threshold, lim , set at 10 • .Note, the MATLAB implementation accounts for 180 • variations in the feature angle.
The thresholds imposed on the three metrics limit the number of features for which removal is attempted.Setting these too low may result in features not being considered for removal which could be removed without compromising the design.Conversely, setting large values for these metrics will result in all features being considered for removal.This will incur unnecessary computational expense, as the feature removal algorithm will be executed for features when it is evident that they cannot be removed without incurring a significant geometric error.For example, removing a feature that is perpendicular to its intersecting feature will inevitably cause a large geometric error and should not be considered for removal.Whilst these metrics determine the features for which removal is attempted, a suggested change is only accepted if the calculated geometric error estimate ( 16) is less than a specified threshold, A lim .If the geom- etry changes are accepted, the feature is removed from the original set of features, otherwise, the feature is added to a RetainedFeatures list to ensure the same feature is not repeatedly considered for removal.

Feature enlargement
To establish a feature hierarchy, precedence is given to wider collinear features and geometrically larger features, hereafter referred to as parent features.Parent features are enlarged to maximise their intersection with each child feature m , which intersects the parent feature.A subsequent step (Sect.3.3) then reduces the size of each child feature m to minimise the intersection.Whilst the child feature cannot be removed from the design space, the size of the parent feature may be increased and the child feature reduced without imposing significant changes in the original design geometry.The aim is to produce a consistent and clear hierarchy in the feature connectivity, where parent features will be modelled in a CAD system first and child features modelled relative to them.

Feature enlargement algorithm
An NLSQ algorithm is used to enlarge parent features.A representation of the initial design for a parent feature, n , and an intersecting child feature, m ∈ I n , is constructed as The abbreviated form, H 0 n∪m , is used to conserve space in the optimisation formulation below.
The objective of the optimisation is to minimise the difference between the original representation given by ( 20) and the representation of the selected parent feature alone.This is done by increasing the size of the parent feature, increasing its dominance in the design.The optimisation is formulated as Whilst maximising the intersection of a parent feature n over a child feature m , the optimisation function ( 21) may perturb feature n such that it deviates from its original rep- resentation, H x, D 0 n .This may cause the parent feature to also increase its overlap with the originally void design space or to move away from grid points that were once within the parent feature itself.This can cause unwanted changes in the design and is controlled by adding a penalty, , to the set of nodes in H x, D 0 n initially one (solid) and a penalty, , to the set of nodes originally zero (void) in the implicit representation as As a guideline, and have been set at 10.The implication of not using the penalty parameters can be seen in Fig. 4c, where and were set at 0. There is an obvious increase in the geometric deviation from the original design as Feature A has increased its intersecting area with Feature B. With the penalty parameters applied, the potential intersection increase is achieved (depicted by the region highlighted in Fig. 4b) whilst minimising changes to the original geometry.

Implementation
In this work, two scenarios are considered for enlarging features: (20) 1. Feature size.Each feature in the design space is ranked in descending size.When a feature n , has the potential to replace part of a child intersecting feature, m ∈ I n , but not fully replace it (demonstrated by features A and B in Fig. 4a), the feature enlargement algorithm maximises the size of the parent feature, Fig. 4b.By default, the first feature (the largest) considered will only have geometrically smaller intersecting features.For all other features, the algorithm is only executed for smaller intersecting features.2. Collinear features.When there is a step change in the width of two intersecting collinear features, this would conventionally be modelled with the narrower feature extending from the wider feature.This may not be captured using the previous logic as the wider feature may be geometrically smaller.Consequently, the algorithm is executed when intersecting features are within a collin- earity threshold, regardless of their size.Implementation is depicted in Fig. 4a, where feature C cannot increase its intersection with feature D without introducing a large error (denoted by the red box in Fig. 4a).Logic considering collinear features produces the desired result (Fig. 4b).

Overlap minimisation
Feature intersections are a common attribute of FM optimisation.This is a consequence of the implicit geometry representation, where a solid material transition is not guaranteed between two features that contact geometrically (Fig. 5a, b).Hence, features overlap to achieve a solid material transition (Fig. 5c, d).This is also observed when a feature extends beyond the design domain boundary to ensure a solid connexion with applied loading and boundary conditions.Whilst overlaps are necessary to ensure a continuous load path, they hinder the identification of the position and nature of feature connexions.An algorithm is developed to minimise the size of intersections between parent and child features, a subsequent step to Sect.3.2, before establishing feature connexions.This is also applied to minimise features extending outside the design domain, an attribute that does not conform with conventional CAD modelling strategies.

Design domain boundary intersection algorithm
A ghost layer is added to the initial design domain by shifting the original boundaries perpendicularly outwards by a pre-defined distance Δ , set at 100 mm, to model the presence of features outside the design domain.An NLSQ algorithm minimises feature extension beyond the design domain and changes in geometry inside the design domain.
An initial representation of a feature n which reflects the desired feature geometry (i.e.not appearing outside the design domain) is calculated using the initial feature design variables as where NN is the set of mesh nodes associated with the origi- nal design domain and NN inf is the set of mesh nodes cor- responding with the inflated design domain.This reflects the desired design representation, where all the features are modelled as expected within the original design domain but are modelled as void for all the nodes outside the original domain boundary, even if the feature extends beyond the original domain boundary.This is in contrast to the feature representation on the ghost layer/inflated domain, where feature extensions beyond the original domain are modelled, represented as An NLSQ algorithm is used to minimise the extension of feature beyond the original design domain, formulated as The objective of the optimisation is to minimise the extension of feature n beyond the original design domain without causing geometric deviations within the design domain.

Feature intersections algorithm
Intersections between features are also minimised using an NLSQ algorithm.The objective is to minimise the overlap between a parent feature n and child feature m .A representa- tion of the region of a child feature m that does not overlap the parent feature n or its intersecting features I n⧵{m} is con- structed using the initial design variables as Whilst the optimisation will seek to minimise the size of feature m , the initial representation denoted by (Eq.26) is the region that must be preserved.Note, the set of features ( 24) H x, D n , x ∈ NN inf .
I n that intersect feature n , will by default include feature m .The NLSQ algorithm is formulated as As with (Eq.22), penalty parameters prevent nodes that were initially within feature m only from being removed from feature m using a penalty parameter, .Nodes that were originally outside the subset of features I n ∪ {n} are penalised from being introduced into features using a penalty parameter .The NLSQ algorithm is reformulated as The optimisation formulation minimises the intersection of feature m with its parent feature n and other inter- secting features, whilst simultaneously ensuring there is no significant deviation in the original geometry representation.These penalty parameters prevent scenarios of a similar nature to that depicted in Fig. 4c.The objective is to further establish the feature hierarchy by reinforcing the distinction between parent and child features.( 27) min

Implementation
A three-step process is implemented for minimising unnecessary feature intersections: 1. Design domain boundary intersections.All features are checked for intersections with the domain boundary.If the feature spine intersects the offset boundary, it is terminated at the offset boundary.Subsequently, (Eq.25) minimises feature representation outside the design domain.There are two scenarios where this has benefits over "hard" spine termination at the domain boundary: a. Reducing excessively wide features that are parallel with a design domain boundary.Termination of the feature spine at the domain boundary will not correct this as demonstrated by feature A in Fig. 6a.Hard termination only cuts the left end of the feature (feature C in Fig. 6b), whereas (Eq. 25)offsets the feature and reduces its width (feature D in Fig. 6b).b.Preventing invalid termination when a feature is approximately parallel to a domain boundary but intersects it.Hard termination would result in a significant error in the geometry of the feature, demonstrated by feature B in Fig. 6a and the updated blue feature in Fig. 6b.The updated yellow feature depicts how (Eq.25) minimises feature extension outside the design domain and feature changes inside the design domain.

Intersections between collinear features of varying widths.
For each feature n with an intersecting narrower feature m that satisfies a collinearity threshold.Feature n is treated as fixed and (Eq.28) minimises the feature intersection by modifying feature m.

Intersections between parent and child features. Each
feature n is selected according to descending size and an intersecting child feature m ∈ I n is selected according to ascending size.If feature m is smaller than the feature n , (Eq.28) is executed to minimise the feature intersection by modifying feature m.
Applying feature intersection minimisation to the example depicted in Fig. 4b produces the result shown in Fig. 7, demonstrating a clear feature hierarchy conforming to conventional modelling practice.

Establishing feature connexions
In feature-based models, intersecting features are often constructed relative to each other, rather than independently within the design space.When a feature instance is created within a CAD model, it is normally attached to other features already defined within the model (Bronsvoort et al. 2006).The connexions used vary depending on the feature type.For example, feature dependency may be established in 3D solid modelling when a pocket, slot or extruded feature is constructed relative to the face of a parent feature.Spines of long slender features are often snapped together forming a dependency, where an endpoint of a child feature is constrained to the spine or to the endpoint of the parent feature.Whilst imposing restrictions on the design, these connexions enable the propagation of design updates between features.This work models connexions between spines of linear features.
The point where feature m ∈ I n intersects feature n is determined by solving where the two feature spines intersect in terms of the feature parameter, t .This can be expressed algebraically as where D is the ratio of the feature m length in the p axis, to the length in the q axis, expressed as A more useful metric for CAD representation is the physical distance from the starting point of feature n , p 0,n , q 0,n . (29) q 1,m − q 0,m .This is evaluated using the calculated intersection point of feature n as where L n is the length of feature n (Eq.2).The appropriate endpoint of the child feature m that will be connected to the parent feature n is determined by the point where feature n intersects feature m , t n→m , calculated as As the feature spines are expressed as a function of t ∈ [0,1] , a value of t n→m < 0.5 indicates the connexion is in the vicinity of the first endpoint, (p, q) 0 .Otherwise, if t n→m > 0.5 , the second endpoint, (p, q) 1 , is used to establish the connexion.

Implementation
Two connexion strategies are implemented in this work: 1. Endpoint to endpoint.When the endpoint of an intersecting feature is made coincident to the endpoint of its parent feature.There are four possible combinations of endpoint 2. Endpoint to spine.When the endpoint of an intersecting feature is made coincident to the spine of its parent feature.
The principle that geometrically smaller and/or narrower features extend from larger features is used in this implementation.Features are ranked according to descending size and considered in turn.Potential connexions for each intersecting feature m ∈ I n of feature n are determined by 1. Testing almost collinear features.If the spine intersection point of feature m with feature n is outside a speci- fied range of spine parameter of feature n (i.e. when | | t m→n − 0.5 | | is greater than a specified threshold, T 1lim , set at 1), the feature endpoints are checked for proximity, as an endpoint-to-endpoint connexion may be feasible.If, for a given endpoint-to-endpoint combination, the (31) distance between the endpoints is less than the width of the parent feature the endpoints are made coincident.This logic targets approximately collinear features with nearby endpoints.If an endpoint connexion cannot be formed, the two features remain independent.2. If | | t m→n − 0.5 | | is less than T 1lim the connexion type is determined by a threshold T 2lim , set at 0 to favour end- point-to-spine connexions, or set greater than 0 to favour endpoint-to-endpoint connexions.
| is less than T 2lim , an endpoint- to-endpoint connexion is established.The relative values of t m→n and t n→m identify which endpoint combination is selected.
| is greater than T 2lim , an end- point-to-spine connexion is established.The relative value of t n→m determines if the p 0 , q 0 m or p 1 , q 1 m endpoint is selected.The connected endpoint coordinates are determined as a function of the master spine and the distance, L m→n , from the point p 0 , q 0 n .
Whilst T 1lim and T 2lim are set relative to the parametric range of t , they may also be defined as a physical distance relative to the length, L n , of feature n .Only one connexion can be established for each feature endpoint.

CAD model construction
Implementation of the proposed algorithms resolves the design issues depicted in Fig. 1b whilst retaining the geometric parameters that define the remaining structural features.The geometric parameters of each feature are used to sketch the feature profiles in a CAD environment.These sketches provide the necessary information for extruded feature templates.Individual features are united using a Boolean union.The final design is fully parametric, enabling modification in subsequent design tasks.

Numerical examples
This section outlines feature-based CAD model construction of a cantilever beam and a Messerschmitt-Bölkow-Blohm (MBB) beam from FM optimisation results.Readers are referred to the well-documented MMC process for details on the optimisation setup for these problems (Guo et al. 2014;Zhang et al. 2016).In these examples, the presented feature colours are for visualisation purposes only.

Cantilever beam
A rectangular design domain (3000 × 1000 mm) is defined with its left end constrained and a point load at the right end.The design domain is discretised with a 600 × 200 regular Cartesian mesh.This corresponds to the density of the integration points used for the feature representation in the original MMC optimisation.A 120 × 40 analysis mesh was used and a degree 4 Newton-Cotes formula was used for numerical integration of the smoothed Heaviside to calculate the density of the analysis elements. 4A regular array of 24 linear features are defined within the design space (Fig. 1a), and the optimisation converges to the result shown in Fig. 8.

Feature removal
Each iteration of the feature removal algorithm attempts to remove a single feature.A user-defined threshold on the geometric error, set at 0.25% and 1.0% in this example, determines if the feature removal is accepted or rejected.Figure 9 plots the geometric error calculated for each iteration, demonstrating rejected removal attempts when the error threshold is violated.The output geometric error associated with each feature can guide the user whether a greater or smaller value could be used to obtain alternative designs with less or more features, respectively.Figure 10a and b shows the updated feature set for error thresholds of 0.25% and 1.0%, respectively.In the first case, eight of the original twenty-four features were removed and in the second case ten were removed.This is analogous to a 33.3% and 41.7% reduction in design complexity, respectively.The remaining features were updated to minimise changes in the geometry.Whilst both designs are valid, the design depicted in Fig. 10a is selected to demonstrate the subsequent stages of the framework.

Feature enlargement and intersection minimisation
For establishing feature hierarchy, the collinearity threshold is set at 0°, which only considers features based on relative areas (Fig. 11), and at 5°, which considers features that are approximately collinear separately, ensuring the wider feature remains dominant (Fig. 12).The highlighted region in Fig. 11a shows how the purple feature has increased its size in the top left of design domain (relative to Fig. 10a) to increase its dominance as a parent feature.Although differences are seen in the intermediate

Feature connexions
Two snapping conditions are considered, firstly setting T 2 lim at 0 favouring endpoint-to-spine connexions, albeit, the endpoints of collinear features are snapped together (Fig. 13a).Secondly, T 2 lim is set at 0.12, favouring endpoint-to-endpoint connexions (Fig. 13c).The updated designs have a compliance of 305.3 302.7, respectively (relative to the original result of 289.3), and both violate the design volume fraction by 7.9e−3 and 8.3e−3.Whilst not in the scope of this work, this suggests a subsequent shape optimisation may refine the geometric changes resulting from the proposed framework.A feature-based approach is used to construct each feature within Siemens NX.Feature connexions are maintained resulting in a fully integrated model.Figure 13b and d corresponds with the CAD representation of the models in Fig. 13a and c, respectively.

MBB beam
An MBB beam problem is defined with a rectangular design domain (6000 × 1000 mm), constraints at the two bottom corners, and a point load at the midpoint of the top edge (Fig. 14a).Using symmetry, the right half of the domain is modelled in the analysis.As in the previous example, a regular array of 24 linear features is defined within the design space (Fig. 1a), and the optimisation converges to the result as shown in Fig. 14b.As before, a 600 × 200 mesh grid is used for the subsequent feature clean-up algorithms.

Feature removal
Figure 15 plots the geometric error calculated for each iteration of the feature removal algorithm, the threshold for which is set at 1.5% and 5.0%, producing the designs in Fig. 16a and b, respectively.In Fig. 16a, seventeen of the original twenty-four features are removed; however, the updated design still includes a thin geometric feature (green) that intersects and is almost parallel to a larger feature.Increasing the threshold to 5.0% in Fig. 16b results in the removal of this feature.The updated model in Fig. 16b is used to demonstrate the subsequent stages of the framework.

Feature enlargement and intersection minimisation
For establishing feature hierarchy, the collinearity threshold is set at 0°, which only considers features based on relative areas (Fig. 17) and at 5°, which considers features that are approximately collinear separately, ensuring the wider feature remains dominant (Fig. 18).The result shown in Fig. 18 is suggested to follow a more conventional modelling approach with the narrow green feature modelled as a child of the blue feature.Figure 18b is chosen for progression in the framework.

Feature connexions
Two snapping conditions are demonstrated, firstly setting T 2 lim to 0, favouring endpoint-to-spine connexions, albeit, the endpoints of collinear features are snapped together (Fig. 19a).Secondly, setting T 2 lim to 0.2, favouring endpoint-to-endpoint snaps (Fig. 19c).The updated designs have a compliance of 346.5 and 336.1 (relative to the original result of 328.9), respectively, and both violate the design volume fraction by 1.7e−2 and 2.2e−2.Connected feature-based models for each design are constructed using extruded features in Siemens NX, as shown in Fig. 19b and d, respectively.
The computational cost for each algorithm is reflected by the times shown for each algorithm as applied to each example in Table 1.These were executed on 2.3-GHz Intel Core i9 with 32-GB RAM.

Discussion
A challenge with FM optimisation is determining the number of features to initiate in the design domain, thus redundant features are inevitable when more features are specified than are required to define an optimal structure.The numerical examples presented in Sect. 4 demonstrate the effectiveness of the proposed geometry clean-up strategy for identifying and removing unnecessary features.Furthermore, the simple logic employed has been effective in establishing a clear and consistent feature hierarchy, a strategy naturally employed in feature-based design.It is acknowledged that the numerical examples presented are not sufficient to challenge the proposed framework exhaustively.However, additional logical reasoners may be introduced to each algorithm to provide additional control over these functions.
Whilst the proposed framework seeks to minimise changes in the geometry of the optimised design, minor deviations have inevitably occurred.Geometry deviation is most notable when establishing endpoint-to-endpoint connexions because of the perturbation of the child feature endpoint to match the parent feature endpoint.Consequently, it would be prudent to use shape optimisation to ensure the design is in an optimal configuration without violating optimisation constraints.
An additional limitation with the present implementation is the constraint to linear features.It is suggested that the framework could be extended for other feature types used in FM frameworks, such as Bezier-defined features.Implementing other feature types in the framework will also enable the use of more complex geometric features available in commercial CAD systems, beyond the extruded features used in this work.The current implementation has also only considered 2D geometry.
A large number of the post-processing strategies reviewed in Sect. 2 can be executed independently of the TO strategy employed in the design optimisation.The framework outlined in this paper is suited specifically to the feature-mapping process.Whilst this addresses a welldocumented limitation of feature-mapping frameworks, extensions that facilitate generic application to other TO strategies would be advantageous.A significant advantage of the synergy with feature-mapping frameworks, however, is the potential for subsequent shape optimisation in the same framework.Alternative post-processing strategies require a shape optimiser for subsequent design refinement.

Conclusions
This paper has presented a framework for constructing feature-based CAD models of FM optimisation designs.Significantly, the strategies developed have focused on: • Constructing geometry following a feature-based modelling strategy to ensure ease of integration in subsequent design and analysis tasks.• Using the minimal number of features to represent the designed geometry.• Establishing a clear feature hierarchy and feature connexions.• Creating features that can be constructed using featurebased templates found within the Siemens NX CAD package.The functionality is also available in competing systems.

Future work
Future work will seek to address some of the challenges and limitations outlined in Sect. 5. Developments that will • improve the generality of application to include other TO formulations • increase the types of features that can be modelled in the proposed framework • facilitate the extension to consider 3D geometry are considered to be the most pertinent by the authors.

Fig. 1
Fig. 1 Cantilever beam optimisation a initialisation and b optimisation result

Fig. 2
Fig. 2 Feature explicit parameters and implicit representation a single feature explicit parameters, b single feature implicit representation, and c aggregated feature implicit representation

Fig. 4
Fig. 4 Feature enlargement a situations for considering feature enlargement, b feature enlargement result, and c the result with no penalty parameters, or applied to Feature A

Fig. 5
Fig. 5 Geometrically contacting features (a) and the corresponding non-solid material transition (b).Geometrically overlapping features (c) and the corresponding solid material transition (d)

Fig. 6
Fig. 6 Minimising design domain boundary intersections; a example problem and b comparison of hard termination and NLSQ intersection minimization.(Color figure online)

Fig. 11
Fig. 11 Cantilever beam feature hierarchy with a 0° collinearity threshold a feature enlargement and b intersection minimization.(Color figure online)

Fig. 13
Fig. 13 Cantilever beam feature connexions a endpoint-to-spine connexions favoured, b corresponding CAD model, c endpoint-to-endpoint connexions favoured, and d corresponding CAD model

Fig. 14
Fig. 14 MBB beam a design space initialisation and b optimisation result

Fig. 15
Fig. 15 Geometric error for iteration of feature removal algorithm on the MBB beam model

Fig. 17
Fig. 17 MBB beam feature hierarchy with a 0° collinearity threshold a feature enlargement and b intersection minimization

Fig. 18
Fig. 18 MBB beam feature hierarchy with a 5° collinearity threshold a feature enlargement and b intersection minimization.(Color figure online)

Table 1
Computational cost