You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verifies the /api/cnc/export endpoint returns a standardized error envelope for an invalid JSON request body.
42
+
43
+
Sends a request with a non-JSON payload and asserts the HTTP status is 400 or 422 and the response body matches the expected error shape (an object with `ok: False` and an `error` containing `code` and `message`).
Generate and print a JSON manifest of GLB model assets found under MODELS_PATTERN.
39
+
40
+
Discovers matching .glb files, builds manifest entries for each using `manifest_entry`, writes the manifest as pretty-printed JSON to standard output, and returns an exit code.
Builds a glTF 2.0 document dictionary and a single concatenated binary buffer for a minimal box mesh with embedded 4x4 PNG textures and module metadata.
144
+
145
+
Returns:
146
+
tuple: A pair (document, binary_blob) where `document` is the glTF JSON-compatible dictionary describing asset, scenes, nodes, meshes, materials, textures, images, bufferViews, accessors, and a buffer entry; and `binary_blob` is the bytes object containing the concatenated, 4-byte-aligned binary data for vertex attributes, indices, and embedded image files.
Generate three deterministic reference GLB files and write them to the frontend public models directory.
327
+
328
+
Creates the target models directory if missing, removes a legacy BaseCabinet600.glb if present, and produces three GLB assets with fixed codes and dimensions — "base_600" (600×720×580), "wall_900" (900×720×360), and "tall_600" (600×2100×580) — by calling create_glb_document for each and writing the resulting files with write_glb. Prints the relative output path for each written file.
Compute the axis-aligned bounding box across all mesh primitives that provide POSITION accessor min/max.
90
+
91
+
Returns:
92
+
A tuple `(min_vals, max_vals)` where each is a 3-element list `[x, y, z]` representing the aggregated minimum and maximum coordinates, or `None` if no POSITION accessors with valid `min`/`max` were found.
Compute the total number of triangles across all meshes in a glTF JSON document.
119
+
120
+
For each mesh primitive, uses the indices accessor count divided by three when present; otherwise uses the POSITION accessor count divided by three. Missing accessors or missing counts are treated as zero contribution.
121
+
122
+
Returns:
123
+
int: Total triangle count summed across all mesh primitives.
Validate a Paform GLB asset and collect detected issues.
144
+
145
+
Performs schema, metadata, material, mesh, bounds, panel type, and LOD validations and aggregates detected issues.
146
+
147
+
Parameters:
148
+
path (Path): Filesystem path to the GLB file to validate.
149
+
fail_on_warning (bool): If True and there are warnings but no errors, treat the run as an error (affects returned counts and issue list).
150
+
warn_threshold (int): If not None and the number of warnings exceeds this threshold, a WARN_THRESHOLD error will be added.
151
+
152
+
Returns:
153
+
Tuple[int, int, List[Issue]]: A tuple of (num_errors, num_warnings, issues) where:
154
+
- num_errors is the number of issues with severity "ERROR" after applying warn_threshold and fail_on_warning rules.
155
+
- num_warnings is the number of issues with severity "WARN" originally detected.
156
+
- issues is the list of Issue objects in the order they were detected, with any additional ERROR issues appended for warn-threshold or fail-on-warning promotion.
0 commit comments