Skip to content

laneway

Laneway

井巷工程 — 断面/巷道/竖井生成

推荐用法(无需实例化)

Laneway.get_section(SectionParam(type=0, width=2.0)) Laneway.get_lane_way_model(LanewayParam(section=..., polylines_set=...)) Laneway.get_lane_way_model(LanewayParam(section=..., polylines_set=..., shaft=True, angle=45.0))

Source code in dimine_python_sdk\lib\exploitation\laneway.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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
class Laneway:
    """
    井巷工程 — 断面/巷道/竖井生成

    推荐用法(无需实例化)
    --------------------
    >>> Laneway.get_section(SectionParam(type=0, width=2.0))
    >>> Laneway.get_lane_way_model(LanewayParam(section=..., polylines_set=...))
    >>> Laneway.get_lane_way_model(LanewayParam(section=..., polylines_set=..., shaft=True, angle=45.0))
    """

    @staticmethod
    def get_section(param: Union[Dict[str, Any], SectionParam]) -> List | np.ndarray:
        """
        获取断面轮廓

        Parameters
        ----------
        param : SectionParam or dict
            断面参数(dict 已废弃,会发出 DeprecationWarning)

        Returns
        -------
        list or np.ndarray
            断面轮廓点列表

        Raises
        ------
        SectionGenerateError
            底层返回空结果或抛出异常时包装
        """
        section = _coerce_section_param(param)
        json_str = _serialize_param(section)
        try:
            result = Dm.GetSectionContour(json_str)
        except Exception as exc:
            raise SectionGenerateError(f"断面生成失败: {exc}") from exc

        if result is None:
            raise SectionGenerateError("断面生成失败: 返回空结果")
        return _to_numpy(result)

    @staticmethod
    def get_lane_way_model(param: Union[Dict[str, Any], LanewayParam]) -> List["TINGeometry"]:
        """
        根据断面 + 中心线生成巷道或竖井

        Parameters
        ----------
        param : LanewayParam or dict
            巷道/竖井建模参数(dict 已废弃,会发出 DeprecationWarning)。
            当 ``shaft=True`` 时切换为竖井建模,由 C++ 侧根据 ``shaft`` 字段区分;
            ``angle`` 控制竖井水平旋转角度(度),范围 ``[0, 360)``。

        Returns
        -------
        List[TINGeometry]
            生成的巷道/竖井模型三角网列表

        Raises
        ------
        LanewayModelingError
            底层返回空结果或抛出异常时包装
        """
        lw = _coerce_laneway_param(param)

        # 三心拱断面自动设置轮廓采集点数为27
        if lw.section.type == 4 and lw.section.point_count != 27:
            lw.section.point_count = 27

        json_str = _serialize_param(lw)
        try:
            result = Dm.LanewayModeling(json_str)
        except Exception as exc:
            raise LanewayModelingError(f"巷道建模失败: {exc}") from exc

        if result is None:
            raise LanewayModelingError("巷道建模失败: 返回空结果")

        from dimine_python_sdk.lib.types.entity import DmPolyData
        from dimine_python_sdk.lib.bridge import dmpolydata_to_tingeometry


        return [
            dmpolydata_to_tingeometry(DmPolyData._from_obj(item))
            for item in result
        ]

get_lane_way_model(param) staticmethod

根据断面 + 中心线生成巷道或竖井

Parameters

param : LanewayParam or dict 巷道/竖井建模参数(dict 已废弃,会发出 DeprecationWarning)。 当 shaft=True 时切换为竖井建模,由 C++ 侧根据 shaft 字段区分; angle 控制竖井水平旋转角度(度),范围 [0, 360)

Returns

List[TINGeometry] 生成的巷道/竖井模型三角网列表

Raises

LanewayModelingError 底层返回空结果或抛出异常时包装

Source code in dimine_python_sdk\lib\exploitation\laneway.py
125
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
@staticmethod
def get_lane_way_model(param: Union[Dict[str, Any], LanewayParam]) -> List["TINGeometry"]:
    """
    根据断面 + 中心线生成巷道或竖井

    Parameters
    ----------
    param : LanewayParam or dict
        巷道/竖井建模参数(dict 已废弃,会发出 DeprecationWarning)。
        当 ``shaft=True`` 时切换为竖井建模,由 C++ 侧根据 ``shaft`` 字段区分;
        ``angle`` 控制竖井水平旋转角度(度),范围 ``[0, 360)``。

    Returns
    -------
    List[TINGeometry]
        生成的巷道/竖井模型三角网列表

    Raises
    ------
    LanewayModelingError
        底层返回空结果或抛出异常时包装
    """
    lw = _coerce_laneway_param(param)

    # 三心拱断面自动设置轮廓采集点数为27
    if lw.section.type == 4 and lw.section.point_count != 27:
        lw.section.point_count = 27

    json_str = _serialize_param(lw)
    try:
        result = Dm.LanewayModeling(json_str)
    except Exception as exc:
        raise LanewayModelingError(f"巷道建模失败: {exc}") from exc

    if result is None:
        raise LanewayModelingError("巷道建模失败: 返回空结果")

    from dimine_python_sdk.lib.types.entity import DmPolyData
    from dimine_python_sdk.lib.bridge import dmpolydata_to_tingeometry


    return [
        dmpolydata_to_tingeometry(DmPolyData._from_obj(item))
        for item in result
    ]

get_section(param) staticmethod

获取断面轮廓

Parameters

param : SectionParam or dict 断面参数(dict 已废弃,会发出 DeprecationWarning)

Returns

list or np.ndarray 断面轮廓点列表

Raises

SectionGenerateError 底层返回空结果或抛出异常时包装

Source code in dimine_python_sdk\lib\exploitation\laneway.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
@staticmethod
def get_section(param: Union[Dict[str, Any], SectionParam]) -> List | np.ndarray:
    """
    获取断面轮廓

    Parameters
    ----------
    param : SectionParam or dict
        断面参数(dict 已废弃,会发出 DeprecationWarning)

    Returns
    -------
    list or np.ndarray
        断面轮廓点列表

    Raises
    ------
    SectionGenerateError
        底层返回空结果或抛出异常时包装
    """
    section = _coerce_section_param(param)
    json_str = _serialize_param(section)
    try:
        result = Dm.GetSectionContour(json_str)
    except Exception as exc:
        raise SectionGenerateError(f"断面生成失败: {exc}") from exc

    if result is None:
        raise SectionGenerateError("断面生成失败: 返回空结果")
    return _to_numpy(result)

LanewayError

Bases: RuntimeError

井巷工程异常基类

Source code in dimine_python_sdk\lib\exploitation\laneway.py
14
15
16
class LanewayError(RuntimeError):
    """井巷工程异常基类"""
    pass

LanewayModelingError

Bases: LanewayError

巷道建模失败

Source code in dimine_python_sdk\lib\exploitation\laneway.py
24
25
26
class LanewayModelingError(LanewayError):
    """巷道建模失败"""
    pass

SectionGenerateError

Bases: LanewayError

断面生成失败

Source code in dimine_python_sdk\lib\exploitation\laneway.py
19
20
21
class SectionGenerateError(LanewayError):
    """断面生成失败"""
    pass