diff --git a/packages/cityjson2dtx/build.js b/packages/cityjson2xgf/build.js
similarity index 85%
rename from packages/cityjson2dtx/build.js
rename to packages/cityjson2xgf/build.js
index 30de0f504..ac145a5e8 100644
--- a/packages/cityjson2dtx/build.js
+++ b/packages/cityjson2xgf/build.js
@@ -5,7 +5,7 @@ const {peerDependencies} = require('./package.json');
const sharedConfig = {
entryPoints: [
- "./src/cityjson2dtx.ts"
+ "./src/cityjson2xgf.ts"
],
bundle: true,
minify: false,
@@ -17,5 +17,5 @@ build({
platform: 'node',
format: 'cjs',
target: "node10.4",
- outfile: "dist/cityjson2dtx.cjs.js",
+ outfile: "dist/cityjson2xgf.cjs.js",
});
diff --git a/packages/cityjson2xgf/package.json b/packages/cityjson2xgf/package.json
new file mode 100644
index 000000000..c1fadf409
--- /dev/null
+++ b/packages/cityjson2xgf/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "@xeokit/cityjson2xgf",
+ "private": false,
+ "version": "0.1.0",
+ "description": ".BIM loader for xeokit",
+ "types": "dist/index.d.ts",
+ "main": "dist/index.js",
+ "module": "dist/index.js",
+ "scripts": {
+ "test": "jest --passWithNoTests",
+ "dist": "node build.js ; tsc",
+ "lint": "eslint . --fix",
+ "docs": "typedoc --json ../../docs/json/cityjson2xgf.json --options typedoc.json --validation.invalidLink false",
+ "publish": "npm publish --access public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/xeokit/sdk.git"
+ },
+ "author": "Lindsay Kay",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "bugs": {
+ "url": "https://github.com/xeokit/sdk/issues"
+ },
+ "homepage": "https://xeokit.io",
+ "files": [
+ "src/",
+ "dist/",
+ "README.md",
+ "package.json"
+ ],
+ "keywords": [],
+ "dependencies": {
+ "@xeokit/config": "^0.1.0",
+ "@xeokit/core": "^0.1.0",
+ "@xeokit/data": "^0.1.0",
+ "@xeokit/scene": "^0.1.0",
+ "@xeokit/cityjson": "^0.1.0",
+ "@xeokit/xgf": "^0.1.0",
+ "commander": "^11.0.0"
+ },
+ "peerDependencies": {
+
+ },
+ "devDependencies": {
+ "@jest/globals": "^29.5.0",
+ "jest-html-reporter": "^3.10.2"
+ }
+}
diff --git a/packages/cityjson2dtx/src/cityjson2dtx.js b/packages/cityjson2xgf/src/cityjson2xgf.js
similarity index 73%
rename from packages/cityjson2dtx/src/cityjson2dtx.js
rename to packages/cityjson2xgf/src/cityjson2xgf.js
index 30b263c94..ab9bd5160 100644
--- a/packages/cityjson2dtx/src/cityjson2dtx.js
+++ b/packages/cityjson2xgf/src/cityjson2xgf.js
@@ -3,7 +3,7 @@ import {Data} from "@xeokit/data";
import {Scene} from "@xeokit/scene";
import {SDKError} from "@xeokit/core";
import {loadCityJSON} from "@xeokit/cityjson";
-import {saveDTX} from "dtx";
+import {saveXGF} from "packages/xgf";
const commander = require('commander');
const npmPackage = require('./package.json');
@@ -15,10 +15,10 @@ program.version(npmPackage.version, '-v, --version');
program
.option('-i, --input [file]', 'path to input CityJSON file')
- .option('-o, --output [file]', 'path to output DTX file');
+ .option('-o, --output [file]', 'path to output XGF file');
program.on('--help', () => {
- console.log(`\n\nDTX version: 10`);
+ console.log(`\n\nXGF version: 10`);
});
program.parse(process.argv);
@@ -26,13 +26,13 @@ program.parse(process.argv);
const options = program.opts();
if (options.input === undefined) {
- console.error('[cityjson2dtx] Error: please specify a path to a CityJSON input file (-i).');
+ console.error('[cityjson2xgf] Error: please specify a path to a CityJSON input file (-i).');
program.help();
process.exit(1);
}
if (options.output === undefined) {
- console.error('[cityjson2dtx] Error: please specify output DTX file path (-o).');
+ console.error('[cityjson2xgf] Error: please specify output XGF file path (-o).');
program.help();
process.exit(1);
}
@@ -45,15 +45,15 @@ function log(msg) {
async function main() {
- log(`[cityjson2dtx] Running cityjson2dtx v${npmPackage.version}...`);
- log(`[cityjson2dtx] Reading CityJSON file ${options.input}...`);
+ log(`[cityjson2xgf] Running cityjson2xgf v${npmPackage.version}...`);
+ log(`[cityjson2xgf] Reading CityJSON file ${options.input}...`);
let fileData;
try {
fileData = fs.readFileSync(options.input);
} catch (err) {
- console.error(`[cityjson2dtx] Error reading CityJSON file: ${err}`);
+ console.error(`[cityjson2xgf] Error reading CityJSON file: ${err}`);
process.exit(1);
}
@@ -64,7 +64,7 @@ async function main() {
});
if (dataModel instanceof SDKError) {
- console.error(`[cityjson2dtx] Error converting CityJSON file: ${dataModel.message}`);
+ console.error(`[cityjson2xgf] Error converting CityJSON file: ${dataModel.message}`);
process.exit(1);
} else {
const scene = new Scene();
@@ -72,26 +72,26 @@ async function main() {
id: "foo"
});
if (sceneModel instanceof SDKError) {
- console.error(`[cityjson2dtx] Error converting CityJSON file: ${sceneModel.message}`);
+ console.error(`[cityjson2xgf] Error converting CityJSON file: ${sceneModel.message}`);
process.exit(1);
} else {
loadCityJSON({fileData, dataModel, sceneModel}).then(() => {
sceneModel.build().then(() => {
dataModel.build();
- const dtxArrayBuffer = saveDTX({dataModel, sceneModel});
+ const xgfArrayBuffer = saveXGF({dataModel, sceneModel});
const outputDir = getBasePath(options.output).trim();
if (outputDir !== "" && !fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, {recursive: true});
}
- fs.writeFileSync(options.output, Buffer.from(dtxArrayBuffer));
- log(`[cityjson2dtx] Created DTX file: ${options.output}`);
+ fs.writeFileSync(options.output, Buffer.from(xgfArrayBuffer));
+ log(`[cityjson2xgf] Created XGF file: ${options.output}`);
process.exit(0);
}).catch((err) => {
- console.error(`[cityjson2dtx] Error converting CityJSON file: ${err}`);
+ console.error(`[cityjson2xgf] Error converting CityJSON file: ${err}`);
process.exit(1);
});
}).catch((err) => {
- console.error(`[cityjson2dtx] Error converting CityJSON file: ${err}`);
+ console.error(`[cityjson2xgf] Error converting CityJSON file: ${err}`);
process.exit(1);
});
}
@@ -106,4 +106,4 @@ function getBasePath(src) {
main().catch(err => {
console.error('Error:', err);
process.exit(1);
-});
\ No newline at end of file
+});
diff --git a/packages/cityjson2dtx/src/index.ts b/packages/cityjson2xgf/src/index.ts
similarity index 56%
rename from packages/cityjson2dtx/src/index.ts
rename to packages/cityjson2xgf/src/index.ts
index 10336fb50..c5e2a6398 100644
--- a/packages/cityjson2dtx/src/index.ts
+++ b/packages/cityjson2xgf/src/index.ts
@@ -1,14 +1,14 @@
/**
* [![npm version](https://badge.fury.io/js/%40xeokit%2Fifcviewer.svg)](https://badge.fury.io/js/%40xeokit%2Fifcviewer)
- * [![](https://data.jsdelivr.com/v1/package/npm/@xeokit/cityjson2dtx/badge)](https://www.jsdelivr.com/package/npm/@xeokit/ifcviewer)
+ * [![](https://data.jsdelivr.com/v1/package/npm/@xeokit/cityjson2xgf/badge)](https://www.jsdelivr.com/package/npm/@xeokit/ifcviewer)
*
*
*
*
*
- * ## cityjson2dtx
+ * ## cityjson2xgf
*
- * Node CLI tool to convert CityJSON files into [DTX](https://xeokit.github.io/sdk/docs/pages/GLOSSARY.html#dtx) files.
+ * Node CLI tool to convert CityJSON files into [XGF](https://xeokit.github.io/sdk/docs/pages/GLOSSARY.html#xgf) files.
*
* ## Features
*
@@ -17,7 +17,7 @@
* ## Installation
*
* ````bash
- * npm install @xeokit/cityjson2dtx
+ * npm install @xeokit/cityjson2xgf
* ````
*
* ## Usage
@@ -25,9 +25,9 @@
* TODO
*
* ````bash
- * cityjson2dtx -i model.json -o model.dtx
+ * cityjson2xgf -i model.json -o model.xgf
* ````
*
- * @module @xeokit/cityjson2dtx
+ * @module @xeokit/cityjson2xgf
*/
-export * from "./cityjson2dtx"
\ No newline at end of file
+export * from "./cityjson2xgf"
diff --git a/packages/cityjson2dtx/tsconfig.json b/packages/cityjson2xgf/tsconfig.json
similarity index 100%
rename from packages/cityjson2dtx/tsconfig.json
rename to packages/cityjson2xgf/tsconfig.json
diff --git a/packages/dtx/typedoc.json b/packages/cityjson2xgf/typedoc.json
similarity index 100%
rename from packages/dtx/typedoc.json
rename to packages/cityjson2xgf/typedoc.json