/// <summary>
        /// Calculate Points On Region.
        /// </summary>
        /// <returns>returns the point on region</returns>
        private IPoint3D GetPointOnRegion()
        {
            IPoint3D  pointOnRegion = new Point3D(OffsetX, OffsetY, 0.0);
            IMatrix44 matrix        = GeomOperation.GetMatrixPlane(region);

            return(matrix.TransformToGCS(pointOnRegion));
        }
Exemple #2
0
        /// <summary>
        /// Calculate relative position of point on polyline.
        /// </summary>
        /// <param name="region">region</param>
        /// <param name="point">Point</param>
        /// <param name="relativeX">Relative Position along local X axis</param>
        /// <param name="relativeY">Relative Position along local Y axis</param>
        /// <param name="toleranceLevel">Tolerance Level</param>
        /// <returns>True if point exist in polyline</returns>
        public static bool GetRelativePosition(IRegion3D region, IPoint3D point, ref double relativeX, ref double relativeY, double toleranceLevel = MathConstants.ZeroWeak)
        {
            IMatrix44 matrix     = GeomOperation.GetMatrixPlane(region);
            IPoint3D  pointInLCS = matrix.TransformToLCS(point);

            if (pointInLCS.Z.IsZero() == false)
            {
                return(false);
            }

            relativeX = pointInLCS.X;
            relativeY = pointInLCS.Y;
            return(true);
        }