Skip to content
AI-Ready Docs
/llms.txt/llms-mcp.txt

Definitions ​

Declares reusable profiles and solids without adding independent Part outputs. It is a logical registry group, not a native modeling operation.

Import Definitions from @barocss/cad-react. This private workspace API is not a published installable package.

Props and output ​

PropInput/defaultMeaning
childrenRequired ReactNodeSupported profile or solid declarations with optional typed object refs.

Example ​

tsx
import * as React from 'react';
import { Definitions, Circle, Extrude, type ProfileHandle } from '@barocss/cad-react';

export function SharedProfile() {
  const profile = React.useRef<ProfileHandle|null>(null);
  return <>
    <Extrude profile={profile} distance={20} />
    <Definitions><Circle ref={profile} center={[0,0]} radius={4} /></Definitions>
  </>;
}

Insert the returned composition as the single output of a Part with a connected lifecycle. Any Definitions in the example remain logical siblings of that output; Target/Tools are used only inside Difference.

Composition and validation ​

Place Definitions alongside the single Part output. A consumer may appear earlier in JSX: the compiler resolves references in the committed graph. Use ProfileRef for an extrusion source and SolidRef for a target or transform source.

Rectangle, Circle and Polygon, plus Loop and Profile, can declare profile tokens in this group. A synchronous ordinary component can pass its optional ref to Polygon. D504 controlled tests cover Polygon forward references through ordinary React components. This reference support does not qualify every native outline.

Definitions alone is not a Part solid output. Missing, duplicate, cross-Part, wrong-kind and cyclic references refuse. Callback refs and ref.current are not dependency tokens. Definitions has no own ref or native-ID prop.

References and identity ​

React.useRef creates the supported object token; no useGeometryRef hook is exported. Handles expose kind metadata only. Reuse does not create persistent source-code links after saved-document reload.

Measured boundary ​

Controlled compiler and real ReactDOM tests cover forward refs, scoped lookup, typed kinds and invalid retention. No separate unmeasured native face/region producer is added by this registry.

The complete code block uses current public exports; its extracted type-check result is recorded separately. Type/compiler checks do not by themselves evaluate this standalone example as a new native case. Read the component catalog, refs and compiler, engine integration and current support limits.

D509 profile composition ​

D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with unchanged inputs and 11 newly run), package/API types, lint and four semantic mutation controls pass. The selected all-six SegmentedProfiledPlate passes four original Viewer states and native proof. Returned-document Studio Open/F and the separate compound-metadata consumer pass at their saved source checkpoints. Current-source Studio continuation and fresh documentation verification are recorded separately from geometry evidence.

Loop and Profile produce closed-profile data. Outer/Voids and LineSegment/ArcSegment are structural descriptors, not extra native features. Extrude.profile, old Rectangle/Circle/Polygon lowerings and staged identities remain compatible. Exact circle conversion uses the existing helper with no sampling. Regions, arbitrary plane/face inputs, constraints and Sweep/Loft adapters remain unexported. Holed Revolve keeps its own native admission and remains physically unqualified by this Extrude case. No universal contact/containment repair or refusal is promised. Part remains one logical Model result that can contain multiple native pieces.