FUNCTION plane_angle_for_pair_in_radian

(* SCHEMA step_merged_ap_schema; *)
-- DIFF IN AP214
-- IN AP214/AP238 STEP-NC/AP242
FUNCTION plane_angle_for_pair_in_radian
      (pair : kinematic_pair;
       angle : plane_angle_measure ) : plane_angle_measure;
   LOCAL
      converted_angle : plane_angle_measure := angle;
      link_rep : kinematic_link_representation := representation_of_link(pair.joint.edge_start);
      link_cntxt : representation_context;
      pa_units : SET OF unit := [];
      pau : unit;
   END_LOCAL;
      link_cntxt := link_rep\representation.context_of_items;
      IF NOT ('STEP_MERGED_AP_SCHEMA.GLOBAL_UNIT_ASSIGNED_CONTEXT' IN TYPEOF(link_cntxt)) THEN
         RETURN (?);
      END_IF;
      pa_units := QUERY (unit <* link_cntxt\global_unit_assigned_context.units| 'STEP_MERGED_AP_SCHEMA.PLANE_ANGLE_UNIT' IN TYPEOF(unit));
      IF SIZEOF(pa_units) <> 1 THEN
         RETURN (?);
      END_IF;
      pau := pa_units[1];
      IF NOT ('STEP_MERGED_AP_SCHEMA.SI_UNIT' IN TYPEOF(pau)) AND NOT ('STEP_MERGED_AP_SCHEMA.CONVERSION_BASED_UNIT' IN TYPEOF(pau)) THEN
         RETURN (?);
      END_IF;
      REPEAT WHILE 'STEP_MERGED_AP_SCHEMA.CONVERSION_BASED_UNIT' IN TYPEOF(pau);
         converted_angle := converted_angle * pau\conversion_based_unit.conversion_factor.value_component;
         pau := pau\conversion_based_unit.conversion_factor.unit_component;
         IF NOT ('STEP_MERGED_AP_SCHEMA.SI_UNIT' IN TYPEOF(pau)) AND NOT ('STEP_MERGED_AP_SCHEMA.CONVERSION_BASED_UNIT' IN TYPEOF(pau)) OR NOT ('STEP_MERGED_AP_SCHEMA.PLANE_ANGLE_UNIT' IN TYPEOF(pau)) THEN
            RETURN (?);
         END_IF;
      END_REPEAT;
      IF pau\si_unit.name <> si_unit_name.radian THEN
         RETURN (?);
      END_IF;
      CASE pau\si_unit.prefix OF
         si_prefix.exa :
               RETURN (1.0E+018 * converted_angle);
         si_prefix.peta :
               RETURN (1.0E+015 * converted_angle);
         si_prefix.tera :
               RETURN (1.0E+012 * converted_angle);
         si_prefix.giga :
               RETURN (1.0E+009 * converted_angle);
         si_prefix.mega :
               RETURN (1.0E+006 * converted_angle);
         si_prefix.kilo :
               RETURN (1000.00 * converted_angle);
         si_prefix.hecto :
               RETURN (100.000 * converted_angle);
         si_prefix.deca :
               RETURN (10.0 * converted_angle);
         si_prefix.deci :
               RETURN (0.100000 * converted_angle);
         si_prefix.centi :
               RETURN (0.0100000 * converted_angle);
         si_prefix.milli :
               RETURN (0.00100000 * converted_angle);
         si_prefix.micro :
               RETURN (1.0E-006 * converted_angle);
         si_prefix.nano :
               RETURN (1.0E-009 * converted_angle);
         si_prefix.pico :
               RETURN (1.0E-012 * converted_angle);
         si_prefix.femto :
               RETURN (1.0E-015 * converted_angle);
         si_prefix.atto :
               RETURN (1.0E-018 * converted_angle);
      OTHERWISE :
            RETURN (converted_angle);
      END_CASE;
END_FUNCTION;

Referenced By

Defintion plane_angle_for_pair_in_radian is references by the following definitions:
DefinitionType
 convert_spatial_to_ypr_rotation FUNCTION
 screw_pair_value ENTITY
 universal_pair ENTITY


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2024-09-06T14:00:33-04:00