diff --git a/modules/math/l3space.ts b/modules/math/l3space.ts deleted file mode 100644 index 74130d34..00000000 --- a/modules/math/l3space.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type Vec3 = [number, number, number]; - diff --git a/modules/math/matrix.ts b/modules/math/matrix.ts index 8e48ee16..cf11c943 100644 --- a/modules/math/matrix.ts +++ b/modules/math/matrix.ts @@ -1,5 +1,5 @@ -import {Vec3} from "math/l3space"; import Vector, {AXIS} from "math/vector"; +import {Vec3} from "math/vec"; export type Matrix3x4Data = [[number, number, number, number], [number, number, number, number], [number, number, number, number]]; diff --git a/modules/math/vec.ts b/modules/math/vec.ts index 775503a9..153bb9cc 100644 --- a/modules/math/vec.ts +++ b/modules/math/vec.ts @@ -1,8 +1,10 @@ export {dotVM} from 'numeric'; +export type VectorData = number[]; +export type Vec3 = [number, number, number]; + type UnaryFn = (number) => number; type BinaryFn = (n1: number, n2: number) => number; -export type VectorData = number[]; export function scalarOperand(v: T, out: T, func: UnaryFn) { for (let i = 0; i < v.length; i++) { diff --git a/web/app/brep/geom/curves/brepCurve.ts b/web/app/brep/geom/curves/brepCurve.ts index df0b1a69..c4858706 100644 --- a/web/app/brep/geom/curves/brepCurve.ts +++ b/web/app/brep/geom/curves/brepCurve.ts @@ -1,5 +1,4 @@ import NurbsCurve from "./nurbsCurve"; -import {Vec3} from 'math/l3space' import {eqSqTol, ueq, veq, veq3, veqNeg} from "../tolerance"; import curveIntersect from "../impl/curve/curves-isec"; @@ -10,6 +9,7 @@ import cache from "../impl/cache"; import {Tessellation1D} from "../../../cad/craft/engine/tessellation"; import {Matrix3} from "math/matrix"; import {areEqual} from "math/equality"; +import {Vec3} from "math/vec"; export default class BrepCurve { diff --git a/web/app/brep/geom/curves/nurbsCurve.ts b/web/app/brep/geom/curves/nurbsCurve.ts index bb362d6f..e8aea8d1 100644 --- a/web/app/brep/geom/curves/nurbsCurve.ts +++ b/web/app/brep/geom/curves/nurbsCurve.ts @@ -1,8 +1,8 @@ import * as ext from '../impl/nurbs-ext'; import {distinctKnots, NurbsCurveData} from '../impl/nurbs-ext'; import {ParametricCurve} from "./parametricCurve"; -import {Vec3} from "math/l3space"; import {Matrix3x4Data} from "math/matrix"; +import {Vec3} from "math/vec"; //in fact the sketcher format diff --git a/web/app/brep/geom/curves/parametricCurve.ts b/web/app/brep/geom/curves/parametricCurve.ts index d29aa306..c870f89f 100644 --- a/web/app/brep/geom/curves/parametricCurve.ts +++ b/web/app/brep/geom/curves/parametricCurve.ts @@ -1,5 +1,5 @@ -import {Vec3} from "math/l3space"; import {Matrix3x4Data} from "math/matrix"; +import {Vec3} from "math/vec"; export interface ParametricCurve { diff --git a/web/app/brep/geom/impl/nurbs-ext.ts b/web/app/brep/geom/impl/nurbs-ext.ts index b5030214..e59e8aba 100644 --- a/web/app/brep/geom/impl/nurbs-ext.ts +++ b/web/app/brep/geom/impl/nurbs-ext.ts @@ -1,8 +1,8 @@ import * as vec from "math/vec"; import {eqEps, TOLERANCE, TOLERANCE_01, TOLERANCE_SQ} from '../tolerance'; -import {Vec3} from "math/l3space"; import {fmin_bfgs} from "math/optim/bfgs"; import {areEqual} from "math/equality"; +import {Vec3} from "math/vec"; export interface NurbsCurveData { degree: number, diff --git a/web/app/brep/geom/surfaces/nullSurface.ts b/web/app/brep/geom/surfaces/nullSurface.ts index 7c6daf0d..72b16cb1 100644 --- a/web/app/brep/geom/surfaces/nullSurface.ts +++ b/web/app/brep/geom/surfaces/nullSurface.ts @@ -1,6 +1,6 @@ import {ParametricSurface, UV} from "./parametricSurface"; -import {Vec3} from "math/l3space"; import {Matrix3x4Data} from "math/matrix"; +import {Vec3} from "math/vec"; export default class NullSurface implements ParametricSurface { diff --git a/web/app/brep/geom/surfaces/nurbsSurface.ts b/web/app/brep/geom/surfaces/nurbsSurface.ts index f131e91b..037d9fad 100644 --- a/web/app/brep/geom/surfaces/nurbsSurface.ts +++ b/web/app/brep/geom/surfaces/nurbsSurface.ts @@ -3,9 +3,9 @@ import cache from '../impl/cache'; import * as ext from '../impl/nurbs-ext'; import NurbsCurve from '../curves/nurbsCurve'; import {ParametricSurface, UV} from "./parametricSurface"; -import {Vec3} from "math/l3space"; import {ParametricCurve} from "../curves/parametricCurve"; import {Matrix3x4Data} from "math/matrix"; +import {Vec3} from "math/vec"; export default class NurbsSurface implements ParametricSurface { diff --git a/web/app/brep/geom/surfaces/parametricSurface.ts b/web/app/brep/geom/surfaces/parametricSurface.ts index 96612d11..28fe23c0 100644 --- a/web/app/brep/geom/surfaces/parametricSurface.ts +++ b/web/app/brep/geom/surfaces/parametricSurface.ts @@ -1,5 +1,5 @@ -import {Vec3} from "math/l3space"; import {Matrix3x4Data} from "math/matrix"; +import {Vec3} from "math/vec"; export type UV = [number, number]; diff --git a/web/app/cad/craft/engine/brepData.d.ts b/web/app/cad/craft/engine/brepData.d.ts index 72a38fc0..55c8d585 100644 --- a/web/app/cad/craft/engine/brepData.d.ts +++ b/web/app/cad/craft/engine/brepData.d.ts @@ -1,9 +1,9 @@ -import {Vec3} from "math/l3space"; import {Tessellation1D, Tessellation2D} from "./tessellation"; import {ProductionInfo} from "./productionInfo"; import {Handle} from "./handle"; import {SurfaceBSplineData, SurfacePlaneData, SurfaceUnknownData} from "./surfaceData"; import {CurveBSplineData, CurveLineData, CurveUnknownData} from "./curveData"; +import {Vec3} from "math/vec"; export interface BREPData { diff --git a/web/app/cad/craft/engine/curveData.d.ts b/web/app/cad/craft/engine/curveData.d.ts index a6f38def..8d1bce6c 100644 --- a/web/app/cad/craft/engine/curveData.d.ts +++ b/web/app/cad/craft/engine/curveData.d.ts @@ -1,4 +1,4 @@ -import {Vec3} from "math/l3space"; +import {Vec3} from "math/vec"; export interface CurveData { diff --git a/web/app/cad/craft/engine/surfaceData.d.ts b/web/app/cad/craft/engine/surfaceData.d.ts index 0a49bccb..6bf5a15d 100644 --- a/web/app/cad/craft/engine/surfaceData.d.ts +++ b/web/app/cad/craft/engine/surfaceData.d.ts @@ -1,4 +1,4 @@ -import {Vec3} from "math/l3space"; +import {Vec3} from "math/vec"; export interface SurfaceData {