 |
PK_BODY_loft_vector_clamp_t |
|
struct PK_BODY_loft_vector_clamp_s
{
int n_tangents; --- number of derivative vectors (0)
const PK_VECTOR_t *tangents; --- array of derivative vectors (NULL)
int n_vertices; --- number of vertices to be clamped (0)
const PK_VERTEX_t *vertices; --- array of vertices to be clamped (NULL)
int n_magnitudes; --- number of vector magnitudes (0)
const double *magnitudes; --- array of vector magnitudes (NULL)
};
typedef struct PK_BODY_loft_vector_clamp_s PK_BODY_loft_vector_clamp_t;
This structure holds an array of derivative vectors and an optional array
of corresponding vertices where the derivative vectors are to be applied.
Used in:
PK_BODY_loft_deriv_conds_t
See Supplying derivative conditions for more information about
vector clamps.
The vector clamp structure has the following fields :
'n_tangents' The number of derivatives held in the structure. This must
equal the value of 'n_vertices', or be 1.
'tangents' An array of derivatives one for each vertex of 'vertices',
or a single vector "constant". If 'vertices' is set to
NULL, they are then taken in order to correspond with
the vertices ordered around the profile commencing with
the start vertex. Note that 'vertices' may not be set to
NULL in the case of a guide wire.
The start vertex will be understood to be the first vertex
on an open profile, and the specified start vertex on a
closed profile.
If the 'magnitudes' array is supplied, then a default value
for the derivative magnitudes is calculated, which is then
scaled according to the values in the 'magnitudes' array.
In this case, all of the entries in the 'tangents' array
must be unit vectors.
Note that for backwards compatibility purposes,
'magnitudes' may be set to NULL, which indicates that the
magnitudes of the derivatives on the resultant lofted
surface will be taken directly from the supplied tangents.
In this case, the tangents do not have to be unit vectors,
and should be supplied with respect to a parameter which:
- for a clamped start profile on a non-periodic loft
varies from 0 to 1 between the first two profiles.
- for a clamped end profile on a non-periodic loft
varies from 0 to 1 between the last two profiles.
- for a clamped intermediate profile, or the start
profile of a periodic loft, varies from 0 to 2
between the two adjacent profiles.
'n_vertices' The number of vertices where the loft derivative is given.
'vertices' An optional array of vertices where the loft derivative
is specified as the corresponding entry in 'tangents'.
Setting 'vertices' to NULL has the same effect as setting
it to be the collection of all vertices of the profile.
When specifying a vector clamp on a profile, if there are
guide wires specified for the loft, the loft derivative
along any guide wire is completely determined. Thus, those
vertices of the profile that have matches on guide wires
must not be included as entries of 'vertices'. Due to the
effect of setting it to NULL, 'vertices' must be explicitly
assigned to exclude profile vertices that have matches on
guide wires.
Similarly, when specifying a vector clamp on a guide wire,
the derivative along any profile is completely determined.
Thus, those vertices of the guide that have matches on
profiles must not be included as entries of 'vertices', and
'vertices' may not be set to NULL.
For vertices of the profile that are not specified in the
'vertices' array and do not have matches on guide wires,
the loft derivatives are interpolated from the supplied
vertex directions and guide wire directions.
'n_magnitudes' The number of vertices where the magnitude is supplied.
This should be equal to 0, 1 or 'n_tangents'.
'magnitudes' An optional array of magnitudes. If this is supplied, then
a default value for the derivative magnitudes is
calculated. The entries in 'magnitudes' specify a scaling
factor for the loft derivative at the vertex relative to
the internally determined default value. If 'n_magnitudes'
equals 1, then this indicates that all tangents should be
scaled by the single supplied magnitude.
Note that setting this field to NULL is not equivalent to
supplying an array with all the entries equal to 1;
instead it indicates to revert to the older behaviour of
taking derivative magnitudes directly from the magnitudes
of the supplied 'tangents' as described above, rather than
calculating an internal default value.
If declaring a vector clamp on a profile whose vertices
or edges touch those of an adjacent profile, a magnitude
must be supplied for each clamped vertex.
If the vector clamp is to be used in conjunction with a
face or planar clamp as a composite clamp then 'magnitudes'
must be supplied and set to 1 for all 'vertices'.
Additionally, the supplied 'tangents' must be perpendicular
to the face or planar clamp normals at all the 'vertices'.