brepjs API Reference
    Preparing search index...

    Type Alias ChamferDistance

    ChamferDistance:
        | number
        | [number, number]
        | { angle: number; distance: number }
        | (
            (
                edge: Edge,
            ) =>
                | number
                | [number, number]
                | { angle: number; distance: number; face?: Face }
                | null
        )

    Chamfer distance specification.

    • number — equal distance
    • [number, number] — asymmetric distances (dist1, dist2). The kernel picks which of the edge's two faces takes dist1, and kernels can pick differently: occt-wasm and brepkit set a box edge's dist1 back on opposite faces.
    • { distance, angle } — distance-angle mode (replaces chamferDistAngleShape); angle in degrees. The kernel picks the face the distance runs along, as for dist1.
    • callback — per-edge value of any of the above; return null (or a non-positive distance) to skip an edge. The edges it keeps must all get plain distances or all get { distance, angle }: mixing the two is an INVALID_CHAMFER_DISTANCE error. Different { distance, angle } values per edge need a kernel that chamfers each edge by its own (occt-wasm 5.9.0+); elsewhere they are an UNSUPPORTED_CAPABILITY error. A callback's { distance, angle, face } measures that edge's chamfer from face, which must be one of the two faces the edge joins (else CHAMFER_ANGLE_FACE_NOT_ADJACENT): the distance is set back on it and the angle taken from it. Without face the kernel picks it (the edge's first adjacent face on occt-wasm). A face needs the same per-edge kernel support. Edges of one tangent-continuous chain are chamfered as one, so they must state the same chamfer; occt-wasm 5.11.0+ also matches one stated from the face on the other side (e.g. { distance: d, angle: 45 } from either face of a square edge).