|
@@ -1,6 +1,6 @@
|
|
import { SPoint } from "@persagy-web/draw/lib";
|
|
import { SPoint } from "@persagy-web/draw/lib";
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
-import { intersect, polygon, segments, combine, selectUnion, selectDifference, selectDifferenceRev} from "polybooljs";
|
|
|
|
|
|
+import { intersect, polygon, segments, combine, selectUnion, selectDifference, selectDifferenceRev } from "polybooljs";
|
|
|
|
|
|
export class generate {
|
|
export class generate {
|
|
/**
|
|
/**
|
|
@@ -10,8 +10,9 @@ export class generate {
|
|
* @param p2 第二个点 也是2条线的交点
|
|
* @param p2 第二个点 也是2条线的交点
|
|
* @param p3 第三个点
|
|
* @param p3 第三个点
|
|
* @param l 距离2条线的距离
|
|
* @param l 距离2条线的距离
|
|
|
|
+ * @return number Array(4) 两个点
|
|
*/
|
|
*/
|
|
- static getBisector(p1: SPoint, p2: SPoint, p3: SPoint, l: number) {
|
|
|
|
|
|
+ static getBisector(p1: SPoint, p2: SPoint, p3: SPoint, l: number): [number, number, number, number] {
|
|
const dy1 = p1.y - p2.y;
|
|
const dy1 = p1.y - p2.y;
|
|
const dx1 = p1.x - p2.x;
|
|
const dx1 = p1.x - p2.x;
|
|
|
|
|
|
@@ -53,8 +54,9 @@ export class generate {
|
|
* @param p1 点1
|
|
* @param p1 点1
|
|
* @param p2 点2
|
|
* @param p2 点2
|
|
* @param l 距离这条线的距离
|
|
* @param l 距离这条线的距离
|
|
|
|
+ * @return number Array(4) 两个点
|
|
*/
|
|
*/
|
|
- static getVertical(p1: SPoint, p2: SPoint, l: number) {
|
|
|
|
|
|
+ static getVertical(p1: SPoint, p2: SPoint, l: number): [number, number, number, number] {
|
|
const dy1 = p1.y - p2.y;
|
|
const dy1 = p1.y - p2.y;
|
|
const dx1 = p1.x - p2.x;
|
|
const dx1 = p1.x - p2.x;
|
|
|
|
|
|
@@ -108,6 +110,16 @@ export class generate {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 一条线生成的4个点,根据这4个点和这条线,将轮廓线排序
|
|
|
|
+ *
|
|
|
|
+ * @param [number, number, number, number]
|
|
|
|
+ * @param [number, number, number, number]
|
|
|
|
+ * @param SLine
|
|
|
|
+ * @return 轮廓线数据
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
static llll() {
|
|
static llll() {
|
|
const a = {
|
|
const a = {
|