anatrea-pins 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/README.md +37 -4
  2. package/package.json +9 -3
package/README.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  Place annotations on 3D models and use them to build timed practical tests. An atlas author chooses a location on the model, enters a name and accepted alternatives, and decides whether each pin is eligible for a test.
4
4
 
5
+ **[Try the demo](https://skiw1.github.io/anatrea-pins/anatrea-pins-demo.html)** · Opens in your browser with sample models. No installation or sign-in required.
6
+
7
+ ### Anatrea Pins in practice
8
+
9
+ [Open the demo and walkthrough page](https://skiw1.github.io/anatrea-pins/) to see the standalone editor alongside Anatrea’s anatomy atlas. The standalone demo exposes the editing tools. The atlas shows how the same pin-quiz workflow can fit a custom interface with timed questions and answer feedback.
10
+
11
+ Models shown in the video: [Open3DModel](https://ana3d.app/en/atlas/o3d-lower-limb/) (Jan Kooloos, Eungyeol Lee et al.) and [Z-Anatomy](https://github.com/Z-Anatomy/Models-of-human-anatomy) (Gauthier Kervyn and contributors, based on BodyParts3D), under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
12
+
13
+ ## Quick start with npm
14
+
15
+ Use Node.js 22.15 or newer. In the terminal, run this from the project that will use the library:
16
+
17
+ ```sh
18
+ npm install anatrea-pins
19
+ ```
20
+
21
+ Save the following JavaScript as `quick-start.mjs` in that project. The example uses a simple Three.js box, so you don't need to download a 3D model.
22
+
23
+ ```js
24
+ import { createProject } from 'anatrea-pins';
25
+ import { createThreeSurface } from 'anatrea-pins/three';
26
+ import { BoxGeometry, Mesh } from 'three';
27
+
28
+ const project = createProject('my-first-model');
29
+ const surface = createThreeSurface(new Mesh(new BoxGeometry()));
30
+
31
+ console.log(project.modelId, typeof surface.pick);
32
+ ```
33
+
34
+ Back in the terminal, run `node quick-start.mjs`. It should print `my-first-model function`.
35
+
36
+ The npm package contains the library. For the editor and sample models, use the [online demo](https://skiw1.github.io/anatrea-pins/) or the [GitHub source checkout](https://github.com/skiw1/anatrea-pins).
37
+
5
38
  ## Why download it?
6
39
 
7
40
  Use the standalone editor to annotate a 3D model and turn those annotations into a timed identification test. The editor opens local GLB files in your browser and saves the annotations as a reusable JSON file.
@@ -10,9 +43,9 @@ Use the standalone editor to annotate a 3D model and turn those annotations into
10
43
  - **Technical training:** Open a GLB exported from a CAD tool, separate the parts of an assembly and annotate components. Use the same pins for a parts-identification exercise.
11
44
  - **Existing viewers:** Keep your own 3D viewer. Use Anatrea Pins to author the data, then use its JavaScript API to resolve the pin positions and run a test.
12
45
 
13
- ## Try it locally
46
+ ## Try the demo from the source checkout
14
47
 
15
- Open the packaged `anatrea-pins-demo.html` directly in a browser with WebGL. You can build this single-file version from the source with `npm run build:demo`.
48
+ The demo and its example models are available in the source checkout. Open `anatrea-pins-demo.html` directly in a browser with WebGL. You can build this single-file version from the source with `npm run build:demo`.
16
49
 
17
50
  To work on the demo as separate source files, use Node.js 22.15 or newer. From this directory run:
18
51
 
@@ -31,7 +64,7 @@ Open [127.0.0.1:4178](http://127.0.0.1:4178) in a browser with WebGL. The demo b
31
64
 
32
65
  The core project and exam APIs are independent of the renderer. The included Three.js adapter works with static triangle meshes and was tested with Three.js 0.170.0. A different renderer can implement its own method of creating and resolving surface anchors. The reference demo shows a complete integration with vanilla JavaScript.
33
66
 
34
- Install this checkout with `npm install /path/to/anatrea-pins` in your atlas, then create the surface adapter using the model's root object. Call `surface.pick` with the atlas camera and pointer coordinates converted to normalized device coordinates, with `x` and `y` from −1 to 1.
67
+ Install `anatrea-pins` in your atlas project, then create the surface adapter using the model's root object. Call `surface.pick` with the atlas camera and pointer coordinates converted to normalized device coordinates, with `x` and `y` from −1 to 1.
35
68
 
36
69
  ```js
37
70
  import { createProject, serializeProject, upsertPin } from 'anatrea-pins';
@@ -78,4 +111,4 @@ npm test
78
111
 
79
112
  The tests cover JSON round-tripping, pin selection, answer matching, timer expiry, and geometry anchors on indexed and non-indexed meshes.
80
113
 
81
- The application code is under the MIT license. The demo bundles Three.js and its addons under their own MIT license in `demo/vendor/three/LICENSE`. The Open3DModel bone meshes are under CC BY-SA 4.0. See [model attribution](demo/models/ATTRIBUTION.md).
114
+ The library code is under the MIT license. The demo bundles Three.js and its addons under their [MIT license](https://github.com/skiw1/anatrea-pins/blob/main/demo/vendor/three/LICENSE). The demo's Open3DModel bone meshes are under CC BY-SA 4.0. See [model attribution](https://github.com/skiw1/anatrea-pins/blob/main/demo/models/ATTRIBUTION.md) for credits.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anatrea-pins",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Portable 3D annotations and timed anatomy practicals",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -8,7 +8,11 @@
8
8
  ".": "./src/index.js",
9
9
  "./three": "./src/three.js"
10
10
  },
11
- "files": ["src", "README.md", "LICENSE"],
11
+ "files": [
12
+ "src",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
12
16
  "peerDependencies": {
13
17
  "three": ">=0.170.0 <0.171.0"
14
18
  },
@@ -17,5 +21,7 @@
17
21
  "demo": "node demo/serve.js",
18
22
  "test": "node --import ./tests/register-three.js --test tests/*.test.js"
19
23
  },
20
- "engines": { "node": ">=22.15" }
24
+ "engines": {
25
+ "node": ">=22.15"
26
+ }
21
27
  }