mxdraw 0.1.150 → 0.1.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/MxModule/MxDbSplineCurve/draw.d.ts +1 -0
- package/dist/lib/MxModule/MxDbSplineCurve/draw.js +1 -0
- package/dist/lib/MxModule/MxDbSplineCurve/index.d.ts +22 -0
- package/dist/lib/MxModule/MxDbSplineCurve/index.js +1 -0
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/mxdraw.es.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function drawMxDbSplineCurve(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function u(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,u)}a((r=r.apply(t,e||[])).next())})};import MxDbSplineCurve from".";import MrxDbgUiPrBaseReturn from"../MrxDbgUiPrBaseReturn";import MrxDbgUiPrPoint from"../MrxDbgUiPrPoint";import MxFun from"../MxFun";export default function drawMxDbSplineCurve(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint,e=new MxDbSplineCurve;t.goWhile(n=>__awaiter(this,void 0,void 0,function*(){if(n===MrxDbgUiPrBaseReturn.kOk)e.points.push(t.value()),t.setUserDraw((n,r)=>{const i=e.clone();i.points.push(n),r.drawCustomEntity(i),0===e.points.length?t.setMessage("\n指定第一个点:"):(t.setMessage("\n指定下一个点:"),t.setKeyWords("[闭合(C)/ 放弃(U)]"))});else if(n===MrxDbgUiPrBaseReturn.kKeyWord){if(t.isKeyWordPicked("C"))return e.closed=!0,{exit:!0};t.isKeyWordPicked("U")&&e.points.pop()}}),()=>{MxFun.getCurrentDraw().addMxEntity(e)})})};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbEntity from "../MxDbEntity";
|
|
3
|
+
import drawMxDbSplineCurve from "./draw";
|
|
4
|
+
export declare class MxDbSplineCurve extends MxDbEntity {
|
|
5
|
+
static draw: typeof drawMxDbSplineCurve;
|
|
6
|
+
/** 圆中心点 */
|
|
7
|
+
points: THREE.Vector3[];
|
|
8
|
+
/** 闭合 */
|
|
9
|
+
closed: boolean;
|
|
10
|
+
/** 曲线的张力 */
|
|
11
|
+
tension: number;
|
|
12
|
+
/** 曲线类型: centripetal、chordal和catmullrom */
|
|
13
|
+
curveType: string;
|
|
14
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
|
+
getGripPoints(): THREE.Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
17
|
+
create(): MxDbEntity;
|
|
18
|
+
dwgIn(obj: any): boolean;
|
|
19
|
+
dwgOut(obj: any): object;
|
|
20
|
+
getTypeName(): string;
|
|
21
|
+
}
|
|
22
|
+
export default MxDbSplineCurve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import MxDbEntity from"../MxDbEntity";import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";import drawMxDbSplineCurve from"./draw";const propertyDbKeys=["points","closed","tension","curveType"];export class MxDbSplineCurve extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.closed=!1,this.tension=.5,this.curveType="centripetal"}worldDraw(t){const e=new THREE.CatmullRomCurve3(this.points,this.closed,"catmullrom",this.tension).getPoints(15*this.points.length),r=(new THREE.Geometry).setFromPoints(e),i=new THREE.LineBasicMaterial({color:this.color}),n=new THREE.Line(r,i);t.drawEntity(n)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return this.points[t].add(e),!0}create(){return new MxDbSplineCurve}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys),t}getTypeName(){return"MxDbSplineCurve"}};MxDbSplineCurve.draw=drawMxDbSplineCurve,addRegisterMxDbEntity(MxDbSplineCurve);export default MxDbSplineCurve;
|