FUNCTION msf_curve_check

(* SCHEMA Ap236_furniture_catalog_and_interior_design_mim_LF; *)
(* Implicit interfaced from: aic_manifold_surface *)
FUNCTION msf_curve_check (cv : representation_item) : BOOLEAN;  
 
(* This function varifies the validity of a curve in the context of a
   manifold surface model. Representation_items are
   valid input, however, they are supposed to be curves; otherwise
   this function will return false.
*)

(* complex subtypes of curve that are both bounded_curve and
   oneof conic, curve_replica, line, or offset_curve_3d are not
   valid
*)
IF SIZEOF (['AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.BOUNDED_CURVE',
  'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.CONIC',
  'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.CURVE_REPLICA', 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.LINE',
  'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.OFFSET_CURVE_3D'] * TYPEOF(cv)) > 1 THEN
  RETURN(FALSE);
END_IF;

(* b_spline_curves shall not self-intersect
 *)
IF (('AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.B_SPLINE_CURVE' IN TYPEOF (cv)) AND
  (cv\b_spline_curve.self_intersect = FALSE)OR
  (cv\b_spline_curve.self_intersect = UNKNOWN)) THEN
  RETURN(TRUE);
ELSE

  (* conics and lines are valid curve types
   *)
  IF SIZEOF (['AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.CONIC', 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.LINE'] 
    * TYPEOF (cv)) = 1 THEN
    RETURN(TRUE);
  ELSE

    (* a curve_replica shall reference a valid curve
     *)
    IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.CURVE_REPLICA' IN TYPEOF(cv) THEN
      RETURN (msf_curve_check(cv\curve_replica.parent_curve)); 
    ELSE 
 
      (* an offset_curve_3d shall not self-intersect and
         shall reference a valid curve; a polyline is not a
         valid basis_curve
       *)
      IF (('AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.OFFSET_CURVE_3D' IN TYPEOF (cv))
        AND
        ((cv\offset_curve_3d.self_intersect = FALSE) OR
        (cv\offset_curve_3d.self_intersect = UNKNOWN))
        AND
        (NOT ('AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.POLYLINE' IN TYPEOF
        (cv\offset_curve_3d.basis_curve)))) THEN
        RETURN (msf_curve_check(cv\offset_curve_3d.basis_curve)); 
      ELSE 
 
        (* a pcurve shall reference a valid curve and a valid
           basis_surface
         *)
        IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.PCURVE' IN TYPEOF(cv) THEN 
          RETURN ((msf_curve_check
          (cv\pcurve.reference_to_curve\representation.items[1])) AND
          (msf_surface_check(cv\pcurve.basis_surface)));
        ELSE 
 
          (* a surface_curve references a curve_3d and one or
             two pcurves or one or two surfaces or one of
             each; all of these references shall be valid
           *)
          IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.SURFACE_CURVE' IN TYPEOF(cv) THEN 

            (* if the curve reference is correct, check also the rest
             *)
            IF msf_curve_check(cv\surface_curve.curve_3d) THEN
              REPEAT i := 1 TO SIZEOF
              (cv\surface_curve.associated_geometry);

                (* do for one or two associated_geometrys:
                 *)
                IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.SURFACE' IN 
                  TYPEOF (cv\surface_curve.associated_geometry[i]) THEN  
                  IF NOT msf_surface_check
                    (cv\surface_curve.associated_geometry[i]) THEN  
                    RETURN(FALSE);  
                  END_IF;  
                ELSE  
                  IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.PCURVE' IN TYPEOF 
                    (cv\surface_curve.associated_geometry[i]) THEN  
                    IF NOT msf_curve_check
                      (cv\surface_curve.associated_geometry[i]) THEN 
                      RETURN(FALSE);  
                    END_IF;  
                  END_IF;  
                END_IF; 
              END_REPEAT;  
              RETURN(TRUE);
            END_IF; 
          ELSE

            (* a polyline shall have at least 3 points
             *)
            IF 'AP236_FURNITURE_CATALOG_AND_INTERIOR_DESIGN_MIM_LF.POLYLINE' IN TYPEOF(cv) THEN
              IF (SIZEOF (cv\polyline.points) >= 3) THEN RETURN (TRUE);
              END_IF;
            END_IF;
          END_IF; 
        END_IF; 
      END_IF; 
    END_IF; 
  END_IF; 
END_IF; 
(* FALSE is returned if the input parameter cv is not a valid curve.
 *)
RETURN (FALSE); 
END_FUNCTION;

Referenced By

Defintion msf_curve_check is references by the following definitions:
DefinitionType
 manifold_surface_shape_representation ENTITY
 msf_surface_check FUNCTION


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:19:03-04:00