mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-14 12:23:03 +01:00
setting entity type for mObjects
This commit is contained in:
parent
0e802520be
commit
51d65fb603
7 changed files with 17 additions and 13 deletions
|
|
@ -6,8 +6,7 @@ export class MDatum extends MObject {
|
|||
static ID_COUNTER = 0; // TODO: reset the counter
|
||||
|
||||
constructor(csys) {
|
||||
super();
|
||||
this.id = 'D:' + (MDatum.ID_COUNTER++);
|
||||
super(MDatum.TYPE, 'D:' + (MDatum.ID_COUNTER++));
|
||||
this.csys = csys;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,8 +5,7 @@ export class MEdge extends MObject {
|
|||
static TYPE = 'edge';
|
||||
|
||||
constructor(id, shell, brepEdge) {
|
||||
super();
|
||||
this.id = id;
|
||||
super(MEdge.TYPE, id);
|
||||
this.shell = shell;
|
||||
this.brepEdge = brepEdge;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import Vector from 'math/vector';
|
|||
import {BasisForPlane} from '../../math/l3space';
|
||||
import {MSketchObject} from './msketchObject';
|
||||
import {EMPTY_ARRAY} from 'gems/iterables';
|
||||
import {PointOnSurface} from '../../brep/geom/pointOnSurface';
|
||||
import CSys from '../../math/csys';
|
||||
|
||||
export class MFace extends MObject {
|
||||
|
|
@ -11,8 +10,7 @@ export class MFace extends MObject {
|
|||
static TYPE = 'face';
|
||||
|
||||
constructor(id, shell, surface, csys) {
|
||||
super(id);
|
||||
this.id = id;
|
||||
super(MFace.TYPE, id);
|
||||
this.shell = shell;
|
||||
this.surface = surface;
|
||||
this.sketchObjects = [];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
|
||||
export class MObject {
|
||||
|
||||
TYPE;
|
||||
|
||||
id;
|
||||
ext = {}
|
||||
ext = {};
|
||||
|
||||
constructor(TYPE, id) {
|
||||
this.TYPE = TYPE;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ export class MShell extends MObject {
|
|||
|
||||
static ID_COUNTER = 0;
|
||||
|
||||
id = 'S:' + (MShell.ID_COUNTER++);
|
||||
constructor() {
|
||||
super(MShell.TYPE, 'S:' + (MShell.ID_COUNTER++))
|
||||
}
|
||||
|
||||
shell;
|
||||
faces = [];
|
||||
edges = [];
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ export class MSketchObject extends MObject {
|
|||
static TYPE = 'sketchObject';
|
||||
|
||||
constructor(face, sketchPrimitive) {
|
||||
super();
|
||||
this.id = sketchPrimitive.id;
|
||||
super(MSketchObject.TYPE, sketchPrimitive.id);
|
||||
this.face = face;
|
||||
this.sketchPrimitive = sketchPrimitive;
|
||||
this.construction = false;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ export class MVertex extends MObject {
|
|||
static TYPE = 'vertex';
|
||||
|
||||
constructor(id, shell, brepVertex) {
|
||||
super();
|
||||
this.id = id;
|
||||
super(MVertex.TYPE, id);
|
||||
this.shell = shell;
|
||||
this.brepVertex = brepVertex;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue