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


C# Point3d类代码示例

本文整理汇总了C#中Point3d的典型用法代码示例。如果您正苦于以下问题:C# Point3d类的具体用法?C# Point3d怎么用?C# Point3d使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: XrefAttachAndInsert

        /// <summary>
        /// Attaches the specified Xref to the current space in the current drawing.
        /// </summary>
        /// <param name="path">Path to the drawing file to attach as an Xref.</param>
        /// <param name="pos">Position of Xref in WCS coordinates.</param>
        /// <param name="name">Optional name for the Xref.</param>
        /// <param name="idBtrXref">Блок внешней ссылки - BlockTableRecord</param>
        /// <returns>Whether the attach operation succeeded.</returns>
        public static bool XrefAttachAndInsert(this Database db, string path, Point3d pos, 
            out ObjectId idBtrXref, out ObjectId idBlRefXref, string name = null)
        {
            idBtrXref = ObjectId.Null;
            idBlRefXref = ObjectId.Null;
            var ret = false;
            if (!File.Exists(path))
                return ret;
            if (String.IsNullOrEmpty(name))
                name = Path.GetFileNameWithoutExtension(path);

            using (var t = db.TransactionManager.StartOpenCloseTransaction())
            {
                idBtrXref = db.AttachXref(path, name);
                if (idBtrXref.IsValid)
                {
                    var ms = (BlockTableRecord)t.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite);
                    var br = new BlockReference(pos, idBtrXref);
                    idBlRefXref = ms.AppendEntity(br);
                    t.AddNewlyCreatedDBObject(br, true);
                    ret = true;
                }
                t.Commit();
            }
            return ret;
        }
开发者ID:vildar82,项目名称:AcadLib,代码行数:34,代码来源:XRefExt.cs

示例2: Point3d

 public Point3d(Point3d vec_in)
 {
     this.f_x = vec_in.x;
     this.f_y = vec_in.y;
     this.f_z = vec_in.z;
     this.f_mag = vec_in.mag;
 }
开发者ID:ItEndsWithTens,项目名称:Quinstance,代码行数:7,代码来源:Quin3d.cs

示例3: AddLinearDimension2

  public static Rhino.Commands.Result AddLinearDimension2(Rhino.RhinoDoc doc)
  {
    Point3d origin = new Point3d(1,1,0);
    Point3d offset = new Point3d(11,1,0);
    Point3d pt = new Point3d((offset.X-origin.X)/2,3,0);

    Plane plane = Plane.WorldXY;
    plane.Origin = origin;

    double u,v;
    plane.ClosestParameter(origin, out u, out v);
    Point2d ext1 = new Point2d(u, v);

    plane.ClosestParameter(offset, out u, out v);
    Point2d ext2 = new Point2d(u, v);

    plane.ClosestParameter(pt, out u, out v);
    Point2d linePt = new Point2d(u, v);

    LinearDimension dimension = new LinearDimension(plane, ext1, ext2, linePt);
    if (doc.Objects.AddLinearDimension(dimension) != Guid.Empty)
    {
      doc.Views.Redraw();
      return Rhino.Commands.Result.Success;
    }
    return Rhino.Commands.Result.Failure;
  }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:27,代码来源:ex_addlineardimension2.cs

示例4: PolyLine3d

 public PolyLine3d(Point3d p1, Point3d p2, Color clr)
 {
     m_points = new ArrayList();
     m_color = clr;
     m_points.Add(p1);
     m_points.Add(p2);
 }
开发者ID:rotteman2,项目名称:UVDLPSlicerController,代码行数:7,代码来源:PolyLine3d.cs

示例5: Init

        public bool Init(ObjectId id, Point3d pt)
        {
            Database db = HostApplicationServices.WorkingDatabase;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                try
                {
                    m_Pos = id;

                    RebarPos pos = tr.GetObject(m_Pos, OpenMode.ForRead) as RebarPos;
                    if (pos == null)
                    {
                        return false;
                    }

                    txtPosMarker.Text = pos.Pos;

                    hit = pos.HitTest(pt);
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message, "RebarPos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return false;
                }
            }

            return true;
        }
开发者ID:oozcitak,项目名称:RebarPos,代码行数:28,代码来源:EditDetachedPosForm.cs

示例6: Movil

 //
 public Movil(ref ObjectId line, ref ObjectId mobile, double minSeparation, double maxSeparation, bool loopTravel)
 {
     this.line = line;
     this.mobile = mobile;
     this.dPromMin = minSeparation;
     this.dPromMax = maxSeparation;
     this.loopTravel = loopTravel;
     this.goal = false;
     this.ruta = Lab3.DBMan.OpenEnity(line) as Polyline;
     this.bloque = Lab3.DBMan.OpenEnity(mobile) as BlockReference;
     this.bloqueCentro = new Point3d((bloque.GeometricExtents.MinPoint.X +
                      bloque.GeometricExtents.MaxPoint.X) / 2,
                      (bloque.GeometricExtents.MinPoint.Y +
                      bloque.GeometricExtents.MaxPoint.Y) / 2,
                      0);
     this.numeroSegmentos = this.ruta.NumberOfVertices - 1;
     this.segmentoActualIndex = 0;
     this.segmentoActual = this.ruta.GetLineSegment2dAt(segmentoActualIndex);
     Lab3.DBMan.UpdateBlockPosition(new Point3d(this.segmentoActual.StartPoint.X, this.segmentoActual.StartPoint.Y, 0), mobile);
     //
     AttributeManager attribute = new AttributeManager(mobile);
     attribute.SetAttribute("Velocity", this.velocity+" [Kms/hr]");
     //
     this.pointActualCurve = 0;
     this.velocityScale = 0.00001f;
     this.velocity = this.UpdateDireccion();
     Lab3.DBMan.UpdateBlockRotation(new Vector2d(this.velocity.X, this.velocity.Y).Angle, this.mobile);
 }
开发者ID:JOndarza,项目名称:CAD,代码行数:29,代码来源:Movil.cs

示例7: BWCad12

 public BWCad12(Transaction trans, short barNumber, double scale, short barAmount, short tierAmount, double barDiameter,
     double spanStep, Point3d barPoint1, Point3d barPoint2, Point3d spanPoint1, Point3d spanPoint2,
     Point3d descriptionSignPoint, double descriptionSignRotation, bool adaptate)
 {
     InitializeBWCad12(trans, barNumber, scale, barAmount, tierAmount, barDiameter, spanStep, barPoint1,
         barPoint2, spanPoint1, spanPoint2, descriptionSignPoint, descriptionSignRotation, adaptate);
 }
开发者ID:anielii,项目名称:Acommands,代码行数:7,代码来源:BWCad12.cs

示例8: checkIfOnLine

 private bool checkIfOnLine(Point3d pt1, Point3d pt2, Point3d pttested)
 {
     double num = pttested.DistanceTo(pt1);
     double num2 = pttested.DistanceTo(pt2);
     double num3 = pt1.DistanceTo(pt2);
     return ((num + num2) > num3);
 }
开发者ID:panhao4812,项目名称:MeshClassLibrary,代码行数:7,代码来源:MeshConvexHull.cs

示例9: AngleBetweenTwoTriangles

 public static double AngleBetweenTwoTriangles(Point3d A, Point3d B, Point3d M, Point3d N)
 {
     return AngleBetweenTwoVectors(
         M - ClosestPointOnLine(M, A, B),
         N - ClosestPointOnLine(N, A, B)
         );
 }
开发者ID:GeneKao,项目名称:Pavilion2015_ITECH,代码行数:7,代码来源:Utils.cs

示例10: EffectObject

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public EffectObject()
        {
            Children = new EffectCollection(this);
            Scenario = new Scenario();
            LocalTransform = new Matrix44d();
            BaseScale = new Point3d(1.0, 1.0, 1.0);
            Scale = new Point3d(1.0, 1.0, 1.0);
            Opacity = 1.0;
            //Transform = new Matrix44d();
            InheritedOpacity = 1.0;

            // 値をForeverにすると、子要素があってもなくてもオブジェクトが
            // 終了しなくなります。
            // また0にすると最初のフレームでオブジェクトが破棄されてしまうため、
            // 初期化の仕方によってはDurationの設定に失敗することがあります。
            // そのため、ここでは非常に小さいけれど0より大きい値を設定しています。
            Duration = TimeSpan.FromSeconds(0.001);

            this.AddPropertyChangedHandler("Parent", (_, __) =>
            {
                OnDataContextChanged(true);
                UpdateInheritedOpacity();
            });
            this.AddPropertyChangedHandler("BasePath", (_, __) =>
                OnBasePathChanged(BasePath));
            this.AddPropertyChangedHandler("DataContext", (_, __) =>
                OnDataContextChanged(false));
            this.AddPropertyChangedHandler("Opacity", (_, __) =>
                UpdateInheritedOpacity());

            lock (instanceList)
            {
                instanceList.Add(new WeakReference(this));
            }
        }
开发者ID:leontius,项目名称:Ragnarok,代码行数:38,代码来源:EffectObject.cs

示例11: SolveInstance

        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            Point3d supportPt = new Point3d();
            DA.GetData(0, ref supportPt);

            bool isXFixed = true;
            DA.GetData(1, ref isXFixed);

            bool isYFixed = true;
            DA.GetData(2, ref isYFixed);

            bool isZFixed = true;
            DA.GetData(3, ref isZFixed);

            double weight = 1.0;
            DA.GetData(4, ref weight);

            //Warning if no direction is fixed
            if (!isXFixed && !isYFixed && !isZFixed)
            {
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "The specified point is free to move!");
            }


            //Create simple support goal
            GoalObject support = new SupportGoal(supportPt, isXFixed, isYFixed, isZFixed, weight);


            //Output
            DA.SetData(0, support);
        }
开发者ID:CecilieBrandt,项目名称:K2Engineering,代码行数:36,代码来源:Support.cs

示例12: GetValue

    private float GetValue(Point3d pt, double minX, double maxX, double minY, double maxY)
    {
      int x = (int)Util.Number.Map(pt.X, minX, maxX, 0, bitmap.Width - 1, false);
      int y = (int)(bitmap.Height - Util.Number.Map(pt.Y, minY, maxY, 0, bitmap.Height - 1, false));

      Color color = crossed ? Color.White : Color.Black;

      if (vehicle.Environment.Wrap)
      {
        if (x < 0)
        {
          x += bitmap.Width;
        }
        else if (x >= bitmap.Width)
        {
          x -= bitmap.Width;
        }
        if (y < 0)
        {
          y += bitmap.Height;
        }
        else if (y >= bitmap.Height)
        {
          y -= bitmap.Height;
        }
      }

      if ((0 <= x && x < bitmap.Width) && (0 <= y && y < bitmap.Height))
      {
        color = bitmap.GetPixel(x, y);
      }

      return color.GetBrightness();
    }
开发者ID:lxfschr,项目名称:Quelea,代码行数:34,代码来源:SenseImageForceComponent.cs

示例13: Point3d

 public Point3d(Point3d p)
 {
     this.X = p.X;
     this.Y = p.Y;
     this.Z = p.Z;
     Index = p.Index;
 }
开发者ID:EvgenyKarataev,项目名称:Two-variables-graph,代码行数:7,代码来源:Point3d.cs

示例14: InsertBlockReference

 /// <summary>
 /// 在AutoCAD图形中插入块参照
 /// </summary>
 /// <param name="spaceId">块参照要加入的模型空间或图纸空间的Id</param>
 /// <param name="layer">块参照要加入的图层名</param>
 /// <param name="blockName">块参照所属的块名</param>
 /// <param name="position">插入点</param>
 /// <param name="scale">缩放比例</param>
 /// <param name="rotateAngle">旋转角度</param>
 /// <param name="attNameValues">属性的名称与取值</param>
 /// <returns>返回块参照的Id</returns>
 public static ObjectId InsertBlockReference(this ObjectId spaceId, string layer, string blockName, Point3d position, Scale3d scale, double rotateAngle)
 {
     DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
     ObjectId blockRefId;
     Database db = spaceId.Database;
     BlockTable bt = (BlockTable)db.BlockTableId.GetObject(OpenMode.ForRead);
     if (!bt.Has(blockName)) return ObjectId.Null;
     BlockTableRecord space = (BlockTableRecord)spaceId.GetObject(OpenMode.ForWrite);
     BlockReference br = new BlockReference(position, bt[blockName]);
     br.ScaleFactors = scale;
     br.Layer = layer;
     br.Rotation = rotateAngle;
     ObjectId btrId = bt[blockName];
     BlockTableRecord record = (BlockTableRecord)btrId.GetObject(OpenMode.ForRead);
     if (record.Annotative == AnnotativeStates.True)
     {
         ObjectContextCollection contextCollection = db.ObjectContextManager.GetContextCollection("ACDB_ANNOTATIONSCALES");
         ObjectContexts.AddContext(br, contextCollection.GetContext("1:1"));
     }
     blockRefId = space.AppendEntity(br);
     db.TransactionManager.AddNewlyCreatedDBObject(br, true);
     space.DowngradeOpen();
     docLock.Dispose();
     return blockRefId;
 }
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:36,代码来源:ToolPanel.xaml.cs

示例15: Leader

    public static Result Leader(RhinoDoc doc)
    {
        var points = new Point3d[]
        {
          new Point3d(1, 1, 0),
          new Point3d(5, 1, 0),
          new Point3d(5, 5, 0),
          new Point3d(9, 5, 0)
        };

        var xy_plane = Plane.WorldXY;

        var points2d = new List<Point2d>();
        foreach (var point3d in points)
        {
          double x, y;
          if (xy_plane.ClosestParameter(point3d, out x, out y))
          {
        var point2d = new Point2d(x, y);
        if (points2d.Count < 1 || point2d.DistanceTo(points2d.Last<Point2d>()) > RhinoMath.SqrtEpsilon)
          points2d.Add(point2d);
          }
        }

        doc.Objects.AddLeader(xy_plane, points2d);
        doc.Views.Redraw();
        return Result.Success;
    }
开发者ID:acormier,项目名称:RhinoCommonExamples,代码行数:28,代码来源:ex_leader.cs


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