Пример #1
0
 private static Transform ToTransform(this IfcObjectPlacement placement)
 {
     if (placement.GetType() == typeof(IfcLocalPlacement))
     {
         var lp = (IfcLocalPlacement)placement;
         var t  = lp.ToTransform();
         return(t);
     }
     else if (placement.GetType() == typeof(IfcGridPlacement))
     {
         throw new Exception("IfcGridPlacement conversion to Transform not supported.");
     }
     return(null);
 }
Пример #2
0
        public static XbimMatrix3D ToMatrix3D(this IfcObjectPlacement objPlace)
        {
            IfcLocalPlacement lp = objPlace as IfcLocalPlacement;

            if (lp != null)
            {
                XbimMatrix3D local = lp.RelativePlacement.ToMatrix3D();
                if (lp.PlacementRelTo != null)
                {
                    return(local * lp.PlacementRelTo.ToMatrix3D());
                }
                else
                {
                    return(local);
                }
            }
            else
            {
                throw new NotImplementedException(String.Format("Placement of type {0} is not implemented", objPlace.GetType().Name));
            }
        }