mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-18 22:45:48 +01:00
30 lines
No EOL
757 B
TypeScript
30 lines
No EOL
757 B
TypeScript
import {MObject} from './mobject';
|
|
import {MFace} from "./mface";
|
|
import {EntityKind} from "cad/model/entities";
|
|
import Vector from "math/vector";
|
|
import {Segment} from "cad/sketch/sketchModel";
|
|
|
|
export class MSketchObject extends MObject {
|
|
|
|
static TYPE = EntityKind.SKETCH_OBJECT;
|
|
face: MFace;
|
|
sketchPrimitive: any;
|
|
construction: boolean;
|
|
|
|
constructor(face, sketchPrimitive) {
|
|
super(MSketchObject.TYPE, sketchPrimitive.id);
|
|
this.face = face;
|
|
this.sketchPrimitive = sketchPrimitive;
|
|
this.construction = false;
|
|
}
|
|
|
|
get parent() {
|
|
return this.face;
|
|
}
|
|
|
|
toDirection(): Vector {
|
|
const tangent = (this.sketchPrimitive as Segment).tangentAtStart();
|
|
return this.face.sketchToWorldTransformation.apply(tangent);
|
|
};
|
|
|
|
} |