feat: 完善参数化编辑语义和槽孔中心距
This commit is contained in:
@@ -590,7 +590,9 @@ def _axis_aligned_edge_candidates(
|
||||
) -> list[TopoDS_Shape]:
|
||||
candidates: list[tuple[float, TopoDS_Shape]] = []
|
||||
length_reference = max(expected_length, reference_radius, 1.0)
|
||||
distance_limit = max(reference_radius * 1.25, length_reference * 0.08, 0.2)
|
||||
# A 90-degree edge fillet restores a sharp edge about sqrt(2) * R away
|
||||
# from the fillet cylinder axis, so 1.25R misses the common box case.
|
||||
distance_limit = max(reference_radius * 1.8, length_reference * 0.08, 0.2)
|
||||
|
||||
for edge in TopologyExplorer(shape, ignore_orientation=True).edges():
|
||||
try:
|
||||
@@ -623,10 +625,10 @@ def _axis_aligned_edge_candidates(
|
||||
return [edge for _score, edge in candidates]
|
||||
|
||||
|
||||
def _finalize_boolean_result(op, operation_name: str) -> TopoDS_Shape:
|
||||
def _finalize_boolean_result(op, operation_name: str, *, use_glue: bool | None = None) -> TopoDS_Shape:
|
||||
op.SetNonDestructive(True)
|
||||
use_glue = "cut" not in operation_name.lower()
|
||||
if use_glue and hasattr(op, "SetGlue"):
|
||||
glue_enabled = "cut" not in operation_name.lower() if use_glue is None else bool(use_glue)
|
||||
if glue_enabled and hasattr(op, "SetGlue"):
|
||||
try:
|
||||
op.SetGlue(BOPAlgo_GlueFull)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user