mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-08 01:13:27 +01:00
rename tpi to exposure
This commit is contained in:
parent
b354605ef6
commit
2bceabb3b4
9 changed files with 23 additions and 23 deletions
|
|
@ -31,8 +31,8 @@ const CASE = {
|
|||
const box2 = app.TPI.brep.primitives.box(100, 100, 100, mat);
|
||||
const shell = app.TPI.brep.bool.union(box1, box2);
|
||||
|
||||
// app.TPI.addShellOnScene(box1);
|
||||
// app.TPI.addShellOnScene(box2);
|
||||
// app.exposure.addShellOnScene(box1);
|
||||
// app.exposure.addShellOnScene(box2);
|
||||
app.TPI.addShellOnScene(shell);
|
||||
env.done();
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ export function singleShellRespone(oldShell, newShellData) {
|
|||
}
|
||||
|
||||
export function readShellData(data, consumed, csys) {
|
||||
let tpi = __CAD_APP.services.tpi;
|
||||
let model = new tpi.scene.readShellEntityFromJson(data, consumed, csys);
|
||||
let exposure = __CAD_APP.services.exposure;
|
||||
let model = new exposure.scene.readShellEntityFromJson(data, consumed, csys);
|
||||
model.brepShell.data.externals.engine = 'e0';
|
||||
return model;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ export function callEngine(request, engineFunc) {
|
|||
let __E0_ENGINE_EXCHANGE_VAL = null;
|
||||
window.__E0_ENGINE_EXCHANGE = function(objStr) {
|
||||
__E0_ENGINE_EXCHANGE_VAL = JSON.parse(objStr);
|
||||
// let tpi = __CAD_APP.services.tpi;
|
||||
// let sceneObject = new tpi.scene.UnmanagedSceneSolid(data, 'SOLID');
|
||||
// tpi.addOnScene(sceneObject);
|
||||
// let exposure = __CAD_APP.services.exposure;
|
||||
// let sceneObject = new exposure.scene.UnmanagedSceneSolid(data, 'SOLID');
|
||||
// exposure.addOnScene(sceneObject);
|
||||
// __DEBUG__.AddTessDump(obj);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ function createRevolveCommand(request, {cadRegistry, sketcher}) {
|
|||
|
||||
let pivot = cadRegistry.findSketchObject(request.axis).sketchPrimitive;
|
||||
let tr = face.csys.outTransformation;
|
||||
let vec = __CAD_APP.services.tpi.math.vec;
|
||||
let vec = __CAD_APP.services.exposure.math.vec;
|
||||
let axisOrigin = tr._apply3(pivot.a.data());
|
||||
let axisDir = vec._normalize(vec._sub(tr._apply3(pivot.b.data()), axisOrigin))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import TPI from './tpi';
|
||||
import exposure from './exposure';
|
||||
import {MBrepShell} from '../model/mshell';
|
||||
|
||||
/*
|
||||
* TPI stands for the Test Program Interface
|
||||
* exposure stands for the Test Program Interface
|
||||
*/
|
||||
export function activate({streams, services}) {
|
||||
|
||||
|
|
@ -15,10 +15,10 @@ export function activate({streams, services}) {
|
|||
streams.craft.models.next([sceneSolid]);
|
||||
services.viewer.render();
|
||||
}
|
||||
services.tpi = Object.assign({
|
||||
services.exposure = Object.assign({
|
||||
streams,
|
||||
services,
|
||||
addShellOnScene,
|
||||
addOnScene
|
||||
}, TPI);
|
||||
}, exposure);
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ import * as ProjectPlugin from '../projectPlugin';
|
|||
import * as ProjectManagerPlugin from '../projectManager/projectManagerPlugin';
|
||||
import * as SketcherPlugin from '../sketch/sketcherPlugin';
|
||||
import * as ExportPlugin from '../exportPlugin';
|
||||
import * as TpiPlugin from '../tpi/tpiPlugin';
|
||||
import * as ExposurePlugin from '../exposure/exposurePlugin';
|
||||
import * as ViewSyncPlugin from '../scene/viewSyncPlugin';
|
||||
import * as EntityContextPlugin from '../scene/entityContextPlugin';
|
||||
import * as E0Plugin from '../craft/e0/e0Plugin';
|
||||
|
|
@ -54,7 +54,7 @@ export default function startApplication(callback) {
|
|||
CraftUiPlugin,
|
||||
CadRegistryPlugin,
|
||||
ExportPlugin,
|
||||
TpiPlugin,
|
||||
ExposurePlugin,
|
||||
E0Plugin,
|
||||
ProjectManagerPlugin
|
||||
];
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import DatumObject3D from './craft/datum/datumObject';
|
|||
import CSys from '../math/csys';
|
||||
import {createOctreeFromSurface, sphereOctree, traverseOctree} from "../../../modules/voxels/octree";
|
||||
|
||||
export function runSandbox({bus, services, services: { viewer, cadScene, cadRegistry, tpi, tpi: {addShellOnScene} }}) {
|
||||
export function runSandbox({bus, services, services: { viewer, cadScene, cadRegistry, exposure, exposure: {addShellOnScene} }}) {
|
||||
|
||||
function test1() {
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ export function runSandbox({bus, services, services: { viewer, cadScene, cadRegi
|
|||
|
||||
addShellOnScene(cylinder1);
|
||||
addShellOnScene(cylinder2);
|
||||
let result = tpi.brep.bool.subtract(cylinder1, cylinder2);
|
||||
let result = exposure.brep.bool.subtract(cylinder1, cylinder2);
|
||||
|
||||
addShellOnScene(result);
|
||||
}
|
||||
|
|
@ -88,19 +88,19 @@ export function runSandbox({bus, services, services: { viewer, cadScene, cadRegi
|
|||
// addShellOnScene(s1);
|
||||
// addShellOnScene(s2);
|
||||
|
||||
// let result = tpi.brep.bool.intersect(s1, s2);
|
||||
// let result = exposure.brep.bool.intersect(s1, s2);
|
||||
let result = s1;
|
||||
addShellOnScene(result);
|
||||
}
|
||||
|
||||
function test3() {
|
||||
const box1 = tpi.brep.primitives.box(500, 500, 500);
|
||||
const box2 = tpi.brep.primitives.box(250, 250, 750, new Matrix3().translate(25, 25, 0));
|
||||
const box1 = exposure.brep.primitives.box(500, 500, 500);
|
||||
const box2 = exposure.brep.primitives.box(250, 250, 750, new Matrix3().translate(25, 25, 0));
|
||||
|
||||
const box3 = tpi.brep.primitives.box(150, 600, 350, new Matrix3().translate(25, 25, -250));
|
||||
// let result = tpi.brep.bool.union(box1, box2);
|
||||
let result = tpi.brep.bool.subtract(box1, box2);
|
||||
result = tpi.brep.bool.subtract(result, box3);
|
||||
const box3 = exposure.brep.primitives.box(150, 600, 350, new Matrix3().translate(25, 25, -250));
|
||||
// let result = exposure.brep.bool.union(box1, box2);
|
||||
let result = exposure.brep.bool.subtract(box1, box2);
|
||||
result = exposure.brep.bool.subtract(result, box3);
|
||||
// addShellOnScene(box1);
|
||||
addShellOnScene(result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue