diff --git a/modules/brep/brep-builder.ts b/modules/brep/brep-builder.ts index 480d458a..9c3fbbfc 100644 --- a/modules/brep/brep-builder.ts +++ b/modules/brep/brep-builder.ts @@ -29,14 +29,14 @@ export default class BrepBuilder { return this._loop.halfEdges[this._loop.halfEdges.length - 1]; } - face(surface?: BrepSurface = null): BrepBuilder { + face(surface?: BrepSurface): BrepBuilder { this._face = new Face(surface ? surface : null); this._shell.faces.push(this._face); this._loop = null; return this; } - loop(vertices: Vertex[]): BrepBuilder { + loop(vertices?: Vertex[]): BrepBuilder { if (this._loop === null) { this._loop = this._face.outerLoop; } else { diff --git a/modules/brep/io/brepIO.ts b/modules/brep/io/brepIO.ts index 535908f6..458bf6e8 100644 --- a/modules/brep/io/brepIO.ts +++ b/modules/brep/io/brepIO.ts @@ -1,7 +1,8 @@ -import BrepBuilder, {createBoundingSurfaceFrom2DPoints, createBoundingSurfaceFromBBox} from '../brep-builder'; +import BrepBuilder, {createBoundingSurfaceFromBBox} from '../brep-builder'; import VertexFactory from '../vertexFactory'; import NurbsSurface from 'geom/surfaces/nurbsSurface'; import * as vec from 'math/vec'; +import {Vec3} from 'math/vec'; import {BrepSurface} from 'geom/surfaces/brepSurface'; import {Plane} from 'geom/impl/plane'; import Vector from 'math/vector'; @@ -10,6 +11,49 @@ import BBox from 'math/bbox'; import NurbsCurve from 'geom/curves/nurbsCurve'; import BrepCurve from 'geom/curves/brepCurve'; import {BREPData} from "../../../web/app/cad/craft/engine/brepData"; +import {ProductionInfo} from "../../../web/app/cad/craft/engine/productionInfo"; +import {Tessellation1D} from "../../../web/app/cad/craft/engine/tessellation"; + +//Extensions for topo objects +declare module '../topo/shell' { + + interface Shell { + data: { + externals: { + ptr?: number + } + } + } +} + +declare module '../topo/face' { + + interface Face { + data: { + id: string, + productionInfo: ProductionInfo, + tessellation: { + format: string, + data: any; + } + externals: { + ref: number + } + } + } +} + +declare module '../topo/edge' { + + interface Edge { + data: { + tessellation: Tessellation1D + externals: { + ptr?: number + } + } + } +} export function readBrep(data: BREPData) { diff --git a/modules/brep/topo/face.ts b/modules/brep/topo/face.ts index bae8bd46..707fb603 100644 --- a/modules/brep/topo/face.ts +++ b/modules/brep/topo/face.ts @@ -4,27 +4,9 @@ import PIP from '../../../web/app/cad/tess/pip'; import {veq} from "geom/tolerance"; import {isOnPositiveHalfPlaneFromVec} from "../operations/boolean"; import {BrepSurface} from "geom/surfaces/brepSurface"; -import {edgesGenerator, Shell} from "./shell"; -import {ProductionInfo} from "../../../web/app/cad/craft/engine/productionInfo"; +import {Shell} from "./shell"; import {HalfEdge} from "brep/topo/edge"; -declare module './face' { - - interface Face { - data: { - id: string, - productionInfo: ProductionInfo, - tessellation: { - format: string, - data: any; - } - externals: { - ref: number - } - } - } -} - export class Face extends TopoObject {