vibe-sketcherDocumentation

vibesketcher.server.interfaces

REST routes for interfaces, stacking faults and planned extended defects (#197).

Building goes through POST /api/documents/{id}/periodic/build with a kind: interface or kind: stacking_fault recipe (revision-checked, recorded as an edit and undone like any build). These routes rank coincidence cells, preview a build and plan grain boundaries or dislocations without changing the document.

Functions

router(store)

Classes

DefectPlanRequest(*, plan[, document])

ExtendedPreviewRequest(*, recipe[, structure])

A preview reads the current document; the answer names its revision.

InterfaceMatchesRequest(*, bottom, top[, ...])

Two parent slabs of the document and the search bounds.

class vibesketcher.server.interfaces.InterfaceMatchesRequest(*, bottom, top, max_area=150.0, max_strain=0.05, twist_deg=0.0, angle_tolerance_deg=0.5, top_flip=False, max_candidates=20)[source]

Bases: BaseModel

Two parent slabs of the document and the search bounds.

Parameters:
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

bottom: str
top: str
max_area: float
max_strain: float
twist_deg: float | None

Rotation of the top phase in degrees; null searches every rotation.

angle_tolerance_deg: float
top_flip: bool
max_candidates: int
class vibesketcher.server.interfaces.ExtendedPreviewRequest(*, recipe, structure=False)[source]

Bases: BaseModel

A preview reads the current document; the answer names its revision.

Parameters:
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

recipe: dict[str, Any]
structure: bool

Include the built structure in the answer (it can be large).

class vibesketcher.server.interfaces.DefectPlanRequest(*, plan, document=None)[source]

Bases: BaseModel

Parameters:
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plan: dict[str, Any]
document: str | None

Optional document holding the plan’s source bulk structure.

vibesketcher.server.interfaces.router(store)[source]
Parameters:

store (Store)

Return type:

APIRouter