solidworks_mcp.utils.feature_tree_classifier¶
solidworks_mcp.utils.feature_tree_classifier ¶
Helpers for classifying SolidWorks model families from feature-tree snapshots.
Attributes¶
_ADVANCED_SOLID_TOKENS
module-attribute
¶
_ADVANCED_SOLID_TOKENS = ('loft', 'boundary', 'sweep', 'shell', 'surface', 'split', 'combine', 'rib', 'dome')
_DRAWING_TOKENS
module-attribute
¶
_EXTRUDE_TOKENS
module-attribute
¶
_REVOLVE_TOKENS
module-attribute
¶
_SHEET_METAL_TOKENS
module-attribute
¶
_SHEET_METAL_TOKENS = ('sheet-metal', 'sheet metal', 'base-flange', 'edge-flange', 'sketched bend', 'miter flange', 'hem', 'jog', 'unfold', 'fold', 'flatten', 'flat-pattern')
Functions¶
_as_lower_text ¶
Build internal as lower text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The resulting text value. |
_feature_text ¶
Build internal feature text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature
|
Mapping[str, Any]
|
The feature value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The resulting text value. |
Source code in src/solidworks_mcp/utils/feature_tree_classifier.py
_has_any ¶
Build internal has any.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
texts
|
list[str]
|
The texts value. |
required |
tokens
|
tuple[str, ...]
|
The tokens value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if any, otherwise False. |
Source code in src/solidworks_mcp/utils/feature_tree_classifier.py
_match_examples ¶
Build internal match examples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
texts
|
list[str]
|
The texts value. |
required |
tokens
|
tuple[str, ...]
|
The tokens value. |
required |
limit
|
int
|
The limit value. Defaults to 4. |
4
|
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: A list containing the resulting items. |
Source code in src/solidworks_mcp/utils/feature_tree_classifier.py
classify_feature_tree_snapshot ¶
classify_feature_tree_snapshot(model_info: Mapping[str, Any] | None, features: list[Mapping[str, Any]] | None) -> dict[str, Any]
Classify a model family from model-info and feature-tree snapshots.
The output is intentionally simple and explainable so agents can use it as a planning primitive rather than as a black-box prediction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_info
|
Mapping[str, Any] | None
|
The model info value. |
required |
features
|
list[Mapping[str, Any]] | None
|
The features value. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the resulting values. |
Source code in src/solidworks_mcp/utils/feature_tree_classifier.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |