Abstract
A computer-implemented method for generating an output computer-aided design (CAD) model representing a mould for use in moulding a part represented by an input CAD model is disclosed. The method comprises: generating a mesh over the external surfaces of the input CAD model; analysing the mesh to generate a visibility data structure defining the visibility of each point on the mesh; for each of a group of three orthogonal axes, identifying and selecting, using the visibility data structure, a set of directions such that every point in the mesh is visible from the set of directions in combination; for each direction, defining one or more candidate pieces covering the visible regions of the mesh from that direction; selecting a combination of the candidate pieces which together cover the whole mesh; dividing the combination of candidate pieces about one or more parting lines into a set of shells; and generating the output CAD model to include a set of model parts, each of which corresponds to a respective one of the set of shells and has a surface which conforms to the shape of the respective shell.
Claims
1. A computer-implemented method for generating an output computer-aided design (CAD) model representing a mould for use in moulding a part represented by an input CAD model, the method comprising: generating a mesh over the external surfaces of the input CAD model; analysing the mesh to generate a visibility data structure defining the visibility of each point on the mesh; for each of a group of three orthogonal axes, identifying and selecting, using the visibility data structure, a set of directions such that every point in the mesh is visible from the set of directions in combination; for each direction, defining one or more candidate pieces covering the visible regions of the mesh from that direction; selecting a combination of the candidate pieces which together cover the whole mesh; dividing the combination of candidate pieces about one or more parting lines into a set of shells; and generating the output CAD model to include a set of model parts, each of which corresponds to a respective one of the set of shells and has a surface which conforms to the shape of the respective shell.
2. The method of claim 1, further comprising detecting holes in the mesh after generating the mesh.
3. The method of claim 2, further comprising detecting holes in the mesh by: for each face in the mesh, projecting a ray from the centre of the face in the mesh normal to the face out the mesh; tagging the face as a hole face if the projected ray intersects another face in the mesh with a normal within a predefined tolerance of opposite to the projected ray, within a predefined distance along the projected ray; and removing hole face tags from faces that are not in a closed loop of hole faces.
4. The method of claim 3, further comprising measuring the distance between vertices on each hole face; and tagging the hole face as a deep hole face when the distance between vertices in the hole face is above a predetermined threshold.
5. The method of claim 1, further comprising detection of hollows in the mesh after the mesh is generated.
6. The method of claim 5, wherein detecting hollows in the mesh, comprises: projecting a plurality of rays from the centre of each face, each ray being projected along a respective one of a plurality of directions; selecting those faces for which all the projected rays intersect other faces in the mesh; and tagging the selected faces as internal volume faces.
7. The method of claim 1, further comprising detection of gaps in the mesh smaller than a predefined size, by: projecting a ray normal to and from the centre of each face except those that have already been tagged as a hole face and measuring the distance to a first intersected face; and tagging the face from which the ray was projected as a narrow gap face when the distance is below the predefined size.
8. The method of claim 1, further comprising detecting walls in the mesh that are thinner than a predefined thickness, by: projecting a ray from each face normal to the face into the mesh and measuring the distance the projected ray travels to the first face the ray intersects; and tagging the face from which the ray was projected as a thin wall face when the distance is below a predetermined threshold.
9. The method of claim 1, further comprising detecting internal corners in the mesh by: detecting all edges in the mesh; for each detected edge in the mesh, projecting rays from the centre of each of a pair of faces either side of the detected edge normal to the face; and tagging the face as an internal corner face when both rays intersect with other faces in the mesh.
10. The method of claim 1, wherein generating the visibility data structure comprises: for each orthogonal axis, constructing polylines around the perimeter of each of a plurality of cross-sectional slices taken through the mesh, the cross-sectional slices being perpendicular to the orthogonal axis; for each vertex along the constructed polylines, analysing every angle from 0 to 360, relative to the orthogonal axis down which the mesh has been sliced to create the polyline, to determine the angles from which the point is obscured by other points in the polyline or by another polyline; for each point along the constructed polylines, analysing every angle from 0 to 360 relative to an external field to determine the angles from which the point is obscured by another polyline by projecting rays from each point at incremental angles; and defining, in the data structure, the visibility of each point on each constructed polyline for every angle from 0 to 360 as either visible or obscured, wherein the visibility of each point from each angle is dependent upon whether the analysis found the angle from the point was obscured by other points in the polyline or another polyline.
11. The method of claim 1, wherein identifying and selecting, using the visibility data structure, a set of directions from which every point in the mesh is visible for each axis comprises: identifying all 0 to 180 and 180 to 360 pairs of angles from which every vertex on every analysed polyline for each axis is visible in combination and adding the pairs to the group; identifying all 0 to 120, 120 to 240, 240 to 360 triplets of angles from which every point on the mesh is visible in combination and adding the triplets to the group; receiving a user-input defining the number of shells wanted for the mould; and choosing, from the group, based on the number of shells wanted for the mould, the combination of angles closest to 0, 90, 180 or 270.
12. The method of claim 11, further comprising rotating the mesh such that the set of directions chosen can be represented by a vector.
13. The method of claim 1, further comprising finding visible faces on the mesh for each direction in the set of directions; wherein finding visible faces on the mesh comprises finding faces with a normal with an angle within a predetermined tolerance of the direction from the set of directions; projecting rays from the centre of these faces in the chosen direction to analyse whether the face is obstructed by another face in the mesh in the chosen direction; tagging those that are not obstructed as visible faces; and identifying faces not tagged as a visible face but are surrounded by visible faces and tagging these faces as isolated faces.
14. The method of claim 13, further comprising: rotating the rays projected from the centre of faces in the mesh with a normal within a predefined angle of perpendicular to the direction from the set of directions to create an angle between the normal and perpendicular to the direction from the set of directions greater than the predefined angle, and/or defining the candidate pieces by merging connected visible- or isolated-tagged faces.
15. (canceled)
16. The method of claim 1, further comprising: analysing the mesh to find faces with a normal within 2 of the direction in the set of directions and issuing an alert if such a face is found, removing faces from one of the candidate pieces that are common with other candidate pieces to generate the parting line where the candidate pieces meet, and/or generating the parting line using the edge of the candidate piece for a single piece solution.
17. (canceled)
18. (canceled)
19. The method of claim 1, wherein selecting the combination of the candidate pieces which together cover the whole mesh comprises taking the dot products of the direction from the set of directions associated with each candidate piece with every other direction associated with every other candidate piece that together cover the whole mesh and selecting the combination of candidate pieces which result in the lowest dot product.
20. A method for making a mould comprising generating an output CAD model using the method of any of the preceding claims and operating a reproduction device to produce the mould represented by the output CAD model.
21. The method of claim 1, further comprising generating a mould from the output CAD model, wherein generating the mould comprises: generating a moulding region for each candidate piece; for each moulding region, filling in gaps in a mesh formed over the surface of the moulding region; extending the boundary of the moulding region tangential to its surface by lofting the boundary towards a straight skeleton formed from it using corresponding vertices on each of the boundary and straight skeleton; and extruding the surface along one of the chosen directions.
22. A system comprising at least one processor coupled to a memory, the memory containing instructions which, when executed on the or each processor, cause the or each processor to perform the steps of the method of claim 1.
23. A computer-readable medium containing instructions for execution on at least one processor, the instructions causing the or each processor, when executed, to perform the steps of the method of claim 1.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Embodiments of the invention will now be described with reference to the accompanying figures in which:
[0044] FIG. 1 shows a flowchart of the method for generating a model representing a mould for use in moulding.
[0045] FIG. 2 shows an exemplary model described by an input STEP file.
[0046] FIG. 3 shows the example from FIG. 2 having had a polyline drawn around its perimeter at the middle of its y-direction cross-section.
[0047] FIG. 4 shows the use of projecting rays to find the visibility of each point on the polyline to populate a visibility data structure.
[0048] FIG. 5 shows the projected rays for a toroidal shape being obscured by another polyline drawn around another part of the toroid.
[0049] FIG. 6 relates to the technique used for finding the combination of directions from which the entire polyline is visible.
[0050] FIGS. 7a and 7b relate to the categorisation of a face as backfacing.
[0051] FIGS. 8a and 8b show an example of rotating a face when its normal is perpendicular to the chosen direction.
[0052] FIG. 9 shows an example projected ray that would flag a face as obstructed.
[0053] FIG. 10 shows example isolated faces from poor meshing.
[0054] FIG. 11 shows a letterbox piece that would not be suitable to use as a solution.
[0055] FIG. 12 shows an example face with a small draft and an example alert due to this.
[0056] FIGS. 13a and 13b show the shells being trimmed.
[0057] FIG. 14 shows the generation of a parting line.
[0058] FIG. 15 shows the generation of a mould solid.
[0059] FIG. 16 shows the triangulation of holes and cutouts in the moulding region.
[0060] FIGS. 17a and 17b show the extending of a boundary of the moulding region tangent to a surface outward.
[0061] FIG. 18 shows the faces of a surface being lofted using opposite vertices.
[0062] FIG. 19 shows faces extruded in the z-direction being clipped.
[0063] FIGS. 20a and 20b show a surface being extruded along a pull direction.
[0064] FIG. 21 shows a system suitable for implementing a method according to the invention.
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0065] FIG. 1 shows a flowchart of a method for generating a model representing a mould for use in moulding. The method may be carried out using a computer system such as that shown in FIG. 21 and described below.
[0066] In step 1 of FIG. 1, the user uploads a STEP file or files. This file may be stored in a cloud storage facility from where it can be retrieved over the Internet by the computer system on which the method is carried out, or it can be stored locally to the computer system. FIG. 2 shows an example model described by the STEP file. The model is of a cuboid 201 with a trough 200 in an upper surface 202 of the cuboid 201.
In step 2, the model of the cuboid 201 is created from the description in the STEP file that has been uploaded and meshes are generated over each face of the cuboid 201. Standard open source libraries OpenCascade or CGAL may be used for loading the STEP file describing the cuboid 201 and for creating the meshes. Alternatively, the model loaded from the STEP file may be meshed and tessellated using proprietary functions.
[0067] Once the meshes have been generated, holes in the faces are detected in step 3. Holes are detected so that they can be drilled out after the mould has been fabricated. The four stages to hole detection are as follows: [0068] a. First, OpenCascade is used to relate the faces of the mesh to the surfaces of the input CAD model, and face classifications are used to detect any faces that could possibly contain holes. This includes faces classified as b-spline and cylindricalsee https://dev.opencascade.org/doc/refman/html/class_geom_surface.html) for a list of possible classifications using OpenCascade. [0069] b. A ray is then projected from the centre of those faces that are identified as possible containing a hole in the direction of the face's normal. If this ray intersects with another face in the mesh with a normal nearly opposite to the face's normal, and if the two faces are close enough together, then the face could be a hole face. If the intersected face is not opposite or is too far away, the original face is no longer tagged as possibly containing a hole. [0070] c. All faces which are still tagged as a hole are analysed and any that are not in closed loops of hole faces have their hole tags removed. CGAL gives adjacent faces, already know hole faces, compare to find. [0071] d. The faces adjacent to faces tagged as hole faces are analysed to find any faces that have been previously classified as conical by the OpenCascade face classification. Of these conical faces adjacent to a hole face, if the conical face is adjacent to at least two other of the conical faces adjacent to the hole faces, then the conical face may also be tagged as a hole face. Conical faces are detected when the OpenCascade face classifications are used in step a.
The value of the diameter of the hole is stored for each face in which a hole is detected, so that the hole diameter can be viewed by the user.
[0072] In step 4, a detailed analysis is carried out on the mesh. This detailed analysis comprises six steps: [0073] a. Hollow volumes in the mesh are detected. This is done by projecting rays from the centre of each face in a mesh in a large number of directions. If all of these rays intersect with other faces in the mesh, the face is tagged as an internal volume face since it is not visible from any direction outside the mesh. [0074] b. Narrow gaps are detected. This is done by projecting a ray from the centre of each face and measuring the distance to the nearest intersected face. Faces which have already been tagged as containing a hole cannot be narrow gap faces. If the nearest intersected face is within a predefined distance, the face from which the ray was projected is tagged as forming a narrow gap. [0075] c. Thin walls are detected. This is done by projecting a ray from the back of each face and checking if the nearest intersected face is within distance and angle bounds. Faces that have been tagged as hole faces are ignored and are not tagged as thin wall faces. This is because holes are often drilled out after the part has been machined, meaning the issues that arise from machining thin walls do not apply. [0076] d. Deep holes are detected. This is done by analysing the distances between the vertices on hole faces and taking the longest length between two vertices. If the length is over a set bound, such as 100 mm, the face is tagged as having a deep hole. This step is only performed on faces that have already been detected as containing a hole. [0077] e. Internal corners are detected. This is done by measuring the angle between the faces either side of each edge in the mesh. If the measured angle is within a set tolerance, rays are projected from the centre of each of the two faces forming the angle in the direction of their 16iving. If both rays intersect with other faces in the mesh, the edge is tagged as an internal corner, including if they intersect with the other of the two faces. [0078] f. A bounding box is generated around the mesh using standard OpenCascade functions, and from this the size of the part in the x-, y- and z-directions, the direction of the bounding box axes and the volume of the bounding box are generated and stored. Surface areas such as total surface area and total planar surface area are calculated and stored.
[0079] In step 5 of FIG. 1, the method involves trying to find good pull directions for the x-, y- and z-planes. The directions are those from which every part of the CAD model is visible. For the example model in FIG. 2, this means finding a direction that the trough 200 is fully visible. The part of the mould that projects into the trough 200 can be removed from the trough 200 by pulling it along the pull direction. If it is pulled in another direction, the mould is likely to interfere with the trough 200 and prevent it being released.
[0080] In step 6 of FIG. 1, the mesh is sliced down the centre of its bounding box in the plane (in the first of the x-, y- or z-planes) to generate polylines for the slice. A CGAL mesh slicing function is used (https://doc.cgal.org/latest/Polygon_mesh_processing/classCGAL_1_1Polygon__mesh__slicer.html#abd67ea7ecable4bdaafe490f0d8e0324) and this fills an empty vector to hold the polylines for the slice. FIG. 3 shows one of the polylines 300 for FIG. 2 when sliced in the y-direction. Polylines are connected sequences of line segments, and the line segments here are drawn from vertex to vertex. The line segment 302 drawn between the vertex 304 and other vertex 306 follows the shape of the trough 200.
[0081] In step 7, for each polyline such as that in FIG. 3, the range of visible angles for each vertex along the polyline is calculated. As the input CAD model has been meshed, curved lines will be represented by small lines with lots of vertices. To calculate the range of visible angles for each vertex along the polyline, each vertex on the polyline is analysed and the range of angles from which each point is visible is found by projecting rays from each vertex to every other vertex in the polyline, and analysing whether the rays intersect other points in the polyline. This provides the visibility of every vertex on the polyline without excessive processing power. This can be seen in FIG. 4, where the vertex 400 has rays projected to vertices 304 and 404 (and the other vertices, not shown), and establishes that vertex 400 can be seen from the range of angles between the two projected rays 402. The range of angles that the vertex 400 is visible from is calculated independent of the chosen point on the polyline; instead the angles 402 are measured in relation to the angles around the axis through which the mesh has been sliced to create the polyline. The vertex 400 in this example is visible from 80 to 135, whereas the vertex 304 is visible from 0 to 180.
[0082] In step 8 of FIG. 1, for each polyline, the angle ranges for each point that are obscured by other polylines in the slice are calculated. FIG. 5 shows an example of a toroidally-shaped model 500 described by an input CAD file. In this model, the slice through the y-axis of the toroid can be seen as two separate polylines 502, 504. As can be seen in FIG. 5, the point 506 on polyline 502 is obscured by the polyline created by the other side of the doughnut 504 between the projected lines 508. Hence, the point 506 is obscured for the angles 160 to 200 by the other polyline, and this is recorded in the data structure.
[0083] Step 9 of FIG. 1 involves calculating, for each point on the polyline, the integer angle values that are in visible ranges determined in step 7 for all polylines and not in any obscured ranges determined in step 8. To generate good mould solutions, sets of pull directions are needed where every point in each polyline is visible from one or more of the pull directions in the set of pull directions. This is found by looping over every integer angle degree relative to the axis currently being analysed and looking for any that cover every point in the polyline. Pairs of angles are then looked for that together cover every point, then sets of three that cover every point on the polyline. It may be possible or required to have more than sets of three angles to view every point, however the vast majority of cases have solutions of three or less angles. Due to the increase in complexity and cost with each mould piece required, it is preferred to have as few angles to view the entire model from as possible. Each angle found is associated with a particular pull direction of the mould.
[0084] Step 10 of FIG. 1 involves finding the best set of visible angles for the slice, looking for angle sets closest to the 90 and 270 for the slice. An example of what is done in step 10 is shown in FIG. 6 in which the CAD model of FIG. 2 is reproduced. The minimum set of angles from which every point in the polyline is visible, preferring those closest to 0, 90, 180 or 270 (corresponding to the axes), are looked for. A simple function comparing the angles to the axes can be used to find the angles closest to these angles. Two pull directions are needed for every point on the polyline of FIG. 6 to be visible, and generally there must be sufficient pull directions so that all points can be seen from the set of pull directions in combination. The possible pull directions from step 9 are passed through a function that returns the best possible set of pull directions for the slice. The function first looks for angle sets that have at least one of the angles at 90 or 270 and returns them if they exist. If no such angle set is found, the angle set closest to 90 and 270 is returned. This function returns sets with the minimum number of pull angles for the slice. To be able to see all points in the trough, the pull direction 600 is needed. This angle ensures that the model shown in FIG. 6 will be properly constructed from the mould as all points along the upper edge polyline 300, the trough 200 and the right-hand side of polyline 300 are visible from pull direction 600. The vertex 604 is not visible from the pull direction 600 so another pull direction is required to see every point on the polyline. Pull direction 602 is chosen as it is closest to one of 0, 90, 180 or 270 while ensuring the vertex 604 is visible.
[0085] In step 11 of FIG. 1 the pull angles are converted to pull direction vectors. The angles found in step 10 are converted from an angle set (e.g. 90, 300) to a set of pull direction vectors. This is done by rotating axis vectors by an angle related to the pull direction angle, so that the pull direction angles can be represented by a vector. For example, if an axis vector is taken that is on a slice, such as (0, 0, 1) on the slice in the x-plane, this is rotated by an amount corresponding to the angle found in step 10, to get the pull direction. For slices in the x- and z-planes, the axis vector is rotated by (90the angle found in step 10), and for the slice in the y-plane the axis vector is simply rotated by the angle found in step 10. In the example shown in FIG. 6, for the slice in the y-plane, we can rotate the axis direction of (1, 0, 0) around the normal to the slice (which is (0, 1, 0)) by the angle found in step 10 to get the pull direction.
[0086] In step 12 of FIG. 1, steps 6 to 12 are repeated for other slices taken along the axis, moving in both directions away from the centre in increments with each new slice. Each slice is evenly spaced across the part, so there will always be an odd number of slices taken. Preferably three slices are taken as this balances speed of analysis with accuracy of the visibility data structure. The spacing for the slices is calculated from the size of the bounding box created earlier. One slice can be taken for quick analysis and for models known to have a constant cross-section.
[0087] In steps 13 and 14 of FIG. 1, steps 6 to 12 are repeated for the other two axes not yet analysed. This ensures all directions are analysed through the previous steps to find the optimal pull directions. At this point in the method, all slices of all axes have been analysed so the visibility data structure has been fully populated (steps 6 to 9). From this fully populated visibility data structure, suitable sets of pull directions have been found for each axis (steps 10 and 11).
[0088] In step 15 of FIG. 1, the faces covering the mesh from each direction are computed. A suitable set of pull directions (6 pull directions, 2 for each axis) has been calculated, and each face can be classified with respect to each of these directions. Each face can be classified to more than one direction if it is visible from more than one direction. Accessibility is the property used to classify how each face is visible from a given pull direction. As can be seen from FIG. 1, this classification process starts in step 16, each face being allocated a classification in the mesh as backfacing, obstructed, visible or isolated. This is done for each pull direction.
[0089] In step 16a of FIG. 1, if a face has a normal pointing in a similar direction (preferably within 3) to the pull direction vector, it is marked as backfacing. This is further exemplified in FIGS. 7a and 7b, which show a variation of FIG. 2 having the top face 700 marked backfacing with respect to the pull direction 602 chosen. The normal 702 of the top face 700 is close to the same as the pull direction 602, so the face cannot be visible from that direction. The face is therefore marked as backfacing.
[0090] In step 16b of FIG. 1, if the face is close to parallel (and so its normal is close to perpendicular) to the pull direction but not backfacing, the angle from which the rays are projected from the centre of the face is rotated slightly, for example by 3. This can be seen in FIGS. 8a and 8b, where the face 800 is parallel to the pull direction 602 and therefore has a normal 802 perpendicular to the pull direction. This face 800 is rotated towards the pull direction, so the rays projected from the centre of the face project at an angle closer to the direction in the set of directions, giving the face more of a chance to be visible from the chosen direction. This avoids losing faces that are invisible from the pull directions but should be considered visible. This allows for depth of moulds to be properly assessed.
[0091] In step 17 of FIG. 1, a ray is projected from the centre of any face not marked as backfacing in the direction opposite to the pull direction. This is done using a CGAL AABB tree function (https://doc.cgal.org/latest/AABB_tree/index.html). Intersections between this ray and any other face in the mesh are looked for. In FIG. 9, a ray 902 is projected from the centre of face 900 in the direction of the pull direction 602.
[0092] In steps 17a and 17b of FIG. 1, it is determined whether the ray has intersected with another face in the mesh. If it has, the face is tagged as obstructed in step 17a. If not, the face is tagged as visible in step 17b since it is visible with respect to the pull direction the accessibility of the faces of the mesh is currently being analysed for. FIG. 9 shows the ray 902 intersecting the face 904, owing to which the face 900 is tagged as obstructed.
[0093] In step 18 of FIG. 1, all faces in the mesh are looked at again, and if a face has been tagged as backfacing or obstructed and are surrounded only by visible faces, it is tagged as isolated. This replaces their previous tag of either backfacing or obstructed. Finding these prevents erroneous faces from being tagged as not visible in the chosen direction when they should bethis can be caused by poor meshing of the CAD model. Isolated faces are seen as visible, along with faces tagged as visible, when analysing the faces visible from each pull direction. FIG. 10 shows an example part, with surface 1000 being visible and surface 1010 not being visible from the chosen direction. Faces 1002, 1004 are not tagged as visible faces even though they should have been. This is likely due to poor meshing of the curve of the part, meaning the faces end up being classified as obstructed as the projected rays from each face interact with another face in the mesh. These faces 1002, 1004, 1006 and 1008 border only visible faces so are tagged as isolated faces.
[0094] In step 19 of FIG. 1 shows each face visible from the pull direction (i.e. each face tagged as either visible or isolated) bordering other faces visible in that pull direction are grouped into a single candidate piece for that direction. The mould solutions will be constructed from these candidate pieces. Different candidate pieces can be selected to create different mould solutions.
[0095] In step 20 so-called letterbox candidate pieces are removed. Some candidate pieces are theoretically possible but would not make sense to make, often being very long and thin. Characteristically, these pieces will have one dimension double or greater than double the length of the other two dimensions. Another characteristic of letterbox pieces is this longest dimension will be 0.95 times or greater the length of the scalar projection of the entire piece (the longest possible distance within the bounding box of the model). These letterbox mould solutions, such as those seen in FIGS. 11a and 11b, are removed from the possible mould solution available for a user to select from. FIG. 11a shows a pull direction 1100 that creates a very thin, long piece, a letterbox candidate piece 1102, which is difficult for manufacture. Similarly, FIG. 11b shows two pull directions 1104, 1106 that creates a thin, complex mould solution 1108 that would not realistically be used to manufacture the design.
[0096] In step 21 of FIG. 1, the draft angle is calculated for each face in each candidate piece. This is done by comparing 90 to the normal of each face with the pull direction. The difference in angle is stored for each face, and this difference is the draft of the face. Any faces with a draft angle of 2 or less are considered to have a poor draft angle which is indicated to the user. Parts generally need to have all faces with a draft of at least 2 to be able to remove the piece from the mould. FIG. 12 shows a part 1200 for manufacture and the part is to be removed vertically from the mould. The side faces 1202 have a draft of less than 2 compared to the pull direction so could catch on the mould when being removed. Since a face with a draft of less than 2 is detected, an alert 1204 is displayed to the user. Areas with poor draft often require extra mould design to increase the angle.
[0097] In step 22 of FIG. 1, combinations of candidate pieces that cover the whole mesh are found. These combinations represent mould solutions for the part. All candidate pieces are passed into another function. This function first looks for candidate pieces that cover the whole mesh alone, and labelling these as single-piece mould solutions. This process repeats for pairs of candidate pieces (faces in the mesh are in one or the other or both of the candidate pieces), and these are labe two-piece mould solutions. The same is then done for all triplets of candidate pieces, to find the three-piece mould solutions. Each single, pair or triplet of candidate pieces that cover all the faces of the mesh are stored as a mould solution. The user can then choose whether they want a single-, double- or triple-piece mould. For a single-piece mould, only a single candidate piece is required. For a double-piece mould, two candidate pieces are required. For a triple-piece mould, three candidate pieces are required. The best candidate piece or set of candidate pieces is found by taking the dot products of the direction from the set of directions associated with each candidate piece with every other direction associated with every other candidate piece that together cover the whole mesh and selecting the combination of candidate pieces which result in the lowest dot product. As there will likely be several possible combinations of candidate pieces that together cover the entire mesh, the most preferable candidate pieces are those with pull directions as close to opposite directions to each other as possible, as this is most likely to create a good mould covering all faces and provide easily pulled apart shells. The candidate pieces with their associated pull directions being as close to opposite to each other as possible can be found by taking the dot product of the pull directions associated with each candidate piece. The set of candidate pieces that cover the entire mesh with the lowest dot product can then be returned, or other options can be given to the user including the single-piece solution.
[0098] Instead of using the dot product, the scalar projection of the pull direction may be compared with a vector of the size of the bounding box of the model, which returns the candidate pieces with fewest letterbox pieces.
[0099] In step 23, each multi-piece solution is trimmed so that there's a male mould piece and cutout and hole faces are removed. Single-piece solutions are trimmed to remove cutout and hole faces. Each multi-piece mould solution is trimmed so that there is no overlap between the candidates that make up the mould solution. This is done so that there is no overlap between each piece in a multi-piece mould, and so that the user has a choice between male and female moulds in single piece solutions. FIG. 13a shows a single-piece mould solution. Surface 1300 is the single side to be moulded, with holes 1302, 1304 to be cut out and a parting line 1306. The parting line is where the different shells of the mould come together. This line can mark the border between the inside and outside of the part on a single-piece solution. FIG. 13b shows the same input CAD model but for a two-piece mould solution. Surface 1308 is one side of the mould and the opposite side (not shown) will also be moulded. As with FIG. 13a, the holes 1310, 1312 will be cut out. In FIG. 13a, the vertical faces touching parting line 1306 will be in both pieces of a two-piece mould solution, so they will be trimmed from one piece to stop an overlap being formed. This can be seen in the male mould shown in FIG. 13a, as the side faces are not included in this mould piece. The hole faces are also trimmed from both mould pieces in the two-piece mould solution, as these may not be moulded but can be cut out later.
[0100] In step 24, for each multi-piece solution, individual single-piece solutions are generated. This is done by taking one of the pieces from the multi-piece solution and setting it as its own single-piece solution. This allows thin pieces to be made using just one of the shells.
[0101] In step 25 of FIG. 1 parting lines are generated for each solution. Every border in each candidate piece is classified as either parting lines, holes or cutouts. This is done by looking at edges between the candidate pieces in a multi-piece mould solution or around the edge of a multi-piece solution. Each parting line is identified as either a standard parting line, or a hole or cutout parting line. FIG. 14 has a mould solution with face A 1400 and face B 1402 and the standard parting line 1404 between the two. FIG. 14 also shows the edges around the holes as hole parting lines 1406. A user can see how the mould pieces will be separated and can identify cutouts and holes.
[0102] In step 26, for each candidate piece, a mould solid is generated. The mould solid is the candidate piece that will be used by the code for automated mould generation. FIG. 15 shows the CAD model of FIG. 14 with the mould solid generated, the moulded faces (i.e. the faces of the candidate piece used) of the region having been extracted to generate the mould solid.
[0103] In step 27, the holes and cutouts in the region are triangulated. Thus, the holes and cutouts are filled in by meshing to make one continuous region. This can be seen in FIG. 16, with the holes and cutouts 1600, 1602, 1604, 1606 having been identified and filled in in the mesh.
[0104] In step 28 of FIG. 1, the boundary of the region tangent to the surface is extended outwards. The boundary may be concave as viewed from the pull direction so simply extruding the boundary in equal amounts directly outwards will cause the boundary to self-intersect. To combat this, a straight skeleton of boundary points is computed to obtain opposite vertices for each vertex in the boundary. A straight skeleton is a geometric representation of a polygon by a topological skeleton. This process can be seen in FIGS. 17a and 17b. In FIG. 17a, extrusion would lead to the self-intersection (1704) in the concave region 1700, so the skeleton 1702 is formed in FIG. 17b, preventing this self-intersection and allowing the boundary of the region tangent to the surface to be extended outwards. The skeleton shown in FIG. 17b is effectively an expanded version of the boundary shown in FIG. 17a, the outline of the boundary being visible in the middle.
[0105] In step 29, the boundary is lofted (a process of creating a 3D solid or surface between two or more cross-sections) towards the straight skeleton using corresponding vertices on each of the boundary and straight skeleton. As can be seen from FIG. 18, this ensures the faces are tangent to the surface where they meet the moulded region.
[0106] In step 30, the lofted faces are clipped in the pull direction. FIG. 19 shows the input CAD model of FIG. 14 having been through the previous steps. Clipping the extruded faces 1900 forms a flat boundary 1902 to match the run-off desired by the user. The run-off defines how much larger the mould is than the part to be moulded. This may be selected by a user prior to carrying out the process on an input CAD model. A suitable default value for run-off may be 25 mm.
[0107] In step 31, the surface is extruded along the pull direction related to the selected mould piece. Extruding down and triangulating creates a new base will completes the final solid mould. FIGS. 20a and 20b show the surfaces 2000, 2002 extruded downwards along the pull direction to create a new boundary which is then triangulated to form the base 2006 that will create the final solid mould.
[0108] FIG. 21 shows an exemplary computer system which can be used to put the method described above into effect. The system comprises a computer 2100 comprising at least a processor 2102 and a memory 2104, connected to a network 2108. The network may be connected to the Internet. The system may also have a graphical user interface 2106, GUI, to allow for user inputs. The memory 2104 may store instructions, which, when executed by the processor 2102 perform the method as described above.