use ShapesType for TYPE property to work properly.

This commit is contained in:
EL JABIRI Tarik 2022-08-19 22:53:11 +01:00 committed by Val Erastov
parent 3587a85341
commit a556ee4b73

View file

@ -23,7 +23,7 @@ import {
} from './constr/ANConstraints'; } from './constr/ANConstraints';
import { SketchGenerator } from './generators/sketchGenerator'; import { SketchGenerator } from './generators/sketchGenerator';
import { BoundaryGeneratorSchema } from './generators/boundaryGenerator'; import { BoundaryGeneratorSchema } from './generators/boundaryGenerator';
import { ShapesTypes, SketchTypes } from './shapes/sketch-types'; import { ShapesTypes } from './shapes/sketch-types';
import { SketchObject } from './shapes/sketch-object'; import { SketchObject } from './shapes/sketch-object';
import { Label } from 'sketcher/shapes/label'; import { Label } from 'sketcher/shapes/label';
import { import {
@ -36,7 +36,6 @@ import {
vec3_t, vec3_t,
} from '@tarikjabiri/dxf'; } from '@tarikjabiri/dxf';
import { DEG_RAD } from 'math/commons'; import { DEG_RAD } from 'math/commons';
import { Point } from './shapes/primitives';
export interface SketchFormat_V3 { export interface SketchFormat_V3 {
version: number; version: number;
@ -387,7 +386,7 @@ export class IO {
} }
svgExport() { svgExport() {
const T = SketchTypes; const T = ShapesTypes;
const out = new TextBuilder(); const out = new TextBuilder();
const bbox = new BBox(); const bbox = new BBox();
@ -510,9 +509,9 @@ export class IO {
dxf.addText(point3d(lx, ly, 0), height, obj.text); dxf.addText(point3d(lx, ly, 0), height, obj.text);
} else if ( } else if (
obj.TYPE === SketchTypes.DIM || obj.TYPE === ShapesTypes.DIM ||
obj.TYPE === SketchTypes.HDIM || obj.TYPE === ShapesTypes.HDIM ||
obj.TYPE === SketchTypes.VDIM obj.TYPE === ShapesTypes.VDIM
) { ) {
// I want to add dimensions but there is no access for them here 🤔 // I want to add dimensions but there is no access for them here 🤔
// dxf.addAlignedDim() // dxf.addAlignedDim()
@ -584,7 +583,7 @@ function BBox() {
-Number.MAX_VALUE, -Number.MAX_VALUE,
]; ];
const T = SketchTypes; const T = ShapesTypes;
this.checkLayers = function (layers) { this.checkLayers = function (layers) {
for (let l = 0; l < layers.length; ++l) for (let l = 0; l < layers.length; ++l)