<<< Sheet Modeling | Chapters | Wire Modeling >>> |
A collection of sheet bodies can be sewn together by gluing them where their edges meet, resulting in a single connected body. Parasolid sews together all pairs of edges which are less than a specified distance apart.
Figure 36-1 Sheet sewing input and output data
Parasolid sewing avoids, where possible, sewing a new sheet onto the target by an edge match less than the stated gap width bound. The reason for doing this is, that doing so may lead to mistakenly inverting the sheet about to be attached. This arises where the match forms a short boundary to an overlap of the target and candidate sheet. Parasolid sewing takes the reasonable view that there should be some match somewhere that is longer than the gap width bound, i.e. it expects to find edges that are larger than the gaps it has been warned about. When such longer edges are found, the sheet is included into the target and sewing then proceeds on the previously ignored edges.
Parasolid sewing checks to see if all edges are shorter than the gap width bound. If this is the case, then it sews along the first encountered match even if it is short.
Where possible during the sewing operation, Parasolid attempts to remove short edges that become degenerate when tolerances are applied while fusing sheet boundaries together. Examples of this are:
Figure 36-2 Short edges degenerating to vertices
Figure 36-3 Short edges created by the algorithm degenerating to vertices
Several options are available to influence the outcome of using PK_BODY_sew_bodies on a collection of sheet bodies. Each is listed below together with a brief explanation of the manner in which the result is affected by its use.
If set to PK_LOGICAL_true this option enables PK_BODY_sew_bodies to return several disjoint composite sheets in cases where the sheets that can be sewn together do not form a single cohesive composite sheet. Basically everything that can be sewn together, is. All of the products of this activity are returned in the
sewn_bodies
return argument.
When set to PK_LOGICAL_false the only sewing operations that are carried out are those that lead to sheets being sewn, directly or indirectly, onto the first sheet presented in the argument 'bodies'. Only the single composite sheet which includes the target are returned.
The default for this option is PK_LOGICAL_false.
If set to PK_LOGICAL_true, PK_BODY_sew_bodies assumes that the input data is intended to produce a manifold result. This allows the algorithm to assume that, if more than two edges are within
gap_width_bound
of each other, then only the two closest are intended to be matched together. Sewing of this closest pair is only carried out if this won't lead to an edge that tolerantly clashes with the eliminated candidates. Where the group doesn't have a pairing distinct from the remainder, the entire group is collected together and reported as a non-manifold problem (see below).
When set to PK_LOGICAL_false, PK_BODY_sew_bodies makes no attempt to separate out a pair of edges from a larger group, but instead immediately reports the whole group as non-manifold.
This option permits the application to state a preference for the body type of the results that are produced by the sewing operation. It was envisioned as a means by which applications could prefer composite sheets having no laminar boundary edges to be returned as closed sheets rather than solid bodies. However the options permit the application to state a preference for:
In Parasolid, the sewing functionality can attempt to remove duplications of sheets. If duplicate sheets are present then the result of the sewing operation is likely to include a large number of reported non-manifold problems. The sewn bodies additionally have a high probability of incorporating pairs of (duplicated) faces sewn together back-to-back. Such bodies are corrupt, and therefore almost useless in later modeling operations.
When you suspect your data contains duplicated sheets then you should use the
duplicate_removal
option, which can take the following values:
Value | Description |
---|---|
Do not attempt to remove duplicate sheets. This is the default. |
|
Identify duplicates to within the tolerance specified by the |
PK_BODY_sewing_remove_cert_c is more successful at identifying duplicates than PK_BODY_sewing_remove_poss_c, but is also slower.
The strategy for removing possible duplicate sheets reliably, and without expensive coincidence checking is:
The unused members of the classes are returned in the array of unsewn bodies.
Parasolid sewing does not handle examples of duplicated candidates where not all of the sheet boundaries are shared. Parasolid is in no position to judge the relative merits of two equally plausible candidates.
The level of success of the sewing operation is determined by the information returned in the arrays
unsewn_bodies
and
problem_groups
together with an evaluation, by the application, of the laminar boundary loops present on each result returned in the array
sewn_bodies
:
unsewn_bodies
returns those bodies that had no other presented sheet body sewn onto it
problem_groups
return, in groups, those edges that are associated with a single problem found during sewing
The
unsewn_bodies
array is fairly self explanatory. However it should be noted that the appearance of a sheet in this array does not imply that it has remained unmodified by the sewing operation. The unsewn sheet may have had some of its edges considered as unsuccessful candidates for sewing. In such cases the edges may have been split to fit the region of the match, but they were subsequently rejected in favor of better nearby pairings. Some edges of the unsewn sheet may also have been deleted in a similar process. For example consider the following three sheets:
Figure 36-4 How the tolerance bound works
Given that sheet A is the target (by being handed in at the head of the array), the result of handing A, B and C to PK_BODY_sew_bodies with default options is that sheets A and B are sewn together. Sheet C is returned as unsewn, but the edge on it nearest sheet A has been split at X while considering matching options in the shaded region. Incidentally the neighboring edges on sheets A and B are also split at Y during the same process of examining the shaded area.
The problem group array holds structures, each of which is an array of edges with an accompanying token indicating the type of problem encountered while dealing with these edges. These tokens, together with their standard interpretations are:
treat_as_manifold
affects the reporting of such problems (see above).Immediate problems aside, the application has to check that the results have the boundaries that were expected to arise from the sewing operation. Despite limited opportunities to make some judgements on the boundaries of a result (e.g. the result of a call that stated a preference for a solid body might be presumed to have no laminar boundary edges), PK_BODY_sew_bodies makes no attempt to do this. However some support for the application to examine sheet boundaries is provided through PK_BODY_find_laminar_edges which presents easy access to this information.
While PK_BODY_sew_bodies does its best to deal with the sheet geometries passed to it, it obviously does have limitations. In order to achieve a high success rate when using this function, it is advisable to bear these limitations in mind when preparing the sheets to sew together.
Figure 36-5 Boolean B-surface sheets together
Figure 36-6 Examples of vertices (not) bounding edge-edge matches
The sewing algorithm has a greater chance of success if it can select the smallest appropriate tolerance for the edges that it fuses together. To facilitate this, it is better that the laminar boundary edges of the sheet bodies handed to PK_BODY_sew_bodies have as small a tolerance as possible. Of course no edge tolerance at all would be preferable.
Vertex tolerances are less of a problem since sewing adjusts these to be as small as possible without violating model consistency. In summary sheets are preferred in descending order left to right in the following diagram:
Figure 36-7 The preferred presentation when sewing sheets
In the course of finding and grouping bundles of candidate matches to an edge, the edge is split at many points. These points are projections on to the edge of neighboring boundary vertices lying within the gap width bound of it. The average number of split points rises roughly as the square of the gap width bound (assuming a uniform distribution of vertices on a locally 2-D problem). Short edges near wide gaps may be induced by neighboring vertices on smaller scale edges associated with correspondingly smaller gaps.
Figure 36-8 Showing why short edges are hard to sew
'Necklaces' of many small-scale edges can provide an overabundance of vertices. Avoid these where possible, perhaps rebounding the surfaces with a single curve that approximates a composite curve constructed from the geometries of the edges in the necklace.
Where they are unavoidable (perhaps on a seriously non-G1 surface) there is always the chance that sewing sheets with necklace edges using a gap width bound relatively significantly smaller than the edges in the necklace may work. Doing this as an initial phase of the sewing operation may help the larger problem.
Parasolid sewing has some limited ability to ignore 2 and 3 edged examples of these thin sliver sheets.
If the collection of sheet bodies to be sewn contains a wide range of gap-widths, then the most effective method of sewing them together is to perform several passes of the sewing operation. This technique is known as incremental sewing.
When incremental sewing is used, sheets are first sewn using a small gap-width bound. The resulting bodies are then sewn using a larger gap-width bound. This is repeated until all the sheets are sewn together or the user-supplied gap-width bound is reached. Sheets that are closer together are sewn together in earlier passes, when the gap width bound is small, and sheets that are further apart are not sewn together until later passes (if it all).
The
number_of_iterations
and
iteration_bounds
options to PK_BODY_sew_bodies are used to control incremental sewing, as follows:
Option | Decription |
---|---|
The number of iterations of the sewing operation to perform. Default is 1 - that is, incremental sewing is not performed. |
|
An array of different gap width bounds used when |
Sometimes the sheet bodies you want to sew together may contain a wide range of gap-width bounds that cannot be easily predicted. If you are attempting to sew a number of sheets together in these conditions, you can increase the success rate of sewing operations by using incremental sewing, rather than specifying a gap-width bound that is large enough to pull all the sheets together in one pass.
Since regions where sheets are close together may be disconnected (creating "islands" of sheets that are close together), we recommend you use the
allow_disjoint_result
option whenever incremental sewing is performed if you want to retain the detail contained in those regions.
Using
allow_disjoint_result
together with incremental sewing ensures that all sheets that are sewn benefit from the greater accuracy of smaller gap width bounds, rather than just those that are in the same "island" as the target, as shown in Figure 36-9.
Figure 36-9 Sewing "islands" of disconnected sheets using allow_disjoint_result
Where sheet boundaries have not been sewn as expected, or when some measurement of actual gap size is required in advance of using PK_BODY_sew_bodies, use PK_EDGE_find_deviation. This function calculates either the maximal distance between a pair of matching edges, or multiple distance samples between those edges, as shown in Figure 36-10.
Figure 36-10 Determining distances and points on unsewn edges
The distance that PK_EDGE_find_deviation measures is the distance between the two edge geometries. To find a corresponding gap-width, subtract the sum of the two edge precisions from the returned distance.
Measurements taken using PK_EDGE_find_deviation are only a guide to predicting the result of applying PK_BODY_sew_bodies. In practice, matching and splitting edges, together with progressive application of local precisions, occasionally results in a marginally different assessment of distance during sewing.
As an alternative to sewing sheets together using PK_BODY_sew_bodies, you can knit sheets or solids together. This can be a useful technique if you want to create a single body by fusing a mixture of solid and sheet bodies.
Figure 36-11 Knitting two solid bodies and four sheets into a single body
Sheets can be knitted together using the following process:
The first step when knitting bodies is to set a suitable model tolerance. You can do this using PK_EDGE_set_precision and PK_VERTEX_set_precision, which are described in more detail in Chapter 4, "Session and Local Precision".
The tolerance you set is used by PK_BODY_find_knit_pattern to determine which edges in the supplied bodies need to match in order to successfully knit the bodies. To ensure that two edges match correctly, the curve attached to at least one of the edges must lie precisely within the tolerance tube of the other edge, as shown in Figure 36-12. You should set an appropriate tolerance so that this is possible for the data you want to knit together.
Figure 36-12 Setting tolerance to ensure that edges match correctly
Note: You may also need to imprint bounding vertices along some of the edges you want to knit together, using PK_EDGE_imprint_point. PK_BODY_find_knit_pattern has the same limitations in locating subsets of edges to compare as PK_BODY_sew_bodies, and so bounding vertices must be supplied as shown in Figure 36-6. |
PK_BODY_find_knit_pattern infers the connectivity of a set of sheet or solid bodies that you want to knit together. It returns this connectivity information in the form of a knit pattern that can be passed to PK_BODY_apply_knit_pattern.
PK_BODY_find_knit_pattern receives and returns the following arguments:
Received | Description |
---|---|
The number of bodies to for which to find a knitting pattern. |
|
Returned | Description |
The connectivity information of those bodies in |
|
Warning: In order to create a knit pattern that can be successfully applied using PK_BODY_apply_knit_pattern, there must be no interference between the supplied bodies other than along the common edge geometry, and no more than two bodies sharing common boundaries. |
If your application already knows the connectivity information of the bodies to be knitted, then you can supply your own knit pattern. This can be supplied using the PK_BODY_knit_pattern_t structure, and has the following fields:
Use PK_BODY_apply_knit_pattern to fuse together the edges specified in the knitting pattern. The edges specified in the matches array of the knitting pattern are deleted after knitting has completed.
PK_BODY_apply_knit_pattern takes and receives the following arguments:
Note: PK_BODY_apply_knit_pattern does not perform any body checking on the resultant body. You are advised to perform a subsequent check in your application code after the knitting operation has completed. |
<<< Sheet Modeling | Chapters | Wire Modeling >>> |