Skip to content

models

ContourAlgorithm

Bases: IntEnum

轮廓线建模算法类型

Source code in dimine_python_sdk\lib\exploitation\models.py
121
122
123
124
125
126
127
class ContourAlgorithm(IntEnum):
    """轮廓线建模算法类型"""

    MIN_PERIMETER = 0  # 最小周长法
    MIN_SURFACE_AREA = 1  # 最小表面积法
    SYNC_ADVANCE = 2  # 同步前进法
    MIN_DISTANCE = 3  # 最小距离法

ExtrapolateDirection

Bases: IntEnum

轮廓线外推方向

Source code in dimine_python_sdk\lib\exploitation\models.py
138
139
140
141
142
143
class ExtrapolateDirection(IntEnum):
    """轮廓线外推方向"""

    BOTH = 0  # 两端
    FRONT = 1  # 正侧
    BACK = 2  # 反侧

ExtrapolateMode

Bases: IntEnum

轮廓线外推建模模式

Source code in dimine_python_sdk\lib\exploitation\models.py
130
131
132
133
134
135
class ExtrapolateMode(IntEnum):
    """轮廓线外推建模模式"""

    TIP = 0  # 尖推
    WEDGE = 1  # 楔推
    FLAT = 2  # 平推

LanewayParam

Bases: ParamModel

巷道/竖井建模参数:断面 + 中心线 + 生成选项

示例

LanewayParam( ... section=SectionParam(type=0, width=2.0, wall_height=1.0), ... polylines_set=[ ... [["1", "2", "0"], ["2", "4", "0"], ["3", "6", "0"]], ... [["2", "1", "3"], ["4", "2", "3"], ["6", "3", "3"]], ... ], ... close=False, ... connectivity=False, ... method=0, ... bottom_contour=False, ... )

竖井建模示例

LanewayParam( ... section=SectionParam(type=0, width=2.0, wall_height=1.0), ... polylines_set=[[["0", "0", "0"], ["0", "0", "10"]]], ... shaft=True, ... angle=45.0, ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 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
class LanewayParam(ParamModel):
    """
    巷道/竖井建模参数:断面 + 中心线 + 生成选项

    示例
    ------
    >>> LanewayParam(
    ...     section=SectionParam(type=0, width=2.0, wall_height=1.0),
    ...     polylines_set=[
    ...         [["1", "2", "0"], ["2", "4", "0"], ["3", "6", "0"]],
    ...         [["2", "1", "3"], ["4", "2", "3"], ["6", "3", "3"]],
    ...     ],
    ...     close=False,
    ...     connectivity=False,
    ...     method=0,
    ...     bottom_contour=False,
    ... )

    竖井建模示例
    ------------
    >>> LanewayParam(
    ...     section=SectionParam(type=0, width=2.0, wall_height=1.0),
    ...     polylines_set=[[["0", "0", "0"], ["0", "0", "10"]]],
    ...     shaft=True,
    ...     angle=45.0,
    ... )
    """

    section: SectionParam = Field(..., description="断面信息")
    polylines_set: List[List[List[float]] | Line] = Field(
        default_factory=list,
        description="中心线集合,三维折线顶点列表的列表",
    )

    @field_validator("polylines_set", mode="before")
    @classmethod
    def _convert_line_to_list(cls, v):
        if not isinstance(v, list):
            return v
        result = []
        for item in v:
            if isinstance(item, Line):
                result.append(item.geometry.tolist())
            else:
                result.append(item)
        return result
    close: bool = Field(default=False, description="是否封口,即巷道的尽头是否封口")
    connectivity: bool = Field(default=False, description="是否联通建模,即巷道交叉口是否自动联通起来")
    method: int = Field(
        default=0,
        ge=0,
        le=2,
        description="生成模式:0整体连接 1拐点分离 2顶墙分离(非联通时用)",
    )
    bottom_contour: bool = Field(default=False, description="是否为底部轮廓线(联通时用)")
    shaft: bool = Field(
        default=False,
        description="是否为竖井,true=竖井,false=巷道",
    )
    angle: float = Field(
        default=0.0,
        ge=0,
        lt=360,
        description="竖井水平旋转角度(度),范围 0~360",
    )

ParamModel

Bases: BaseModel

参数模型基类,提供 model_dump 的 to_dict 别名以兼容旧代码

Source code in dimine_python_sdk\lib\exploitation\models.py
 8
 9
10
11
12
13
14
class ParamModel(BaseModel):
    """参数模型基类,提供 model_dump 的 to_dict 别名以兼容旧代码"""

    model_config = ConfigDict(populate_by_name=True)

    def to_dict(self) -> Dict[str, Any]:
        return self.model_dump(by_alias=True)

SectionParam

Bases: ParamModel

巷道断面参数

示例

SectionParam( ... type=0, ... width=2.0, ... width_up=2.0, ... wall_height=1.0, ... wide_arch_ratio=3, ... offset_x=0, ... offset_y=0, ... point_count=20, ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class SectionParam(ParamModel):
    """
    巷道断面参数

    示例
    ------
    >>> SectionParam(
    ...     type=0,
    ...     width=2.0,
    ...     width_up=2.0,
    ...     wall_height=1.0,
    ...     wide_arch_ratio=3,
    ...     offset_x=0,
    ...     offset_y=0,
    ...     point_count=20,
    ... )
    """

    type: int = Field(
        ...,
        ge=0,
        le=6,
        description="断面类型:0矩形拱 1梯形拱 2圆形拱 3圆弧拱 4三心拱 5六边形拱 6自定义断面",
    )
    width: float = Field(..., gt=0, description="下宽度")
    width_up: float = Field(default=0.0, description="上宽度")
    wall_height: float = Field(..., gt=0, description="墙高。竖井也有墙高")
    wide_arch_ratio: int = Field(
        default=2,
        ge=1,
        description="宽度/拱高比",
    )
    offset_x: float = Field(default=0.0, description="X轴偏移")
    offset_y: float = Field(default=0.0, description="Y轴偏移")
    point_count: int = Field(default=20, gt=0, description="轮廓采集点数")