diff --git a/modules/brep/io/brepIO.ts b/modules/brep/io/brepIO.ts index 2fd0f8f6..535908f6 100644 --- a/modules/brep/io/brepIO.ts +++ b/modules/brep/io/brepIO.ts @@ -20,9 +20,9 @@ export function readBrep(data: BREPData) { bb.face(); let nonDirect = faceData.surface.direct === false; // left handed coordinate system for planes let inverted = faceData.inverted !== nonDirect; - bb._face.data.tesselation = { + bb._face.data.tessellation = { format: 'verbose', - data: normalizeTesselationData(faceData.tess, inverted, faceData.surface.TYPE === 'PLANE' ? faceData.surface.normal : undefined) + data: normalizetessellationData(faceData.tess, inverted, faceData.surface.TYPE === 'PLANE' ? faceData.surface.normal : undefined) }; bb._face.data.productionInfo = faceData.productionInfo; if (faceData.ref !== undefined) { @@ -37,7 +37,7 @@ export function readBrep(data: BREPData) { let a = vf.getData(edgeData.inverted ? edgeData.b : edgeData.a); let b = vf.getData(edgeData.inverted ? edgeData.a : edgeData.b); bb.edge(a, b, () => readCurve(edgeData.curve), edgeData.inverted, edgeData.edgeRef); - bb.lastHalfEdge.edge.data.tesselation = edgeData.tess; + bb.lastHalfEdge.edge.data.tessellation = edgeData.tess; //todo: data should provide full externals object bb.lastHalfEdge.edge.data.externals = { ptr: edgeData.ptr @@ -73,7 +73,7 @@ function readSurface(s, inverted, face) { let tr = plane.get2DTransformation(); for (let he of face.outerLoop.halfEdges) { - let tess = he.edge.data.tesselation ? he.edge.data.tesselation : he.edge.curve.tessellateToData(); + let tess = he.edge.data.tessellation ? he.edge.data.tessellation : he.edge.curve.tessellateToData(); tess.forEach(p => bBox.checkData(tr.apply3(p))); } bBox.expand(10); @@ -96,7 +96,7 @@ function readCurve(curve) { } } -export function normalizeTesselationData(tessellation, inverted, surfaceNormal) { +export function normalizetessellationData(tessellation, inverted, surfaceNormal) { let tess = []; for (let i = 0; i < tessellation.length; ++i) { let [tr, normales] = tessellation[i]; diff --git a/modules/brep/topo/face.ts b/modules/brep/topo/face.ts index 4c15919b..bae8bd46 100644 --- a/modules/brep/topo/face.ts +++ b/modules/brep/topo/face.ts @@ -14,7 +14,7 @@ declare module './face' { data: { id: string, productionInfo: ProductionInfo, - tesselation: { + tessellation: { format: string, data: any; } diff --git a/modules/scene/objects/scalableLine.js b/modules/scene/objects/scalableLine.js index 3fa58b99..cffef86a 100644 --- a/modules/scene/objects/scalableLine.js +++ b/modules/scene/objects/scalableLine.js @@ -10,8 +10,8 @@ import {ORIGIN} from "math/vector"; export default class ScalableLine extends Mesh { - constructor(tesselation, width, color, opacity, smooth, ambient) { - super(createGeometry(tesselation, smooth), createMaterial(color, opacity, ambient)); + constructor(tessellation, width, color, opacity, smooth, ambient) { + super(createGeometry(tessellation, smooth), createMaterial(color, opacity, ambient)); this.width = width; this.morphTargetInfluences = [0]; } diff --git a/web/app/cad/scene/views/edgeView.js b/web/app/cad/scene/views/edgeView.js index e0c21e74..6df56d1f 100644 --- a/web/app/cad/scene/views/edgeView.js +++ b/web/app/cad/scene/views/edgeView.js @@ -4,7 +4,7 @@ export class EdgeView extends CurveBasedView { constructor(edge) { let brepEdge = edge.brepEdge; - let tess = brepEdge.data.tesselation ? brepEdge.data.tesselation : brepEdge.curve.tessellateToData(); + let tess = brepEdge.data.tessellation ? brepEdge.data.tessellation : brepEdge.curve.tessellateToData(); super(edge, tess, 2, 3, 0x2B3856, 0xd1726c); } } diff --git a/web/app/cad/scene/views/faceView.js b/web/app/cad/scene/views/faceView.js index a5d17ac8..834bab4a 100644 --- a/web/app/cad/scene/views/faceView.js +++ b/web/app/cad/scene/views/faceView.js @@ -56,8 +56,8 @@ export class FaceView extends SketchingView { this.geometry = geometry; this.meshFaces = []; let off = geometry.faces.length; - if (face.brepFace.data.tesselation) { - tessDataToGeom(face.brepFace.data.tesselation.data, geometry) + if (face.brepFace.data.tessellation) { + tessDataToGeom(face.brepFace.data.tessellation.data, geometry) } else { brepFaceToGeom(face, geometry); } diff --git a/web/app/cad/scene/wrappers/brepSceneObject.js b/web/app/cad/scene/wrappers/brepSceneObject.js index 1021a5d9..2b472856 100644 --- a/web/app/cad/scene/wrappers/brepSceneObject.js +++ b/web/app/cad/scene/wrappers/brepSceneObject.js @@ -33,8 +33,8 @@ export class BREPSceneSolid extends SceneSolid { const sceneFace = new BREPSceneFace(brepFace, this); this.sceneFaces.push(sceneFace); let off = geom.faces.length; - if (brepFace.data.tesselation) { - tessDataToGeom(brepFace.data.tesselation.data, geom) + if (brepFace.data.tessellation) { + tessDataToGeom(brepFace.data.tessellation.data, geom) } else { brepFaceToGeom(brepFace, geom); } @@ -67,7 +67,7 @@ export class BREPSceneSolid extends SceneSolid { materialParams.transparent = true; materialParams.opacity = opacity; } - let tess = edge.data.tesselation ? edge.data.tesselation : edge.curve.tessellateToData(); + let tess = edge.data.tessellation ? edge.data.tessellation : edge.curve.tessellateToData(); let base = null; for (let i = 1; i < tess.length; i++) { diff --git a/web/app/cad/tess/brep-tess.js b/web/app/cad/tess/brep-tess.js index bfd92133..75cbc246 100644 --- a/web/app/cad/tess/brep-tess.js +++ b/web/app/cad/tess/brep-tess.js @@ -124,6 +124,6 @@ function begincallback(type) { } } function errorcallback(errno) { - console.log('tesselation error'); + console.log('tessellation error'); console.log('error number: ' + errno); } diff --git a/web/app/cad/tess/triangulation.js b/web/app/cad/tess/triangulation.js index 0a50b3d3..b0833b46 100644 --- a/web/app/cad/tess/triangulation.js +++ b/web/app/cad/tess/triangulation.js @@ -43,8 +43,8 @@ function errorcallback(errno) { export function Triangulate(contours, normal) { const tessy = initTesselator(); - // libtess will take 3d verts and flatten to a plane for tesselation - // since only doing 2d tesselation here, provide z=1 normal to skip + // libtess will take 3d verts and flatten to a plane for tessellation + // since only doing 2d tessellation here, provide z=1 normal to skip // iterating over verts only to get the same answer. // comment out to test normal-generation code //tessy.gluTessNormal(0, 0, 1);