Facet Mesh Generation   

<<< Display Tolerances Chapters Faceting Output Via GO >>>

Contents

[back to top]


107.1 Introduction

This chapter describes how the fields of the PK_TOPOL_facet_mesh_o_t and PK_TOPOL_facet_mesh_2_o_t options structures control the generation of the facet mesh.

 

Note: Because these two options structures have many options in common, you should assume that the options described in this chapter are available in both options structures, unless noted otherwise.

 

Note: The functionality described here offers partial support for topology that has facet geometry (meshes and plines). See the PK Interface Programming Reference Manual for more information.

 

Related Topics:

107.1.1 Default values

The default values in PK_TOPOL_facet_mesh_o_t and PK_TOPOL_facet_mesh_2_o_t demonstrate how to return basic topological data for a facet representation, together with associated geometric data, to your application.

Depending on whether you are calling PK_TOPOL_render_facet or PK_TOPOL_facet_2, you should initialise these options structures using either PK_TOPOL_render_facet_o_m or PK_TOPOL_facet_2_o_m.

 

Warning: Do not initialise these options structures using either PK_TOPOL_facet_mesh_o_m or PK_TOPOL_facet_mesh_2_o_m

See Section 109.2.2, “Choosing which tables to return”, for more information.

107.1.2 Viewing transformation

Some of the facet mesh options require a viewing matrix to be specified. Parasolid has a number of requirements on such matrices, as explained in Section 107.2.3, “Increasing facet density for given view directions” and Section 107.2.4, “Culling backward facing facets”.

View matrices are explained in Chapter 110, “Parasolid View Matrices”.

107.1.3 Setting tolerance values

A number of the facet mesh options can take a tolerance value. It is assumed that if no explicit tolerance value is provided, Parasolid is free to calculate its own internal tolerance values. These are generally case-specific, rather than using specific fixed values.

[back to top]


107.2 Mesh generation options

The following sections describe the fields in the PK_TOPOL_facet_mesh_o_t and PK_TOPOL_facet_mesh_2_o_t options structures.

107.2.1 Shape

The shape field constrains what shape of facets are allowed in the facet mesh. The options are:

 

Option

Description

PK_facet_shape_convex_c (default)

facets are generated so that all interior angles are convex and none of the facets contain interior holes

PK_facet_shape_cut_c

the application permits concave interior facet angles, and none of the facets contain interior holes

PK_facet_shape_any_c

the application permits concave interior facet angles, and the application permits facets to contain interior holes

The convexity test is made by projecting the facet fins onto the mid-plane of the facet and testing its interior angles. The “mid-plane” is defined in Section 107.2.13, “Facet planarity tolerance”.

The PK_facet_shape_cut_c and PK_facet_shape_any_c settings are only relevant where facets can contain more than three sides, as described in Section 107.2.6, “Maximum number of sides on facets”.

If PK_TOPOL_facet_2 is being used to return tabular facet data with the shape field set to PK_facet_shape_any_c, any facets containing holes are defined in the facet_fin table using the null_index marker to separate the exterior fin boundary from the interior fin boundaries. This format is described in the Section 109.4, “Topological information”.

107.2.2 Match

When solid or sheet parts are faceted, the match option allows faces to be faceted independently or faceted together as a complete mesh. The options are:

 

Match type

Option

Description

geometry matching

PK_facet_match_geom_c

Facet meshes between neighbouring faces meet exactly but are topologically disjoint.

topology matching (default)

PK_facet_match_topol_c

Facet meshes between neighbouring faces meet exactly and have the same topology.

trimmed facets

PK_facet_match_trimmed_c

Neighbouring faces are not considered and the resultant facet meshes may contain overlapping facets or facets that have gaps between them.

 

Note: When your application inputs a list of faces, Parasolid recognises faces that belong to the same body and have identical transform entities. The requested matching will be applied to the edges between these faces unless ignore_scope is PK_facet_ignore_scope_local_c. For more information on ignore_scope , see Section 107.2.15, “Ignoring small features”

107.2.2.1 Geometry matching

The geometry matching option (PK_facet_match_geom_c) can be used when generating faceted output for a simple rendering application.

 

Figure 107-1 Geometry matching

The boundaries of neighbouring facet meshes will meet exactly (except in the special circumstances described below) but are topologically disjoint. If PK_TOPOL_facet_2 is being used to return tabular facet data, the fin_fin table only matches fins which belong to the same face (the co-fin values of fins on the face mesh boundary are set to a null index value).

When facet meshes may not match

Facet meshes may not match if faces are faceted using a coarse chordal tolerance. Parasolid checks whether the face contains any inner loops that lie very close to the outer face boundary. If it does, Parasolid reduces its chordal tolerance locally so that the boundary chords do not intersect any inner loops. If geometry matching is switched on, the refined mesh boundary no longer exactly matches the relatively coarse boundary of the adjacent face (small triangular gaps occur between chords on the refined boundary and those on the coarse boundary). You can use topology matching to prevent such gaps occurring.

107.2.2.2 Topology matching

The topology matching option facets all of the faces of a solid or sheet part as a single mesh.

 

Figure 107-2 Topology matching

If PK_TOPOL_facet_2 is being used to return tabular facet data, the fin_fin table describes matching between fins which belong to the same face and between boundary fins which belong to the neighbouring faces.

The topology matching option checks that the boundary vertices on a facet mesh always match with vertices on the boundaries of neighboring meshes (possibly splitting facets in the neighboring facet mesh in order to meet this condition).

The topology matching option corrects the problem of slight gaps described in “Geometry matching”.

 

Note: Topology matching has no effect when faces are faceted individually (where face entities are supplied explicitly as arguments to the PK faceting functions).

However, when your application has input an array of faces, Parasolid recognises faces from that array that all belong to the same body, and applies topology matching to any boundaries between neighbouring faces in the input array.

107.2.2.3 Trimmed facets

The trimmed facets option clips facet boundaries to model edge curves.

 

Figure 107-3 Trimmed matching

It gives no matching between facets on the two faces of an edge, but ensures that the gaps or overlaps between such facets are no bigger than the supplied tolerances. Figure 107-3 shows the gaps occurring along a model edge.

107.2.3 Increasing facet density for given view directions

The density option lets you increase the local facet density in either or both of the following cases:

The option lets you generate view-specific facet meshes that contain enhanced detail where the facet surfaces form silhouettes against, or are nearly parallel to, the specified views. The effect of each value is shown in Figure 107-4.

 

Figure 107-4 Increasing facet density for given view directions

It takes the following values:

 

Option

Description

PK_facet_density_no_view_c (default)

Facet density is independent of any views (it is ignored).

PK_facet_density_use_view_c

Increase facet density at silhouettes for any specified views.

PK_facet_density_parallel_c

Increase facet density in areas where the facet normals are nearly parallel to the given view directions.

PK_facet_density_both_c

Increase facet density at both view silhouettes and in areas where the facet normals are nearly parallel to the view directions. The same view directions are used to compute the silhouette and parallel areas in which the facet density is increased.

Each non-default value requires that view directions and local tolerance values are specified.

If density is set to a non-default value, view directions for increasing facet density are specified using the view_directions option. This takes an array of unit vectors, each unit vector defining a different view direction. A corresponding n_view_directions option contains the number of view directions, and should correspond with the size of the view_directions array.

When using PK_TOPOL_render_facet, you can also specify a single view direction using the view_transf argument in the function call. If both view_directions and view_transf are supplied, view_transf is ignored.

 

Note: In any view direction used for increasing facet density, the rotation component of the underlying matrix must not contain reflections, scales, or shears, and it must define a set of orthogonal axes. In addition, any perspective information supplied is ignored.

See Section 107.2.4, “Culling backward facing facets”, for information about how view directions are used when culling back facing facets.

For more information on view matrices, see Chapter 110, “Parasolid View Matrices”.

107.2.3.1 Specifying local density tolerance

Local density tolerance values are required when density is set to a non-default value. These are specified using the options described below. In each of the following options, you use the boolean is_... option to switch on use of the tolerance, and its companion to specify a tolerance value. If an is... option is PK_LOGICAL_true, then its companion must be a positive, non-zero value.

 

Value field

Description

local_density_tol
is_local_density_tol

A local value for the surface distance tolerance when density is set to a non-default value (replacing the surface_plane_tol value temporarily)

local_density_ang
is_local_density_ang

A local value for the surface angular tolerance when density is set to a non-default value (replacing the surface_plane_ang value temporarily)

When density is a non-default value, local_density_tol must be supplied. Supplying local_density_ang is optional.

107.2.4 Culling backward facing facets

The cull field lets you reduce the total size of the facet mesh by removing any backward facing facets that are hidden when viewed from a given view direction.It takes the following values:

 

Option

Description

PK_facet_cull_none_c (default)

Do not cull any facets; output them all

PK_facet_cull_back_c

Cull back facing facets. This value requires that a view is specified.

Because perspective information may be required in any view directions used by the culling process, the way that you specify view directions depends on which function you are using:

The cull_transfs is an array of PK_TRANSF_t objects, each object defining a different view direction. A corresponding n_cull_transfs option contains the number of view directions, and should correspond with the size of the cull_transfs array.

 

Note: The cull_transf array can currently only contain a single view direction.

In any view direction used for culling, the rotation component of the underlying matrix must not contain reflections, scales, or shears, and it must define a set of orthogonal axes

 

Note: Topology matching (the default type of matching) must be switched off when culling backward facing facets. See Section 107.2.2, “Match” for more details.

For more information on view matrices, see Chapter 110, “Parasolid View Matrices”.

107.2.5 Loops

The n_loops and loops options allow specific PK_LOOP_t entities to be ignored when a sheet body or a face of a sheet body is faceted. This has the effect that specified holes can be capped when sheet entities are faceted.

Each entity is a loop which is owned by one of the sheet bodies (or faces of a sheet body) which are being faceted.

The default setting is not to ignore any loops.

107.2.6 Maximum number of sides on facets

The max_facet_sides field constrains the maximum number of sides on facets. The default value is 3.

 

Figure 107-5 Maximum number of sides on facets

107.2.7 Minimum and maximum facet width

The is_min_facet_width and is_max_facet_width options control the minimum and maximum width of any side of a facet.

The value of min_facet_width overrides other input tolerance values. When is_min_facet_width is set to PK_LOGICAL_true, facets will be repeatedly refined until the width of each facet is less than min_facet_width . Once this happens, Parasolid will not further refine the facet to satisfy the supplied curve, surface or planarity tolerances, which typically results in facet dimensions that are smaller than min_facet_width .

When is_max_facet_width is set to PK_LOGICAL_true, the value of max_facet_width determines the maximum facet width. Figure 107-6 shows a body where the maximum height of the sides of its facets has been set to 0.4 model units.

 

Note: If both facet widths options are supplied, min_facet_width must be less than max_facet_width .

 

Figure 107-6 Maximum width of any side of a facet

 

Note: The min_facet_width option is ignored on topologies with facet geometry.

107.2.8 Curve tolerance

The following sets of fields control how closely the fins on the boundaries of a face mesh match the originating edge geometry.

 

Switch field

Value field

Description

is_curve_chord_tol

curve_chord_tol

The maximum permitted distance from a chord (i.e. facet fin) to the curve (i.e. edge entity) which it approximates.

is_curve_chord_max

curve_chord_max

The maximum length of chord which can be used to approximate a curve.

is_curve_chord_ang

curve_chord_ang

The maximum angle (in radians) which is allowed between a chord and its originating curve; this is calculated as the sum of the two angles between a chord and the curve tangents, measured at the chord ends. It must be no more than pi/2 radians.

The default setting of each of is_curve_chord_tol , is_curve_chord_max and is_curve_chord_ang is PK_LOGICAL_false. This implies that no explicit curve tolerance values are supplied (Parasolid calculates appropriate tolerance values internally).

One or more of these fields can be set to the value PK_LOGICAL_true with one or more of the corresponding fields - curve_chord_tol , curve_chord_max , curve_chord_ang - set to a non zero, positive value.

107.2.9 Surface tolerance

The following sets of fields control how closely each face mesh matches the surface geometry of the originating face.

 

Switch field

Value field

Description

is_surface_plane_tol

surface_plane_tol

An upper bound on the distance from a facet to the surface which it approximates.

is_surface_plane_ang

surface_plane_ang

The maximum angle (in radians) which is allowed between a facet plane and its originating surface; this is calculated as the sum of the angular deviation between the surface normal and facet planar normal at any two positions within the facet boundary. It must be no more than pi/2 radians.

The default setting of is_surface_plane_tol and is_surface_plane_ang is PK_LOGICAL_false. These imply that no explicit surface tolerance values are supplied. (Parasolid calculates appropriate tolerance values internally).

One or more of these fields can be set to the value PK_LOGICAL_true with one or both of the corresponding fields, surface_plane_tol or surface_plane_ang set to a non zero, positive value.

 

Figure 107-7 Examples of different surface tolerance settings

107.2.10 Local tolerances

You can attach local tolerance to individual or groups of topological entities (either faces or bodies) which then override the faceting tolerances already defined for the face or body using the various curve and surface tolerance options available (see Section 107.2.8 and Section 107.2.9 respectively).

Local tolerances are specified using the following options:

 

Option

Description

local_tols

A set of tolerances to be attached to entities. This is an array of PK_facet_local_tolerances_t. Default: 0 (empty).

topols_with_local_tols

An array of unique topological entities (faces or bodies) to which you want to attach local tolerances.

  • Local tolerances are not used if this is empty.
  • If this is not empty, the parallel array local_tols_for_topols must be completed.

Default: 0 (empty).

local_tols_for_topols

A list of indexes into the local_tols array for each of the entities in topols_with_local_tols . This field specifies which of the specified local tolerances is to be used for each of the specified entities.

The field must be of length n_topols_with_local_tols .

107.2.11 Vertices at degeneracies

 

Note: This option is only available in PK_TOPOL_facet_mesh_o_t.

There are a number of ways that you can manage facet output at degenerate vertices. Parasolid lets you control:

You use the degen (PK_facet_degen_t) option to specify which one you want to use. The values it can take are as follows:

 

Value

Description

PK_facet_degen_multiple_vxs_c

Each facet adjacent to a degeneracy has a unique vertex at the degeneracy. The value for the degenerate parameter at each vertex is the value of the degenerate parameter found for the previous vertex in the facet. Normals and derivatives for each facet are calculated using the appropriate parameter, and so are guaranteed to be accurate for each facet. However, the topology of the original part is not preserved. This is the default setting.

PK_facet_degen_single_vx_c

Parasolid creates a single vertex which is used by all the facets adjacent to the vertex. The value for the degenerate parameter at this vertex is taken from the lowest value at the other end of one of the facets. This preserves the topology of the original, but the parameters, normals and derivatives of all other facets are incorrect.

This option only has an effect if using tabular faceting via PK_TOPOL_facet_2. See Chapter 109, “Tabular Output Of Faceting” for more information.

PK_facet_degen_average_parms_c

Like the default method, each facet adjacent to a degeneracy has a unique vertex at the degeneracy, with a unique parameter. The normals and derivatives are therefore correct for each facet adjacent to the degeneracy, but topology is not preserved.

Unlike the default setting, the value for the degenerate parameter at each vertex is taken from the average value of the degenerate parameters found for the vertices on either side.

The differences between these three options are illustrated in Figure 107-8.

 

Figure 107-8 Creating facet vertices at degeneracies

107.2.12 Order of constraints

This is managed first by the initial division of a face into a small number of facets. Each facet is then tested to see if it meets the tolerance criteria, i.e. surface tolerance, maximum size, etc. If the facet does not meet the criteria it is then split into two and each resulting facet is again tested as before. This process continues until the criteria are satisfied. However, if the process comes to a point where a facet has been produced which is smaller than the minimum width, then the recursion stops, regardless of the other criteria.

107.2.13 Facet planarity tolerance

The following sets of fields control how closely the coordinates of a facet are matched to a common mid-plane. This is defined as the plane passing through the center of gravity of the facet vertices whose normal is the normalized sum of the cross products of all ordered pairs of adjacent vertices in the facet. For more details see the documentation for PK_TOPOL_facet_mesh_2_o_t.

 

Switch field

Value field

Description

is_facet_plane_tol
facet_plane_tol

an upper bound on the distance from a facet to its mid-plane

is_facet_plane_ang
facet_plane_ang

the maximum permitted ratio between facet_plane_tol and max_facet_width

The facet planarity tolerance values are only relevant where facets can contain more than three sides.

 

Figure 107-9 Examples of different planarity tolerance settings

107.2.14 Wire edges in faces

You can control how facets are created for faces that contain wire edges using the wire_edges option. This takes the following values:

 

Value

Description

PK_facet_wire_edges_no_c (default)

Faceting ignores wire edges in faces, and they are faceted over

PK_facet_wire_edges_yes_c

Faceting takes wire edges in faces into account and facets the face in such a way that no facet is intersected by a wire edge.

The behaviour of this option is illustrated in Figure 107-10.

 

Figure 107-10 faceting faces that contain wire edges

107.2.15 Ignoring small features

Small features in a body or model may be ignored during faceting operations. A small feature is a set of connected faces whose box size is smaller than a user-specified value. Doing this can speed up faceting, and reduce the number of facets created. It is useful if you are generating a “draft view” of a model, in order to get a rough idea of what it looks like.

Warning: This option is intended only to improve the performance of faceting. In particular, you should not use it to implement any type of feature suppression functionality in your application.

You use the ignore , ignore_value , and ignore_scope options in PK_TOPOL_facet_mesh_2_o_t or PK_TOPOL_facet_mesh_o_t to control whether, and how, small features are ignored.

Not all small features are ignored. This is determined by the position of the boundary between the small feature and the rest of the model, only if this boundary lies completely within a face of the model is the small feature ignored as illustrated in Figure 107-11.

 

Figure 107-11 Ignoring small features

 

Option

Description

ignore

Control whether to ignore small features. This can take the following values:

  • PK_facet_ignore_no_c (default) - all features are faceted, regardless of size.
  • PK_facet_ignore_absolute_c - a feature whose box size is smaller than the value specified in ignore_value may be ignored.
  • PK_facet_ignore_ratio_c - a feature may be ignored if the ratio of its box size to the overall box size is smaller than the ratio specified in ignore_value .
  • PK_facet_ignore_body_ratio_c - a feature may be ignored if the ratio of the its box size to the box size of its owning body is smaller than the ratio specified in ignore_value .

For a description of the difference between these last two values, see Section 107.2.15.1, “Defining small features using a ratio value”.

ignore_value

Define which features are classed as small. This option takes either:

The default is 0.0. See Section 107.2.15.1, “Defining small features using a ratio value” for more information.

ignore_scope

This option lets you specify the scope within which loops in a face may be ignored. It only applies when faceting a list of faces. The option can take two values:

  • PK_facet_ignore_scope_global_c (default) - loops are only ignored if they would have been ignored had the whole of the owning body (rather than just the face) been faceted.
  • PK_facet_ignore_scope_local_c - the face is faceted as a separate entity. If it contains holes that can be classed as small according to the settings in ignore and ignore_value , then they are ignored.

The value of local_scope also has implications for the ratio values of ignore . See Section 107.2.15.1, “Defining small features using a ratio value” for more information.

 

Note: If the loops option is used, faceting ignores the specified loops regardless of the value of ignore . See Section 107.2.5, “Loops”, for information.

107.2.15.1 Defining small features using a ratio value

The PK_facet_ignore_ratio_c and PK_facet_ignore_body_ratio_c values for ignore let you define the size of a small feature in terms of a ratio, rather than an absolute value. This is useful, because you can ignore small features without having to know anything about the overall size of the model. For example, specifying an ignore_value of 0.01 when using one of the ratio values means that any feature whose box size is less than 1% of the size of the entire model or owning body is ignored, regardless of its absolute size.

Two ratio values are available so that you can choose whether to define small features in terms of either the owning body or the entire assembly.

 

Value for ignore

Ratio defined relative to

PK_facet_ignore_ratio_c

The overall box.

PK_facet_ignore_body_ratio_c

The owning body.

If faceting bodies, the overall box is the union of all the topols boxes (with topol_transfs applied) in the call to PK_TOPOL_facet_2 or PK_TOPOL_render_facet.

If faceting a list of faces, the overall box depends on the value of local_scope :

 

Value for local_scope

Definition of overall box

PK_facet_ignore_scope_global_c

The union of all the topols owning bodies’ boxes (with topol_transfs applied)

PK_facet_ignore_scope_local_c

The union of all the topols boxes (with topol_transfs applied)

107.2.16 Incremental faceting

If you are using geometry or topology matching, Parasolid provides support for incremental faceting. When incremental faceting is used, only those faces in a body that have not already been faceted, have been modified, or that need to be refaceted due to refinement of their boundaries are faceted. This can lead to a large performance improvement, for example, in applications that display a shaded image of a model after each feature operation. Incremental faceting is supported by the functions PK_TOPOL_facet_2 and PK_TOPOL_render_facet.

 

Note: Changes to other facet controls may not be honoured while incremental faceting is switched on.

For an example of this functionality, see the code example in the C++\Code Examples\Application Support\facetting folder, located in example_applications in your Parasolid installation folder.

 

Note: Incremental faceting only supports topology matching if the following are set:

107.2.16.1 Using incremental faceting

Incremental faceting is controlled by the following options in PK_TOPOL_facet_mesh_o_t and PK_TOPOL_facet_mesh_2_o_t:

 

Option

Description

incremental_facetting

Whether or not to use incremental faceting. The following settings can be used:

  • PK_facet_incr_no_c: Switch incremental faceting off. Default
  • PK_facet_incr_clear_c: Incremental faceting is switched off. Any incremental faceting data on the topols being faceted is deleted.
  • PK_facet_incr_refresh_no_c: Incremental faceting is switched on. Any incremental faceting data on the topols being faceted is deleted and new incremental faceting data is generated.
  • PK_facet_incr_yes_c: Incremental faceting is switched on. Any existing incremental faceting data will be used and new incremental faceting data is generated as necessary.
Note: When using concurrent faceting, incremental_facetting must be set to PK_facet_incr_no_c. See Section 103.4, “Controlling exclusivity of rendering and faceting functions”, for more information.

incremental_method

Which method to use for incremental_facetting

See Section 107.2.16.2, “Choosing the incremental faceting method”, for more information.

Note: When using topology matching, this option must be set to PK_facet_incr_method_auto_c.

incremental_transformation

Whether faces that have only been transformed since the last incremental faceting call but have no other modifications are treated as changed by the incremental faceting call.The following settings can be used:

  • PK_facet_incr_tf_no_c: Refacet bodies that have been transformed since the incremental data was set up. Default
  • PK_facet_incr_tf_rigid_c: Do not refacet bodies that have had a rigid transform applied since the incremental data was set up.
  • PK_facet_incr_tf_reflection_c: Do not refacet bodies that have had a rigid body or reflection transform applied since the incremental data was set up.
Note: If the application is able to transform the facets displayed, this option can be used to limit the faces that need to be refaceted to those that have been modified rather than just transformed.

Note: If incremental_method is set to PK_facet_incr_method_attrib_c, this option is ignored.

incremental_refinement
Note: If incremental_method is set to PK_facet_incr_method_auto_c, this option is ignored and any faces adjacent to an edge that has been refined will be automatically refaceted.

Under certain circumstances, the current tessellation of facets does not satisfy the required faceting controls, and Parasolid needs to refine the facet mesh in order to produce an accurate facet representation. The usual consequence of this is that additional facet vertices are added to model edges. This option controls whether or not such refinement is allowed. The following settings can be used:

  • Do not allow refinement. If an edge requires refinement, then a refinement error is reported for each face to be faceted that neighbours that edge, and those faces are not faceted. This does not terminate the faceting operation. If errors occur, you should delete the face attribute from those faces and re-facet. Default.
  • Note: Depending on the setting for incremental_report , refinement errors may also be reported for faces that are not being faceted.

  • Allow refinement. New attributes are added to edges and fins requiring refinement. If faceting a list of faces (rather than a body), and an edge requiring refinement is shared by a face not being faceted, then geometry matching may not be honoured for that face.
incremental_report
Note: If incremental_method is set to PK_facet_incr_method_auto_c, this option is ignored.

Controls how much additional information is reported when faceting fails. The following settings can be used:

  • Do not report any additional error details. Default
  • When faceting a list of faces (rather than a body), list all additional faces required for faceting to succeed.
  • If an edge requires refining, report all the faces that share that edge.
  • Report all additional error details.

The incremental_refinement option must be switched on before any reported errors can be fixed.

 

Note: If PK_TOPOL_facet_2 or PK_TOPOL_render_facet is running concurrently in a thread without locked partitions, incremental_facetting must be set to PK_facet_incr_no_c. See Chapter 113, “Calling Parasolid From Multiple Threads”, for more information on locked partitions.

107.2.16.2 Choosing the incremental faceting method

Parasolid provides two methods for incremental faceting via the incremental_method option. If set to PK_facet_incr_method_auto_c Parasolid automatically refacets any faces on a body that need to be faceted for example, due to changes in the body. In addition, any faces that need new facets in order to honour requested matching are also refaceted.

 

Note: If you are using rollback, we recommend that you set incremental_method to PK_face_incr_method_auto_c to ensure facet information survives all rollback operations.

 

Note: If incremental_method is set to PK_facet_incr_method_auto_c, the incremental_report and incremental_refinement options are ignored.

If incremental_method is set to PK_facet_incr_method_attrib_c, Parasolid will only refacet faces that do not have one of the following system attributes attached:

Only faces without an attribute of type SDL/TYSA_INCREMENTAL_FACETTING are faceted. Attributes of type SDL/TYSA_FACET_VERTEX_DATA on a face’s edges and fins are used to regenerate the positions of facet vertices.

 

Note: If attributes are attached to both an edge and its fins, then the fin data must match the edge data, or an error is raised.

 

    Performance issue: Implementing incremental faceting requires a trade-off between speed and application memory: although incremental faceting decreases the time it takes to re-facet a changed body, it also increases the amount of application memory required, due to the incremental faceting data that is stored on all faces and edges.

Figure 107-12 provides a simple demonstration of how incremental faceting works with both methods:

 

PK_facet_incr_method_auto_c

 

PK_facet_incr_method_attrib_c

  • User creates block.
  • Application generates faceted display.
  • Parasolid adds faceting data to every face and edge faceted.

 

  • User creates block.
  • Application generates faceted display.
  • Parasolid adds faceting attributes to every face and edge faceted.

 

  • User creates cylinder and unites with block.
  • Application refreshes faceted display by calling Parasolid: faces with faceting data are refaceted if needed.
  • Parasolid adds faceting data to all re-faceted faces.

 

 

  • User creates cylinder and unites with block.
  • Parasolid deletes attributes from changed faces on block.
  • Application refreshes faceted display by calling Parasolid: faces with faceting attributes are not re-faceted.
  • Parasolid adds faceting attributes to all re-faceted faces.

Figure 107-12 A simple example of incremental faceting in use

For more details about the specification of the system attributes used for incremental faceting, see Section A.4, “System attribute definitions whose presence alone defines a property”.

 

Note: As a side effect, you can use Parasolid’s support for incremental faceting to force the tessellation of faces in a body. You can do this by explicitly adding attributes to the faces and edges in the body yourself. See Chapter 95, “Attributes”, for information on adding attributes to entities.

If you use this method, then you need to specify chordal tolerance information if you want to allow incremental refinement to take place.

107.2.17 Improving faceting around points of inflection

Sometimes, around points of inflection, it is possible that a single facet is generated which is large, relative to the surrounding facets. Despite the change in curvature around the point of inflection, this facet can still satisfy the specified surface_plane_tol and the surface_plane_ang . This means that, by default, the facet spanning the point of inflection is not split, and this can result in a shaded image that looks “flat” around the inflection, particularly if the graphics library used by your application uses the normals at the facet vertices.

One way of improving the appearance of a faceted image that has points of inflection is simply to generate more facets for the whole image, by specifying a smaller max_facet_width. However, this can have a large performance cost and result in a large number of facets even for those parts of the image that do not require it.

A better method is to use the inflect option to increase the number of facets around points of inflection, while leaving the facet density in other areas the same. This option can take the following values:

 

Value

Description

PK_facet_inflect_no_c

Do not increase the number of facets around points of inflection. This is the default.

PK_facet_inflect_split_near_c

Split facets around the point of inflection so as to increase the number of facets.

Figure 107-13 shows the superior effects that can be achieved when splitting facets around the point of inflection.

 

Figure 107-13 Increasing the number of facets around points of inflection

107.2.18 Improving facet quality

You can improve the general quality of the facets that are created using the quality option. This option controls whether extra checks are performed during the faceting operation: running additional checks results in better quality facets. Facet quality is improved at the expense of performance, and so you should expect the faceting algorithm to be slower if you use a non-default quality value. In particular, you should only consider using this option if you are using facets for purposes other than visualisation.

The quality option takes the following values:

 

Value

Description

PK_facet_quality_standard_c

No additional checks are performed to improve facet quality. This is the default.

PK_facet_quality_improved_c

Extra checks are performed in order to improve the quality of the facets.

107.2.19 Controlling facet vertices on tolerant edges

If a body contains a tolerant edge, switching on the vertices_on_planar option lets you control which of the tolerant edge’s SP-curves the resulting facet vertices lie on. If a tolerant edge has an adjacent face with a planar surface attached, using vertices_on_planar ensures that the facet vertices along the tolerant edge lie in the plane of the planar face. If vertices_on_planar is not used, the facet vertices may lie on either side of the edge.

Figure 107-14 demonstrates the effect of this option. In the example, a face attached to a spherical (i.e. non-planar) surface and a face attached to a planar surface share a tolerant edge. After faceting, the facet vertices lie either on the SP-curve attached to the non-planar face (the default result), or on the SP-curve attached to the planar face (using vertices_on_planar ), leading to a visible difference in the resulting facet mesh.

 

Figure 107-14 Forcing facet vertices on tolerant edges to lie on planar faces

 

Note: If both faces adjacent to a tolerant edge are planar, Parasolid cannot force the facet vertices to be on a particular face using vertices_on_planar .

107.2.20 Facet topology at singularities

You can control the topology of the facets created for any singularities in a body using the sing_topol option, which takes the following values:

 

Value

Description

PK_facet_sing_topol_default_c

The default setting for this option treats the singularity as a single vertex. Facets are created around that vertex such that all the facets share the vertex at the singularity.

PK_facet_sing_topol_degen_c

This setting treats the singularity as a surface boundary. Each facet that has an apex at the singularity has its own vertex at the singularity. Pairs of visually adjacent facets that meet at the singularity are actually separated by a degenerate (zero-width) triangular facet.

The effect of this option on a cone is illustrated in Figure 107-15.

 

Figure 107-15 Controlling the topology of a faceted cone at the singularity

 

Note: One advantage of setting facet_sing to PK_facet_sing_topol_degen_c is that it enables the facets created around a singularity to be output as a single facet strip, if you wish. This is not possible by default.

107.2.21 Facet generation on offset faces

You can control faceting on faces that are offsets of one another using the respect_offset option in PK_TOPOL_facet_mesh_2_o_t or PK_TOPOL_facet_mesh_o_t. It takes the following values:

 

Values

Description

PK_facet_respect_yes_c

Take faces that are offsets of one another into account when creating facets.

PK_facet_respect_no_c

Do not take faces that are offsets of one another into account when creating facets. This is the default.

 

Note: If set to PK_facet_respect_yes_c, faceting will attempt to reduce the likelihood that facets on these faces clash. This may result in the creation of more facets.

The following conditions apply when respect_offset is PK_facet_respect_yes_c:

 

Option

Must be set to:

Further information

density

PK_facet_density_no_view_c

Section 107.2.3

incremental_facetting

PK_facet_incr_no_c

Section 107.2.16

cull

PK_facet_cull_none_c

Section 107.2.4

107.2.22 Facet generation on bodies created at different scales

You can enlarge facets generated from bodies created at different scales using the bodies_with_scales and scale_factors options. An array of bodies whose facets you want to enlarge are supplied via bodies_with_scales . The scale to which the supplied facets are to be enlarged is supplied via scale_factors option which has the following values:

 

Values

Description

PK_scale_factor_1x_c

A scaling factor of 1 is used.

PK_scale_factor_10x_c

A scaling factor of 10 is used.

PK_scale_factor_100x_c

A scaling factor of 100 is used.

PK_scale_factor_1000x_c

A scaling factor of 1000 is used

 

Note: If topols_transfs are supplied any translation component of the transform will be applied to the facets after they have been scaled.

107.2.23 Using viewports to limit the number of facets returned

The n_viewports and viewports options allow you to return only those facets that lie on faces which overlap with at least one supplied viewport.

If n_viewports is set to 0, all facets will be returned.

 

Note: If incremental_facetting is set to anything other than PK_facet_incr_no_c, n_viewports must be set to 0.

 

[back to top]

<<< Display Tolerances Chapters Faceting Output Via GO >>>