solidworks_mcp.adapters.mock_sheet_metal¶
solidworks_mcp.adapters.mock_sheet_metal ¶
The mock adapter's sheet metal: a 100 x 60 mm plate, flanges and its blank.
The base flange is always the plate the live check builds (100 x 60 mm in
x and z, thickness thick); edge flanges go on its edges at
|x| = 50 or |z| = 30. The flat blank uses the bend deduction from
the K-factor, the value SolidWorks measured live (78.712 mm for a 20 mm
flange on a 2 mm sheet with a 2 mm radius and K = 0.5).
Attributes¶
_START_WITH
module-attribute
¶
Classes¶
AdapterResult
dataclass
¶
AdapterResult(status: AdapterResultStatus, data: T | None = None, error: str | None = None, execution_time: float | None = None, metadata: dict[str, Any] | None = None)
Result wrapper for adapter operations.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
T | None
|
The data value. |
error |
str | None
|
The error value. |
execution_time |
float | None
|
The execution time value. |
metadata |
dict[str, Any] | None
|
The metadata value. |
status |
AdapterResultStatus
|
The status value. |
AdapterResultStatus ¶
Bases: StrEnum
Result status for adapter operations.
Attributes:
| Name | Type | Description |
|---|---|---|
ERROR |
Any
|
The error value. |
SUCCESS |
Any
|
The success value. |
TIMEOUT |
Any
|
The timeout value. |
WARNING |
Any
|
The warning value. |
MockSheetMetalMixin ¶
Base flange, edge flanges, sketched bends and the flat blank, in memory.
Methods:¶
add_edge_flange
async
¶
add_edge_flange(edge_point: list[float], length: float, angle: float = 90.0, bend_radius: float | None = None, flip: bool = False) -> AdapterResult[dict[str, Any]]
Add a flange on one of the plate's long edges (|z| = 30).
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
create_base_flange
async
¶
create_base_flange(thickness: float, bend_radius: float, k_factor: float = 0.5, depth: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
Make the active part the mock plate.
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
create_sketched_bend
async
¶
create_sketched_bend(angle: float = 90.0, bend_radius: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
Fold half the plate up, as SolidWorks does (it keeps the +x half).
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
set_flat_pattern
async
¶
Flatten or fold the plate, and give its box.
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
Functions:¶
_error ¶
_ok ¶
bend_deduction ¶
A 90° bend's deduction, mm: twice the outside setback less the allowance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thickness
|
float
|
Sheet thickness, mm. |
required |
radius
|
float
|
Inside bend radius, mm. |
required |
k_factor
|
float
|
The K-factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The bend deduction. |