// 带有空洞的多边形 public static PolygonWrapper Create(List <Vector2> data, bool random, List <Vector4> removeEdge = null, float scale = 4.0f) // 单位之间间隔为 1 / scale { PolygonWrapper wrapper = new PolygonWrapper(data); wrapper.Initialize(scale); wrapper.InitializeSegmentsBvh(removeEdge); if (random) { wrapper.ShuffleCenterList(); } return(wrapper); }
public static PolygonWrapper Create(List <Vector2> data, List <Vector2> innerBorder, bool random, float scale = 4.0f) // 单位之间间隔为 1 / scale { PolygonWrapper wrapper = new PolygonWrapper(data); wrapper.Initialize(scale); wrapper.InitializeSegmentsBvh(data, innerBorder); if (innerBorder != null) { wrapper.RemovePointsInPolygon(innerBorder); } if (random) { wrapper.ShuffleCenterList(); } return(wrapper); }