circuit-json-to-gltf 0.0.151 → 0.0.153
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/dist/index.d.ts +11 -0
- package/dist/index.js +10727 -10594
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,10 @@ interface Size3 {
|
|
|
82
82
|
y: number;
|
|
83
83
|
z: number;
|
|
84
84
|
}
|
|
85
|
+
/** Geometry uses outward counterclockwise winding, with normals agreeing with
|
|
86
|
+
* the vertex order. Scene3D triangles use +Y up and mm; source geometry may use
|
|
87
|
+
* another frame until its loader converts it. Reflections reverse vertex order
|
|
88
|
+
* and attached UVs once; rotations leave winding unchanged. */
|
|
85
89
|
interface Triangle {
|
|
86
90
|
/** Authored JSCAD appearance; color tuples use linear 0–1 RGB. */
|
|
87
91
|
material?: MaterialOptions;
|
|
@@ -111,6 +115,8 @@ interface BoundingBox {
|
|
|
111
115
|
min: Point3;
|
|
112
116
|
max: Point3;
|
|
113
117
|
}
|
|
118
|
+
/** Loader and Scene3D meshes use +Y-up mm and outward-wound triangles.
|
|
119
|
+
* Exporters preserve their order; the final glTF X reflection owns its reversal. */
|
|
114
120
|
interface STLMesh {
|
|
115
121
|
triangles: Triangle[];
|
|
116
122
|
boundingBox: BoundingBox;
|
|
@@ -354,6 +360,11 @@ declare function getBestCameraPosition(circuitJson: CircuitJson, opts?: CameraFi
|
|
|
354
360
|
};
|
|
355
361
|
|
|
356
362
|
declare function applyCoordinateTransform(point: Point3, config: CoordinateTransformConfig): Point3;
|
|
363
|
+
/** Convert source-frame triangles into the configured frame, in the same mm
|
|
364
|
+
* units. Reflections preserve outward faces by swapping winding and vertex UVs;
|
|
365
|
+
* normals are unit inverse-transpose directions, including nonuniform flips.
|
|
366
|
+
* Matches pcb-fold.swapMeshFrame for the Circuit Z-up -> Scene Y-up reflection.
|
|
367
|
+
*/
|
|
357
368
|
declare function transformTriangles(triangles: Triangle[], config: CoordinateTransformConfig): Triangle[];
|
|
358
369
|
declare const COORDINATE_TRANSFORMS: {
|
|
359
370
|
readonly CIRCUIT_Z_UP_TO_SCENE_Y_UP: CoordinateTransformConfig;
|