jsketcher/web/app/cad/tpi/tpiPlugin.js
2019-11-28 02:01:48 -08:00

24 lines
No EOL
549 B
JavaScript

import TPI from './tpi';
import {MBrepShell} from '../model/mshell';
/*
* TPI stands for the Test Program Interface
*/
export function activate({streams, services}) {
function addShellOnScene(shell, skin) {
const sceneSolid = new MBrepShell(shell);
addOnScene(sceneSolid, skin);
return sceneSolid;
}
function addOnScene(sceneSolid, skin) {
streams.craft.models.next([sceneSolid]);
services.viewer.render();
}
services.tpi = Object.assign({
streams,
services,
addShellOnScene,
addOnScene
}, TPI);
}