Exemple #1
0
        public double DistanceToLinePlane(PosXYZ pos)
        {
            var plane = new PlaneParams();

            plane.Origin = Origin;
            plane.Normal = Direction.Cross(new Vector3d(1, 0, 0));

            return(plane.Point2Plane(pos));
        }
Exemple #2
0
        public static PlaneParams FitPlane(List <PosXYZ> pos)
        {
            var plane = new OrthogonalPlaneFit3(pos.Select(p => new Vector3d(p.X, p.Y, p.Z)));
            var ret   = new PlaneParams()
            {
                Normal = plane.Normal, Origin = plane.Origin
            };

            if (ret.Normal.z < 0)
            {
                ret.Normal = -ret.Normal;
            }
            return(ret);
        }