@meshinspector/meshlib 1.0.0-5638

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/LICENSE ADDED
@@ -0,0 +1,148 @@
1
+ NON-COMMERCIAL & education LICENSE AGREEMENT
2
+
3
+ This agreement is between the individual below (User) and AMV Consulting, LLC, a
4
+ Nevada limited liability company (AMV). The AMV source code library software, and all
5
+ modifications, enhancements, technical documentation provided by AMV as part of the
6
+ Software (Software) are licensed and are not sold. By receiving or using this
7
+ Software, User indicates its acceptance of the terms of this agreement.
8
+
9
+
10
+ TRIAL LICENSE.
11
+
12
+ Subject to the terms of this agreement, AMV grants User a terminable, non-exclusive,
13
+ and non-transferable license to use the Software, solely for non-commercial,
14
+ evaluation or educational purposes.
15
+
16
+
17
+ DISCLAIMER.
18
+
19
+ AMV DISCLAIMS ANY AND ALL REPRESENTATIONS OR WARRANTIES OF ANY
20
+ KIND, WHETHER EXPRESS OR IMPLIED, MADE WITH RESPECT TO THE
21
+ SOFTWARE, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
22
+ OF MERCHANTABILITY, NON-INFRINGEMENT, AND FITNESS FOR A
23
+ PARTICULAR PURPOSE. THE SOFTWARE IS PROVIDED ‘AS IS’ WITHOUT ANY
24
+ WARRANTY OF ANY KIND. AMV AND ITS LICENSORS DO NOT WARRANT THAT
25
+ ANY SOFTWARE IS WITHOUT DEFECT OR ERROR, OR THAT THE OPERATION
26
+ OF ANY SOFTWARE WILL BE UNINTERRUPTED.
27
+
28
+
29
+ RESTRICTIONS ON USE.
30
+
31
+ User may not sell, rent, sublicense, display, modify, or otherwise transfer the Software
32
+ to any third party.
33
+
34
+
35
+ OWNERSHIP.
36
+
37
+ All right, title, and interest to the Software are owned by AMV and its licensors, and
38
+ are protected by United States and international intellectual property laws. User may
39
+ not remove or alter any copyright or proprietary notice from copies of the Software.
40
+ AMV reserves all rights not expressly granted to User.
41
+
42
+
43
+ TERMINATION.
44
+
45
+ The license in Section 1 terminates upon AMV’s notice of termination to User. Upon
46
+ termination of this agreement or a license for any reason, User must discontinue using
47
+ the Software, de-install, and destroy the Software and all copies within 5 days. Upon
48
+ AMV’s request, User will confirm in writing its compliance with this destruction or
49
+ return requirement.
50
+
51
+
52
+ LIABILITY LIMIT.
53
+
54
+ EXCLUSION OF INDIRECT DAMAGES. TO THE MAXIMUM EXTENT ALLOWED
55
+ BY LAW, AMV IS NOT LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
56
+ OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS
57
+ AGREEMENT (INCLUDING, WITHOUT LIMITATION, COSTS OF DELAY; LOSS
58
+ OF OR UNAUTHORIZED ACCESS TO DATA OR INFORMATION; AND LOST
59
+ PROFITS, REVENUE, OR ANTICIPATED COST SAVINGS), EVEN IF IT
60
+ KNOWS OF THE POSSIBILITY OR FORESEEABILITY OF SUCH DAMAGE OR
61
+ LOSS.
62
+
63
+ TOTAL LIMIT ON LIABILITY. TO THE MAXIMUM EXTENT ALLOWED BY LAW,
64
+ AMV'S TOTAL LIABILITY ARISING OUT OF OR RELATED TO THIS
65
+ AGREEMENT (WHETHER IN CONTRACT, TORT, OR OTHERWISE) DOES NOT
66
+ EXCEED $100.
67
+
68
+
69
+ GOVERNING LAW AND FORUM.
70
+
71
+ This agreement is governed by the laws of the State of Nevada (without regard to
72
+ conflicts of law principles) for any dispute between the parties or relating in any way to
73
+ the subject matter of this agreement. Any suit or legal proceeding must be exclusively
74
+ brought in the federal or state courts for Washoe County, Nevada, and User submits to
75
+ this personal jurisdiction and venue. Nothing in this agreement prevents either party
76
+ from seeking injunctive relief in a court of competent jurisdiction. The prevailing party
77
+ in any litigation is entitled to recover its attorneys’ fees and costs from the other party.
78
+
79
+
80
+ OTHER TERMS.
81
+
82
+ Entire Agreement and Changes. This agreement constitutes the entire
83
+ agreement between the parties and supersedes any prior or contemporaneous
84
+ negotiations or agreements, whether oral or written, related to this subject matter.
85
+ User is not relying on any representation concerning this subject matter, oral or
86
+ written, not included in this agreement. No representation, promise, or inducement
87
+ not included in this agreement is binding. No modification or waiver of any term of
88
+ this agreement is effective unless both parties sign it.
89
+
90
+ No Assignment. Neither party may assign or transfer this agreement to a third
91
+ party, nor delegate any duty, except that the agreement may be assigned, without
92
+ the consent of the other party, (i) as part of a merger or sale of all or substantially
93
+ all a party's businesses or assets, of User, and (ii) in the case of AMV at any time
94
+ to any third party.
95
+
96
+ Independent Contractors. The parties are independent contractors with respect
97
+ to each other, and neither party is an agent, employee, or partner of the other
98
+ party or the other party's affiliates.
99
+
100
+ Enforceability and Force Majeure. If any term of this agreement is invalid or
101
+ unenforceable, the other terms remain in effect. Neither party is liable for its non-
102
+ performance due to events beyond its reasonable control, including but not limited
103
+ to natural weather events and disasters, labor disruptions, and disruptions in the
104
+ supply of utilities.
105
+
106
+ Money Damages Insufficient. Any breach by a party of this agreement or
107
+ violation of the other party’s intellectual property rights could cause irreparable
108
+ injury or harm to the other party. The other party may seek a court order to stop
109
+ any breach or avoid any future breach of this agreement.
110
+
111
+ Survival of Terms. All provisions of this agreement regarding payment,
112
+ confidentiality, indemnification, limitations of liability, proprietary rights and such
113
+ other provisions that by fair implication require performance beyond the term of
114
+ this agreement must survive expiration or termination of this agreement until fully
115
+ performed or otherwise are inapplicable. The UN Convention on Contracts for the
116
+ International Sale of Goods does not apply.
117
+
118
+ Compliance Audit. No more than once in any 12-month period and upon at least
119
+ 30 days’ advance notice, AMV (or its representative) may audit User’s usage of the
120
+ Software at any User facility. User will cooperate with such audit. User agrees to pay
121
+ within 30 days of written notification any fees applicable to User’s use of the
122
+ Software in excess of the license.
123
+
124
+ Export Compliance. The Software and Confidential Information may be subject to
125
+ export laws and regulations of the United States and other jurisdictions. Each party
126
+ represents that it is not named on any U.S. government denied-party list. Neither
127
+ party will permit its personnel or representatives to access any Software in a U.S.-
128
+ embargoed country or in violation of any applicable export law or regulation.
129
+
130
+ U.S. Government Restricted Rights. If User is a United States government
131
+ agency or acquired the license to the Software hereunder pursuant to a
132
+ government contract or with government funds, then as defined in FAR §2.101,
133
+ DFAR §252.227-7014(a)(1), and DFAR §252.227-7014(a)(5), or otherwise, all
134
+ Software provided in connection with this agreement are “commercial items,”
135
+ “commercial computer software,” or “commercial computer software
136
+ documentation.” Consistent with DFAR §227.7202 and FAR §12.212, any use,
137
+ modification, reproduction, release, performance, display, disclosure, or
138
+ distribution by or for the United States government is governed solely by the
139
+ terms of this agreement and is prohibited except to the extent permitted by the
140
+ terms of this agreement.
141
+
142
+ Open Source Software Licenses. The Software may contain embedded open source
143
+ software components, which are provided as part of the Software and for
144
+ which additional terms may be included in the technical documentation.
145
+
146
+ Feedback. If User provides feedback or suggestions about the Software, then AMV
147
+ (and those it allows to use its technology) may use such information without
148
+ obligation to User.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @meshinspector/meshlib
2
+
3
+ [MeshLib](https://meshlib.io/) geometry library compiled to WebAssembly.
4
+
5
+ This package ships the **single-threaded** build of MeshLib's WebAssembly
6
+ module (`meshlib.mjs` + `meshlib.wasm`).
7
+
8
+ - Source: https://github.com/MeshInspector/MeshLib
9
+ - Documentation: https://meshlib.io/documentation/index.html
10
+
11
+ ## Requirements
12
+
13
+ - Node.js >= 18
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npm install @meshinspector/meshlib
19
+ ```
20
+
21
+ ## Use from CDN
22
+
23
+ In the browser you can skip npm entirely and import the module directly:
24
+
25
+ ```js
26
+ // latest version
27
+ import createMeshLib from 'https://js.meshlib.io/meshlib/meshlib.mjs';
28
+
29
+ // or pin a specific version
30
+ import createMeshLib from 'https://js.meshlib.io/meshlib@1.2.3/meshlib.mjs';
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ The default export is an async factory. Await it once to get the module instance, then
36
+ call MeshLib functions on it:
37
+
38
+ ```js
39
+ import createMeshLib from '@meshinspector/meshlib';
40
+
41
+ const ml = await createMeshLib();
42
+
43
+ // Build a cube (side 2) from raw geometry.
44
+ const positions = new Float32Array([
45
+ -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1,
46
+ -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1,
47
+ ]);
48
+ const indices = new Uint32Array([
49
+ 0, 2, 1, 0, 3, 2, 4, 5, 6, 4, 6, 7, 0, 1, 5, 0, 5, 4,
50
+ 3, 6, 2, 3, 7, 6, 0, 4, 7, 0, 7, 3, 1, 2, 6, 1, 6, 5,
51
+ ]);
52
+
53
+ const coords = ml.VertCoords.fromArray(positions);
54
+ const tris = ml.Triangulation.fromArray(indices);
55
+ const mesh = ml.Mesh.fromTriangles(coords, tris);
56
+
57
+ console.log('volume =', mesh.volume()); // ~8
58
+
59
+ // Objects are backed by WebAssembly memory — free them explicitly.
60
+ coords.delete();
61
+ tris.delete();
62
+ mesh.delete();
63
+ ```
64
+
65
+ ## TypeScript
66
+
67
+ The package ships type definitions, so `createMeshLib` and the whole module API are typed with
68
+ no extra setup:
69
+
70
+ ```ts
71
+ import createMeshLib, { type Mesh } from '@meshinspector/meshlib';
72
+
73
+ const ml = await createMeshLib();
74
+ const mesh: Mesh = ml.Mesh.fromTriangles(coords, tris);
75
+ const { valid, distSq } = ml.findProjection(point, mesh);
76
+ ```
77
+
78
+ ## Memory management
79
+
80
+ Values returned from the API (meshes, bit sets, settings, result objects, …) hold
81
+ WebAssembly memory that the JavaScript garbage collector does not reclaim. Call
82
+ `.delete()` on them when you are done to avoid leaks.
83
+
84
+ ## License
85
+
86
+ Free for non-commercial and educational use. See [LICENSE](./LICENSE).
87
+
88
+ For commercial use, contact us at https://meshlib.io/book-a-call/