Example #1
0
        public static List <Point3d[]> _GetTrimControlPoints(this BrepTrimList loopTrims)
        {
            loopTrims._InitThreadSafe();

            var res = new List <Point3d[]>();

            foreach (var trim in loopTrims)
            {
                var points = trim.TrimType == BrepTrimType.Singular
                    ? new[] { trim.PointAtStart, trim.PointAtEnd }
                    : trim._ToNurbsCurve().Points.Select(o => o.Location).ToArray();
                res.Add(points);
            }
            return(res);
        }
Example #2
0
        public static List <BrepTrim> _SelectNonSingularTrims(this BrepTrimList trims)
        {
            trims._InitThreadSafe();
            var res = new List <BrepTrim>();

            foreach (var trim in trims)
            {
                switch (trim.TrimType)
                {
                case BrepTrimType.Boundary:
                case BrepTrimType.Mated:
                case BrepTrimType.Seam:
                    res.Add(trim);
                    //var edgeLength = trim.Edge.GetLength();
                    //var trimLength = trim.GetLength();
                    //if (edgeLength < 0.0001)
                    //{
                    //    var nothing = 0;
                    //    // do not add very small edges
                    //}
                    //else
                    //{
                    //    trimsUnsorted.Add(trim);
                    //}
                    break;

                case BrepTrimType.Singular:
                    // nothing - dont copy singular trims
                    int i = 0;
                    break;

                default:
                    throw new Exception("Exception: class Object_BrepLoop - Not supported type in trims: " + trim.ObjectType);
                }
            }
            return(res);
        }