mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-16 05:23:19 +01:00
24 lines
No EOL
592 B
JavaScript
24 lines
No EOL
592 B
JavaScript
import TPI from './tpi';
|
|
import {BREPSceneSolid} from '../scene/wrappers/brepSceneObject';
|
|
|
|
/*
|
|
* TPI stands for the Test Program Interface
|
|
*/
|
|
export function activate({bus, services}) {
|
|
|
|
function addShellOnScene(shell, skin) {
|
|
const sceneSolid = new BREPSceneSolid(shell, undefined, skin);
|
|
addOnScene(sceneSolid, skin);
|
|
return sceneSolid;
|
|
}
|
|
function addOnScene(sceneSolid, skin) {
|
|
services.cadRegistry.update(null, [sceneSolid]);
|
|
services.viewer.render();
|
|
}
|
|
services.tpi = Object.assign({
|
|
bus,
|
|
services,
|
|
addShellOnScene,
|
|
addOnScene
|
|
}, TPI);
|
|
} |