(self)
| 112 | ) ** 0.5 |
| 113 | |
| 114 | def create(self): |
| 115 | # Read data from input file |
| 116 | # data = data |
| 117 | |
| 118 | self.elements = elements = data["elements"] |
| 119 | self.connections = connections = data["connections"] |
| 120 | # --> Delete this reference data and repopulate it with the objects |
| 121 | # while going through elements |
| 122 | for conn in connections: |
| 123 | conn["related_elements"] = [] |
| 124 | # End <-- |
| 125 | |
| 126 | mesh_size = self.mesh_size |
| 127 | |
| 128 | dec = 7 # 4 decimals for length in mm |
| 129 | tol = 10 ** (-dec - 3 + 1) |
| 130 | |
| 131 | self.tolLoc = tol * 10 * 2 |
| 132 | tolLoc = self.tolLoc |
| 133 | |
| 134 | self.NEW_SALOME = NEW_SALOME = int(salome_version.getVersion()[0]) >= 9 |
| 135 | salome.salome_init() |
| 136 | theStudy = salome.myStudy |
| 137 | notebook = salome_notebook.NoteBook(theStudy) |
| 138 | |
| 139 | ### |
| 140 | ### GEOM component |
| 141 | ### |
| 142 | import math |
| 143 | |
| 144 | import GEOM |
| 145 | import SALOMEDS |
| 146 | from salome.geom import geomBuilder |
| 147 | |
| 148 | gg = salome.ImportComponentGUI("GEOM") |
| 149 | if NEW_SALOME: |
| 150 | geompy = geomBuilder.New() |
| 151 | else: |
| 152 | geompy = geomBuilder.New(theStudy) |
| 153 | self.geompy = geompy |
| 154 | |
| 155 | O = geompy.MakeVertex(0, 0, 0) |
| 156 | OX = geompy.MakeVectorDXDYDZ(1, 0, 0) |
| 157 | OY = geompy.MakeVectorDXDYDZ(0, 1, 0) |
| 158 | OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) |
| 159 | geompy.addToStudy(O, "O") |
| 160 | geompy.addToStudy(OX, "OX") |
| 161 | geompy.addToStudy(OY, "OY") |
| 162 | geompy.addToStudy(OZ, "OZ") |
| 163 | |
| 164 | if len([e for e in elements if e["geometry_type"] == "Edge"]) > 0: |
| 165 | buildingShapeType = "EDGE" |
| 166 | if len([e for e in elements if e["geometry_type"] == "Face"]) > 0: |
| 167 | buildingShapeType = "FACE" |
| 168 | |
| 169 | ### Define entities ### |
| 170 | start_time = time.time() |
| 171 | print("Defining Object Geometry") |
no test coverage detected