 |
PK_CURVE_make_wire_body_2 |
|
PK_ERROR_code_t PK_CURVE_make_wire_body_2
(
--- received arguments ---
int n_curves, --- number of curves (ie,
--- length of curves and
--- bounds arrays)
const PK_CURVE_t curves[], --- curves to create a wire
--- body out of
const PK_INTERVAL_t bounds[], --- bounds of each curve
const PK_CURVE_make_wire_body_o_t *options, --- options structure
--- returned arguments ---
PK_BODY_t *const body, --- the created wire body
int *const n_new_edges, --- number of new edges
PK_EDGE_t **const new_edges, --- new edges
int **const edge_index --- pos in original array
)
This function creates a wire body from an array of curves and intervals. The
curves do not need to be ordered (unless specified otherwise) or directed.
Specific Errors:
PK_ERROR_bad_combination bad combination of options (MILD)
PK_ERROR_unsuitable_entity unsuitable curve(s) supplied (MILD)
PK_ERROR_invalid_geometry invalid geometry supplied (MILD)
PK_ERROR_bad_shared_dep dependant of entity would be illegally
shared (SERIOUS)
PK_ERROR_not_connected body is disjoint, and 'allow_disjoint' set
to PK_LOGICAL_false (SERIOUS)
PK_ERROR_crossing_edge two or more edges would cross, or more than
two edges would meet at a vertex when not
allowing a general result (SERIOUS)
PK_ERROR_bad_vertex tolerance bubbles of two vertices clash
(SERIOUS)
PK_ERROR_bad_parameter bad parameters supplied (MILD)
PK_ERROR_cant_extract_geom failed to extract geometry (SERIOUS)
See also Creating wire bodies from curves for more information.
The part of each curve required must be defined by the corresponding parametric
interval in the array 'bounds'. The wire may be closed. If 'allow_disjoint' of
the options structure is set to PK_LOGICAL_true, then disjoint bodies can be
created.
If the wire body crosses the seam of a closed curve, then the parameterisation
of the curve must be periodic (see Knot Vectors).
Orphan curves are used as the geometry of the body, otherwise a copy of each
curve that is not an orphan is used as the geometry of the body. A copy will
also be used for any curve that is located in a partition other than the
current partition, and the resultant body will be created in the current
partition.
If a curve that needs to be duplicated is supplied more than once, then it is
only duplicated once.
Normally the curves do not have to be ordered, and any pair of curves may be
used to create edges which will be connected by a common vertex in the
resultant body. The application can indicate that only consecutive curves in
the array should be connected to each other, along with the first and last
curve if it is possible to form a closed body, by setting 'sequential' in the
options structure to PK_CURVE_sequential_yes_c. This option may only be set if
'allow_disjoint' is set to PK_LOGICAL_false. This option may be useful if a
self-intersecting wire body is desired where the ends of more than two curves
meet at a particular position (though 'check' must be set to PK_LOGICAL_false
in order to create a self-intersecting body). This option will also in general
give improved performance. Note that the curves do not have to be directed
whether or not this option is used.
The number of edges in the wire body is returned. If 'want_edges' of the
options structure is set to PK_LOGICAL_true, then an array of the edges of the
new wire body will be returned in new_edges. If 'want_indices' of the options
structure is set to PK_LOGICAL_true, then an array of integers indicating the
position in the array of curves and bounds that refers to the curve and bound
used to create the corresponding edge in new_edges will be returned in
edge_index. See Mapping edges onto originating curves for more
information.
If a curve meets another curve at a position within their specified 'bounds'
intervals (but not at either end of their intervals), PK_ERROR_crossing_edge
will be returned.
If more than two curves' ends meet at the same position, and the option
'allow_general' is set to PK_LOGICAL_false, then the function returns
PK_ERROR_crossing_edge. If PK_SESSION_set_general_topology and the option
'allow_general' are set to PK_LOGICAL_true a general body is created.