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 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
  ![Example](/javascript/docs/javascript-example.gif)
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.1",
4
- "description": "URDF Loader for THREE.js and webcomponent viewer",
5
- "main": "src/URDFLoader.js",
6
- "type": "module",
7
- "scripts": {
8
- "start": "concurrently --kill-others \"rollup -c -w\" \"cd .. && static-server\"",
9
- "build": "rollup -c",
10
- "test": "jest",
11
- "lint": "eslint \"./src/*.js\" \"./test/*.js\" && tsc -p tsconfig.json --noEmit"
12
- },
13
- "files": [
14
- "src/*",
15
- "umd/*",
16
- "example/index.js",
17
- "example/dragAndDrop.js",
18
- "example/styles.css"
19
- ],
20
- "license": "Apache-2.0",
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/gkjohnson/urdf-loaders.git"
24
- },
25
- "bugs": {
26
- "url": "https://github.com/gkjohnson/urdf-loaders/issues"
27
- },
28
- "homepage": "https://github.com/gkjohnson/urdf-loaders#readme",
29
- "keywords": [
30
- "javascript",
31
- "threejs",
32
- "graphics",
33
- "ros",
34
- "robotics",
35
- "urdf",
36
- "urdf-models",
37
- "webcomponents"
38
- ],
39
- "peerDependencies": {
40
- "three": ">=0.105.0"
41
- },
42
- "devDependencies": {
43
- "@babel/core": "^7.11.6",
44
- "@babel/preset-env": "^7.11.5",
45
- "@rollup/plugin-node-resolve": "^8.4.0",
46
- "@webcomponents/webcomponentsjs": "^2.4.4",
47
- "babel-jest": "^25.4.0",
48
- "concurrently": "^4.1.2",
49
- "eslint": "^7.10.0",
50
- "eslint-plugin-jest": "^24.1.0",
51
- "jest": "^25.4.0",
52
- "jest-cli": "^25.4.0",
53
- "jsdom": "^16.4.0",
54
- "node-fetch": "^2.6.1",
55
- "nyc": "^13.3.0",
56
- "rollup": "^2.29.0",
57
- "static-server": "^3.0.0",
58
- "three": "^0.119.0",
59
- "typescript": "^3.9.7"
60
- },
61
- "dependencies": {}
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
+ }
@@ -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