コード例 #1
0
ファイル: Nozzle.cs プロジェクト: gjbsaiia/EyeShotSweepIssue
        public static Point3D FindCenter(ICurve[] curves)
        {
            var compCurve = new CompositeCurve(curves, 0.001, true);
            var lis       = new List <Point3D>();
            var l         = compCurve.Length();

            lis.AddRange(compCurve.GetPointsByLength(l / 69)); // nice.
            var x_mean = Math.Round(lis.Average(p => p.X), 3);
            var y_mean = 0.0;
            var z_mean = Math.Round(lis.Average(p => p.Z), 3);

            return(new Point3D(x_mean, y_mean, z_mean));
        }