PK_ERROR_code_t PK_BODY_make_swept_body ( --- received arguments --- const PK_BODY_t profile, --- profile to sweep const PK_BODY_t path, --- path of sweep const PK_VERTEX_t path_start, --- path start vertex const PK_BODY_make_swept_body_o_t *options, --- options on sweepng --- returned arguments --- PK_BODY_tracked_sweep_r_t *const swept_body --- result swept body ) This function creates a sheet or solid body by sweeping a wire or sheet profile along a wire path. Specific Errors: PK_ERROR_bad_type Either of the profile or path is of the incorrect type. PK_ERROR_bad_twist_law The data handed in for the twist law could not be made to represent a valid twist law. PK_ERROR_bad_scale_law The data handed in for the scale law could not be made to represent a valid scale law. PK_ERROR_bad_value An unrecognised token was passed to request the level of attempted simplification, or the value passed to specify the alignment of the profile with respect to the path was not recognised PK_ERROR_sweep_failed PK_BODY_make_swept_body suffered an internal algorithmic failure Introduction This function creates sheet or solid bodies from wire or sheet profiles by sweeping them along a specified wire path. The wire or sheet profile is supplied in the profile argument and it is swept along the wire path specified in path. The shape and structure of the swept body can be modified via the following controls within the option structure : o Twist and scale transformations o Profile alignment o Sweep improvement o Geometry simplification o Topological structure The user is informed of the result of the sweep operation via a returned results structure which contains the resultant swept body, tracking and error information. Profile Specification The type of body (sheet or solid) created by this function depends on the type of body (wire or sheet) used to define the profile for the sweep. Wire Profiles If a wire body is specified as the sweep profile, the resulting body will be a sheet body. The following points need to be considered when specifying a wire profile : o The wire profile must be oriented (PK_EDGE_propagate_orientation may be used to achieve this). o The wire profile must only represent a single wire; disjoint wire profiles are not permitted. o The faces of the sheet body will be constructed so that the outward normal is aligned with the cross product of : o The tangent in the direction of the profile orientation. o The tangent along the path in the direction of its orientation. o The input wire profile will not be modified or deleted by the sweep operation. None of the received wire profile topology, nor its geometry, is incorporated into the resultant sheet body. Sheet Profiles If a sheet body is specified as the sweep profile, the resulting body will be a solid body. The following points need to be considered when specifying a sheet profile : o The sheet profile can have more than one laminar boundary, but must not be disjoint. o The input sheet profile will not be modified or deleted by the sweep operation. Note for the following types of sweep path : o Open path : The resultant swept solid will be capped at the start and end with the necessary parts of transformed copies of the sheet profile body. o Closed path : The resultant swept solid will not contain any of the sheet profile topology or its geometry. Path Specification The sweep path body must be a wire body. The following points need to be considered when specifying a wire body for the sweep path : o The sweep path is expected to be a manifold connected wire that is oriented (by use of PK_EDGE_propagate_orientation if necessary). o The sweep path need not be G1 continuous. At non-G1 vertices the resultant swept body will have mitred corners. o The sweep path must not contain any tolerant vertices. o The start of the sweep operation is determined by the vertex specified in the path_start argument. For an open path, the path_start argument need not be supplied, in which case the first vertex on the wire body will be taken as the sweep path's start vertex. o It is an error to specify a wire path that is a single ring edge with no vertices. Sweep Shape Controls The shape of the resultant swept body can be modified via the shape controls within the function's option structure. Profile Alignment When sweeping the profile along the path, its orientation may either; be held constant, or vary along the sweep by maintaining a fixed relationship with the tangent on the sweep path. The choice is made through the alignment field of the structure passed to the received options argument. This field should be set to one of the following values o PK_BODY_sweep_alignment_parallel_c, selects constant orientation o PK_BODY_sweep_alignment_normal_c, the default, selects varying orientation The alignment control is applied to the profile prior to any application of a transformation implied by scale or twist laws ( see below ). Sweep Improvement The behaviour of the sweep along the path can be enhanced by setting the fair field. Selecting the appropriate option will mean that certain characteristics of the path that would lead to undesirable properties in the resultant body are ignored by Parasolid. This field should be set to one of the following values: o PK_BODY_sweep_fair_no_c, the default, the method is not improved. o PK_BODY_sweep_fair_twist_c, in regions where the swept profile would rapidly twist around the path, or where the path is near planar, the sweep will avoid unnecessary twisting. It is recommended that applications use the PK_BODY_sweep_fair_twist_c option for best results. Twist and Scale Controls Variation from a simple sweep of a fixed profile is enabled by controlling : o Angles of rotation about the path tangent at the point on the path (twist) in radians. o Scale magnifications about the point on the path. Twist and scale controls may only be supplied with G1 continuous paths. Twist Control Twist is specified via the twist field of the function's option structure. The twist is specified as a rotation transformation of the profile about the tangent lines of the path. The twist may be applied by providing either of the following : o A set of radian angular values to be interpolated at each vertex on the path. A constant or linear interpolated twist between the start and end vertices can be achieved via this control. See the PK_BODY_sweep_law_discrete_t documentation for more details. o A 1-D twist law function parameterised [0,1] proportionally to the arc length of the path (e.g. evaluating it at t = 0.5 should produce the angle to be rotated through by the profile half way along the path). Scale Control Scale is specified via the scale field of the function's option structure. Scaling the size of the profile may be applied by providing either of the following : o A set of scale values to be interpolated at each vertex on the path. The scale values specified via this control must always be positive. A constant or linear interpolated scaling between the start and end vertices can be achieved via this controls. See the PK_BODY_sweep_law_discrete_t documentation for more details. o A 1-D scale law function parameterised [0,1] proportionally to the arc length of the path ( e.g. evaluating it at t = 0.5 should produce the scale to be applied to the profile half way along the path ). The scale law must always evaluate to positive values. In specifying these twist and scale controls it should be remembered that all sweeps are carried out making appropriate transformations on the profile about the appropriate location on the path. Scale transformations will consequently produce variations in the distance of the profile from the path as well as variations in its size. Twist transformations will similarly cause rotations of the whole profile around the path, producing corkscrew like sweeps where the profile isn't pierced by the path. Swept Body Structure Controls The structure of the resultant swept body can be modified via controls within the function's option structure. Topological Structure of Swept Body The topological structure of the resultant swept body may be controlled via the topology_form field within the option structure. The field may be set to one of the following values : o PK_BODY_topology_minimal_c: (default) The swept body will have the minimum number of faces possible. Profile edges which meet smoothly may be swept into a single face. o PK_BODY_topology_columns_c: The swept body will have one set of faces for each edge in the profile regardless of whether they are smoothly connected. o PK_BODY_topology_grid_c: The swept body will have one face for each pair of profile and path edges. Geometry Simplification The simplification of the geometry of individual swept faces may be attempted, depending on the value of the simplify field within the option structure. The field may be set to one of the following values : o PK_BODY_simplify_no_c: B-spline geometry will be used to represent the sweep of all sections of the profiles. o PK_BODY_simplify_yes_c (default): The swept surfaces may be replaced where the combination of sweep profile and path edge geometries produces an analytic simplification of the sweep. If the surface of a face is simplified, the edges of the face may be simplified as well. Nominal Geometry on the Swept Body The resultant swept body will always have nominal geometry enabled. The state of the nominal geometry flag on the resultant swept body can be enquired and set via PK_BODY_ask_curve_nmnl_state and PK_BODY_set_curve_nmnl_state respectively. The edges in the resultant swept body which are copied from transformed versions of the input profile will have nominal geometry associated with them. The edges formed as a result of the sweeping operation (lateral edges) may have nominal geometry associated with them. The nominal geometry for an edge may be acquired via the functions, PK_EDGE_ask_curve_nmnl and PK_EDGE_ask_geometry_nmnl. Returned Tracking and Error Information The resultant swept body is returned in swept_body as a structure that packages it with associated status and tracking information. The status information, in the status field of the returned structure, is itself a structure that contains information on any failure to create the swept body. The type of fault that occurred is indicated by the fault field. The location of the fault is given by a point and topology in the fault_location and fault_topol fields respectively. The tracking information relates topology prior to the operation, to topology after it. Details of the structure of this information is given in the documentation on PK_TOPOL_track_r_t. The tracking information will relate faces in the resultant body to faces and edges in the received profile and path bodies. The tracking records contain : o for a lateral face generated by sweeping an edge : product_topols is an array containing that lateral face original_topols is the set of edges in the profile and path from which it was generated. Where the lateral face results from mitring a corner the path topology will be the corresponding non-G1 vertex. o for a face in an end cap copied from a sheet profile : product_topols is an array containing that end face original_topols is an array holding the single face in the original profile for which it is a transformed copy, and the corresponding start or end vertex on the path. Topologies involved in many topological operations may appear in several tracking records. In particular, where several product topologies arise from the same original topologies these products will be grouped together in a single track record.