Sheet Sewing   

<<< Sheet Modeling Chapters Wire Modeling >>>

Contents

[back to top]


36.1 Introduction

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.

[back to top]


36.2 Sheet sewing

Sheet sewing is performed using PK_BODY_sew_bodies, which receives the array of sheets that are required to be sewn together, and a lower bound on the width of gaps that are allowed to remain in the result(s). The first sheet in the array is the target sheet. On completion of the sewing operation the target sheet is enlarged by having all or some of the given sheets sewn to it, and information is provided on which sheets were not sewn to the target.

 

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

[back to top]

36.2.1 Control options in sheet sewing

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.

allow_disjoint_result

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.

treat_as_manifold

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.

prefered_body_type

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:

duplicate_removal

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

PK_BODY_sewing_remove_none_c

Do not attempt to remove duplicate sheets. This is the default.

PK_BODY_sewing_remove_poss_c

Identify possible duplicates to within Parasolid precision.

PK_BODY_sewing_remove_cert_c

Identify duplicates to within the tolerance specified by the gap_width_bound argument to PK_BODY_sew_bodies.

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.

[back to top]

36.2.2 How successful was the boolean?

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 :

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:

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.

[back to top]

36.2.3 Getting the best from sheet booleans

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

 

Figure 36-7 The preferred presentation when sewing sheets

 

Figure 36-8 Showing why short edges are hard to sew

[back to top]

36.2.4 Incremental sewing using different gap-width-bound values

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

number_of_iterations

The number of iterations of the sewing operation to perform. Default is 1 - that is, incremental sewing is not performed.

iteration_bounds

An array of different gap width bounds used when number_of_iterations > 1. If this array is NULL (the default) then Parasolid generates a range of gap width bounds based on the value of the gap width bound passed to PK_BODY_sew_bodies.

[back to top]

36.2.5 Getting the best from sheet sewing

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

[back to top]

36.2.6 What to do if sheets are not sewn together

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.

[back to top]


36.3 Knitting sheets together

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:

[back to top]

36.3.1 Setting model tolerance

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.

[back to top]

36.3.2 Finding connectivity information

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

n_bodies

The number of bodies to for which to find a knitting pattern.

bodies

An array of bodies for which to find a knitting pattern.

Returned Description

knit_pattern

The connectivity information of those bodies in bodies that could be connected.

n_absent_bodies

The number of bodies that could not be connected together.

absent_bodies

An array of bodies that could not be connected together.

 

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:

 

Field Description

n_edges

The number of pairs of matching edges. The edges and matches arrays should both be this length.

edges

An array of edges that can be matched wholly with the list of matching edges supplied in matches . Each item in this array matches wholly with the corresponding item in matches .

matches

An array of matching edges for the supplied edges . Each item in this array matches wholly with the corresponding item in edges .

n_reversals

The number of owning bodies of edges in either edges or matches that need to be reversed for knitting to succeed.

reversals

An array containing the owning bodies of any edges in either edges or matches that need to be reversed in order to knit the bodies together successfully.

[back to top]

36.3.3 Applying connectivity information

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:

 

Received Description

body

The target body into which the result of the knit operation is placed.

knit_pattern

The knit pattern used to fuse a series of edges into body.

options

Options describing the final form of body. These options let you specify whether a solid or a sheet body should be created by the knit operation,

Returned Description

knit_result

Information about the result of the knit operation. This structure contains any edges that could not be knitted together, as well as status information about the operation.

 

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.

[back to top]

<<< Sheet Modeling Chapters Wire Modeling >>>