internal CoordinateSystem GetCSAtParameters(double u, double v) { bool uchange = GeometryExtension.ClipParamRange(ref u); bool vchange = GeometryExtension.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); Point origin = pos.ToPoint(false, null); Vector xAxis = new Vector(SurfaceEntity.TangentAtUParameter(u, v)); Vector yAxis = new Vector(SurfaceEntity.TangentAtVParameter(u, v)); Vector zAxis = xAxis.Cross(yAxis); return(CoordinateSystem.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 Point PointAtParametersCore(ref double u, ref double v, double offset) { bool uchange = GeometryExtension.ClipParamRange(ref u); bool vchange = GeometryExtension.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)) { Vector normal = new Vector(SurfaceEntity.NormalAtPoint(pt)); Vector translation = normal.Normalize().Scale(offset); IPointEntity offsetPt = pt.Add(translation); pt.Dispose(); pt = offsetPt; } return(pt.ToPoint(true, this)); }