brepjs API Reference
    Preparing search index...

    Function assignRoles

    • Auto-assign role names to the faces of a shape based on operation type.

      For 'box': uses face normals to assign cardinal names ('box:top', 'box:bottom', 'box:front', 'box:back', 'box:left', 'box:right'). Note: Box role detection assumes axis-aligned faces (normal within 0.9 of a cardinal axis). Rotated boxes may receive fewer than 6 named roles; remaining faces fall through to sequential naming.

      For other types: sequential naming ('opType:face_0', 'opType:face_1', ...).

      Parameters

      • shape: Shape3D
      • operationType: string

      Returns Map<string, number>

      Map from role name to face hash code