导出step文件合并为整体,方便后续修改
This commit is contained in:
@@ -6,7 +6,7 @@ from OCC.Core.GProp import GProp_GProps
|
||||
from OCC.Core.gp import gp_Dir, gp_Pln, gp_Pnt
|
||||
from OCC.Core.TopAbs import TopAbs_FACE
|
||||
from OCC.Core.TopExp import TopExp_Explorer
|
||||
from OCC.Core.TopoDS import TopoDS_Face, topods
|
||||
from OCC.Core.TopoDS import TopoDS_Face, TopoDS_Shape, topods
|
||||
|
||||
from core.mold_generator import MoldCavityGenerator
|
||||
from core.aluminum_foam_mold import AluminumFoamMoldGenerator
|
||||
@@ -31,7 +31,7 @@ class MultiSchemeMoldPlanner:
|
||||
|
||||
def generate_plan(
|
||||
self,
|
||||
shape: Any,
|
||||
shape: TopoDS_Shape,
|
||||
material: Dict[str, Any],
|
||||
is_foam_material: bool = False,
|
||||
max_schemes: int = 3,
|
||||
@@ -92,7 +92,7 @@ class MultiSchemeMoldPlanner:
|
||||
def _build_scheme(
|
||||
self,
|
||||
generator: Any,
|
||||
shape: Any,
|
||||
shape: TopoDS_Shape,
|
||||
analysis: Dict[str, Any],
|
||||
candidate: Dict[str, Any],
|
||||
is_foam_material: bool,
|
||||
@@ -209,10 +209,10 @@ class MultiSchemeMoldPlanner:
|
||||
generator: Any,
|
||||
analysis: Dict[str, Any],
|
||||
direction_vector: List[float],
|
||||
shape: Any,
|
||||
shape: TopoDS_Shape,
|
||||
offset_ratio: float = 0.0,
|
||||
opening_span_mm: Optional[float] = None,
|
||||
) -> Any:
|
||||
) -> TopoDS_Face:
|
||||
center = analysis.get("bounding_box", {}).get("center", [0, 0, 0])
|
||||
dims = analysis.get("bounding_box", {}).get("dimensions", [100, 100, 100])
|
||||
span = max(dims) * 1.5 + 30
|
||||
@@ -272,7 +272,7 @@ class MultiSchemeMoldPlanner:
|
||||
|
||||
return variants
|
||||
|
||||
def _collect_axis_normal_stats(self, generator: Any, shape: Any) -> Dict[str, float]:
|
||||
def _collect_axis_normal_stats(self, generator: Any, shape: TopoDS_Shape) -> Dict[str, float]:
|
||||
"""按坐标轴统计面法向分布强度,用于候选方向排序。"""
|
||||
stats = {"X": 0.0, "Y": 0.0, "Z": 0.0}
|
||||
explorer = TopExp_Explorer(shape, TopAbs_FACE)
|
||||
|
||||
Reference in New Issue
Block a user