Filling Holes In Facet Bodies   

<<< Checking and Repairing Mesh Data Chapters Performing Evaluations On Meshes >>>

Contents

[back to top]


87.1 Introduction

Parasolid supports functionality for filling holes in a mesh, thereby providing you with the ability to effect repairs, for example after importing a mesh stored in a foreign facet format. This functionality is comparable to the topological fill hole functionality provided by PK_BODY_fill_hole, but differs in several important ways, including:

 

Related Topics:

[back to top]


87.2 Overview of the API

Parasolid provides two functions dedicated to filling holes in a mesh:

 

Function

Description

PK_MESH_find_laminar_mfins

Finds the laminar mfins in a mesh, returning them in groups of connected chains.

PK_MESH_fill_holes

Fills holes in the given mesh, returning a new mesh with the specified holes filled.

Depending on the type of workflow you wish to implement, you can use PK_MESH_find_laminar_mfins to let your users identify which holes to fill, before passing this information to PK_MESH_fill_holes to perform the repair itself, or you can use PK_MESH_fill_holes to automatically fill all holes in a mesh that fulfill a specified set of criteria.

A summary of the options provided by these functions is as follows:

PK_MESH_find_laminar_mfins finds laminar mfins in a mesh, based on the following options:

 

Option

Description

max_mfins

The maximum number of mfins you want in any returned chain of mfins. Laminar boundaries that contain more than this number of mfins are not returned. See Section 87.3.1, “Choosing holes based on chains of mfins”, for more information.

help_positions

An array of position data to help locate chains of mfins to return. See Section 87.3.2, “Choosing holes based on help positions”, for more information.

want_plines

If PK_LOGICAL_true, then a polyline is created for each chain of mfins returned.

open_comps

Whether laminar mfins should be returned as open components if they cannot be grouped into closed components. Any laminar mfins that are returned as open components should not be used for filling mesh holes.

The open_comps option takes the following values:

 

Value

Description

PK_MESH_open_comps_no_c

If laminar mfins cannot be grouped into closed components the function will return PK_ERROR_mesh_open_components. Default.

PK_MESH_open_comps_allow_c

Any laminar mfins that cannot be grouped into closed components are returned as open components.

PK_MESH_open_comps_report_c

In addition to returning the same information as PK_MESH_open_comps_allow_c, a Parasolid Report of type PK_REPORT_record_type_3_c is created with a status of PK_REPORT_3_mesh_open_comps_c. See the PK Interface Programming Reference Manual for more information.

PK_MESH_fill_holes fills holes in a mesh, based on the number of connected mfins in any of the mesh’s boundaries. In addition, it fills any holes you specify explicitly. It takes the following options:

 

Option

Description

max_n_mfins

The maximum number of mfins on the boundary of any hole to be filled. Laminar boundaries that contain more than this number of mfins are not filled. See Section 87.3.1, “Choosing holes based on chains of mfins”, for more information.

input_holes

A list of boundary mfins defining holes to be filled in addition to those identified by max_n_mfins . See Section 87.3.2, “Choosing holes based on help positions”, for more information.

fill_shape

The method used to create patches for holes in the mesh. Different values for this option yield results with different numbers of facets and different appearances. See Section 87.4, “Controlling the shape of the patch”, for more information.

 

Note: The max_n_mfins and input_holes work independently of each other, within the same call to PK_MESH_fill_holes. For example, if you specify max_n_mfins as 8 and also pass a 10 fin chain to input_holes , PK_MESH_fill_holes fills all holes with boundaries of 8 or fewer mfins, and also fills the 10 mfin hole specified.

[back to top]


87.3 Choosing which holes to fill

In order to fill holes in a mesh, you need to set suitable options in PK_MESH_find_laminar_mfins and PK_MESH_fill_holes so that holes can be correctly identified. There are two fundamental approaches to choosing which holes in a mesh to fill.

This section explains how you can implement both these approaches.

87.3.1 Choosing holes based on chains of mfins

You can define which holes to fill by specifying the maximum number of mfins that should be considered to represent the boundary of a hole. This allows you to exclude large chains of mfins (which might represent, for example, the boundary of an entire mesh, rather than a hole within that mesh). You can specify a maximum number of mfins using either PK_MESH_find_laminar_mfins or PK_MESH_fill_holes, as follows:

 

To identify holes using this function:

Do this:

Result

PK_MESH_find_laminar_mfins

Specify the maximum number of mfins using the max_mfins option.

The function returns chains of laminar mfins with at most max_mfins elements. To fill the holes these chains represent, pass the chains into PK_MESH_fill_holes using the input_holes option.

PK_MESH_fill_holes

Specify the maximum number of mfins using the max_n_mfins option.

All chains of mfins containing fewer than max_n_mfins are filled during the call to PK_MESH_fill_holes. You should use a value of at least 3 for max_n_mfins , since any value less than this cannot represent a hole.

87.3.2 Choosing holes based on help positions

If you want to identify specific holes in to fill, you should use the help_positions option in PK_MESH_find_laminar_mfins. You could use this option, for example, to implement a workflow in which your users choose which hole to fill using Parasolid’s picking functionality. See Chapter 111, “Picking Topology”, for more information on this functionality.

The help_positions option takes an array of position vectors, and for each position vector specified, PK_MESH_find_laminar_mfins returns the closest chain of connected mfins. To subsequently fill the holes identified using help_positions , pass the returned chains to PK_MESH_fill_holes using the input_holes option: holes specified using this option are filled regardless of any other options set.

 

Figure 87-1 Filling specific holes using help positions

 

Note: To fill only the holes identified using help_positions , leave the max_n_mfins option in PK_MESH_fill_holes at the default value of 0.

[back to top]


87.4 Controlling the shape of the patch

You can use the fill_shape option in PK_MESH_fill_holes to control the shape of the patches that are created in the resulting filled mesh. This can take the following values:

 

Value

Description

PK_MESH_fill_shape_linear_c

Fills each hole without creating new mesh vertices in the interior of each hole. This is the default.

PK_MESH_fill_shape_refined_c

Produces a similar shape to PK_MESH_fill_shape_linear_c, but may introduce new mesh vertices in the interior of each hole to ensure new facets maintain approximately the same size as those nearby.

PK_MESH_fill_shape_tangent_c

Uses a similar method to PK_MESH_fill_shape_refined_c, but additionally maintains tangency of the mesh around the boundary of each hole.

PK_MESH_fill_shape_curvature_c

Uses a similar method to PK_MESH_fill_shape_tangent_c, but in addition adjusts the patch to maintain the general curvature of the mesh around the boundary of each hole.

Figure 87-2 shows the effect of using different values of fill_shape to fill a hole in a spherical mesh.

 

Figure 87-2 Controlling the shape of the patch

[back to top]

<<< Checking and Repairing Mesh Data Chapters Performing Evaluations On Meshes >>>