Beispiel #1
0
        /// <summary>
        /// Given two adjoining RawJoin's, computer the right and left sides of a miter-ish join.
        /// </summary>
        /// <returns>The join.</returns>
        static Tuple <Vector2d, Vector2d> MiterishJoin(RawJoin rjIn, RawJoin rjOut)
        {
            var v1 = MiterishIntersect(rjIn.SideR, rjIn.AlongR, rjOut.SideR, rjOut.AlongR);
            var v2 = MiterishIntersect(rjIn.SideL, rjIn.AlongL, rjOut.SideL, rjOut.AlongL);

            return(new Tuple <Vector2d, Vector2d>(v1, v2));
        }
Beispiel #2
0
        /// <summary>
        /// Given a RawJoin, compute the corners of a square cap.
        /// </summary>
        /// <returns>The cap.</returns>
        /// <param name="rj">The RawJoin</param>
        /// <param name="multiplier">Usually -1.0 for backward or +1.0 for forward,
        /// depending on the segment being capped.</param>
        static Tuple <Vector2d, Vector2d> SquarishCap(RawJoin rj, double multiplier)
        {
            var extent = multiplier * (0.5 * (rj.SideR - rj.SideL).Length);

            return(new Tuple <Vector2d, Vector2d>(rj.SideR + rj.AlongR * extent, rj.SideL + rj.AlongL * extent));
        }