organizing math module - move Vec3 type definition to vec module

This commit is contained in:
Val Erastov (xibyte) 2020-07-19 15:53:26 -07:00
parent 2ffec12989
commit 58b9094c85
13 changed files with 14 additions and 14 deletions

View file

@ -1,2 +0,0 @@
export type Vec3 = [number, number, number];

View file

@ -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]];

View file

@ -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<T extends VectorData>(v: T, out: T, func: UnaryFn) {
for (let i = 0; i < v.length; i++) {

View file

@ -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 {

View file

@ -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

View file

@ -1,5 +1,5 @@
import {Vec3} from "math/l3space";
import {Matrix3x4Data} from "math/matrix";
import {Vec3} from "math/vec";
export interface ParametricCurve {

View file

@ -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,

View file

@ -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 {

View file

@ -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 {

View file

@ -1,5 +1,5 @@
import {Vec3} from "math/l3space";
import {Matrix3x4Data} from "math/matrix";
import {Vec3} from "math/vec";
export type UV = [number, number];

View file

@ -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 {

View file

@ -1,4 +1,4 @@
import {Vec3} from "math/l3space";
import {Vec3} from "math/vec";
export interface CurveData {

View file

@ -1,4 +1,4 @@
import {Vec3} from "math/l3space";
import {Vec3} from "math/vec";
export interface SurfaceData {