Skip to content

exploitation

Native Layer v2 开采模块

巷道/轮廓建模,对外返回 NativeTin 列表。

contour_extrapolate_modeling(param)

轮廓线外推建模

Source code in dimine_python_sdk\lib\native\exploitation.py
77
78
79
80
81
82
83
def contour_extrapolate_modeling(param: dict | str) -> list[NativeTin]:
    """轮廓线外推建模"""
    try:
        result = Dm.ContourExtrapolateModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"轮廓线外推建模失败: {exc}") from exc
    return _convert_polydata_list(result, "轮廓线外推建模")

get_section_contour(param)

获取断面轮廓

Source code in dimine_python_sdk\lib\native\exploitation.py
36
37
38
39
40
41
42
43
44
45
46
47
def get_section_contour(param: dict | str) -> "np.ndarray":
    """获取断面轮廓"""
    import numpy as np

    try:
        result = Dm.GetSectionContour(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"断面生成失败: {exc}") from exc

    if result is None:
        raise NativeExploitationError("断面生成返回空结果")
    return np.asarray(result, dtype=float)

implicit_stratum_modeling(param)

隐式地层建模

C++ 返回 (polydata_list, msg) 元组: - 失败时 list 为空,msg 为错误信息; - 成功时 msg 携带各地层名称(非标准 JSON,由 _parse_lithology_names 解析)。

Source code in dimine_python_sdk\lib\native\exploitation.py
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
def implicit_stratum_modeling(param: dict | str) -> list[NativeLithologyModel]:
    """
    隐式地层建模

    C++ 返回 (polydata_list, msg) 元组:
    - 失败时 list 为空,msg 为错误信息;
    - 成功时 msg 携带各地层名称(非标准 JSON,由 _parse_lithology_names 解析)。
    """
    try:
        result = Dm.ImplicitStratumModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"隐式地层建模失败: {exc}") from exc

    if not isinstance(result, (tuple, list)) or len(result) != 2:
        raise NativeExploitationError(f"隐式地层建模返回结果格式异常: {result!r}")

    polydata_list, msg = result[0], str(result[1])
    if not polydata_list:
        raise NativeExploitationError(f"隐式地层建模失败: {msg or '未知错误'}")

    names = _parse_lithology_names(msg, len(polydata_list))
    return [
        NativeLithologyModel(name=name, tin=_geom.tin_from_polydata(item))
        for name, item in zip(names, polydata_list)
    ]

laneway_modeling(param)

巷道/竖井建模

Source code in dimine_python_sdk\lib\native\exploitation.py
50
51
52
53
54
55
56
def laneway_modeling(param: dict | str) -> list[NativeTin]:
    """巷道/竖井建模"""
    try:
        result = Dm.LanewayModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"巷道建模失败: {exc}") from exc
    return _convert_polydata_list(result, "巷道建模")

multi_parallel_contour_modeling(param)

多平行轮廓线建模

Source code in dimine_python_sdk\lib\native\exploitation.py
86
87
88
89
90
91
92
def multi_parallel_contour_modeling(param: dict | str) -> list[NativeTin]:
    """多平行轮廓线建模"""
    try:
        result = Dm.MultiParallelContourModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"多平行轮廓线建模失败: {exc}") from exc
    return _convert_polydata_list(result, "多平行轮廓线建模")

single_contour_modeling(param)

单轮廓线封闭为面

Source code in dimine_python_sdk\lib\native\exploitation.py
68
69
70
71
72
73
74
def single_contour_modeling(param: dict | str) -> list[NativeTin]:
    """单轮廓线封闭为面"""
    try:
        result = Dm.SingleContourModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"单轮廓线建模失败: {exc}") from exc
    return _convert_polydata_list(result, "单轮廓线建模")

two_contour_modeling(param)

两轮廓线建模

Source code in dimine_python_sdk\lib\native\exploitation.py
59
60
61
62
63
64
65
def two_contour_modeling(param: dict | str) -> list[NativeTin]:
    """两轮廓线建模"""
    try:
        result = Dm.TwoContourModeling(_serialize_param(param))
    except Exception as exc:
        raise NativeExploitationError(f"两轮廓线建模失败: {exc}") from exc
    return _convert_polydata_list(result, "两轮廓线建模")

unite_polydata(tin_list)

实体合并

Source code in dimine_python_sdk\lib\native\exploitation.py
 95
 96
 97
 98
 99
100
101
102
def unite_polydata(tin_list: list[NativeTin]) -> list[NativeTin]:
    """实体合并"""
    native_objs = [_geom.tin_to_polydata(tin)._cpp_obj for tin in tin_list]
    try:
        result = Dm.UnitePolyData(native_objs)
    except Exception as exc:
        raise NativeExploitationError(f"实体合并失败: {exc}") from exc
    return _convert_polydata_list(result, "实体合并")