프로젝트

일반

사용자정보

개정판 2823dd31

ID2823dd31ef26467d124fdcd7aafd02a193fb6e95
상위 8208c302
하위 0f6f727f

함의성이(가) 약 2년 전에 추가함

cad symbol point import test

Change-Id: Ibdd6a8cab67fbef1621c9961a493b1a54f16e55e

차이점 보기:

DTI_PID/DTI_PID/ImportTextFromCADDialog.py
1127 1127
            if 3 == len(tokens):
1128 1128
                min_extents = self.convert_to_image_coords([float(tokens[0]), float(tokens[1])])
1129 1129

  
1130
            _height = abs(max_extents[1] - min_extents[1])
1131
            _width = abs(max_extents[0] - min_extents[0])
1130
            _height = math.ceil(abs(max_extents[1] - min_extents[1]))
1131
            _width = math.ceil(abs(max_extents[0] - min_extents[0]))
1132 1132

  
1133 1133
            loc = [min(min_extents[0], max_extents[0]), min(min_extents[1], max_extents[1])]
1134 1134

  
1135 1135
            origin = [math.ceil(_origin[0] - loc[0]), math.ceil(_origin[1] - loc[1])]
1136 1136

  
1137
            points = []
1138
            if blk_ref_node.attrib['Nodes']:
1139
                _points = blk_ref_node.attrib['Nodes'].replace('(', '').replace(')', '').split('/')
1140
                if _points:
1141
                    for _point in _points:
1142
                        _point = _point.split(',')
1143
                        point = self.convert_to_image_coords([float(_point[0]), float(_point[1])])
1144
                        point[0] = 0 if math.ceil(point[0] - loc[0]) <= 0 else (_width if math.ceil(point[0] - loc[0]) > _width else math.ceil(point[0] - loc[0]))
1145
                        point[1] = 0 if math.ceil(point[1] - loc[1]) <= 0 else (_height if math.ceil(point[1] - loc[1]) > _height else math.ceil(point[1] - loc[1]))
1146
                        points.append(point)
1147

  
1148
            strPoints = []
1149
            for point in points:
1150
                strPoint = 'AUTO,' + str(point[0]) + ',' + str(point[1]) + ',0,None,X,Secondary'
1151
                strPoints.append(strPoint)
1152

  
1137 1153
            ret = symbol.SymbolBase(name, type, 0.75, 0, 1, 0, 0, 0, \
1138 1154
                                    "{},{}".format(origin[0], origin[1]), \
1139
                                    '', \
1155
                                    '/'.join(strPoints), \
1140 1156
                                    'None', '', 0, 0, -1, \
1141 1157
                                    iType=-2, detectFlip=0, text_area='')
1142 1158

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)