@threepipe/plugin-svg-renderer 0.1.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 (206) hide show
  1. package/LICENSE +674 -0
  2. package/dist/BasicSVGRendererPlugin.d.ts +26 -0
  3. package/dist/BasicSVGRendererPlugin.d.ts.map +1 -0
  4. package/dist/ThreeSVGRendererPlugin.d.ts +100 -0
  5. package/dist/ThreeSVGRendererPlugin.d.ts.map +1 -0
  6. package/dist/basic/BasicSVGRenderer.d.ts +10 -0
  7. package/dist/basic/BasicSVGRenderer.d.ts.map +1 -0
  8. package/dist/dependencies.txt +315 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +16798 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/index.mjs +16798 -0
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/three-mesh-halfedge/augments.d.ts +8 -0
  16. package/dist/three-mesh-halfedge/augments.d.ts.map +1 -0
  17. package/dist/three-mesh-halfedge/core/Face.d.ts +39 -0
  18. package/dist/three-mesh-halfedge/core/Face.d.ts.map +1 -0
  19. package/dist/three-mesh-halfedge/core/Halfedge.d.ts +40 -0
  20. package/dist/three-mesh-halfedge/core/Halfedge.d.ts.map +1 -0
  21. package/dist/three-mesh-halfedge/core/HalfedgeDS.d.ts +109 -0
  22. package/dist/three-mesh-halfedge/core/HalfedgeDS.d.ts.map +1 -0
  23. package/dist/three-mesh-halfedge/core/Vertex.d.ts +69 -0
  24. package/dist/three-mesh-halfedge/core/Vertex.d.ts.map +1 -0
  25. package/dist/three-mesh-halfedge/core/Vertex.test.d.ts +1 -0
  26. package/dist/three-mesh-halfedge/core/Vertex.test.d.ts.map +1 -0
  27. package/dist/three-mesh-halfedge/index.d.ts +5 -0
  28. package/dist/three-mesh-halfedge/index.d.ts.map +1 -0
  29. package/dist/three-mesh-halfedge/operations/addEdge.d.ts +5 -0
  30. package/dist/three-mesh-halfedge/operations/addEdge.d.ts.map +1 -0
  31. package/dist/three-mesh-halfedge/operations/addEdge.test.d.ts +1 -0
  32. package/dist/three-mesh-halfedge/operations/addEdge.test.d.ts.map +1 -0
  33. package/dist/three-mesh-halfedge/operations/addFace.d.ts +5 -0
  34. package/dist/three-mesh-halfedge/operations/addFace.d.ts.map +1 -0
  35. package/dist/three-mesh-halfedge/operations/addVertex.d.ts +5 -0
  36. package/dist/three-mesh-halfedge/operations/addVertex.d.ts.map +1 -0
  37. package/dist/three-mesh-halfedge/operations/addVertex.test.d.ts +1 -0
  38. package/dist/three-mesh-halfedge/operations/addVertex.test.d.ts.map +1 -0
  39. package/dist/three-mesh-halfedge/operations/cutFace.d.ts +6 -0
  40. package/dist/three-mesh-halfedge/operations/cutFace.d.ts.map +1 -0
  41. package/dist/three-mesh-halfedge/operations/cutFace.test.d.ts +1 -0
  42. package/dist/three-mesh-halfedge/operations/cutFace.test.d.ts.map +1 -0
  43. package/dist/three-mesh-halfedge/operations/removeEdge.d.ts +4 -0
  44. package/dist/three-mesh-halfedge/operations/removeEdge.d.ts.map +1 -0
  45. package/dist/three-mesh-halfedge/operations/removeFace.d.ts +4 -0
  46. package/dist/three-mesh-halfedge/operations/removeFace.d.ts.map +1 -0
  47. package/dist/three-mesh-halfedge/operations/removeVertex.d.ts +4 -0
  48. package/dist/three-mesh-halfedge/operations/removeVertex.d.ts.map +1 -0
  49. package/dist/three-mesh-halfedge/operations/setFromGeometry.d.ts +13 -0
  50. package/dist/three-mesh-halfedge/operations/setFromGeometry.d.ts.map +1 -0
  51. package/dist/three-mesh-halfedge/operations/setFromGeometry.test.d.ts +1 -0
  52. package/dist/three-mesh-halfedge/operations/setFromGeometry.test.d.ts.map +1 -0
  53. package/dist/three-mesh-halfedge/operations/splitEdge.d.ts +6 -0
  54. package/dist/three-mesh-halfedge/operations/splitEdge.d.ts.map +1 -0
  55. package/dist/three-mesh-halfedge/setuptests.d.ts +1 -0
  56. package/dist/three-mesh-halfedge/setuptests.d.ts.map +1 -0
  57. package/dist/three-mesh-halfedge/utils/geometry.d.ts +5 -0
  58. package/dist/three-mesh-halfedge/utils/geometry.d.ts.map +1 -0
  59. package/dist/three-mesh-halfedge/utils/testutils.d.ts +3 -0
  60. package/dist/three-mesh-halfedge/utils/testutils.d.ts.map +1 -0
  61. package/dist/three-svg-renderer/SVGRenderer.d.ts +58 -0
  62. package/dist/three-svg-renderer/SVGRenderer.d.ts.map +1 -0
  63. package/dist/three-svg-renderer/core/SVGMesh.d.ts +57 -0
  64. package/dist/three-svg-renderer/core/SVGMesh.d.ts.map +1 -0
  65. package/dist/three-svg-renderer/core/index.d.ts +4 -0
  66. package/dist/three-svg-renderer/core/index.d.ts.map +1 -0
  67. package/dist/three-svg-renderer/core/svg/SVGDrawHandler.d.ts +23 -0
  68. package/dist/three-svg-renderer/core/svg/SVGDrawHandler.d.ts.map +1 -0
  69. package/dist/three-svg-renderer/core/svg/index.d.ts +3 -0
  70. package/dist/three-svg-renderer/core/svg/index.d.ts.map +1 -0
  71. package/dist/three-svg-renderer/core/svg/passes/ChainPass.d.ts +112 -0
  72. package/dist/three-svg-renderer/core/svg/passes/ChainPass.d.ts.map +1 -0
  73. package/dist/three-svg-renderer/core/svg/passes/DrawPass.d.ts +22 -0
  74. package/dist/three-svg-renderer/core/svg/passes/DrawPass.d.ts.map +1 -0
  75. package/dist/three-svg-renderer/core/svg/passes/FillPass.d.ts +46 -0
  76. package/dist/three-svg-renderer/core/svg/passes/FillPass.d.ts.map +1 -0
  77. package/dist/three-svg-renderer/core/svg/passes/SingularityPointPass.d.ts +16 -0
  78. package/dist/three-svg-renderer/core/svg/passes/SingularityPointPass.d.ts.map +1 -0
  79. package/dist/three-svg-renderer/core/svg/passes/TexturePass.d.ts +1 -0
  80. package/dist/three-svg-renderer/core/svg/passes/TexturePass.d.ts.map +1 -0
  81. package/dist/three-svg-renderer/core/svg/passes/index.d.ts +5 -0
  82. package/dist/three-svg-renderer/core/svg/passes/index.d.ts.map +1 -0
  83. package/dist/three-svg-renderer/core/svg/svgutils.d.ts +10 -0
  84. package/dist/three-svg-renderer/core/svg/svgutils.d.ts.map +1 -0
  85. package/dist/three-svg-renderer/core/viewmap/Chain.d.ts +26 -0
  86. package/dist/three-svg-renderer/core/viewmap/Chain.d.ts.map +1 -0
  87. package/dist/three-svg-renderer/core/viewmap/Polygon.d.ts +12 -0
  88. package/dist/three-svg-renderer/core/viewmap/Polygon.d.ts.map +1 -0
  89. package/dist/three-svg-renderer/core/viewmap/ViewEdge.d.ts +67 -0
  90. package/dist/three-svg-renderer/core/viewmap/ViewEdge.d.ts.map +1 -0
  91. package/dist/three-svg-renderer/core/viewmap/ViewVertex.d.ts +27 -0
  92. package/dist/three-svg-renderer/core/viewmap/ViewVertex.d.ts.map +1 -0
  93. package/dist/three-svg-renderer/core/viewmap/Viewmap.d.ts +83 -0
  94. package/dist/three-svg-renderer/core/viewmap/Viewmap.d.ts.map +1 -0
  95. package/dist/three-svg-renderer/core/viewmap/index.d.ts +6 -0
  96. package/dist/three-svg-renderer/core/viewmap/index.d.ts.map +1 -0
  97. package/dist/three-svg-renderer/core/viewmap/operations/assignPolygons.d.ts +11 -0
  98. package/dist/three-svg-renderer/core/viewmap/operations/assignPolygons.d.ts.map +1 -0
  99. package/dist/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.d.ts +19 -0
  100. package/dist/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.d.ts.map +1 -0
  101. package/dist/three-svg-renderer/core/viewmap/operations/computeMeshIntersections.d.ts +11 -0
  102. package/dist/three-svg-renderer/core/viewmap/operations/computeMeshIntersections.d.ts.map +1 -0
  103. package/dist/three-svg-renderer/core/viewmap/operations/computePolygons.d.ts +17 -0
  104. package/dist/three-svg-renderer/core/viewmap/operations/computePolygons.d.ts.map +1 -0
  105. package/dist/three-svg-renderer/core/viewmap/operations/createChains.d.ts +7 -0
  106. package/dist/three-svg-renderer/core/viewmap/operations/createChains.d.ts.map +1 -0
  107. package/dist/three-svg-renderer/core/viewmap/operations/createViewVertex.d.ts +11 -0
  108. package/dist/three-svg-renderer/core/viewmap/operations/createViewVertex.d.ts.map +1 -0
  109. package/dist/three-svg-renderer/core/viewmap/operations/find2dSingularities.d.ts +9 -0
  110. package/dist/three-svg-renderer/core/viewmap/operations/find2dSingularities.d.ts.map +1 -0
  111. package/dist/three-svg-renderer/core/viewmap/operations/find3dSingularities.d.ts +26 -0
  112. package/dist/three-svg-renderer/core/viewmap/operations/find3dSingularities.d.ts.map +1 -0
  113. package/dist/three-svg-renderer/core/viewmap/operations/meshIntersectionCb.d.ts +18 -0
  114. package/dist/three-svg-renderer/core/viewmap/operations/meshIntersectionCb.d.ts.map +1 -0
  115. package/dist/three-svg-renderer/core/viewmap/operations/setupEdges.d.ts +25 -0
  116. package/dist/three-svg-renderer/core/viewmap/operations/setupEdges.d.ts.map +1 -0
  117. package/dist/three-svg-renderer/core/viewmap/operations/splitEdge.d.ts +20 -0
  118. package/dist/three-svg-renderer/core/viewmap/operations/splitEdge.d.ts.map +1 -0
  119. package/dist/three-svg-renderer/index.d.ts +4 -0
  120. package/dist/three-svg-renderer/index.d.ts.map +1 -0
  121. package/dist/three-svg-renderer/setuptests.d.ts +1 -0
  122. package/dist/three-svg-renderer/setuptests.d.ts.map +1 -0
  123. package/dist/three-svg-renderer/utils/buffergeometry.d.ts +17 -0
  124. package/dist/three-svg-renderer/utils/buffergeometry.d.ts.map +1 -0
  125. package/dist/three-svg-renderer/utils/geometry.d.ts +45 -0
  126. package/dist/three-svg-renderer/utils/geometry.d.ts.map +1 -0
  127. package/dist/three-svg-renderer/utils/geometry.test.d.ts +1 -0
  128. package/dist/three-svg-renderer/utils/geometry.test.d.ts.map +1 -0
  129. package/dist/three-svg-renderer/utils/index.d.ts +4 -0
  130. package/dist/three-svg-renderer/utils/index.d.ts.map +1 -0
  131. package/dist/three-svg-renderer/utils/objects.d.ts +2 -0
  132. package/dist/three-svg-renderer/utils/objects.d.ts.map +1 -0
  133. package/dist/three-svg-renderer/utils/orientationtests.d.ts +65 -0
  134. package/dist/three-svg-renderer/utils/orientationtests.d.ts.map +1 -0
  135. package/dist/three-svg-renderer/utils/testutils.d.ts +1 -0
  136. package/dist/three-svg-renderer/utils/testutils.d.ts.map +1 -0
  137. package/package.json +34 -0
  138. package/src/BasicSVGRendererPlugin.ts +110 -0
  139. package/src/ThreeSVGRendererPlugin.ts +405 -0
  140. package/src/basic/BasicSVGRenderer.ts +23 -0
  141. package/src/global.d.ts +40 -0
  142. package/src/index.ts +5 -0
  143. package/src/three-mesh-halfedge/LICENSE +21 -0
  144. package/src/three-mesh-halfedge/augments.ts +35 -0
  145. package/src/three-mesh-halfedge/core/Face.ts +122 -0
  146. package/src/three-mesh-halfedge/core/Halfedge.ts +109 -0
  147. package/src/three-mesh-halfedge/core/HalfedgeDS.ts +192 -0
  148. package/src/three-mesh-halfedge/core/Vertex.test.ts +185 -0
  149. package/src/three-mesh-halfedge/core/Vertex.ts +192 -0
  150. package/src/three-mesh-halfedge/index.ts +6 -0
  151. package/src/three-mesh-halfedge/operations/addEdge.test.ts +119 -0
  152. package/src/three-mesh-halfedge/operations/addEdge.ts +100 -0
  153. package/src/three-mesh-halfedge/operations/addFace.ts +108 -0
  154. package/src/three-mesh-halfedge/operations/addVertex.test.ts +60 -0
  155. package/src/three-mesh-halfedge/operations/addVertex.ts +38 -0
  156. package/src/three-mesh-halfedge/operations/cutFace.test.ts +157 -0
  157. package/src/three-mesh-halfedge/operations/cutFace.ts +162 -0
  158. package/src/three-mesh-halfedge/operations/removeEdge.ts +84 -0
  159. package/src/three-mesh-halfedge/operations/removeFace.ts +30 -0
  160. package/src/three-mesh-halfedge/operations/removeVertex.ts +53 -0
  161. package/src/three-mesh-halfedge/operations/setFromGeometry.test.ts +216 -0
  162. package/src/three-mesh-halfedge/operations/setFromGeometry.ts +174 -0
  163. package/src/three-mesh-halfedge/operations/splitEdge.ts +80 -0
  164. package/src/three-mesh-halfedge/setuptests.ts +16 -0
  165. package/src/three-mesh-halfedge/utils/geometry.ts +44 -0
  166. package/src/three-mesh-halfedge/utils/testutils.ts +83 -0
  167. package/src/three-svg-renderer/LICENSE +674 -0
  168. package/src/three-svg-renderer/SVGRenderer.ts +141 -0
  169. package/src/three-svg-renderer/core/SVGMesh.ts +172 -0
  170. package/src/three-svg-renderer/core/index.ts +17 -0
  171. package/src/three-svg-renderer/core/svg/SVGDrawHandler.ts +78 -0
  172. package/src/three-svg-renderer/core/svg/index.ts +21 -0
  173. package/src/three-svg-renderer/core/svg/passes/ChainPass.ts +303 -0
  174. package/src/three-svg-renderer/core/svg/passes/DrawPass.ts +37 -0
  175. package/src/three-svg-renderer/core/svg/passes/FillPass.ts +227 -0
  176. package/src/three-svg-renderer/core/svg/passes/SingularityPointPass.ts +126 -0
  177. package/src/three-svg-renderer/core/svg/passes/TexturePass.ts +440 -0
  178. package/src/three-svg-renderer/core/svg/passes/index.ts +19 -0
  179. package/src/three-svg-renderer/core/svg/svgutils.ts +152 -0
  180. package/src/three-svg-renderer/core/viewmap/Chain.ts +82 -0
  181. package/src/three-svg-renderer/core/viewmap/Polygon.ts +34 -0
  182. package/src/three-svg-renderer/core/viewmap/ViewEdge.ts +143 -0
  183. package/src/three-svg-renderer/core/viewmap/ViewVertex.ts +74 -0
  184. package/src/three-svg-renderer/core/viewmap/Viewmap.ts +389 -0
  185. package/src/three-svg-renderer/core/viewmap/index.ts +24 -0
  186. package/src/three-svg-renderer/core/viewmap/operations/assignPolygons.ts +85 -0
  187. package/src/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.ts +147 -0
  188. package/src/three-svg-renderer/core/viewmap/operations/computeMeshIntersections.ts +129 -0
  189. package/src/three-svg-renderer/core/viewmap/operations/computePolygons.ts +112 -0
  190. package/src/three-svg-renderer/core/viewmap/operations/createChains.ts +82 -0
  191. package/src/three-svg-renderer/core/viewmap/operations/createViewVertex.ts +42 -0
  192. package/src/three-svg-renderer/core/viewmap/operations/find2dSingularities.ts +126 -0
  193. package/src/three-svg-renderer/core/viewmap/operations/find3dSingularities.ts +176 -0
  194. package/src/three-svg-renderer/core/viewmap/operations/meshIntersectionCb.ts +86 -0
  195. package/src/three-svg-renderer/core/viewmap/operations/setupEdges.ts +152 -0
  196. package/src/three-svg-renderer/core/viewmap/operations/splitEdge.ts +197 -0
  197. package/src/three-svg-renderer/index.ts +15 -0
  198. package/src/three-svg-renderer/setuptests.ts +15 -0
  199. package/src/three-svg-renderer/types/isect/index.d.ts +65 -0
  200. package/src/three-svg-renderer/utils/buffergeometry.ts +66 -0
  201. package/src/three-svg-renderer/utils/geometry.test.ts +95 -0
  202. package/src/three-svg-renderer/utils/geometry.ts +156 -0
  203. package/src/three-svg-renderer/utils/index.ts +17 -0
  204. package/src/three-svg-renderer/utils/objects.ts +24 -0
  205. package/src/three-svg-renderer/utils/orientationtests.ts +108 -0
  206. package/src/three-svg-renderer/utils/testutils.ts +64 -0
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ interface Array<T> {
3
+ clear(): Array<T>;
4
+ remove(t: T): boolean;
5
+ }
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=augments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augments.d.ts","sourceRoot":"","sources":["../../src/three-mesh-halfedge/augments.ts"],"names":[],"mappings":"AAYA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,CAAC;QACf,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;KACvB;CACF;AAgBD,OAAO,EAAE,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ import { Vertex } from './Vertex';
3
+ import { Halfedge } from './Halfedge';
4
+ export declare class Face {
5
+ halfedge: Halfedge;
6
+ constructor(halfEdge: Halfedge);
7
+ getNormal(target: Vector3): void;
8
+ getMidpoint(target: Vector3): void;
9
+ /**
10
+ * Returns wether the face facing the given position
11
+ *
12
+ * @param position The position
13
+ * @return `true` if face is front facing, `false` otherwise.
14
+ */
15
+ isFront(position: Vector3): boolean;
16
+ /**
17
+ * Returns the face halfedge containing the given position.
18
+ * @param position Target position
19
+ * @param tolerance Tolerance
20
+ * @returns `HalfEdge` if found, `null` otherwise
21
+ */
22
+ halfedgeFromPosition(position: Vector3, tolerance?: number): Halfedge | null;
23
+ /**
24
+ * Returns the face vertex that matches the given position within the tolerance
25
+ * @param position
26
+ * @param tolerance
27
+ * @returns
28
+ */
29
+ vertexFromPosition(position: Vector3, tolerance?: number): Vertex | null;
30
+ /**
31
+ * Returns the face halfedge starting from the given vertex
32
+
33
+ * @param vertex
34
+ * @returns
35
+ */
36
+ halfedgeFromVertex(vertex: Vertex): Halfedge | null;
37
+ hasVertex(vertex: Vertex): boolean;
38
+ }
39
+ //# sourceMappingURL=Face.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Face.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/core/Face.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAY,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAOtC,qBAAa,IAAI;IAEf,QAAQ,EAAE,QAAQ,CAAC;gBAEP,QAAQ,EAAE,QAAQ;IAI9B,SAAS,CAAC,MAAM,EAAE,OAAO;IASzB,WAAW,CAAC,MAAM,EAAE,OAAO;IAS3B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,OAAO;IAQzB;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,SAAQ,GAAG,QAAQ,GAAG,IAAI;IAU3E;;;;;OAKG;IACH,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,SAAQ,GAAG,MAAM,GAAG,IAAI;IAcvE;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM;IAUjC,SAAS,CAAC,MAAM,EAAE,MAAM;CAQzB"}
@@ -0,0 +1,40 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ import { Face } from './Face';
3
+ import { Vertex } from './Vertex';
4
+ export declare class Halfedge {
5
+ vertex: Vertex;
6
+ face: Face | null;
7
+ twin: Halfedge;
8
+ prev: Halfedge;
9
+ next: Halfedge;
10
+ constructor(vertex: Vertex);
11
+ get id(): string;
12
+ containsPoint(point: Vector3, tolerance?: number): boolean;
13
+ /**
14
+ * Indicates whether the halfedge is free (i.e. no connected face)
15
+ *
16
+ * @type {boolean}
17
+ */
18
+ isFree(): boolean;
19
+ /**
20
+ * Indicated wetcher the halfedge is a boundary (i.e. no connected face but
21
+ * twin has a face)
22
+ */
23
+ isBoundary(): boolean;
24
+ /**
25
+ * Returns true if the halfedge is concave, false if convexe.
26
+ * IMPORTANT: Returns false if halfedge has no twin.
27
+ *
28
+ * @type {boolean}
29
+ */
30
+ get isConcave(): boolean;
31
+ /**
32
+ * Returns a generator looping over all the next halfedges
33
+ */
34
+ nextLoop(): Generator<Halfedge, null, unknown>;
35
+ /**
36
+ * Returns a generator looping over all the previous halfedges
37
+ */
38
+ prevLoop(): Generator<Halfedge, null, unknown>;
39
+ }
40
+ //# sourceMappingURL=Halfedge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Halfedge.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/core/Halfedge.ts"],"names":[],"mappings":"AAYA,OAAO,EAAS,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,qBAAa,QAAQ;IAEnB,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;gBAEX,MAAM,EAAE,MAAM;IAI1B,IAAI,EAAE,WAEL;IAED,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAQ,GAAG,OAAO;IAQzD;;;;OAIG;IACH,MAAM;IAIN;;;OAGG;IACH,UAAU;IAIV;;;;;OAKG;IACH,IAAI,SAAS,YASZ;IAED;;OAEG;IACF,QAAQ;IAUT;;OAEG;IACF,QAAQ;CAUV"}
@@ -0,0 +1,109 @@
1
+ import { BufferGeometry, Vector3 } from '../../threepipe';
2
+ import { Face } from './Face';
3
+ import { Vertex } from './Vertex';
4
+ import { Halfedge } from './Halfedge';
5
+ /**
6
+ * Class representing an Halfedge Data Structure
7
+ */
8
+ export declare class HalfedgeDS {
9
+ /** @readonly Faces */
10
+ readonly faces: Face[];
11
+ /** @readonly Vertices */
12
+ readonly vertices: Vertex[];
13
+ /** @readonly Halfedges */
14
+ readonly halfedges: Halfedge[];
15
+ /**
16
+ * Sets the halfedge structure from a BufferGeometry.
17
+ * @param geometry BufferGeometry to read
18
+ * @param tolerance Tolerance distance from which positions are considered equal
19
+ */
20
+ setFromGeometry(geometry: BufferGeometry, tolerance?: number): void;
21
+ /**
22
+ * Returns an array of all the halfedge loops in the structure.
23
+ *
24
+ * *Note: Actually returns an array of halfedges from which loop generator
25
+ * can be called*
26
+ *
27
+ * @returns
28
+ */
29
+ loops(): Halfedge[];
30
+ /**
31
+ * Clear the structure data
32
+ */
33
+ clear(): void;
34
+ /**
35
+ * Adds a new vertex to the structure at the given position and returns it.
36
+ * If checkDuplicates is true, returns any existing vertex that matches the
37
+ * given position.
38
+ *
39
+ * @param position New vertex position
40
+ * @param checkDuplicates Enable/disable existing vertex matching, default false
41
+ * @param tolerance Tolerance used for vertices position comparison
42
+ * @returns
43
+ */
44
+ addVertex(position: Vector3, checkDuplicates?: boolean, tolerance?: number): Vertex;
45
+ /**
46
+ * Adds an edge (i.e. a pair of halfedges) between the given vertices.
47
+ * Requires vertices to be free, i.e., there is at least one free halfedge
48
+ * (i.e. without face) in their neighborhood.
49
+ *
50
+ * @param v1 First vertex to link
51
+ * @param v2 Second vertex to link
52
+ * @param allowParallels Allows multiple pair of halfedges between vertices, default false
53
+ * @returns Existing or new halfedge
54
+ */
55
+ addEdge(v1: Vertex, v2: Vertex, allowParallels?: boolean): Halfedge;
56
+ /**
57
+ * Adds a face to an existing halfedge loop
58
+ * @param halfedge
59
+ * @returns
60
+ */
61
+ addFace(halfedges: Halfedge[]): Face;
62
+ /**
63
+ * Removes a vertex from the structure
64
+ * @param vertex Vertex to remove
65
+ * @param mergeFaces If true, merges connected faces if any, otherwise removes them. Default true
66
+ */
67
+ removeVertex(vertex: Vertex, mergeFaces?: boolean): void;
68
+ /**
69
+ * Removes an edge from the structrure
70
+ * @param halfedge Halfedge to remove
71
+ * @param mergeFaces If true, merges connected faces if any, otherwise removes them. Default true
72
+ */
73
+ removeEdge(halfedge: Halfedge, mergeFaces?: boolean): void;
74
+ /**
75
+ * Removes a face from the structure.
76
+ * @param face Face to remove
77
+ */
78
+ removeFace(face: Face): void;
79
+ /**ts
80
+ * Cuts the `face` between the vertices `v1` and `v2`.
81
+ * v1 and v2 must either be vertices of the face or isolated vertices.
82
+ *
83
+ * To test if a new face is created, simply do
84
+ * ```
85
+ * const halfedge = struct.cutFace(face, v1, v2, true);
86
+ * if (halfedge.face !== halfedge.twin.face) {
87
+ * // Halfedge are on different faces / loops
88
+ * const existingFace = halfedge.face;
89
+ * const newFace = halfedge.twin.face;
90
+ * }
91
+ * ```
92
+ *
93
+ *
94
+ * @param face Face to cut
95
+ * @param v1 1st vertex
96
+ * @param v2 2nd vertex
97
+ * @param createNewFace wether to create a new face or not when cutting
98
+ * @returns the cutting halfedge
99
+ */
100
+ cutFace(face: Face, v1: Vertex, v2: Vertex, createNewFace?: boolean): Halfedge;
101
+ /**
102
+ * Splits the halfedge at position and returns the new vertex
103
+ * @param halfEdge The HalfEdge to be splitted
104
+ * @param position Position of the split vertex
105
+ * @returns the new created vertex
106
+ */
107
+ splitEdge(halfedge: Halfedge, position: Vector3, tolerance?: number): Vertex;
108
+ }
109
+ //# sourceMappingURL=HalfedgeDS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HalfedgeDS.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/core/HalfedgeDS.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,cAAc,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAYpC;;GAEG;AACH,qBAAa,UAAU;IAErB,sBAAsB;IACtB,QAAQ,CAAC,KAAK,SAAqB;IACnC,yBAAyB;IACzB,QAAQ,CAAC,QAAQ,WAAuB;IACxC,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,aAAyB;IAE3C;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,SAAQ;IAI3D;;;;;;;OAOG;IACH,KAAK;IAiBL;;OAEG;IACH,KAAK;IAML;;;;;;;;;OASG;IACH,SAAS,CACL,QAAQ,EAAE,OAAO,EACjB,eAAe,UAAQ,EACvB,SAAS,SAAQ;IAIrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,UAAQ;IAItD;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE;IAI7B;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,UAAO;IAI9C;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,UAAO;IAIhD;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI;IAIrB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,UAAO;IAIhE;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,SAAQ;CAInE"}
@@ -0,0 +1,69 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ import type { Face } from './Face';
3
+ import { Halfedge } from './Halfedge';
4
+ export declare class Vertex {
5
+ /** Vertex position */
6
+ readonly position: Vector3;
7
+ /** Reference to one halfedge starting from the vertex */
8
+ halfedge: Halfedge | null;
9
+ id: number;
10
+ constructor();
11
+ /**
12
+ * Returns a generator of free halfedges starting from this vertex.
13
+ * @param start The halfedge to start, default is vertex halfedge
14
+ */
15
+ freeHalfedgesOutLoop(start?: Halfedge | null): Generator<Halfedge, null, unknown>;
16
+ /**
17
+ * Returns a generator of free halfedges arriving to this vertex.
18
+ * @param start The halfedge to start, default is vertex halfedge
19
+ */
20
+ freeHalfedgesInLoop(start?: Halfedge | null): Generator<Halfedge, null, unknown>;
21
+ /**
22
+ * Returns a generator of boundary halfedges starting from this vertex.
23
+ * @param start The halfedge to start, default is vertex halfedge
24
+ */
25
+ boundaryHalfedgesOutLoop(start?: Halfedge | null): Generator<Halfedge, null, unknown>;
26
+ /**
27
+ * Returns a generator of boundary halfedges arriving to this vertex.
28
+ * @param start The halfedge to start, default is vertex halfedge
29
+ */
30
+ boundaryHalfedgesInLoop(start?: Halfedge | null): Generator<Halfedge, null, unknown>;
31
+ /**
32
+ * Returns whether the vertex is free, i.e. on of its ongoing halfedge has no
33
+ * face.
34
+ *
35
+ * @ref https://kaba.hilvi.org/homepage/blog/halfedge/halfedge.htm
36
+ *
37
+ * @returns `true` if free, `false` otherwise
38
+ */
39
+ isFree(): boolean;
40
+ isIsolated(): boolean;
41
+ commonFacesWithVertex(other: Vertex): Face[];
42
+ /**
43
+ * Checkes whether the vertex matches the given position
44
+ *
45
+ * @param {Vector3} position The position
46
+ * @param {number} [tolerance=1e-10] The tolerance
47
+ * @return {boolean}
48
+ */
49
+ matchesPosition(position: Vector3, tolerance?: number): boolean;
50
+ /**
51
+ * Returns the halfedge going from *this* vertex to *other* vertex if any.
52
+ * @param other The other vertex
53
+ * @returns `HalfEdge` if found, `null` otherwise.
54
+ */
55
+ getHalfedgeToVertex(other: Vertex): Halfedge | null;
56
+ isConnectedToVertex(other: Vertex): boolean;
57
+ static MAX_LOOP: number;
58
+ /**
59
+ * Returns a generator of halfedges starting from this vertex in CW order.
60
+ * @param start The halfedge to start looping, default is vertex halfedge
61
+ */
62
+ loopCW(start?: Halfedge | null, maxLoop?: number): Generator<Halfedge, null, unknown>;
63
+ /**
64
+ * Returns a generator of halfedges starting from this vertex in CCW order.
65
+ * @param start The halfedge to start, default is vertex halfedge
66
+ */
67
+ loopCCW(start?: Halfedge | null, maxLoop?: number): Generator<Halfedge, null, unknown>;
68
+ }
69
+ //# sourceMappingURL=Vertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Vertex.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/core/Vertex.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAKpC,qBAAa,MAAM;IACjB,sBAAsB;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAiB;IAE3C,yDAAyD;IACzD,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAEjC,EAAE,EAAE,MAAM,CAAC;;IAOX;;;OAGG;IACF,oBAAoB,CAAC,KAAK,kBAAgB;IAS3C;;;MAGE;IACD,mBAAmB,CAAC,KAAK,kBAAgB;IAS1C;;;OAGG;IACF,wBAAwB,CAAC,KAAK,kBAAgB;IAS/C;;;MAGE;IACD,uBAAuB,CAAC,KAAK,kBAAgB;IAS9C;;;;;;;OAOG;IACH,MAAM;IAYN,UAAU;IAIV,qBAAqB,CAAC,KAAK,EAAE,MAAM;IAUnC;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,SAAQ,GAAG,OAAO;IAK9D;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IASnD,mBAAmB,CAAC,KAAK,EAAE,MAAM;IAIjC,MAAM,CAAC,QAAQ,SAAY;IAC3B;;;OAGG;IACF,MAAM,CAAC,KAAK,kBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM;IAgB/C;;;OAGG;IACF,OAAO,CAAC,KAAK,kBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM;CAejD"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=Vertex.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Vertex.test.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/core/Vertex.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export { HalfedgeDS } from './core/HalfedgeDS';
2
+ export { Face } from './core/Face';
3
+ export { Vertex } from './core/Vertex';
4
+ export { Halfedge } from './core/Halfedge';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/three-mesh-halfedge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEzC,OAAO,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Halfedge } from "../core/Halfedge";
2
+ import { HalfedgeDS } from "../core/HalfedgeDS";
3
+ import { Vertex } from "../core/Vertex";
4
+ export declare function addEdge(struct: HalfedgeDS, v1: Vertex, v2: Vertex, allowParallels?: boolean): Halfedge;
5
+ //# sourceMappingURL=addEdge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addEdge.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/addEdge.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,wBAAgB,OAAO,CACnB,MAAM,EAAE,UAAU,EAClB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,cAAc,UAAQ,YA4EzB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=addEdge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addEdge.test.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/addEdge.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { Face } from "../core/Face";
2
+ import { Halfedge } from "../core/Halfedge";
3
+ import { HalfedgeDS } from "../core/HalfedgeDS";
4
+ export declare function addFace(struct: HalfedgeDS, halfedges: Halfedge[]): Face;
5
+ //# sourceMappingURL=addFace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addFace.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/addFace.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAwChE"}
@@ -0,0 +1,5 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ import { HalfedgeDS } from "../core/HalfedgeDS";
3
+ import { Vertex } from "../core/Vertex";
4
+ export declare function addVertex(struct: HalfedgeDS, position: Vector3, checkDuplicates?: boolean, tolerance?: number): Vertex;
5
+ //# sourceMappingURL=addVertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addVertex.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/addVertex.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,wBAAgB,SAAS,CACrB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,OAAO,EACjB,eAAe,UAAQ,EACvB,SAAS,SAAQ,UAepB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=addVertex.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addVertex.test.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/addVertex.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { Face } from "../core/Face";
2
+ import { Halfedge } from "../core/Halfedge";
3
+ import { HalfedgeDS } from "../core/HalfedgeDS";
4
+ import { Vertex } from "../core/Vertex";
5
+ export declare function cutFace(struct: HalfedgeDS, face: Face, v1: Vertex, v2: Vertex, createNewFace?: boolean): Halfedge;
6
+ //# sourceMappingURL=cutFace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cutFace.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/cutFace.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,wBAAgB,OAAO,CACnB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,aAAa,UAAO,YAyIvB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=cutFace.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cutFace.test.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/cutFace.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Halfedge } from "../core/Halfedge";
2
+ import { HalfedgeDS } from "../core/HalfedgeDS";
3
+ export declare function removeEdge(struct: HalfedgeDS, halfedge: Halfedge, mergeFaces?: boolean): void;
4
+ //# sourceMappingURL=removeEdge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeEdge.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/removeEdge.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,wBAAgB,UAAU,CACtB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,UAAO,QA8DpB"}
@@ -0,0 +1,4 @@
1
+ import { Face } from "../core/Face";
2
+ import { HalfedgeDS } from "../core/HalfedgeDS";
3
+ export declare function removeFace(struct: HalfedgeDS, face: Face): void;
4
+ //# sourceMappingURL=removeFace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeFace.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/removeFace.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,wBAAgB,UAAU,CACtB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,IAAI,QAUb"}
@@ -0,0 +1,4 @@
1
+ import { HalfedgeDS } from "../core/HalfedgeDS";
2
+ import { Vertex } from "../core/Vertex";
3
+ export declare function removeVertex(struct: HalfedgeDS, vertex: Vertex, mergeFaces?: boolean): void;
4
+ //# sourceMappingURL=removeVertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeVertex.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/removeVertex.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA2BxC,wBAAgB,YAAY,CACxB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,UAAO,QAOpB"}
@@ -0,0 +1,13 @@
1
+ import { BufferAttribute, BufferGeometry, InterleavedBufferAttribute } from '../../threepipe';
2
+ import { HalfedgeDS } from "../core/HalfedgeDS";
3
+ export declare function setFromGeometry(struct: HalfedgeDS, geometry: BufferGeometry, tolerance?: number): void;
4
+ /**
5
+ * Returns an array where each index points to its new index in the buffer
6
+ * attribute
7
+ *
8
+ * @param positions Vertices positions buffer
9
+ * @param tolerance Distance tolerance of the vertices to merge
10
+ * @returns
11
+ */
12
+ export declare function computeVerticesIndexArray(positions: BufferAttribute | InterleavedBufferAttribute, tolerance?: number): number[];
13
+ //# sourceMappingURL=setFromGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setFromGeometry.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/setFromGeometry.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,eAAe,EAAE,cAAc,EAAE,0BAA0B,EAAU,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAK9C,wBAAgB,eAAe,CAC3B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,cAAc,EACxB,SAAS,SAAO,QA2GnB;AAID;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,eAAe,GAAG,0BAA0B,EACvD,SAAS,SAAQ,YAyBpB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=setFromGeometry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setFromGeometry.test.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/setFromGeometry.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ import { Halfedge } from "../core/Halfedge";
3
+ import { HalfedgeDS } from "../core/HalfedgeDS";
4
+ import { Vertex } from "../core/Vertex";
5
+ export declare function splitEdge(struct: HalfedgeDS, halfedge: Halfedge, position: Vector3, tolerance?: number): Vertex;
6
+ //# sourceMappingURL=splitEdge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitEdge.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/operations/splitEdge.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,wBAAgB,SAAS,CACrB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EACjB,SAAS,SAAQ,UAwDpB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=setuptests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setuptests.d.ts","sourceRoot":"","sources":["../../src/three-mesh-halfedge/setuptests.ts"],"names":[],"mappings":"AAcA,OAAO,YAAY,CAAC;AACpB,OAAO,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Vector3 } from '../../threepipe';
2
+ export declare function orient3D(a: Vector3, b: Vector3, c: Vector3, d: Vector3): 0 | 1 | -1;
3
+ export declare function frontSide(a: Vector3, b: Vector3, c: Vector3, d: Vector3): 0 | 1 | -1;
4
+ export declare function sameSide(a: Vector3, b: Vector3, c: Vector3, d: Vector3, e: Vector3): boolean;
5
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/utils/geometry.ts"],"names":[],"mappings":"AAYA,OAAO,EAAU,OAAO,EAAC,MAAM,OAAO,CAAC;AAMvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,cAetE;AAGD,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,cAEvE;AAGD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,WAElF"}
@@ -0,0 +1,3 @@
1
+ export declare function generatorSize(g: Generator): number;
2
+ export declare function generatorToArray<T>(g: Generator<T>): T[];
3
+ //# sourceMappingURL=testutils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testutils.d.ts","sourceRoot":"","sources":["../../../src/three-mesh-halfedge/utils/testutils.ts"],"names":[],"mappings":"AAgEA,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,UAQzC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,OAQlD"}
@@ -0,0 +1,58 @@
1
+ /// <reference types="@svgdotjs/svg.topath.js" />
2
+ import { PerspectiveCamera } from '../threepipe';
3
+ import { DrawPass, SVGDrawHandler, SVGDrawInfo, SVGDrawOptions, Viewmap, ViewmapBuildInfo, ViewmapOptions } from './core';
4
+ import { SVGMesh } from './core/SVGMesh';
5
+ import { Svg } from '@svgdotjs/svg.js';
6
+ export interface ExportOptions {
7
+ prettify?: boolean;
8
+ }
9
+ export declare class SVGRenderInfo {
10
+ resolution: {
11
+ w: number;
12
+ h: number;
13
+ };
14
+ renderingTime: number;
15
+ readonly svgDrawInfo: SVGDrawInfo;
16
+ readonly viewmapInfo: ViewmapBuildInfo;
17
+ }
18
+ export interface ProgressInfo {
19
+ currentStepName: string;
20
+ currentStep: number;
21
+ totalSteps: number;
22
+ }
23
+ /**
24
+ *
25
+ */
26
+ export declare class SVGRenderer {
27
+ readonly viewmap: Viewmap;
28
+ readonly drawHandler: SVGDrawHandler;
29
+ constructor(vOptions?: ViewmapOptions, sOptions?: SVGDrawOptions);
30
+ /**
31
+ * Render a SVG file from the given meshes and returns it.
32
+ * @param meshes Mehses to render
33
+ * @param camera Camera used to compute the perspective
34
+ * @param size Size of the render (will be scaled by camera aspect ratio)
35
+ * @param options Options to customize the render
36
+ * @param info Object containing info (e.g. times) on the rendering process
37
+ * @returns SVG object from the Svgdotjs lib
38
+ */
39
+ generateSVG(meshes: Array<SVGMesh>, camera: PerspectiveCamera, size: {
40
+ w: number;
41
+ h: number;
42
+ }, info?: SVGRenderInfo): Promise<Svg>;
43
+ /**
44
+ * Adds a pass to the SVG rendering pipeline.
45
+ * @param pass
46
+ */
47
+ addPass(pass: DrawPass): void;
48
+ /**
49
+ * Removes a pass from the SVG rendering pipeline
50
+ * @param pass
51
+ */
52
+ removePass(pass: DrawPass): void;
53
+ /**
54
+ * Removes all the passes from the SVG rendering pipeline.
55
+ */
56
+ clearPasses(): void;
57
+ }
58
+ //# sourceMappingURL=SVGRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SVGRenderer.d.ts","sourceRoot":"","sources":["../../src/three-svg-renderer/SVGRenderer.ts"],"names":[],"mappings":";AAYA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAC,MAAM,QAAQ,CAAC;AACxH,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAC;AAIrC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,aAAa;IACxB,UAAU;;;MAA8B;IACxC,aAAa,SAAY;IACzB,QAAQ,CAAC,WAAW,cAAqB;IACzC,QAAQ,CAAC,WAAW,mBAA0B;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,WAAW;IAEtB,QAAQ,CAAC,OAAO,UAAC;IACjB,QAAQ,CAAC,WAAW,iBAAC;gBAGT,QAAQ,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,cAAc;IAMhE;;;;;;;;OAQG;IACG,WAAW,CACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,EACtB,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,EAC5B,IAAI,gBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC;IAyB7C;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,QAAQ;IAMtB;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,QAAQ;IAIzB;;OAEG;IACH,WAAW;CA8BZ"}
@@ -0,0 +1,57 @@
1
+ import { Color, Material, Mesh, Vector3 } from '../../threepipe';
2
+ import { HalfedgeDS } from '../../three-mesh-halfedge';
3
+ import { MeshBVH, MeshBVHOptions } from 'three-mesh-bvh';
4
+ export interface SVGMeshOptions {
5
+ bvhOptions?: MeshBVHOptions;
6
+ }
7
+ /**
8
+ * SVGTexture allows to add a texture to a SVGMesh.
9
+ * Raster image (.jpeg, .png) or vector graphics (.svg) are supported.
10
+ */
11
+ export interface SVGTexture {
12
+ /**
13
+ * Name of the texture
14
+ */
15
+ name: string;
16
+ /**
17
+ * DataUrl to the image and vector graphics texture
18
+ */
19
+ url: string;
20
+ }
21
+ /**
22
+ * Mesh object that can be rendered as SVG.
23
+ * Wrapper class around three mesh object that duplicates geometry if needed (i.e.
24
+ * for SkinnedMesh) and computes BVH and HalfEdgeStructure on demand)
25
+ */
26
+ export declare class SVGMesh {
27
+ readonly sourceMesh: Mesh;
28
+ readonly threeMesh: Mesh<import('../../threepipe').BufferGeometry<import('../../threepipe').NormalBufferAttributes, import('../../threepipe').Event, string>, Material<import('../../threepipe').Event, string> | Material<import('../../threepipe').Event, string>[]>;
29
+ readonly hes: HalfedgeDS;
30
+ readonly bvhOptions: MeshBVHOptions;
31
+ bvh: MeshBVH;
32
+ drawFills: boolean;
33
+ drawVisibleContours: boolean;
34
+ drawHiddenContours: boolean;
35
+ isUsingBVHForRaycasting: boolean;
36
+ texture?: SVGTexture;
37
+ constructor(mesh: Mesh, options?: SVGMeshOptions);
38
+ /**
39
+ * Adds a SVGtexture to the mesh.
40
+ *
41
+ * @param texture The image or vector graphics texture to use.
42
+ */
43
+ addTexture(texture: SVGTexture): void;
44
+ updateMorphGeometry(): void;
45
+ updateBVH(updateMorphGeometry?: boolean): void;
46
+ updateHES(updateMorphGeometry?: boolean): void;
47
+ localToWorld(target: Vector3): Vector3;
48
+ colorForFaceIndex(faceIndex: number): null | Color;
49
+ dispose(): void;
50
+ get material(): Material<import('../../threepipe').Event, string> | Material<import('../../threepipe').Event, string>[];
51
+ get matrixWorld(): import('../../threepipe').Matrix4;
52
+ get name(): string;
53
+ set name(name: string);
54
+ updateObject(): void;
55
+ remakeBVH(): void;
56
+ }
57
+ //# sourceMappingURL=SVGMesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SVGMesh.d.ts","sourceRoot":"","sources":["../../../src/three-svg-renderer/core/SVGMesh.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAA6B,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAKnF,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,qBAAa,OAAO;IAElB,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,SAAS,mMAAc;IAChC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,UAAQ;IACjB,mBAAmB,UAAQ;IAC3B,kBAAkB,UAAQ;IAC1B,uBAAuB,UAAS;IAChC,OAAO,CAAC,EAAE,UAAU,CAAC;gBAET,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE,cAAmB;IAmCpD;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,UAAU;IAI9B,mBAAmB;IAKnB,SAAS,CAAC,mBAAmB,UAAO;IAOpC,SAAS,CAAC,mBAAmB,UAAO;IAMpC,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAItC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK;IAgBlD,OAAO;IAIP,IAAI,QAAQ,wFAAsC;IAClD,IAAI,WAAW,4BAAyC;IACxD,IAAI,IAAI,IACO,MAAM,CADqB;IAC1C,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAiC;IAEtD,YAAY;IAcZ,SAAS;CAIV"}
@@ -0,0 +1,4 @@
1
+ export * from "./viewmap";
2
+ export * from "./svg";
3
+ export { SVGMesh, type SVGMeshOptions, type SVGTexture } from "./SVGMesh";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/three-svg-renderer/core/index.ts"],"names":[],"mappings":"AAcA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Viewmap } from '../viewmap/Viewmap';
2
+ import { SizeLike } from '../../utils/geometry';
3
+ import { Svg } from '@svgdotjs/svg.js';
4
+ import { DrawPass } from './passes/DrawPass';
5
+ export interface SVGDrawPassInfo {
6
+ name: string;
7
+ order: number;
8
+ time: number;
9
+ }
10
+ export declare class SVGDrawInfo {
11
+ totalTime: number;
12
+ passesInfo: SVGDrawPassInfo[];
13
+ }
14
+ export interface SVGDrawOptions {
15
+ prettifySVG?: boolean;
16
+ }
17
+ export declare class SVGDrawHandler {
18
+ readonly options: Required<SVGDrawOptions>;
19
+ readonly passes: DrawPass[];
20
+ constructor(options?: SVGDrawOptions);
21
+ drawSVG(viewmap: Viewmap, size: SizeLike, info?: SVGDrawInfo): Promise<Svg>;
22
+ }
23
+ //# sourceMappingURL=SVGDrawHandler.d.ts.map