Inspection API
Use Shape for routine measurements on live native geometry. Use cadflow.inspect.brep when a workflow needs structured evidence from a STEP file or compatibility shape.
from cadflow.inspect import brep
summary = brep.inspect_step_rsummary("input/part.step")
inspection = brep.inspect_step_rbrepinspection("input/part.step")
Data model
| Type | Role |
|---|---|
BRepModel | Indexed shape and stable per-run entity tables |
BRepInspection | Global properties, topology, entities, and evidence |
BRepComparison | Structured difference between two shapes or STEP files |
SliceSpec / SliceComparison | Plane-section definition and comparison |
EntityInspectionParity | Agreement between entity inspection and reconstructed geometry |
BRepEntityError | Invalid or unavailable entity reference |
Loading and indexing
load_step_rshape returns compatibility geometry. load_step_rbrepmodel additionally creates an indexed inspection model. index_shape_rbrepmodel does the same for an in-memory shape. The STEP loader maintains a cache for repeated inspection; clear_step_model_cache_rnone releases it explicitly.
Entity indices belong to one indexed model. Do not transfer them to a reconstructed or modified shape without a comparison step.
Local inspection
Public functions inspect a point, entity, face boundary, topology neighborhood, nearby entities, difference region, or selected region. Section helpers intersect geometry with explicit planes and return descriptors suitable for automated comparison.
Use a narrow query when investigating a known discrepancy; full inspection can produce much larger data and render output.
Comparison
Comparison functions cover global properties, material evidence, sections, boundary distance, complete shapes, STEP files, and model-to-inspection parity. A comparison result records tolerances and evidence; the caller decides which deviations are acceptable for the application.
Rendering
render_shape_views_rpath, render_step_views_rpath, entity maps, colored component views, and region renderers write diagnostic images. They are evidence artifacts rather than geometry exports. Supply an explicit output path and verify the produced file.
Execution boundary
Inspection functions that perform external I/O or diagnostic rendering should run outside active model recording. Treat input files as untrusted: bound size in the application, handle parse errors, and retain source hashes for traceability.
See all 47 Inspection symbols.