Local Ops: Generic Face Editing   

<<< Local Ops: Adding a Vertex to Topology Chapters Euler Operations >>>

Contents

[back to top]


23.1 Introduction

You may sometimes need to perform a number of different local operations to different faces in the same body. Some faces might need offsetting, while others require tapering. Blend faces may need to be reconstructed after moving other faces in the body. There are two approaches to this type of problem:

The second approach can have a number of benefits over the first:

 

Figure 23-1 Moving a blended boss feature using generic face editing

 

Figure 23-2 Performing operations without yielding invalid bodies

PK_FACE_change takes the following arguments:

 

Argument Description
n_faces 

The number of faces to change.

faces 

The faces to change.

mapping 

An array mapping operations onto faces. See Section 23.2, "Specifying operations", for details.

n_operations 

The number of different operations to perform.

operations 

The operations to perform. This is an array of PK_FACE_change_t types, and can be any combination of the following operations:

  • Blend
  • Replace
  • Transform
  • Taper
  • Offset

See Section 23.2, "Specifying operations", for details of how to specify operations.

tolerance 

A supplied tolerance.

options 

Options structure specifying options for the call. See Section 23.3, "Specifying options", for details.

[back to top]


23.2 Specifying operations

Supplied faces are mapped onto different operations using the mappings array. This array should contain the same number of elements as the faces array. Each integer in mapping indicates the operation to perform on the corresponding face in faces . This is illustrated in Figure 23-3.

 

Figure 23-3 Mapping faces onto operations

An operation in the operations array is specified using PK_FACE_change_t. This contains the following fields:

 

Field Description
op_type 

The type of operation to perform on a face. This is one of the following:

  • PK_FACE_change_type_none_c
  • PK_FACE_change_type_offset_c
  • PK_FACE_change_type_taper_c
  • PK_FACE_change_type_transform_c
  • PK_FACE_change_type_replace_c
  • PK_FACE_change_type_blend_c

The default value is PK_FACE_change_none.

op_param 

Parameters for the change operation. This field is a union of the parameters for each individual operation. See Section 23.2.1, "Operation parameters".

op_opts 

Change-specific options. This field is a union of the options for each individual operation. See Section 23.2.2, "Operation-specific options"

[back to top]

23.2.1 Operation parameters

Data for an operation is specified in the op_param field, which itself contains fields for each type of operation supported by PK_FACE_change. The op_param field is a union of any data supplied in each of these operation-specific fields.

The fields available, together with the data you can specify, are described below

 

Operation Fields Description
offset 
distance 

The offset distance for the faces.

taper 
direction 

Direction of the taper.

angle 

Angle for the taper (in radians).

n_refs 

Number of reference entities for the taper.

references 

Array of reference entities for the taper. See Section 20.2, "Reference entities", for details.

transform 
transform 

A transform to apply to the faces.

replace 
surface 

Replacement surface for the relevant face.

sense 

Orientation of surface . For a given face/surface combination, this is either:

  • PK_LOGICAL_true - the face normal with surface attached is in the same direction as the natural surface normal (as calculated by PK_SURF_eval_with_normal).
  • PK_LOGICAL_false - the face normal with surface attached is in the opposite direction to the natural surface normal (as calculated by PK_SURF_eval_with_normal).
blend 

None

Blends faces are reconstructed automatically by PK_FACE_change. No data for blend operations needs to be supplied.

[back to top]

23.2.2 Operation-specific options

The op_opts field (PK_FACE_change_opts_t) in PK_FACE_change_t contains options specific to individual operations. It is a union of all data specified in the options structures it contains. There is one options structure for each operation that PK_FACE_change can perform.

 

Note: Do not confuse these options with those described in Section 23.3, "Specifying options".

Taper options

The following taper-specific options are available in PK_FACE_change_taper_o_t:

 

Option Description
tapered_edges 

The edges from which tapered step faces are created. The surfaces on which these edges lie satisfy the taper condition. Edges that appear in this array should not also appear in the normal_edges array.

normal_edges 

The edges from which normal step faces are created. The surfaces on which these edges lie do not necessarily satisfy the taper condition. Edges that appear in this array should not also appear in the tapered_edges array.

method 

The taper method used. This can be either:

The default is PK_method_curve_c. See Section 20.4, "Taper methods" for more detail.

For more information about creating tapered surfaces, see Chapter 20, "Local Ops: Adding Draft".

Replace options

The following replace-specific options are available in PK_FACE_change_replace_o_t:

 

Option Description
merge

Control whether Parasolid merges adjacent faces that become mergeable as a result of replacing the surfaces of some faces. See Section 17.2, "Merging adjacent faces", for more information. By default, faces that become mergeable are not merged automatically.

Blend options

The following blend-specific options are available in PK_FACE_change_blend_o_t:

 

Option Description
radius

The blend radius to use when reapplying the blend. If this is 0.0 (the default), then the radius used when reapplying the blend is the same as the radius of the original blend.

[back to top]


23.3 Specifying options

You can set a number of options for PK_FACE_change using the PK_FACE_change_o_t option structure. Unlike the options described in Section 23.2.2, "Operation-specific options", the options described in this section apply to all the operations specified in the call to PK_FACE_change. The options available are described below.

 

Option Description
merge_face 

If this is PK_LOGICAL_true, then any new faces created by the call are merged with their neighbors, if this is possible. Default: PK_LOGICAL_true

allow_disjoint 

Whether or not to allow disjoint bodies in the result:

  • PK_LOGICAL_true - if the body is split as a result of the call, all the components of the body are preserved in a single disjoint body.
  • PK_LOGICAL_false - if the body is split, only one component is returned.

Default: PK_LOGICAL_false.

check_fa_fa 

Whether to check for face-face inconsistencies. This can be either:

Default: PK_check_fa_fa_yes_c.

edge_data 

Structure containing the geometry that you want the edge to have after any modeling operations specified in the call. Any edge that is adjacent to a modified face that is not in this array will have its geometry recalculated. See Section 23.3.1, "Specifying edge and vertex geometry".

vertex_data 

Structure containing the geometry that you want the vertex to have after any modeling operations specified in the call. Any vertex that is adjacent to a modified face that is not in this array will have its geometry recalculated. See Section 23.3.1, "Specifying edge and vertex geometry".

edge_help 

Structure containing edge geometry that is used in cases where the change operation results in multiple possible solutions. If several outcomes are possible, the one with the closest curve to the supplied geometry is chosen. See Section 23.3.2, "Dealing with multiple solutions".

vertex_help 

Structure containing vertex geometry that is used in cases where the change operation results in multiple possible solutions. If several outcomes are possible, the one with the closest point to the supplied geometry is chosen. See Section 23.3.2, "Dealing with multiple solutions".

[back to top]

23.3.1 Specifying edge and vertex geometry

You can use the edge_data and vertex_data fields in PK_FACE_change_o_t to specify edge and vertex data that you want to ensure is present in a body after a generic face editing operation. These fields should contain any edge geometry and vertex geometry respectively that must be part of the body after the call to PK_FACE_change has returned.

The edge_data field takes the information shown below. The default values for this type are such that no edge data is specified for the body.

 

Field Description
n_edges 

The number of edges to preserve. The edges , curves , and tolerances arrays must all be this length. Default: 0.

edges 

An array of edges to preserve. Default: NULL

curves 

An array of replacement curves attached to each edge in edges . The direction of each curve must be appropriate for the specified edges. Default: NULL.

tolerances 

An array of tolerances within which to work. A separate value is supplied for each set of edge data. Values of 0.0 indicate accurate edges. Default: NULL.

The vertex_data field takes the information shown below. The default values for this type are such that no vertex data is specified for the body.

 

Field Description
n_vertices 

The number of vertices to preserve. The vertices , positions , and tolerances arrays must all be this length. Default: 0.

vertices 

An array of vertices to preserve. Default: NULL

positions 

An array of replacement positions attached to each vertex in vertices . The direction of each curve must be appropriate for the specified edges. Default: NULL.

tolerances 

An array of tolerances within which to work. A separate value is supplied for each set of vertex data. Values of 0.0 indicate accurate edges. Default: NULL.

[back to top]

23.3.2 Dealing with multiple solutions

Sometimes a series of modeling operations yields a number of possible different solutions. You can force Parasolid to choose a particular solution by specifying help geometry to use with the topological entities that are ambiguous. The solution that is chosen is the one whose topology has attached geometry that is closest to the supplied geometry.

For PK_FACE_change, help geometry is supplied using the edge_help and vertex_help fields in PK_FACE_change_o_t. Both these fields are of the type PK_replace_help_points_t, and take the information described below:

 

Field Description
n_topologies 

The number of topological entities that you want to help modify. Default: 0

topologies 

The topological entities (edges for edge_help or vertices for vertex_help ) that you want to help modify. Default: NULL

positions 

An array of geometric help positions for the supplied topologies . The solution chosen is the one for which the geometry attached to topologies is closest to the geometry in positions .

[back to top]

<<< Local Ops: Adding a Vertex to Topology Chapters Euler Operations >>>