Ejemplo n.º 1
0
        /// <summary>
        ///   Build a vector from the two pints, scale the vector with the desired value
        ///   and calculate a transformation applied on the first point to generate where
        ///   the second point should be.
        /// </summary>
        public static Point3D ScaleSegment(Point3D point1, Point3D point2, double scale)
        {
            var vector = new gpVec(point1.GpPnt, point2.GpPnt);

            vector.Scale(scale);
            var transformation = new gpTrsf();

            transformation.SetTranslation(vector);

            // Apply the transformation on the vertex
            return(new Point3D(point1.GpPnt.Transformed(transformation)));
        }