UNPKG

cga.js

Version:

Xtor Compute Geometry Algorithm Libary 计算几何算法库

23 lines (17 loc) 494 B
import { v3, Vec3 } from "../../math/Vec3"; import { DistanceResult } from './result'; export class Line { direction: Vec3; constructor(public origin: Vec3 = v3(), public end: Vec3 = v3()) { this.direction = this.end .clone() .sub(this.origin) .normalize(); } distancePoint(pt: any): DistanceResult { throw new Error("Method not implemented."); } } export function line(start?: Vec3, end?: Vec3) { return new Line(start, end); }