fix(engine): 接受 hole_wizard 的 thread 装饰并按光滑孔降级执行
This commit is contained in:
@@ -314,8 +314,12 @@ class CapabilityAnalyzer:
|
||||
except ValueError as error:
|
||||
blockers.append(self._blocker(node.feature_id, "invalid_hole_spec", str(error)))
|
||||
if node.atomic_id == "hole_wizard":
|
||||
if params.get("thread"):
|
||||
blockers.append(self._blocker(node.feature_id, "unsupported_hole_subtype", "Threaded Hole Wizard geometry is not represented by the current CDSL runtime"))
|
||||
# #9 hole thread:SolidWorks 螺纹孔的 thread 是装饰信息(无螺距、
|
||||
# 不进实体几何,STEP 导出即光滑孔)。HoleSpec.from_feature 只读
|
||||
# 直径/深度/位置/沉头/沉孔,thread 天然不参与几何计算 → 孔特征
|
||||
# 直接按光滑圆柱孔执行,runtime 侧记录 thread_decoration_ignored
|
||||
# info 诊断便于追溯(见 _execute_hole)。不再报
|
||||
# unsupported_hole_subtype,使 ≈712 个带 thread 的孔恢复可执行。
|
||||
hole_extent = (params.get("end_condition") or {"type": "blind"}).get("type")
|
||||
if hole_extent not in {"blind", "through_all", "through_all_both"}:
|
||||
blockers.append(self._blocker(
|
||||
|
||||
@@ -501,8 +501,18 @@ def _execute_hole(node: FeaturePlanNode, session: ExecutionSession, *, wizard: b
|
||||
session.adapter.body_span(session.body, inward) + 2.0,
|
||||
)
|
||||
# 6. 从主体上减去工具实体,登记新主体并返回结果。
|
||||
# thread 是装饰螺纹(无螺距、不进实体几何,SolidWorks/STEP 的螺纹孔
|
||||
# 即光滑孔):孔按光滑圆柱孔执行,同时记录 info 级诊断便于批量报告
|
||||
# 追溯降级数量(issue #9,capabilities 已不再拒绝 thread)。
|
||||
diagnostics: list[RuntimeDiagnostic] = []
|
||||
if wizard and node.params.get("thread"):
|
||||
diagnostics.append(RuntimeDiagnostic(
|
||||
code="thread_decoration_ignored",
|
||||
message="Thread decoration is not modeled; the hole falls back to a plain cylindrical bore",
|
||||
feature_id=node.feature_id,
|
||||
))
|
||||
session.register_body(node.feature_id, session.adapter.cut(session.body, tool), replay_node=node)
|
||||
return session.result(node)
|
||||
return session.result(node, diagnostics=diagnostics)
|
||||
|
||||
|
||||
def _selector_edges(node: FeaturePlanNode, session: ExecutionSession, *, tangent_propagation: bool = False) -> list[Any]:
|
||||
|
||||
Reference in New Issue
Block a user