Skip to content

Qualified translated-strip Body ​

A Body combines a closed boundary with the material region that boundary encloses. Six independent Faces do not provide that result by themselves: they need shared Edges, consistent Uses, connected Vertex links and a proof that the whole boundary describes the intended region.

This experimental API builds one qualified translated-strip Body from complete base, end-Face and volume results. Its Body/report schema is version 0. It is available in the newer CAD provider ded1ef68; the earlier 5f5ad866 provider used by the general CAD reference and interactive geometry examples does not include these Body constructors. The package version remains 0.0.0-experimental.

Understand the boundary ​

ConceptRole in this Body
VertexOne of eight shared boundary locations, with its qualified local memberships
EdgeOne World Curve shared by two Faces
UseA Face's directed traversal of a shared Edge
FaceA bounded portion of an original Support Surface, with its loop and pcurves
ShellThe connected, closed, oriented collection of six Faces
BodyThe Shell coupled to its qualified material-boundary certificate

The admitted result contains 8 Vertices, 12 Edges, 6 Faces and 24 Uses. Every Edge has two opposing effective Uses. Each Vertex has one connected three-germ link, and the Face adjacency is connected. Euler characteristic 2 is a useful invariant, but it does not prove that the boundary is embedded or encloses the correct material.

Build from complete qualified parents ​

The constructor requires three public result types:

  • TranslatedSurfaceBaseFaceResult: the base closure.
  • TranslatedSurfaceEndFacesResult: the two U-end closures.
  • TranslatedSurfaceStripVolumeResult: the source-defined occupied region and volume.

Create these results from the same complete lower/upper wall and Plane-cap contexts. The wall results must agree in every retained field and represented number bit. The cap in the end-Face result must match the cap in the volume result. The exposed left/right base-Line IDs and full Curve geometry must also agree. Matching names or nominal dimensions alone are insufficient.

The six Face roles are lower wall, upper wall, Plane cap, base, U-min end and U-max end. Their admitted orientations are forward, reverse, forward, reverse, forward and reverse. Their parent loops already encode Face reversal in the stored Use order/senses. Preserve those effective directions once; do not flip them again. Face orientation also participates in the support-normal/material proof.

Public API example ​

The following application function accepts all three complete qualified parents. Use a CAD build that contains the newer Body API described above:

js
import {
  buildQualifiedTranslatedStripBody,
  validateQualifiedTranslatedStripBody,
} from '@barocss/cad';

export function assembleTranslatedStripBody(base, ends, volume, identity) {
  const body = buildQualifiedTranslatedStripBody(base, ends, volume, {
    evaluationId: identity.evaluationId,
    resultIdPrefix: identity.resultIdPrefix,
    maximumParents: 3,
    maximumModels: 2,
    maximumObservations: 24,
  });
  const report = validateQualifiedTranslatedStripBody(body);
  return { body, report };
}

base, ends and volume are the complete results named above. identity supplies unique application IDs. The constructor validates the parents and creates the topology/material result. The validator reconstructs and compares the complete result, then returns a copied report. It does not return an edited Body or adopt an unchecked report.

Signatures and public types ​

ts
buildQualifiedTranslatedStripBody(
  base: TranslatedSurfaceBaseFaceResult,
  ends: TranslatedSurfaceEndFacesResult,
  volume: TranslatedSurfaceStripVolumeResult,
  options: QualifiedTranslatedStripBodyOptions,
): QualifiedTranslatedStripBodyResult

validateQualifiedTranslatedStripBody(
  result: QualifiedTranslatedStripBodyResult,
): QualifiedTranslatedStripBodyReport

Public types are QualifiedTranslatedStripBodyOptions, QualifiedTranslatedStripBodyEdge, QualifiedTranslatedStripBodyReport and QualifiedTranslatedStripBodyResult. Error handling uses QualifiedTranslatedStripBodyError and QualifiedTranslatedStripBodyDiagnosticCode.

ts
interface QualifiedTranslatedStripBodyOptions {
  evaluationId: string;
  resultIdPrefix: string;
  maximumParents: 3;
  maximumModels: 2;
  maximumObservations: 24;
}

Supply exactly these five fields. IDs use ASCII letters/underscore first, then letters/digits/underscore/hyphen, with length 1..48. The prefix has length 1..12. Choose IDs that do not collide with any complete parent context. The budgets are exactly 3/2/24; they do not request a partial Body.

Resolve geometry across two Models ​

The six native Support Surfaces and twelve unique World Curves make eighteen used geometry objects. They remain in two actual source0 Models:

ModelGeometry
models[0]Six Supports and the first ten World Curves: 16 objects
models[1]The remaining two World Curves: 2 objects

The per-Model 16-object limit is unchanged. Do not flatten these records into an eighteen-object Model. Each record retains sourceId, source text, sourceVersion:0 and its native model. The geometry catalog covers each used object once. Complete older Models and unused siblings remain in the retained parents.

Face supportRef and Edge curveRef include both sourceModelId and objectId. Resolve them against the referenced record's model.name:

js
const edge = body.edges[11];
const record = body.models.find(
  item => item.model.name === edge.curveRef.sourceModelId,
);
const curve = record?.model.objects.find(
  item => item.id === edge.curveRef.objectId,
);
if (!curve || curve.kind !== 'curve') throw new Error('Unresolved qualified Curve');

Here body is the constructed result returned by the application function. A local Curve ID alone does not identify its owning Model. These source0 records carry Curve/Surface geometry; the model language has no @body declaration.

Distinguish topology from material proof ​

Shared topology establishes how Faces, Edges and Vertices connect. The separate material certificate binds all six entire Face images to the source-defined region:

text
Phi(u,t,w) = S_lower(u, Vmin + t*(roofV(u)-Vmin)) + [0,h*w,0]

Positive exact source coefficients establish the restricted map's injectivity, piecewise Jacobian and complete outward boundary. The restricted Solid qualification follows only after graph, source and whole material-boundary checks succeed. An individual Face, a closed graph count or a scalar volume cannot replace that proof.

Endpoint comparisons check native Curve ends against the shared Vertices, with a 1e-7 mm admission limit. Those observations do not prove entire Face images or a global geometric error bound. Regularity is per smooth patch and one-sided endpoint; global C1 and global binary64 evaluation guarantees remain outside this qualification.

Qualifying the new Body preserves earlier parent results and their flags. It does not retroactively change the meaning of an independent Face or volume result.

Units, result ownership and edits ​

Native XYZ uses authored coordinates in mm with no axis conversion. Volume uses mm³. Native U/V and local pcurves are dimensionless and retain their original domains. Keep UV sidecars separate from World Curves; do not retag them as millimetre geometry.

The result contains:

text
base, ends, volume, options, models, vertices, edges, faces,
shell, body, proof, observations, report

These are independently copied CPU data. They create no renderer, event loop or display resources. Release application references when the data is no longer needed. Editing source requires new qualified parents and a new Body; editing a report flag does not change geometry.

Preserve represented number bits, including negative zero, when storing complete data. JSON.parse preserves numeric -0; ordinary JSON.stringify changes it to 0. Revalidate a restored result before trusting its topology/material report.

Handle errors without adopting a partial result ​

QualifiedTranslatedStripBodyError provides code and the actual cause when wrapped. Messages are bounded to 1024 characters.

CodeRefused boundary
INPUT, IDENTITY, BUDGETOwn-data shape, IDs or resources
PARENT, PAIRComplete parent validity or shared context/geometry
SOURCE, BINDINGQualified object resolution or geometry/proof binding
TOPOLOGY, ORIENTATIONLoops, pairs, links or effective/outward direction
MATERIAL, REPRESENTABILITY, NATIVEMaterial proof, represented data or native observation
OWNEDStored-result reconstruction or complete comparison

A failed constructor returns no partial Body and preserves caller data. Keep the last accepted application result until the new call succeeds. A validator checks the complete result rather than trusting stored quality flags.

Derive a boundary mesh ​

The newer Body boundary mesh API derives shared sampled geometry and separate faceted display chunks from a complete accepted Body. It retains the native Body and its material certificate. Read that guide for its own API version, input file, mesh limits and display interpretation.

Resource limits and supported boundary ​

ResourceLimit
Complete request/result JSON representation2097152 UTF-16 units and 2097152 UTF-8 bytes each, including final newline
Source string262144 characters; source compiler byte limits also apply
Objects per Model16; this Body uses two Models for eighteen objects
Parent / Model / observation budgetsExactly 3 / 2 / 24
Own values / depth1048576 / 64
Array elements / record fields8192 / 64
Own key / string lengths128 / 262144 characters
Rational operations / GCD steps200000 / 200000
Rational integer bits / fraction integer characters8192 / 5000

Use dense, bounded plain own data. Accessors, hidden/symbol fields, cycles, sparse arrays and foreign prototypes refuse. The two-MiB envelope belongs to this complete Body family; it does not enlarge predecessor or source-Model limits.

This API qualifies the restricted translated-strip topology and material boundary. It does not provide generic Boolean operands, point membership, arbitrary curved Solid operations, manufacturing parity or renderer/Viewer consumption. A mesh of an untrimmed Support Surface does not display the qualified trimmed Body.

CAD API · Geometry examples · Model language · Limits

Local manual snapshot. Availability is stated on each package page.