Commonplace kernel API
    Preparing search index...

    Interface KernelQueryExperimental

    The read side of the kernel. kernelQuery makes one over a kernel instance.

    2026-Q4

    experimental — stable-by target: 2027-Q2

    interface KernelQuery {
        kind: "half-edge";
        bodies(): BodyRecord[];
        bodyOf(id: string): BodyRecord | null;
        classifyPointInBody(p: Point3, faceIds?: readonly string[]): BodyPointClass;
        classifyPointOnFace(faceId: string, p: Point3): FacePointClass;
        counts(): { edges: number; faces: number; vertices: number };
        develop(faceId: string, options?: UnfoldOptions): DevelopResult | null;
        edge(id: string): EdgeRecord | null;
        edgeCurve(edgeId: string): CurveDef | null;
        edgeIdOf(id: string): string | null;
        edgeIds(): string[];
        edgeLength(edgeId: string): number | null;
        edgePointAt(edgeId: string, t: number): Point3 | null;
        edgePolyline(edgeId: string, maxDeviation?: number): Point3[] | null;
        face(id: string): FaceRecord | null;
        faceDomain(faceId: string): FaceDomain | null;
        faceIds(): string[];
        faceNormalAt(faceId: string, u: number, v: number): Point3 | null;
        facePointAt(faceId: string, u: number, v: number): Point3 | null;
        faceSurface(faceId: string): SurfaceDef | null;
        faceTriangles(
            faceId: string,
            maxDeviation?: number,
        ): Float64Array<ArrayBufferLike> | null;
        intersectEdgeFace(
            edgeId: string,
            faceId: string,
        ): EdgeFaceIntersection | null;
        intersectEdges(edgeA: string, edgeB: string): EdgeIntersection | null;
        kindOf(id: string): EntityKind | null;
        massProperties(
            options?: MassPropertiesOptions,
        ): MassPropertiesResult | null;
        neighborsOfFace(faceId: string): string[] | null;
        pickEdge(origin: Point3, direction: Point3, maxGap: number): EdgeHit | null;
        pickFace(origin: Point3, direction: Point3): FaceHit | null;
        position(vertexId: string): Point3 | null;
        projectToFace(faceId: string, p: Point3): FaceProjection | null;
        tangentPlane(faceId: string, p: Point3): TangentPlane | null;
        unfold(
            faceIds?: readonly string[],
            options?: UnfoldOptions & { connect?: boolean },
        ): Pattern | null;
        vertex(id: string): VertexRecord | null;
        vertexIds(): string[];
        vertexRing(vertexId: string): RingMemberRecord[] | null;
    }
    Index
    kind: "half-edge"
    • Experimental

      Returns { edges: number; faces: number; vertices: number }

    • Experimental

      One face on the page: laid flat, developed exactly, or (unless exactOnly) flattened by the ADR-098 routes with its strain stated; every edge with its provenance (Unfolding.ts). A typed refusal when it has none. null while the unfold module loads (the load is started; loadUnfolding() or loadKernel() awaits it).

      Parameters

      • faceId: string
      • Optionaloptions: UnfoldOptions

      Returns DevelopResult | null

    • Experimental

      The edge's curve as a definition (a line, an arc, an ellipse, a Bézier), running from the edge's start (0) to its end (1) as edgePointAt does; on-surface for a curve the kernel holds on a surface, with no closed form to hand out.

      Parameters

      • edgeId: string

      Returns CurveDef | null

    • Experimental

      The canonical id of the edge id names (either half), or null.

      Parameters

      • id: string

      Returns string | null

    • Experimental

      The edge's length along its curve.

      Parameters

      • edgeId: string

      Returns number | null

    • Experimental

      The point at t along an edge, from its start (0) to its end (1).

      Parameters

      • edgeId: string
      • t: number

      Returns Point3 | null

    • Experimental

      The edge as a polyline within maxDeviation of its curve, start to end.

      Parameters

      • edgeId: string
      • OptionalmaxDeviation: number

      Returns Point3[] | null

    • Experimental

      The surface's unit normal at (u, v), on the face's front side.

      Parameters

      • faceId: string
      • u: number
      • v: number

      Returns Point3 | null

    • Experimental

      The surface the face lies on (untrimmed), as a definition: a plane, cylinder, cone, sphere or torus where it is one to rounding, else its rails or NURBS net; other for a surface with no definition to hand out.

      Parameters

      • faceId: string

      Returns SurfaceDef | null

    • Experimental

      A face as triangles, 9 numbers each (three corners), where the viewport draws it (FaceFillTriangles.ts), holes left open; null for an unknown face or one that does not tessellate.

      Parameters

      • faceId: string
      • OptionalmaxDeviation: number

      Returns Float64Array<ArrayBufferLike> | null

    • Experimental

      Where an edge meets a face's surface, each point flagged inside when it is on the face itself (within its trim). null for an edge that is a curve on a surface, or a face the solver cannot read.

      Parameters

      • edgeId: string
      • faceId: string

      Returns EdgeFaceIntersection | null

    • Experimental

      Where two edges meet, solved exactly on their own curves within the kernel's tolerance: the crossings a cut would split them at, and the stretches where one lies along the other. null when the solver has no answer yet (its module still loading: loadKernel() loads it) or none at all (an edge on a surface that is gone).

      Parameters

      • edgeA: string
      • edgeB: string

      Returns EdgeIntersection | null

    • Experimental

      Area, volume, centroid and inertia of the faces (every face by default), per shell and in total, measured on their own surfaces (MassProperties.ts). null while the measuring module loads (the load is started; loadMassProperties() or loadKernel() awaits it).

      Parameters

      • Optionaloptions: MassPropertiesOptions

      Returns MassPropertiesResult | null

    • Experimental

      Faces sharing an edge with faceId, without repeats.

      Parameters

      • faceId: string

      Returns string[] | null

    • Experimental

      The edge that passes nearest a ray, if within maxGap (model units) of it: nearest the ray first, then nearest the origin. Scans every edge.

      Parameters

      Returns EdgeHit | null

    • Experimental

      The face a ray meets first, on the face's own surface and inside its trim (a ray through a hole goes on), in model coordinates; hidden faces are passed over. null when it meets none or the direction is zero. Scans every face.

      Parameters

      Returns FaceHit | null

    • Experimental

      The face's tangent plane at the point of its (untrimmed) surface nearest p: that point, the front-side unit normal there, its (u, v) and the distance. null where the surface has no normal (a cone's apex) or cannot be read. Follow it with classifyPointOnFace to know whether the point is on the face itself.

      Parameters

      Returns TangentPlane | null

    • Experimental

      The faces (every face by default) unfolded into nets, hinged along shared straight edges, each edge reported as a fold (with its signed dihedral) or a cut, and the faces left off with their reasons. connect: false gives one island per face. null while the unfold module loads.

      Parameters

      • OptionalfaceIds: readonly string[]
      • Optionaloptions: UnfoldOptions & { connect?: boolean }

      Returns Pattern | null

    • Experimental

      The edges at a vertex in the order of its stored ring (ADR-109), or null for an unknown vertex or a ring that does not close. O(degree), where vertex scans the mesh and returns its edges unordered.

      Parameters

      • vertexId: string

      Returns RingMemberRecord[] | null