Beispiel #1
0
        // 带有空洞的多边形
        public static PolygonWrapperRotation Create(List <Vector2> data, bool random, List <Vector4> removeEdge = null, float scale = 4.0f) // 单位之间间隔为 1 / scale
        {
            PolygonWrapperRotation wrapper = new PolygonWrapperRotation(data);

            wrapper.Initialize(scale);
            wrapper.InitializeSegmentsBvh(removeEdge);
            if (random)
            {
                wrapper.ShuffleCenterList();
            }
            return(wrapper);
        }
Beispiel #2
0
        public static PolygonWrapperRotation Create(List <Vector2> data, List <Vector2> innerBorder, bool random, float scale = 4.0f) // 单位之间间隔为 1 / scale
        {
            PolygonWrapperRotation wrapper = new PolygonWrapperRotation(data);

            wrapper.Initialize(scale);
            wrapper.InitializeSegmentsBvh(data, innerBorder);
            if (innerBorder != null)
            {
                wrapper.RemovePointsInPolygon(innerBorder);
            }
            if (random)
            {
                wrapper.ShuffleCenterList();
            }
            return(wrapper);
        }