forked from 1b-agent/opencadstudio-upstream
ocs_doc_api: fix review findings (layouts, Helix bounds, points_aabb, mass-properties budget, docs)
- layouts.json: append the 6 missing ops (CreateDimensionRadius/Diameter/Angular,
CreateAttributeDefinition, CreateTable, CreateDimensionAngular2Ln); regenerate
binding_schema.json + api_reference.md wire vocabulary (all 28 ops).
- Helix bounds: bound the evaluated spline control polygon (was a degenerate
single-start-point AABB).
- points_aabb: empty -> Geometry::Empty('entity has no points to bound'), not
UnknownId (the entity exists; don't misclassify as stale/deleted).
- mass_properties: accuracy-first fine tessellation + graceful degradation to the
approximate meshes.metrics value when the cold-tess budget is exhausted (large
distinct-solid batches no longer hard-fail).
- IMPLEMENTATION.md: Volume/Centroid rows + accuracy paragraph + test count (618)
consistent with the final design.
- 618 host lib + 8 crate + 3 consistency green.
This commit is contained in:
1 parent
28c8e0ef1a
commit
ac54d6079b
6 files changed
+52
-16
No files matched your search
+9
-1
@@ -633,10 +633,18 @@ impl HostSession<'_> {
|
||||
}
|
||||
// Accuracy path: fine tessellation so the divergence volume/centroid
|
||||
// converge to near-analytic (the render-mesh metrics cache is the coarse
|
||||
// LOD for display, NOT for query accuracy). Bounded by the cold-tess budget;
|
||||
// display LOD, NOT for query accuracy). Bounded by the cold-tess budget;
|
||||
// memoized per (handle, epoch) so repeated queries on the same solid are O(1).
|
||||
const COLD_TESS_BUDGET: usize = 256;
|
||||
if self.cold_tess_used >= COLD_TESS_BUDGET {
|
||||
// Budget exhausted: serve a documented-approximate value from the render
|
||||
// mesh metrics cache rather than failing (large distinct-solid batches
|
||||
// degrade gracefully instead of erroring). Accuracy-first up to the budget.
|
||||
if let Some(metrics) = self.scene().meshes.get(&handle).map(|m| m.metrics) {
|
||||
if metrics.volume.abs() > 0.0 {
|
||||
return Ok((metrics.volume, metrics.centroid));
|
||||
}
|
||||
}
|
||||
return Err(ApiError::Unsupported(
|
||||
"volume/centroid cold-tessellation budget exceeded for this session; query fewer distinct solids".into(),
|
||||
));
|
||||
|
||||
Reference in new issue
Block a user