Wire Modeling   

<<< Introduction To Sheets and Wires Chapters Sheet Modeling >>>

Contents

[back to top]


44.1 Introduction

Parasolid provides some specific functionality for modeling operations which can be applied to wire bodies, and for creating wire bodies from other entities:

 

Related Topics:

[back to top]


44.2 Creating faces to fit wire bodies

Given a closed wire body, it is possible to create a face whose boundary contains the edges of the wire body using PK_EDGE_make_faces_from_wire. This is the reverse operation to piercing the face on a single-faced sheet. The new face created does not have a surface attached, but one may be attached using either PK_FACE_attach_surfs or PK_FACE_attach_surf_fitting.

This function allows faces with holes or bodies with separate profiles to be created. Each loop in a new face is created from a closed loop of edges in the wire body and the function allows you to specify how many faces are created and the sense of each loop with respect to the edges.

The wire body becomes a sheet body if there are no wire-frame edges remaining, otherwise it becomes a general body.

[back to top]


44.3 Blending vertices on wire bodies

The blending of vertices in a wire body is done by PK_VERTEX_make_blend, and the principles are exactly the same as for blending vertices of sheet bodies.

See Section 45.4.1, “Blending vertices on sheet bodies”, for details of this operation.

[back to top]


44.4 Offsetting planar wire bodies

You can offset a planar wire body in the plane in which it lies using PK_BODY_offset_planar_wire, producing a new wire body. The body can be offset either inwards or outwards, as shown in Figure 44-1.

 

Figure 44-1 Various offsets of a wire body

 

Note: This functionality does not support facet geometry.

To create a new body, edge curves are offset by the specified distance, and any gaps created as a result of splitting vertices are filled. PK_BODY_offset_planar_wire provides the following options to let you control the result:

 

Option

Description

gap_fill
constrained_gap_fill
gap_fill_angle

A group of options that let you control how the gaps created from split vertices are filled. See Section 44.4.1, “Controlling how gaps between vertices are filled”, for information.

local_check

Whether to perform local checks.

tolerance

A tolerance for converting curves. See Section 44.4.2, “Return information for offset wire bodies”, for information.

repair_self_int

Whether to repair self-intersecting bodies. If this is PK_LOGICAL_true, any edge pairs that still intersect after offsetting, are trimmed back to the intersection. Figure 44-2 shows an example of this.

allow_disjoint

Whether return bodies may be disjoint. Figure 44-2 shows an example of a disjoint result.

 

Figure 44-2 Fixing self-intersecting offsets and returning disjoint bodies

For examples of this functionality, see the code example in the C++\Code Examples\Modelling\Offset Planar Wire folder, located in example_applications in your Parasolid installation folder.

44.4.1 Controlling how gaps between vertices are filled

When a wire body is offset, vertices on the original body may be split, introducing gaps in the resulting offset body. Parasolid provides a number of options that let you control how those gaps are filled.

Parasolid provides several methods for filling gaps. You use the PK_VERTEX_gap_fill_t datatype to choose between the following:

For each call to PK_BODY_offset_planar_wire, you can use up to two of these methods, using the gap_fill and constrained_gap_fill options.

You control which method is used at each split vertex in the body using the gap_fill_angle option. This option takes a double constraint that defines an angular interval in radians:

Figure 44-3 illustrates how you can use these options to produce an offset wire body that combines two different gap fill methods within a single result body.

 

Figure 44-3 Combining different gap fill methods using angle constraints

For more information on how to use double constraints, see Section 64.7, “Constraining identification of details”.

44.4.2 Return information for offset wire bodies

PK_BODY_offset_planar_wire returns information pairing the edges of the new offset wire body with their originating edges or vertices (in the case of new edge segments), using the standard data structure PK_TOPOL_track_r_t.

The geometry of a new edge is only of the same type as the geometry of the original edge if it was originally a line or circular edge; otherwise it is generated approximately. You can use the tolerance option to control this approximation. Depending on the value of repair_self_int , edges may be split to avoid self-intersecting offsets.

[back to top]


44.5 Edge orientation on wire bodies

The direction of the edges of a wire body can be changed with the following functions:

 

Function

Description

PK_EDGE_reverse_2

reverses an edge and its associated geometry (this function also supports sheet, solid and general bodies)

PK_EDGE_propagate_orientation

orientates all the edges of a wire body in the same direction as a given edge

[back to top]


44.6 Splitting a wire body

PK_VERTEX_remove_edge can be used to split a wire body into two bodies.

The function takes a vertex and an edge to be separated, and adds a new vertex to the end of the edge, introducing a cut into the body. If the body is a wire body, and if it is split into two pieces as a result of being cut at the vertex, a new body is created.

[back to top]


44.7 Creating wire bodies from curves

PK_CURVE_make_wire_body_2 creates a wire body from an array of curves. The wire body that is created can be open or closed, and may be disjoint. This function receives and returns the following arguments:

 

Received

Description

curvesn_curves

An array of curves used to make a wire body, together with the number of those curves. If any supplied curves come from a partition other than the current partition, then a copy of that curve is used.

Note: The supplied curves cannot be 2D B-curves.

bounds

An array of intervals. Each interval describes the bound for the corresponding curve in curves .

options

A set of options. See Section 44.7.2, “Specifying options”.

 

Returned

Description

body

The wire body. This is always returned in the current partition, even if some of the received curves come from a different partition.

n_new_edges

The number of edges in the body.

new_edges

An array of the edges in the wire body. Returning this information can be controlled using want_edges . See Section 44.7.2, “Specifying options”.

edge_index

An array of length n_new_edges that maps edges in new_edges to the curves in curves from which they were created. See Section 44.7.1, “Mapping edges onto originating curves”.

If any of the supplied curves contain discontinuities, a new edge is created for each continuous section of the curve. Curves are never joined together to form a single edge.

 

 

Note: The order that edges are returned in the new_edges array is undefined.

44.7.1 Mapping edges onto originating curves

The edge_index array returns information about which curves in the received curves array were used to create each edge in the resulting body. This is illustrated in Figure 44-4.

 

Figure 44-4 Mapping supplied curves to returned edges

In Figure 44-4, a wire body containing 4 edges has been created from an array of 2 curves, one of which contains 2 discontinuities. The value of edge_index for this wire body is [0, 1, 1, 1].

Returning this information is controlled using want_indices . See Section 44.7.2, “Specifying options”.

44.7.2 Specifying options

You can set a number of options using the associated PK_CURVE_make_wire_body_o_t options structure, as follows:

 

Option

Description

tolerance

The maximum separation allowed between two curves that are to be connected. Default: 1.0e-6.

allow_disjoint

Whether disjoint bodies can be created. If this is PK_LOGICAL_false, then PK_CURVE_make_wire_body_2 fails with error PK_ERROR_not_connected if you pass a set of curves that would result in a disjoint body. Default: PK_LOGICAL_true.

allow_general

Whether general wire bodies can be created. If this is PK_LOGICAL_true and general topology is enabled (PK_SESSION_set_general_topology), a general wire body is created. Default: PK_LOGICAL_false.

check

Whether to check the created body for errors. Default: PK_LOGICAL_true.

want_edges

Whether to return the edges of the returned body in new_edges . Default: PK_LOGICAL_false.

want_indices

Whether to return index information that maps edges in the returned new_edges array to the curves they correspond to in the received curves array. Default: PK_LOGICAL_false.

sequential

Whether the received curves have been supplied to PK_CURVE_make_wire_body_2 in the correct sequence. If PK_CURVE_sequential_yes_c, the function assumes that you have supplied the curves in the sequence that they should be connected. It only attempts to connect consecutive curves, with the exception of the first and last curves, which are also connected if possible, thus forming a closed body. This improves performance, and is particularly useful if more than two curves meet at the same position.

You should not use this option if allow_disjoint is PK_LOGICAL_true.

Default: PK_CURVE_sequential_no_c.

[back to top]


44.8 Creating wire bodies from edges

PK_EDGE_make_wire_body creates a wire body from an array of edges. The supplied edges can come from a number of different parts, but they must not intersect or coincide to any degree. This function receives and returns the following arguments:

 

Received

Description

edges
n_edges

An array of edges used to create a wire body, together with the number of edges. Edges can be passed to PK_EDGE_make_wire_body in any order.

options

A set of options. See Section 44.8.1, “Specifying options”.

 

Returned

Description

body

The wire body.

tracking

Tracking information.

PK_EDGE_make_wire_body can return a disjoint wire body if required, and can create a non-manifold body if general topology is enabled in Parasolid.

For information on how to enable the creation of general topology, see Section 15.8, “Creating general bodies”.

44.8.1 Specifying options

You can set a number of options using the associated PK_EDGE_make_wire_body_o_t options structure, as follows:

 

Option

Description

allow_disjoint

Whether disjoint bodies can be created. If this is PK_LOGICAL_false, then PK_EDGE_make_wire_body fails with error PK_ERROR_disjoint if you pass a set of edges that would result in a disjoint body. Default: PK_LOGICAL_false.

copy_dep_geom

Whether to use curve copy when creating a wire body.

  • If PK_LOGICAL_true, then curves that have dependent geometry (e.g. sp-curves, intersections) are copied into the returned body .
  • If PK_LOGICAL_false, then curves with dependent geometry are approximated in the returned body by b-curves to within the specified tolerance.

Default: PK_LOGICAL_true.

use_nmnl_geom

Whether to use nominal geometry on any of the original edges.

  • If PK_LOGICAL_true, then any nominal geometry specified on a received edge is used as the real geometry for that edge in the resulting body.
  • If PK_LOGICAL_false, any nominal geometry specified on a received edge is ignored.

If this is PK_LOGICAL_true, and copy_dep_geom is PK_LOGICAL_false, then nominal geometry is approximated and then used as the real geometry in the returned body .

Default: PK_LOGICAL_false.

tolerance

The tolerance to be used when curve approximation is turned on. Default: 1.0e-5.

 

[back to top]

<<< Introduction To Sheets and Wires Chapters Sheet Modeling >>>