Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="TParams"></typeparam>
        /// <param name="featDef"></param>
        /// <param name="dim"></param>
        /// <param name="centerPt">Point at the center of the radiam dimension (fixed point)</param>
        /// <param name="refPt">Reference point of the radial dimension (fixed point)</param>
        /// <param name="rotVec">Vector, normal to the radial dimension extension line</param>
        public static void AlignAngularDimension <TParams>(this IXCustomFeatureDefinition <TParams> featDef,
                                                           IXDimension dim, Point centerPt, Point refPt, Vector rotVec)
            where TParams : class, new()
        {
            var angle = dim.GetValue();

            var dirVec = new Vector(refPt.X - centerPt.X, refPt.Y - centerPt.Y, refPt.Z - centerPt.Z);

            var contLegLenth = dirVec.GetLength();

            var alignDir = rotVec.Cross(dirVec);

            var oppLegLength = contLegLenth * Math.Tan(angle);

            var midPt = refPt.Move(alignDir, oppLegLength);

            featDef.AlignDimension(dim, new Point[] { refPt, midPt, centerPt }, null, null);
        }
Esempio n. 2
0
        private static Point CalculateEndPoint(IXDimension dim, Point startPt, Vector dir)
        {
            var length = dim.GetValue();

            return(startPt.Move(dir, length));
        }