Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "0.1.0",
"version": "0.1.4-alpha",
"name": "xeokit",
"author": "Lindsay Kay <xeolabs.com>",
"repository": {
Expand Down
19 changes: 19 additions & 0 deletions packages/sdk/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { build } = require("esbuild");

const sharedConfig = {
entryPoints: [
"./src/index.ts"
],
bundle: true,
minify: false,
sourcemap: true
};

build({
...sharedConfig,
platform: 'browser',
format: 'esm',
outfile: 'dist/xeokit-sdk.esm.js',
});


26 changes: 16 additions & 10 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "@xeokit/sdk",
"private": false,
"version": "0.1.0-alpha",
"version": "0.1.5-alpha",
"description": "Next generation xeokit SDK",
"main": "dist/index.js",
"module": "dist/index.js",
"module": "dist/xeokit-sdk.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"sdk-test": "jest --passWithNoTests",
"sdk-dist": "rm -Rf tsconfig.tsbuildinfo; tsc; node ./scripts/build-cli-tools.js",
"sdk-build": "rm -Rf tsconfig.tsbuildinfo; tsc; node ./scripts/build-cli-tools.js",
"sdk-bundle": "node build.js",
"sdk-dist": "npm run sdk-build && npm run sdk-bundle",
"sdk-lint": "eslint . --fix",
"sdk-publish": "npm publish --access public",
"website-sdk-docs": "typedoc --json ../website/docs/json/sdk.json --options typedoc.json --validation.invalidLink false && cp -Rf ./assets ../website/docs/."
Expand All @@ -27,27 +29,31 @@
"homepage": "https://xeokit.github.io/sdk/docs/api/index.html",
"files": [
"src/",
"dist/",
"README.md",
"package.json"
],
"keywords": [],
"dependencies": {
"strongly-typed-events": "3.0.7",
"@loaders.gl/core": "^4.0.4",
"@loaders.gl/gltf": "^4.0.4",
"@loaders.gl/images": "^3.4.1",
"@loaders.gl/math": "^4.0.4",
"@loaders.gl/las": "^4.0.4",
"@loaders.gl/gltf": "^4.0.4",
"@loaders.gl/math": "^4.0.4",
"@loaders.gl/polyfills": "^4.0.4",
"@loaders.gl/textures": "^4.0.4",
"web-ifc": "^0.0.50",
"pako": "^2.0.4",
"commander": "^11.0.0",
"pako": "^2.0.4",
"strongly-typed-events": "3.0.7",
"web-ifc": "^0.0.50",
"yargs": "17.7.2"
},
"peerDependencies": {
"typedoc": "^0.27.6",
"typedoc-plugin-mermaid": "1.12.0"
},
"devDependencies": {}
"devDependencies": {
"@types/node": "^22.14.1",
"esbuild": "^0.20.2"
}
}
9 changes: 2 additions & 7 deletions packages/sdk/src/ifc/IFCLoader.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import {ModelLoader, ModelParseParams} from "../io";
import {parse as parse_IFC4} from "./versions/IFC4/parse";
import {IfcAPI as IfcAPI_node} from "node_modules/web-ifc/web-ifc-api-node.js";
import {IfcAPI as IfcAPI_browser} from "node_modules/web-ifc/web-ifc-api.js";
import {IfcAPI} from "web-ifc";

let ifcAPI: any = null;

/**
* Loads an IFC file into a {@link scene!SceneModel | SceneModel} and/or a {@link data!DataModel | DataModel}.
*
Expand Down Expand Up @@ -32,22 +30,19 @@ export class IFCLoader extends ModelLoader {
function parse(params: ModelParseParams, options: any): Promise<any> {
return new Promise<void>((resolve, reject) => {
if (!ifcAPI) {
let api;
let wasmPath = "";
switch (detectEnvironment()) {
case "browser":
api = IfcAPI_browser;
wasmPath = "https://cdn.jsdelivr.net/npm/[email protected]/"; // FIXME: this is hard-wired to 0.0.50
break;
case "node":
api = IfcAPI_node;
wasmPath = "../../node_modules/web-ifc/"; // Note that we can't (easily) fetch WASM over HTTP from node
break;
default:
reject("[IFCLoader] Failed to determine environment");
return;
}
ifcAPI = new api();
ifcAPI = new IfcAPI();
ifcAPI.SetWasmPath(wasmPath);
ifcAPI.Init()
.then(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/viewer/Viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class Viewer extends Component {
for (let viewIndex = 0; viewIndex < this.viewList.length; viewIndex++) {
// console.log("this.renderer.render()");
// console.log("...");
this.renderer.render(viewIndex, {force: false});
this.renderer.render(viewIndex, {force: false, opaqueOnly: false});
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"module": "esnext",
"stripInternal": false,
"typeRoots": [
"../../node_modules/@types"
"./node_modules/@types"
],
"alwaysStrict": true,
"strictFunctionTypes": true,
Expand All @@ -40,7 +40,7 @@
"node_modules"
],
"typeRoots": [
"node_modules/@types"
"./node_modules/@types"
],
"plugin": [
"typedoc-plugin-mermaid"
Expand Down
Loading