|
@@ -206,6 +206,12 @@ export class generate {
|
|
|
* @return 简化后的轮廓线数据
|
|
|
*/
|
|
|
static simplyOutline(outline: SPoint[]): SPoint[] {
|
|
|
+ for (let i = 0; i < outline.length - 1; i++) {
|
|
|
+ if (outline[i].x - outline[i + 1].x == 0 && outline[i].y - outline[i + 1].y == 0) {
|
|
|
+ outline.splice(i, 1);
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (outline.length > 2) {
|
|
|
for (let i = 1; i < outline.length - 1; i++) {
|
|
|
if (outline[i].y - outline[i - 1].y == 0 && outline[i + 1].y - outline[i].y == 0) {
|