def complexGeom(utype, node, filename): if hasattr(node, 'complexFaultGeometry'): node = node.complexFaultGeometry _validate_complex_fault_geometry(utype, node, filename) spacing = node["spacing"] edges = [] for edge_node in node.nodes: coords = split_coords_3d(~edge_node.LineString.posList) edges.append(geo.Line([geo.Point(*p) for p in coords])) return edges, spacing
def _validate_complex_fault_geometry(utype, node, filename): # NB: if the geometry does not conform to the Aki & Richards convention # this will not be verified here, but will raise an error when the surface # is created valid_edges = [] for edge_node in node.nodes: try: coords = split_coords_3d(edge_node.LineString.posList.text) edge = geo.Line([geo.Point(*p) for p in coords]) except ValueError: # See use of validation error in simple geometry case # The node is valid if all of the edges compile correctly edge = [] if len(edge): valid_edges.append(True) else: valid_edges.append(False) if node["spacing"] and all(valid_edges): return raise LogicTreeError(node, filename, "'complexFaultGeometry' node is not valid")