mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-15 12:53:52 +01:00
organizing math module - move Vec3 type definition to vec module
This commit is contained in:
parent
2ffec12989
commit
58b9094c85
13 changed files with 14 additions and 14 deletions
|
|
@ -1,2 +0,0 @@
|
|||
export type Vec3 = [number, number, number];
|
||||
|
||||
|
|
@ -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]];
|
||||
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {Vec3} from "math/l3space";
|
||||
import {Matrix3x4Data} from "math/matrix";
|
||||
import {Vec3} from "math/vec";
|
||||
|
||||
export interface ParametricCurve {
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {Vec3} from "math/l3space";
|
||||
import {Matrix3x4Data} from "math/matrix";
|
||||
import {Vec3} from "math/vec";
|
||||
|
||||
export type UV = [number, number];
|
||||
|
||||
|
|
|
|||
2
web/app/cad/craft/engine/brepData.d.ts
vendored
2
web/app/cad/craft/engine/brepData.d.ts
vendored
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
2
web/app/cad/craft/engine/curveData.d.ts
vendored
2
web/app/cad/craft/engine/curveData.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import {Vec3} from "math/l3space";
|
||||
import {Vec3} from "math/vec";
|
||||
|
||||
export interface CurveData {
|
||||
|
||||
|
|
|
|||
2
web/app/cad/craft/engine/surfaceData.d.ts
vendored
2
web/app/cad/craft/engine/surfaceData.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import {Vec3} from "math/l3space";
|
||||
import {Vec3} from "math/vec";
|
||||
|
||||
export interface SurfaceData {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue