FUNCTION validate_countersink_radii
(cskhole : solid_with_stepped_round_hole_and_conical_transitions) : BOOLEAN;
LOCAL i,j : INTEGER; n : INTEGER := 1 + cskhole\solid_with_stepped_round_hole.segments; smaller, larger : positive_length_measure; END_LOCAL;
REPEAT i := 1 TO SIZEOF(cskhole.conical_transitions);
-- First check whether transition i applies TO the entry OF the hole OR -- the exit OF a through hole - those cases only need TO be checked FOR -- the sign OF the cone apex angle.
IF (((cskhole.conical_transitions[i].transition_number = 1) AND (cskhole.conical_transitions[i].cone_apex_angle < 0)) XOR ((cskhole.conical_transitions[i].transition_number = n) AND (cskhole.conical_transitions[i].cone_apex_angle > 0))) THEN RETURN(FALSE); ELSE IF ((cskhole.conical_transitions[i].transition_number <> 1) AND (cskhole.conical_transitions[i].transition_number <> n)) THEN
-- FOR all remaining transitions, check that the cone base radius -- lies IN the range OF validity.
BEGIN j := cskhole.conical_transitions[i].transition_number; IF cskhole\solid_with_stepped_round_hole.segment_radii[j] > cskhole\solid_with_stepped_round_hole.segment_radii[j-1] THEN BEGIN IF (cskhole.conical_transitions[i].cone_apex_angle > 0) THEN RETURN(FALSE); END_IF; larger := cskhole\solid_with_stepped_round_hole.segment_radii[j]; smaller := cskhole\solid_with_stepped_round_hole.segment_radii[j-1]; END; ELSE BEGIN IF (cskhole.conical_transitions[i].cone_apex_angle < 0) THEN RETURN(FALSE); END_IF; larger := cskhole\solid_with_stepped_round_hole.segment_radii[j-1]; smaller := cskhole\solid_with_stepped_round_hole.segment_radii[j]; END; END_IF; IF ((cskhole.conical_transitions[i].cone_base_radius > larger) OR (cskhole.conical_transitions[i].cone_base_radius < smaller)) THEN RETURN(FALSE); END_IF; END; END_IF; END_IF; END_REPEAT; RETURN(TRUE); END_FUNCTION; -- validate_countersink_radii
|