Sweeping Tool Bodies Along a Path   

<<< Sweeping Chapters Lofting >>>

Contents

[back to top]


39.1 Introduction

 

Note: Parasolid’s functionality to sweep a tool along a path is targeted specifically at CAM workflows. It is not intended for use as a general purpose 3D solid sweep algorithm.

With this functionality:

You can use this function to construct bodies that represent regions to be cut from a solid body using a machine tool. For example, you can create a region to be cut out using PK_BODY_make_swept_tool and then subtract this region from the solid body either using a boolean operation, as shown in Figure 39-1, or the sweep_boolean option as described in Section 39.9, “Performing boolean operations with solid tool bodies”.

 

Figure 39-1 Creating swept bodies for use in cutting out regions from a body

For examples of this functionality, see the code examples in the C++\Code Examples\Modelling\Profiling folder in your Parasolid installation folder.

 

Note: This functionality does not support facet geometry.

 

Related Topics:

39.1.1 Received and returned arguments

PK_BODY_make_swept_tool receives and returns the following arguments:

 

Received

Description

tool

A tool body that is spun about the tool_axis to form a profile for the resulting swept body. See Section 39.2, “Specifying a tool body”, for details about the form this body should take.

tool_axis

An axis about which the supplied tool is rotated in order to form a profile for the sweep operation. See Section 39.2, “Specifying a tool body” for more details.

path

A path for the sweep operation. See Section 39.3, “Specifying a path”, for details about the form this path should take.

options

A set of options. See Section 39.1.2, “Options available when sweeping tool bodies”, for details about the options available.

 

Returned

Description

tracking

A structure containing tracking information that relates topology prior to the operation to the topology that is available after it. You can control the amount of tracking information returned: see Section 39.1.2, “Options available when sweeping tool bodies” for details.

swept_tool

A structure that combines the resulting swept body together with a status structure that provides details about any faults that occurred during the sweep operation, together with their associated fault_locations and fault_entities .

39.1.2 Options available when sweeping tool bodies

PK_BODY_make_swept_tool contains an options structure that provides the following options:

 

Option

Description

tolerance

The tolerance to which entities are approximated or assumed to be coincident. Default: 1.0e-5.

allow_rationals

Whether or not rational B-surfaces may be used in the resulting body. Default: PK_LOGICAL_true

want_edge_tracking

Whether or not tracking information for edges should be returned in the tracking structure. If PK_LOGICAL_false, only tracking information for faces is returned. Default: PK_LOGICAL_false

have_lock_direction

Whether to use a lock direction for the sweep. If set to PK_LOGICAL_true, the sweep direction and the orientation of the tool are controlled by lock_direction . Default: PK_LOGICAL_false

See Section 39.4, “Sweeping along 3D paths”, for more information.

lock_direction

The direction of the lock if have_lock_direction is set to PK_LOGICAL_true.

See Section 39.4, “Sweeping along 3D paths”, for more information.

tool_site

A positioning vertex on the path that indicates the location of tool_axis .

See Section 39.5, “Positioning the tool on or off the path”, for more information.

n_cap_faces
cap_faces

An array of faces on the tool body whose precise geometry is not significant for downstream operations.

See Section 39.7, “Simplifying faces of a swept tool body”, for more information.

place_tool_on_path

Whether the tool should be placed on the path before sweeping. Default: PK_LOGICAL_true.

See Section 39.5, “Positioning the tool on or off the path”, for more information.

sweep_boolean

Specifies which boolean operation to apply to the sweep tool and target . Default: PK_sweep_boolean_none_c. See Section 39.9, “Performing boolean operations with solid tool bodies” for more information.

target

Specifies the target body to use when using a sweep_boolean operation. See Section 39.9, “Performing boolean operations with solid tool bodies” for more information.

corner_type

Specifies which type of corner to produce at non-G1 discontinuities in the path. Default: PK_sweep_corner_type_spin_c. See Section 39.8, “Specifying corner types” for more information.

have_turn_axis

Whether turn_axis is supplied. Default: PK_LOGICAL_false

See Section 39.6, “Specifying that path edges lie on a spun surface” for more information.

turn_axis

The supplied turn axis.

See Section 39.6, “Specifying that path edges lie on a spun surface” for more information.

turn_edges

The path edges to which the turn_axis applies.

See Section 39.6, “Specifying that path edges lie on a spun surface” for more information.

update

If your application uses models created using earlier versions of Parasolid, you can use the update option to help eliminate differences in rebuild results. This option lets you turn off some of the enhancements to sweeping, to ensure that you get the same results in the latest version of Parasolid as in earlier versions. See PK_swept_tool_update_t in the PK Interface Programming Reference Manual for more information on this update option.

Note: The default value is PK_swept_tool_update_default_c which uses all appropriate sweeping enhancements. Setting to a non-default value disables all appropriate sweeping enhancements.

[back to top]


39.2 Specifying a tool body

The tool supplied to PK_BODY_make_swept_tool has the following restrictions:

It does not matter where the tool is located with respect to the path . By default, PK_BODY_make_swept_tool positions the tool so that the location of the tool_axis is on the specified path before sweeping. If you do not want to move the tool onto the path , you can set place_tool_on_path to PK_LOGICAL_false. See Section 39.5, “Positioning the tool on or off the path”, for more information.

The tool_axis defines the axis about which the tool body is spun. The tool does not need to be rotationally symmetric about the tool_axis . The shape of the resultant body can vary depending on the position of the tool_axis as illustrated in Figure 39-2.

 

Figure 39-2 The effect that changing the location of the tool axis has on the result body

[back to top]


39.3 Specifying a path

The path supplied to PK_BODY_make_swept_tool:

 

Note: If you are sweeping a tool along a path and the tool is not positioned on the path; then the path must be G1 continuous. See Section 39.5, “Positioning the tool on or off the path”, for more information.

 

Figure 39-3 Forming swept bodies at G1-discontinuities on the path

 

Warning: You must not specify a wire path that consists of a single ring edge with no vertices.

[back to top]


39.4 Sweeping along 3D paths

For non-planar paths or when the tool spin axis is not orthogonal to the path, you must supply a lock_direction to specify the orientation of the swept tool. It must be a unit vector and is used if have_lock_direction is PK_LOGICAL_true. Figure 39-4 shows a cylindrical tool with a set lock_direction being swept along a 3D path.

 

Figure 39-4 Sweeping along a 3D path

 

Note: For 3D paths, the path curve cannot be an SP-curve.

The lock_direction does not have to be in the same direction as the tool_axis and their relative directions can affect the overall shape of the result. Figure 39-5 (a) shows the result when the direction of the lock_direction and tool_axis are the same, and (b) shows the result when the direction of the lock_direction is different to that of the tool_axis .

 

Note: If lock_direction is not the same as the direction of tool_axis , tool_site must be used. In addition, the edges of the path must be one of the following: an analytic curve, a C2 non-rational b-curve or a helical curve created by a Parasolid function. You cannot supply a lock_direction that is parallel to the path tangent at any interior point of the path edge unless the edge is entirely parallel to the lock_direction .

 

Figure 39-5 Difference in the shape of the result body when the direction of lock_direction is the same (a) and different (b) to the direction of tool_axis

[back to top]


39.5 Positioning the tool on or off the path

Using the place_tool_on_path option, you can choose whether or not to place the tool on the path before sweeping. When set to PK_LOGICAL_false, the tool will not be moved onto the path and will be swept from its initial position if the following conditions are met:

By default, the tool will be moved onto the path before it is swept. The results of both values are illustrated in Figure 39-6 and Figure 39-7.

 

Figure 39-6 Sweeping a tool that lies on the path

 

Figure 39-7 Sweeping a tool that lies off the path

Any vertex on the path can be used as a positioning vertex. Figure 39-8 and Figure 39-9 show how the location of the positioning vertex on the path can affect the overall shape of the resultant swept profile.

 

 

Figure 39-8 Sweeping along a path using a vertex at the start of the path as a positioning vertex

 

Figure 39-9 Sweeping along a path using a vertex in the middle of the path as a positioning vertex

 

Note: If lock_direction is not the same as the direction of tool_axis , tool_site must be used.

[back to top]


39.6 Specifying that path edges lie on a spun surface

You can use the have_turn_axis, turn_axis , and turn_edges options to specify a subset of the path that is considered to turn around the turn_axis . Specifying these options can improve the quality of the resulting swept body, for example when simulating lathing and turning operations.

If have_turn_axis is PK_LOGICAL_true:

 

Figure 39-10 Specifying the turn_edges in the sweep operation

[back to top]


39.7 Simplifying faces of a swept tool body

If there are faces on the tool body whose precise geometry is not significant for downstream operations, they can be supplied as cap_faces to enable Parasolid to generate simpler geometry for these faces. These cap faces are often used to close off the tool volume or to represent the shaft of the tool.

Figure 39-11 (a) shows a tool body sweep without cap_faces supplied. Figure 39-11 (b) shows the same tool body sweep where the faces coloured red in the tool have been supplied as cap_faces . Parasolid geometrically simplifies these cap_faces to a spherical face that is smoothly joined to the tool and the sweep operation proceeds with this remodelled tool.

Swept faces generated from cap_faces are returned in a Parasolid Report of type PK_REPORT_record_type_3_c with a status of PK_REPORT_3_sweep_tool_cap_c. This contains a PK_sweep_tool_cap_t status to indicate whether the swept tool volume is either enclosed (PK_swept_tool_cap_enclose_c) or undercut (PK_sweep_tool_cap_undercut_c) by the simplified cap geometry.

See Chapter 11, “Using Reports”, for more information about the Parasolid report mechanism.

 

Figure 39-11 Sweeping a tool body with and without supplying cap_faces

 

Note: Faces whose precise geometry is significant for downstream operations must not be supplied as cap_faces .

[back to top]


39.8 Specifying corner types

When the sweep path is not G1-continuous, you can choose to produce either a rounded or mitred corner at each sharp corner on the path using the corner_type option. By default, rounded corners are produced. When set to PK_sweep_corner_type_mitre_c, each section of the sweep is linearly extended to produce mitred corners.

 

Note: If the value is set to PK_sweep_corner_type_mitre_c, the path must be planar and lie in a plane orthogonal to the tool axis. If you are using a lock direction for the sweep, it must be parallel to the tool axis.

 

Figure 39-12 Producing rounded or mitred corners when sweeping with a tool body

[back to top]


39.9 Performing boolean operations with solid tool bodies

As discussed in Section 39.1, you can use PK_BODY_make_swept_tool to construct bodies that represent regions to be cut from a solid body and then use Parasolid’s boolean operation to subtract the specified region from the solid body. See Chapter 52, “Manifold Booleans” for more information on boolean functionality.

Alternatively, you can perform both the sweep and boolean operation in one function call, using the sweep_boolean option in PK_BODY_make_swept_tool. When simulating lathing operations for example, the volume of interest is often the volume remaining after removal of material from the target body. In these circumstances, setting the sweep_boolean option allows the complexity of the modelling operations to be reduced.

To use this functionality you must specify an appropriate target body in addition to the chosen boolean operation (either subtract or intersect) using the sweep_boolean option. This takes the following values:

 

Value

Description

PK_sweep_boolean_none_c

Do not perform a boolean operation. Default.

PK_sweep_boolean_subtract_c

Subtract the swept tool from the chosen target body to create the result body.

PK_sweep_boolean_intersect_c

Intersect the chosen target with the swept tool to create the result body.

 

Note: Only solid body targets are supported for this functionality

Figure 39-13 shows an example of this functionality. When sweep_boolean is set to PK_sweep_boolean_subtract_c the swept tool volume is subtracted from the specified target body to create a result body. When set to PK_sweep_boolean_intersect_c the specified target volume is intersected with the swept tool to create a result body

With this option, the boolean operation occurs immediately after the swept tool has been swept along its path and the swept tool returned is the target body which is the result of the boolean operation between the sweep and boolean combination.

 

Figure 39-13 Performing boolean operations with a swept tool body

[back to top]

<<< Sweeping Chapters Lofting >>>