FUNCTION validate_countersink_radii
(* SCHEMA solid_shape_element_schema; *)
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 blind 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;
IF ((cskhole.conical_transitions[i].cone_base_radius > larger)
OR (cskhole.conical_transitions[i].cone_base_radius < smaller))
THEN RETURN(FALSE);
END_IF;
END_IF;
END;
END_IF;
END_IF;
END_REPEAT;
RETURN(TRUE);
END_FUNCTION;
Referenced By
Defintion validate_countersink_radii is references by the following definitions:
[Top Level Definitions] [Exit]Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:14:00-04:00