urdf-loader 0.10.1 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +61 -62
- package/src/URDFLoader.d.ts +2 -2
- package/src/URDFLoader.js +2 -1
- package/src/urdf-viewer-element.js +551 -551
- package/umd/URDFLoader.js +40 -17
- package/umd/URDFLoader.js.map +1 -1
- package/umd/urdf-manipulator-element.js +23 -2
- package/umd/urdf-manipulator-element.js.map +1 -1
- package/umd/urdf-viewer-element.js +563 -542
- package/umd/urdf-viewer-element.js.map +1 -1
- package/CHANGELOG.md +0 -264
- package/example/styles.css +0 -281
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Utilities for loading URDF files into THREE.js and a Web Component that loads and renders the model.
|
|
8
8
|
|
|
9
|
-
[Basic loader example here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/simple.html)
|
|
9
|
+
[Basic loader example here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/simple.html)
|
|
10
10
|
|
|
11
|
-
[VR example here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/vr.html)
|
|
11
|
+
[VR example here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/vr.html)
|
|
12
12
|
|
|
13
|
-
[Drag and drop web component tool here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/index.html)
|
|
13
|
+
[Drag and drop web component tool here!](https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/index.html)
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
@@ -144,7 +144,7 @@ loadMeshCb = null :
|
|
|
144
144
|
(
|
|
145
145
|
pathToModel : string,
|
|
146
146
|
manager : LoadingManager,
|
|
147
|
-
onComplete : ( obj : Object3D ) => void
|
|
147
|
+
onComplete : ( obj : Object3D, err ?: Error ) => void
|
|
148
148
|
) => void
|
|
149
149
|
```
|
|
150
150
|
|
|
@@ -565,7 +565,7 @@ Run `npm install`.
|
|
|
565
565
|
|
|
566
566
|
Run `npm start`.
|
|
567
567
|
|
|
568
|
-
Visit `localhost:9080/javascript/example/` to view the page.
|
|
568
|
+
Visit `localhost:9080/javascript/example/dev-bundle/` to view the page.
|
|
569
569
|
|
|
570
570
|
# LICENSE
|
|
571
571
|
|
package/package.json
CHANGED
|
@@ -1,62 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "urdf-loader",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "URDF Loader for THREE.js and webcomponent viewer",
|
|
5
|
-
"main": "src/URDFLoader.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "concurrently --
|
|
9
|
-
"build": "rollup -c",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"urdf",
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"@babel/
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "urdf-loader",
|
|
3
|
+
"version": "0.10.4",
|
|
4
|
+
"description": "URDF Loader for THREE.js and webcomponent viewer",
|
|
5
|
+
"main": "src/URDFLoader.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "concurrently \"parcel watch ./example/*.html --out-dir ./example/dev-bundle/ --public-url . --no-cache\" \"cd .. && static-server\"",
|
|
9
|
+
"build": "rollup -c",
|
|
10
|
+
"build-examples": "parcel build ./example/*.html --out-dir ./example/bundle/ --public-url . --no-cache --no-source-maps --no-content-hash",
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"lint": "eslint \"./src/*.js\" \"./test/*.js\" && tsc -p tsconfig.json --noEmit",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src/*",
|
|
17
|
+
"umd/*"
|
|
18
|
+
],
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/gkjohnson/urdf-loaders.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/gkjohnson/urdf-loaders/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/gkjohnson/urdf-loaders#readme",
|
|
28
|
+
"keywords": [
|
|
29
|
+
"javascript",
|
|
30
|
+
"threejs",
|
|
31
|
+
"graphics",
|
|
32
|
+
"ros",
|
|
33
|
+
"robotics",
|
|
34
|
+
"urdf",
|
|
35
|
+
"urdf-models",
|
|
36
|
+
"webcomponents"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"three": ">=0.105.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.11.6",
|
|
43
|
+
"@babel/preset-env": "^7.11.5",
|
|
44
|
+
"@webcomponents/webcomponentsjs": "^2.4.4",
|
|
45
|
+
"babel-jest": "^25.4.0",
|
|
46
|
+
"concurrently": "^6.2.1",
|
|
47
|
+
"eslint": "^7.10.0",
|
|
48
|
+
"eslint-plugin-jest": "^24.1.0",
|
|
49
|
+
"jest": "^27.1.1",
|
|
50
|
+
"jest-cli": "^27.1.1",
|
|
51
|
+
"jsdom": "^17.0.0",
|
|
52
|
+
"node-fetch": "^3.0.0",
|
|
53
|
+
"nyc": "^15.1.0",
|
|
54
|
+
"parcel-bundler": "^1.12.5",
|
|
55
|
+
"static-server": "^3.0.0",
|
|
56
|
+
"three": "^0.135.0",
|
|
57
|
+
"typescript": "^3.9.7",
|
|
58
|
+
"rollup": "^2.29.0"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {}
|
|
61
|
+
}
|
package/src/URDFLoader.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LoadingManager, Object3D } from 'three';
|
|
|
2
2
|
import { URDFRobot } from './URDFClasses';
|
|
3
3
|
|
|
4
4
|
interface MeshLoadDoneFunc {
|
|
5
|
-
(mesh: Object3D): void;
|
|
5
|
+
(mesh: Object3D, err?: Error): void;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
interface MeshLoadFunc{
|
|
@@ -19,7 +19,7 @@ export default class URDFLoader {
|
|
|
19
19
|
workingPath: string;
|
|
20
20
|
parseVisual: boolean;
|
|
21
21
|
parseCollision: boolean;
|
|
22
|
-
packages: string | { [key: string]: string };
|
|
22
|
+
packages: string | { [key: string]: string } | ((targetPkg: string) => string);
|
|
23
23
|
loadMeshCb: MeshLoadFunc;
|
|
24
24
|
|
|
25
25
|
constructor(manager?: LoadingManager);
|
package/src/URDFLoader.js
CHANGED
|
@@ -473,7 +473,7 @@ class URDFLoader {
|
|
|
473
473
|
.split(/\s/g)
|
|
474
474
|
.map(v => parseFloat(v));
|
|
475
475
|
|
|
476
|
-
material.color.setRGB(rgba[0], rgba[1], rgba[2]);
|
|
476
|
+
material.color.setRGB(rgba[0], rgba[1], rgba[2]).convertSRGBToLinear();
|
|
477
477
|
material.opacity = rgba[3];
|
|
478
478
|
material.transparent = rgba[3] < 1;
|
|
479
479
|
material.depthWrite = !material.transparent;
|
|
@@ -488,6 +488,7 @@ class URDFLoader {
|
|
|
488
488
|
const loader = new THREE.TextureLoader(manager);
|
|
489
489
|
const filePath = resolvePath(filename);
|
|
490
490
|
material.map = loader.load(filePath);
|
|
491
|
+
material.map.encoding = THREE.sRGBEncoding;
|
|
491
492
|
|
|
492
493
|
}
|
|
493
494
|
|