Esempio n. 1
0
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            Rhino.UI.OpenFileDialog dialog = new Rhino.UI.OpenFileDialog();
            dialog.Title = "Open pointcloud file";
            dialog.ShowOpenDialog();

            Rhino.Input.Custom.OptionInteger optStep = new Rhino.Input.Custom.OptionInteger(4, 1, 1000);
            Rhino.Input.Custom.GetOption     getOpt  = new Rhino.Input.Custom.GetOption();
            getOpt.AddOptionInteger("Resolution", ref optStep);
            getOpt.SetCommandPrompt("Loading options");

            string path = dialog.FileName;

            if (!System.IO.File.Exists(path))
            {
                Rhino.RhinoApp.WriteLine("Farhino: Failed to find file...");
                return(Result.Failure);
            }

            getOpt.Get();

            Rhino.RhinoApp.WriteLine("Farhino: Step value: " + optStep.CurrentValue.ToString());
            RFContext.LoadScan(path, optStep.CurrentValue);

            return(Result.Success);
        }
Esempio n. 2
0
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            if (RFContext.Clip)
            {
                int    N        = RFContext.Cloud.Count;
                bool[] included = new bool[N];

                for (int i = 0; i < N; ++i)
                {
                    if (RFContext.ClippingBox.Contains(RFContext.Cloud[i].Location))
                    {
                        included[i] = true;
                    }
                }


                PointCloud pc = new PointCloud();

                for (int i = 0; i < N; ++i)
                {
                    if (included[i])
                    {
                        pc.Add(
                            RFContext.Cloud[i].Location,
                            RFContext.Cloud[i].Normal,
                            RFContext.Cloud[i].Color);
                    }
                }

                doc.Objects.AddPointCloud(pc);
            }
            else
            {
                doc.Objects.AddPointCloud(RFContext.Cloud);
            }

            Polyline poly = new Polyline(new Point3d[] {
                new Point3d(0, 0, 0), new Point3d(120, 0, 0),
                new Point3d(0, 100, 0), new Point3d(0, 0, 0)
            });

            poly.Transform(RFContext.Xform);
            doc.Objects.AddPolyline(poly);

            RFContext.ClearCloud();
            return(Result.Success);
        }
Esempio n. 3
0
 protected override Result RunCommand(RhinoDoc doc, RunMode mode)
 {
     RFContext.ListAllAttributes();
     return(Result.Success);
 }
Esempio n. 4
0
 public RFPlugIn()
 {
     Instance = this;
     rf       = new RFContext();
 }
Esempio n. 5
0
 protected override Result RunCommand(RhinoDoc doc, RunMode mode)
 {
     RFContext.ClearCloud();
     return(Result.Success);
 }