mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 10:25:36 +01:00
organizing brep package
This commit is contained in:
parent
a99c8cf5a5
commit
590cd37878
10 changed files with 20 additions and 16 deletions
|
|
@ -29,7 +29,7 @@ export default class BrepBuilder {
|
|||
return this._loop.halfEdges[this._loop.halfEdges.length - 1];
|
||||
}
|
||||
|
||||
face(surface: BrepSurface): BrepBuilder {
|
||||
face(surface?: BrepSurface = null): BrepBuilder {
|
||||
this._face = new Face(surface ? surface : null);
|
||||
this._shell.faces.push(this._face);
|
||||
this._loop = null;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {Point} from 'geom/point'
|
||||
import {Plane} from 'geom/impl/plane'
|
||||
import {createPrism, enclose} from './brep-enclose'
|
||||
import {createPrism, enclose} from './operations/brep-enclose'
|
||||
import {Circle} from '../../web/app/cad/sketch/sketchModel'
|
||||
import CSys from 'math/csys';
|
||||
import {Matrix3x4} from 'math/matrix';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import {Shell} from './topo/shell';
|
||||
import {Face} from './topo/face';
|
||||
import {Edge} from './topo/edge';
|
||||
import {Shell} from '../topo/shell';
|
||||
import {Face} from '../topo/face';
|
||||
import {Edge} from '../topo/edge';
|
||||
import BrepCurve from 'geom/curves/brepCurve';
|
||||
import {Plane} from 'geom/impl/plane';
|
||||
import * as cad_utils from '../../web/app/cad/cad-utils';
|
||||
import {createBoundingSurface} from './brep-builder';
|
||||
import * as cad_utils from '../../../web/app/cad/cad-utils';
|
||||
import {createBoundingSurface} from '../brep-builder';
|
||||
import NurbsSurface from 'geom/surfaces/nurbsSurface';
|
||||
import {BrepSurface} from 'geom/surfaces/brepSurface';
|
||||
import {Matrix3x4} from 'math/matrix';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import {Edge} from './topo/edge'
|
||||
import {Edge} from '../topo/edge'
|
||||
import {equal} from "math/equality";
|
||||
|
||||
export default function({curve, start}) {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import {DoubleKeyMap} from '../../web/app/utils/utils'
|
||||
import {DoubleKeyMap} from '../../../web/app/utils/utils'
|
||||
|
||||
export const FACE_CHUNK = 'stitching.face.chunk';
|
||||
export const EDGE_CHUNK = 'stitching.edge.chunk';
|
||||
|
|
@ -1,14 +1,18 @@
|
|||
import {Vertex} from './topo/vertex';
|
||||
import {veqXYZ} from 'geom/tolerance';
|
||||
import {Point} from 'geom/point';
|
||||
import {XYZ} from "math/xyz";
|
||||
import {VectorData} from "math/vec";
|
||||
|
||||
export default class VertexFactory {
|
||||
|
||||
vertices: Vertex[];
|
||||
|
||||
constructor() {
|
||||
this.vertices = [];
|
||||
}
|
||||
|
||||
get(_x, _y, _z) {
|
||||
get(_x: number, _y: number, _z: number): Vertex {
|
||||
for (let vertex of this.vertices) {
|
||||
let {x, y, z} = vertex.point;
|
||||
if (veqXYZ(_x, _y, _z, x, y, z)) {
|
||||
|
|
@ -20,11 +24,11 @@ export default class VertexFactory {
|
|||
return v;
|
||||
}
|
||||
|
||||
getPoint({x, y, z}) {
|
||||
getPoint({x, y, z}: XYZ): Vertex {
|
||||
return this.get(x, y, z);
|
||||
}
|
||||
|
||||
getData([x, y, z]) {
|
||||
getData([x, y, z]: VectorData): Vertex {
|
||||
return this.get(x, y, z);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import {intersect, subtract, union} from 'brep/operations/boolean';
|
||||
import {update as updateStitching} from 'brep/stitching';
|
||||
import {update as updateStitching} from 'brep/operations/stitching';
|
||||
import {BREPValidator} from 'brep/brep-validator';
|
||||
import {Shell} from 'brep/topo/shell';
|
||||
import {MBrepShell} from '../model/mshell';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {enclose} from 'brep/brep-enclose'
|
||||
import {enclose} from 'brep/operations/brep-enclose'
|
||||
import {BooleanOperation, combineShells} from '../booleanOperation'
|
||||
import {Matrix3x4} from 'math/matrix';
|
||||
import {equal} from 'math/equality';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as BREPPrimitives from 'brep/brep-primitives'
|
||||
import BrepBuilder, {createBoundingSurface} from 'brep/brep-builder'
|
||||
import {createPrism} from 'brep/brep-enclose'
|
||||
import {createPrism} from 'brep/operations/brep-enclose'
|
||||
import * as BREPBool from 'brep/operations/boolean'
|
||||
import * as IO from 'brep/io/brepLoopsFormat'
|
||||
import {BREPValidator} from 'brep/brep-validator'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import * as stitching from 'brep/stitching'
|
||||
import * as stitching from 'brep/operations/stitching'
|
||||
import {AbstractSelectionMarker, setFacesColor} from "./abstractSelectionMarker";
|
||||
|
||||
export class SelectionMarker extends AbstractSelectionMarker {
|
||||
|
|
|
|||
Loading…
Reference in a new issue