@metamesh/modeling 0.0.0-stage → 0.6.0

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 (130) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +200 -0
  3. package/README.md +314 -2
  4. package/THIRD_PARTY_NOTICES.md +153 -0
  5. package/dist/api/engine.d.ts +54 -0
  6. package/dist/api/geometry.d.ts +2912 -0
  7. package/dist/api/index.d.ts +1648 -0
  8. package/dist/api/text.d.ts +77 -0
  9. package/dist/engine/construction-operations.js +189 -0
  10. package/dist/engine/execution.js +227 -0
  11. package/dist/engine/export-3mf.js +100 -0
  12. package/dist/engine/extrusion-finishing.js +82 -0
  13. package/dist/engine/finalization.js +214 -0
  14. package/dist/engine/index.js +72 -0
  15. package/dist/engine/inspection-operations.js +52 -0
  16. package/dist/engine/kernel/LICENSE +201 -0
  17. package/dist/engine/kernel/manifold.js +2 -0
  18. package/dist/engine/kernel/manifold.wasm +0 -0
  19. package/dist/engine/loft-operations.js +156 -0
  20. package/dist/engine/mechanical-operations.js +51 -0
  21. package/dist/engine/modeling-context.js +38 -0
  22. package/dist/engine/native/adapter.js +20 -0
  23. package/dist/engine/native/context.js +209 -0
  24. package/dist/engine/native/copied-views.js +46 -0
  25. package/dist/engine/native/index.js +13 -0
  26. package/dist/engine/native/operations.js +115 -0
  27. package/dist/engine/native/ownership.js +98 -0
  28. package/dist/engine/native/regions.js +138 -0
  29. package/dist/engine/native/scoped-primitives.js +127 -0
  30. package/dist/engine/native/scoped-threads.js +34 -0
  31. package/dist/engine/native/threads.js +52 -0
  32. package/dist/engine/native/transforms.js +111 -0
  33. package/dist/engine/operation-environment.js +20 -0
  34. package/dist/engine/pattern-operations.js +36 -0
  35. package/dist/engine/pattern-placements.js +176 -0
  36. package/dist/engine/primitive-anchors.js +70 -0
  37. package/dist/engine/primitive-correspondence.js +74 -0
  38. package/dist/engine/primitive-operations.js +151 -0
  39. package/dist/engine/primitive-profile-types.js +1 -0
  40. package/dist/engine/primitive-profiles.js +250 -0
  41. package/dist/engine/profile-mesh.js +279 -0
  42. package/dist/engine/section-operations.js +93 -0
  43. package/dist/engine/shape-anchors.js +88 -0
  44. package/dist/engine/transform-operations.js +225 -0
  45. package/dist/engine/types.js +1 -0
  46. package/dist/geometry/anchors.js +226 -0
  47. package/dist/geometry/curves/evaluation.js +162 -0
  48. package/dist/geometry/curves/sampling.js +265 -0
  49. package/dist/geometry/curves/types.js +1 -0
  50. package/dist/geometry/cylinder.js +117 -0
  51. package/dist/geometry/edge-finishing.js +160 -0
  52. package/dist/geometry/errors.js +76 -0
  53. package/dist/geometry/extrusion.js +150 -0
  54. package/dist/geometry/heightfield.js +107 -0
  55. package/dist/geometry/index.js +42 -0
  56. package/dist/geometry/loft-correspondence.js +204 -0
  57. package/dist/geometry/loft-geometry.js +184 -0
  58. package/dist/geometry/loft-options.js +56 -0
  59. package/dist/geometry/loft-simple-mesh.js +92 -0
  60. package/dist/geometry/loft-triangulation.js +64 -0
  61. package/dist/geometry/loft.js +80 -0
  62. package/dist/geometry/math/vector3.js +41 -0
  63. package/dist/geometry/mechanical/gear-motion.js +94 -0
  64. package/dist/geometry/mechanical/gears.js +484 -0
  65. package/dist/geometry/mechanical/index.js +13 -0
  66. package/dist/geometry/mechanical/standards.js +67 -0
  67. package/dist/geometry/mechanical/thread-helices.js +44 -0
  68. package/dist/geometry/mechanical/thread-mesh-plan.js +358 -0
  69. package/dist/geometry/mechanical/thread-mesh.js +142 -0
  70. package/dist/geometry/mechanical/thread-profiles.js +368 -0
  71. package/dist/geometry/mechanical/thread-solids.js +230 -0
  72. package/dist/geometry/mechanical/thread-surface.js +433 -0
  73. package/dist/geometry/mechanical/threads.js +138 -0
  74. package/dist/geometry/mesh-planar.js +408 -0
  75. package/dist/geometry/mesh-quality.js +396 -0
  76. package/dist/geometry/mesh-signature.js +137 -0
  77. package/dist/geometry/mesh.js +300 -0
  78. package/dist/geometry/model-limits.js +50 -0
  79. package/dist/geometry/numeric.js +11 -0
  80. package/dist/geometry/paths/frames.js +118 -0
  81. package/dist/geometry/paths/helix.js +49 -0
  82. package/dist/geometry/paths/path.js +30 -0
  83. package/dist/geometry/paths/planar.js +135 -0
  84. package/dist/geometry/paths/resampling.js +124 -0
  85. package/dist/geometry/polygon-clipping.js +52 -0
  86. package/dist/geometry/primitive-options.js +1 -0
  87. package/dist/geometry/primitive-resolution.js +17 -0
  88. package/dist/geometry/primitive-resolvers.js +235 -0
  89. package/dist/geometry/profiles/matched.js +184 -0
  90. package/dist/geometry/profiles/open-profile.js +137 -0
  91. package/dist/geometry/profiles/profiles.js +70 -0
  92. package/dist/geometry/profiles/rectangle.js +235 -0
  93. package/dist/geometry/profiles/shapes.js +34 -0
  94. package/dist/geometry/profiles/span-sampling.js +28 -0
  95. package/dist/geometry/profiles/types.js +1 -0
  96. package/dist/geometry/profiles/validation.js +20 -0
  97. package/dist/geometry/regions.js +371 -0
  98. package/dist/geometry/resolution.js +236 -0
  99. package/dist/geometry/revolve/revolve-mesh.js +123 -0
  100. package/dist/geometry/sampling-limits.js +29 -0
  101. package/dist/geometry/stroke-path.js +181 -0
  102. package/dist/geometry/svg/errors.js +23 -0
  103. package/dist/geometry/svg/fill.js +172 -0
  104. package/dist/geometry/svg/index.js +1 -0
  105. package/dist/geometry/svg/matrix.js +130 -0
  106. package/dist/geometry/svg/parser.js +536 -0
  107. package/dist/geometry/svg/path.js +349 -0
  108. package/dist/geometry/svg/types.js +1 -0
  109. package/dist/geometry/svg-import.js +662 -0
  110. package/dist/geometry/sweeps/options.js +28 -0
  111. package/dist/geometry/sweeps/orientation.js +106 -0
  112. package/dist/geometry/sweeps/stations.js +161 -0
  113. package/dist/geometry/sweeps/sweep-closed.js +96 -0
  114. package/dist/geometry/sweeps/sweep-mesh.js +20 -0
  115. package/dist/geometry/sweeps/sweep-open.js +76 -0
  116. package/dist/geometry/sweeps/validation.js +116 -0
  117. package/dist/geometry/text-contours.js +32 -0
  118. package/dist/geometry/text-layout.js +1 -0
  119. package/dist/geometry/tolerance.js +53 -0
  120. package/dist/geometry/transform-geometry.js +41 -0
  121. package/dist/geometry/transform3.js +340 -0
  122. package/dist/geometry/types.js +1 -0
  123. package/dist/index.js +1 -0
  124. package/dist/model/execution-binding.js +30 -0
  125. package/dist/model/operations.js +152 -0
  126. package/dist/model/options.js +1 -0
  127. package/dist/model/types.js +1 -0
  128. package/dist/text/index.js +48 -0
  129. package/dist/text/vector-text-layout.js +279 -0
  130. package/package.json +100 -3
@@ -0,0 +1,153 @@
1
+ # Third-party notices
2
+
3
+ `dist/geometry-module.js` includes source from the packages listed below. The private
4
+ `dist/engine/kernel/` contains exact Manifold 3.5.4 JS/WASM bytes, verified by SHA-256 during the
5
+ build. Its complete Apache-2.0 license is distributed at `dist/engine/kernel/LICENSE`.
6
+
7
+ ## Manifold 3.5.4 (Apache-2.0)
8
+
9
+ Source: https://github.com/elalish/manifold
10
+
11
+ The package incorporates only the kernel loader and WASM, with their license. Upstream CLI,
12
+ glTF utilities, examples, and their dependencies are excluded.
13
+
14
+ ## polygon-clipping 0.15.7 (MIT)
15
+
16
+ Copyright (c) 2018 Mike Fogel <mike@fogel.ca> - covers everything not specially attributed to
17
+ others below.
18
+
19
+ Copyright (c) 2016 Alexander Milevski <info@w8r.name> - covers all portions originally part of
20
+ github:w8r/martinez, from which this project was forked on February 2, 2018.
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
23
+ associated documentation files (the "Software"), to deal in the Software without restriction,
24
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
25
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
26
+ furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all copies or
29
+ substantial portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
32
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
35
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36
+
37
+ ## splaytree 3.1.2 (MIT)
38
+
39
+ Copyright (c) 2019 Alexander Milevski <info@w8r.name>
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
42
+ associated documentation files (the "Software"), to deal in the Software without restriction,
43
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
44
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all copies or
48
+ substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
51
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
52
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
53
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
54
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55
+
56
+ ## TypeScript runtime helpers in polygon-clipping 0.15.7 (Apache-2.0)
57
+
58
+ Copyright (c) Microsoft Corporation. All rights reserved.
59
+
60
+ Licensed under the Apache License, Version 2.0. A copy of that license is included in `LICENSE`.
61
+
62
+ ## svg-pathdata 9.0.0 (MIT)
63
+
64
+ Copyright © 2017 Nicolas Froidure
65
+
66
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
67
+ associated documentation files (the "Software"), to deal in the Software without restriction,
68
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
69
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all copies or
73
+ substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
76
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
77
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
78
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
79
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
80
+
81
+ ## saxes 6.0.0 (ISC)
82
+
83
+ Copyright (c) Contributors
84
+
85
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without
86
+ fee is hereby granted, provided that the above copyright notice and this permission notice appear
87
+ in all copies.
88
+
89
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
90
+ SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
91
+ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
92
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
93
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
94
+ OF THIS SOFTWARE.
95
+
96
+ Saxes is forked from sax, which carries the following notice:
97
+
98
+ Copyright (c) Isaac Z. Schlueter and Contributors
99
+
100
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without
101
+ fee is hereby granted, provided that the above copyright notice and this permission notice appear
102
+ in all copies.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
105
+ SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
106
+ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
107
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
108
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
109
+ OF THIS SOFTWARE.
110
+
111
+ ## xmlchars 2.2.0 (MIT)
112
+
113
+ Copyright Louis-Dominique Dubeau and contributors to xmlchars
114
+
115
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
116
+ associated documentation files (the "Software"), to deal in the Software without restriction,
117
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
118
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in all copies or
122
+ substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
125
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
126
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
127
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
128
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
129
+
130
+ ## robust-predicates (Unlicense)
131
+
132
+ The browser distribution bundled by polygon-clipping 0.15.7 contains robust-predicates code but
133
+ does not identify a more specific embedded version.
134
+
135
+ This is free and unencumbered software released into the public domain.
136
+
137
+ Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in
138
+ source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by
139
+ any means.
140
+
141
+ In jurisdictions that recognize copyright laws, the author or authors of this software dedicate
142
+ any and all copyright interest in the software to the public domain. We make this dedication for
143
+ the benefit of the public at large and to the detriment of our heirs and successors. We intend this
144
+ dedication to be an overt act of relinquishment in perpetuity of all present and future rights to
145
+ this software under copyright law.
146
+
147
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
148
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
149
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
150
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
151
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
152
+
153
+ For more information, please refer to <http://unlicense.org/>.
@@ -0,0 +1,54 @@
1
+ import type { TriangleMesh } from "@metamesh/modeling/geometry";
2
+ import type { BuildOutput, FinalizedModel, GeometryResolution, ModelingContext, ModelingLimits, FinalizedPart, GeometrySamplingLimits } from "@metamesh/modeling";
3
+ /** Default host resource ceilings for parts, vertices, triangles, and transferable bytes. */
4
+ declare const defaultModelingLimits: Readonly<ModelingLimits>;
5
+
6
+
7
+ /** Execution settings supplied by the host, independently of generator metadata. */
8
+ export interface BuildOptions {
9
+ /** Per-build limits, no larger than the configured engine ceilings. */
10
+ readonly limits?: Partial<ModelingLimits>;
11
+ /** Physical sampling defaults; model-derived contexts and exact counts override these. */
12
+ readonly resolution?: GeometryResolution;
13
+ /** Optional bounded planar cleanup; unsupported candidates preserve the original part. */
14
+ readonly meshTopologyMode?: "original" | "optimized";
15
+ }
16
+ /** Host engine. No native values or manually disposable handles are exposed. */
17
+ export interface ModelEngine {
18
+ /** Immutable resource ceilings selected when this engine was initialized. */
19
+ readonly limits: ModelingLimits;
20
+ /** Runs once, finalizes copied parts, and disposes all native values on every exit. */
21
+ build(build: (model: ModelingContext) => BuildOutput, options?: BuildOptions): FinalizedModel;
22
+ /** Serializes already finalized mesh parts; never prepares or builds a generator again. */
23
+ export3mf(parts: readonly ExportMeshPart[], options?: Export3mfOptions): Promise<ArrayBuffer>;
24
+ }
25
+ /** Manufacturing buffers accepted by the snapshot exporter. */
26
+ export interface ExportMeshPart extends TriangleMesh {
27
+ /** Stable canonical lowercase identity; unique within the containing topology or output. */
28
+ readonly id: string;
29
+ /** Optional six-digit hex RGB display color. */
30
+ readonly color?: string;
31
+ }
32
+ /** Completed-snapshot serialization settings; filename selection belongs to the host. */
33
+ export interface Export3mfOptions {
34
+ /** Document display name; defaults to MetaMesh model. */
35
+ readonly name?: string;
36
+ }
37
+ /** Kernel asset initialization. Networking and Worker ownership remain with the host. */
38
+ export interface ModelEngineOptions {
39
+ /** Resolves the kernel's WASM asset. Browser hosts supply their bundled asset URL. */
40
+ readonly locateFile?: () => string;
41
+ /** Trusted application ceilings. Builds may lower them; generators receive no engine. */
42
+ readonly limits?: Partial<ModelingLimits>;
43
+ }
44
+
45
+
46
+
47
+
48
+ export { defaultModelingLimits };
49
+ /** URL of the package's pinned WASM asset; browser bundlers may replace it with their emitted URL. */
50
+ export declare const modelingWasmUrl: string;
51
+
52
+ /** Initializes one host kernel and returns a lifecycle-safe engine. No generator initializes WASM. */
53
+ export declare function createModelEngine(options?: ModelEngineOptions): Promise<ModelEngine>;
54
+ export type { BuildOutput, FinalizedModel, FinalizedPart, ModelingContext, ModelingLimits, GeometryResolution, GeometrySamplingLimits, };