internal DSCoordinateSystem GetCSAtParameters(double u, double v) { bool uchange = DSGeometryExtension.ClipParamRange(ref u); bool vchange = DSGeometryExtension.ClipParamRange(ref v); // TO DO - throw a warning each time a condition above is satisfied. //throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "u or v parameter", "Surface.PointAtUVParameters")); IPointEntity pos = SurfaceEntity.PointAtParameter(u, v); DSPoint origin = pos.ToPoint(false, null); DSVector xAxis = new DSVector(SurfaceEntity.TangentAtUParameter(u, v)); DSVector yAxis = new DSVector(SurfaceEntity.TangentAtVParameter(u, v)); DSVector zAxis = xAxis.Cross(yAxis); return(DSCoordinateSystem.ByOriginVectors(origin, xAxis, yAxis, zAxis, false, true, false)); }
/// <summary> /// /// </summary> /// <param name="u"></param> /// <param name="v"></param> /// <param name="offset"></param> /// <returns></returns> internal DSPoint PointAtParametersCore(ref double u, ref double v, double offset) { bool uchange = DSGeometryExtension.ClipParamRange(ref u); bool vchange = DSGeometryExtension.ClipParamRange(ref v); // TO DO - throw a warning each time a condition above is satisfied. //throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "u or v parameter", "Surface.PointAtParameters")); IPointEntity pt = SurfaceEntity.PointAtParameter(u, v); if (!offset.EqualsTo(0.0)) { DSVector normal = new DSVector(SurfaceEntity.NormalAtPoint(pt)); DSVector translation = normal.Normalize().Scale(offset); IPointEntity offsetPt = pt.Add(translation); pt.Dispose(); pt = offsetPt; } return(pt.ToPoint(true, this)); }