当前位置: 首页>>代码示例>>C#>>正文


C# Transform.OfVector方法代码示例

本文整理汇总了C#中Transform.OfVector方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.OfVector方法的具体用法?C# Transform.OfVector怎么用?C# Transform.OfVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transform的用法示例。


在下文中一共展示了Transform.OfVector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSurface

        /// <summary>
        /// Returns the surface which defines the internal shape of the face
        /// </summary>
        /// <param name="lcs">The local coordinate system for the surface.  Can be null.</param>
        /// <returns>The surface which defines the internal shape of the face</returns>
        public override Surface GetSurface(Transform lcs)
        {
           if (lcs == null || Plane == null)
               return Plane;

           // Make a new copy of the plane.
           return new Plane(lcs.OfVector(Plane.Normal), lcs.OfPoint(Plane.Origin));
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:13,代码来源:IFCPlane.cs

示例2: GetSuggestedShiftDirection

 /// <summary>
 /// In case of a Boolean operation failure, provide a recommended direction to shift the geometry in for a second attempt.
 /// </summary>
 /// <param name="lcs">The local transform for this entity.</param>
 /// <returns>An XYZ representing a unit direction vector, or null if no direction is suggested.</returns>
 /// <remarks>If the 2nd attempt fails, a third attempt will be done with a shift in the opposite direction.</remarks>
 public XYZ GetSuggestedShiftDirection(Transform lcs)
 {
    IFCPlane ifcPlane = BaseSurface as IFCPlane;
    Plane plane = (ifcPlane != null) ? ifcPlane.Plane : null;
    XYZ untransformedNorm = (plane != null) ? plane.Normal : null;
    return (lcs == null) ? untransformedNorm : lcs.OfVector(untransformedNorm);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:13,代码来源:IFCHalfSpaceSolid.cs

示例3: AddTransform

        public void AddTransform(Transform inTrans)
        {
            //m_pCurrentTransform = inTrans;

            XYZ _rot = inTrans.OfVector(XYZ.Zero);
            XYZ _pos = inTrans.OfPoint(_rot);
            double _scale = inTrans.Scale;

            m_pCurrentMesh.Position = new Vector3(_pos.X, _pos.Y, _pos.Z);
            m_pCurrentMesh.Rotation = new Vector3(_rot.X, _rot.Y, _rot.Z);
            m_pCurrentMesh.Scale = _scale;
        }
开发者ID:Ninjestra,项目名称:BoldArcRevitPlugin,代码行数:12,代码来源:FbxExporter.cs

示例4: CreateGeometryInternal

      /// <summary>
      /// Create geometry for an IfcHalfSpaceSolid.
      /// </summary>
      /// <param name="shapeEditScope">The shape edit scope.</param>
      /// <param name="lcs">Local coordinate system for the geometry, without scale.</param>
      /// <param name="scaledLcs">Local coordinate system for the geometry, including scale, potentially non-uniform.</param>
      /// <param name="guid">The guid of an element for which represntation is being created.</param>
      /// <returns>A list containing one geometry for the IfcHalfSpaceSolid.</returns>
      protected virtual IList<GeometryObject> CreateGeometryInternal(
            IFCImportShapeEditScope shapeEditScope, Transform lcs, Transform scaledLcs, string guid)
      {
         IFCPlane ifcPlane = BaseSurface as IFCPlane;
         Plane plane = ifcPlane.Plane;
         XYZ origin = plane.Origin;
         XYZ xVec = plane.XVec;
         XYZ yVec = plane.YVec;

         // Set some huge boundaries for now.
         const double largeCoordinateValue = 100000;
         XYZ[] corners = new XYZ[4] {
                lcs.OfPoint((xVec * -largeCoordinateValue) + (yVec * -largeCoordinateValue) + origin),
                lcs.OfPoint((xVec * largeCoordinateValue) + (yVec * -largeCoordinateValue) + origin),
                lcs.OfPoint((xVec * largeCoordinateValue) + (yVec * largeCoordinateValue) + origin),
                lcs.OfPoint((xVec * -largeCoordinateValue) + (yVec * largeCoordinateValue) + origin)
            };

         IList<CurveLoop> loops = new List<CurveLoop>();
         CurveLoop loop = new CurveLoop();
         for (int ii = 0; ii < 4; ii++)
         {
            if (AgreementFlag)
               loop.Append(Line.CreateBound(corners[(5 - ii) % 4], corners[(4 - ii) % 4]));
            else
               loop.Append(Line.CreateBound(corners[ii], corners[(ii + 1) % 4]));
         }
         loops.Add(loop);

         XYZ normal = lcs.OfVector(AgreementFlag ? -plane.Normal : plane.Normal);
         SolidOptions solidOptions = new SolidOptions(GetMaterialElementId(shapeEditScope), shapeEditScope.GraphicsStyleId);
         Solid baseSolid = GeometryCreationUtilities.CreateExtrusionGeometry(loops, normal, largeCoordinateValue, solidOptions);

         if (BaseBoundingCurve != null)
         {
            CurveLoop polygonalBoundary = BaseBoundingCurve.CurveLoop;

            Transform totalTransform = lcs.Multiply(BaseBoundingCurveTransform);

            // Make sure this bounding polygon extends below base of half-space soild.
            Transform moveBaseTransform = Transform.Identity;
            moveBaseTransform.Origin = new XYZ(0, 0, -largeCoordinateValue);
            totalTransform = totalTransform.Multiply(moveBaseTransform);

            CurveLoop transformedPolygonalBoundary = IFCGeometryUtil.CreateTransformed(polygonalBoundary, totalTransform);
            IList<CurveLoop> boundingLoops = new List<CurveLoop>();
            boundingLoops.Add(transformedPolygonalBoundary);

            Solid boundingSolid = GeometryCreationUtilities.CreateExtrusionGeometry(boundingLoops, totalTransform.BasisZ, 2.0 * largeCoordinateValue,
                solidOptions);
            baseSolid = IFCGeometryUtil.ExecuteSafeBooleanOperation(Id, BaseBoundingCurve.Id, baseSolid, boundingSolid, BooleanOperationsType.Intersect, null);
         }

         IList<GeometryObject> returnList = new List<GeometryObject>();
         returnList.Add(baseSolid);
         return returnList;
      }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:65,代码来源:IFCHalfSpaceSolid.cs


注:本文中的Transform.OfVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。