topologicpy 0.5.0__py3-none-any.whl → 0.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- topologicpy/Face.py +18 -2
- topologicpy/Graph.py +202 -10
- topologicpy/Helper.py +69 -0
- topologicpy/Vertex.py +2 -0
- topologicpy/__init__.py +1 -1
- {topologicpy-0.5.0.dist-info → topologicpy-0.5.2.dist-info}/METADATA +1 -1
- {topologicpy-0.5.0.dist-info → topologicpy-0.5.2.dist-info}/RECORD +10 -10
- {topologicpy-0.5.0.dist-info → topologicpy-0.5.2.dist-info}/LICENSE +0 -0
- {topologicpy-0.5.0.dist-info → topologicpy-0.5.2.dist-info}/WHEEL +0 -0
- {topologicpy-0.5.0.dist-info → topologicpy-0.5.2.dist-info}/top_level.txt +0 -0
topologicpy/Face.py
CHANGED
@@ -1391,7 +1391,7 @@ class Face(Topology):
|
|
1391
1391
|
return returnResult
|
1392
1392
|
|
1393
1393
|
@staticmethod
|
1394
|
-
def NormalEdge(face: topologic.Face, length: float = 1.0) -> topologic.Edge:
|
1394
|
+
def NormalEdge(face: topologic.Face, length: float = 1.0, tolerance: float = 0.0001, silent: bool = False) -> topologic.Edge:
|
1395
1395
|
"""
|
1396
1396
|
Returns the normal vector to the input face as an edge with the desired input length. A normal vector of a face is a vector perpendicular to it.
|
1397
1397
|
|
@@ -1401,6 +1401,8 @@ class Face(Topology):
|
|
1401
1401
|
The input face.
|
1402
1402
|
length : float , optional
|
1403
1403
|
The desired length of the normal edge. The default is 1.
|
1404
|
+
tolerance : float , optional
|
1405
|
+
The desired tolerance. The default is 0.0001.
|
1404
1406
|
|
1405
1407
|
Returns
|
1406
1408
|
-------
|
@@ -1408,7 +1410,21 @@ class Face(Topology):
|
|
1408
1410
|
The created normal edge to the input face. This is computed at the approximate center of the face.
|
1409
1411
|
|
1410
1412
|
"""
|
1411
|
-
|
1413
|
+
from topologicpy.Edge import Edge
|
1414
|
+
|
1415
|
+
if not isinstance(face, topologic.Face):
|
1416
|
+
if not silent:
|
1417
|
+
print("Face.NormalEdge - Error: The input face parameter is not a valid face. Retuning None.")
|
1418
|
+
return None
|
1419
|
+
if length < tolerance:
|
1420
|
+
if not silent:
|
1421
|
+
print("Face.NormalEdge - Error: The input length parameter is less than the input tolerance. Retuning None.")
|
1422
|
+
return None
|
1423
|
+
iv = Face.InternalVertex(face)
|
1424
|
+
u, v = Face.VertexParameters(face, iv)
|
1425
|
+
vec = Face.NormalAtParameters(face, u=u, v=v)
|
1426
|
+
ev = Topology.TranslateByDirectionDistance(iv, vec, length)
|
1427
|
+
return Edge.ByVertices([iv, ev], tolerance=tolerance, silent=silent)
|
1412
1428
|
|
1413
1429
|
@staticmethod
|
1414
1430
|
def NormalEdgeAtParameters(face: topologic.Face, u: float = 0.5, v: float = 0.5, length: float = 1.0, tolerance: float = 0.0001) -> topologic.Edge:
|
topologicpy/Graph.py
CHANGED
@@ -1604,8 +1604,8 @@ class Graph:
|
|
1604
1604
|
keys = (Dictionary.Keys(mDict) or [])+["relationship"]
|
1605
1605
|
values = (Dictionary.Values(mDict) or [])+["Direct"]
|
1606
1606
|
else:
|
1607
|
-
keys = []
|
1608
|
-
values = []
|
1607
|
+
keys = ["relationship"]
|
1608
|
+
values = ["Direct"]
|
1609
1609
|
mDict = Dictionary.ByKeysValues(keys, values)
|
1610
1610
|
if mDict:
|
1611
1611
|
e.SetDictionary(mDict)
|
@@ -1765,18 +1765,19 @@ class Graph:
|
|
1765
1765
|
edges.append(tempe)
|
1766
1766
|
if viaSharedApertures:
|
1767
1767
|
for sharedAperture in sharedApertures:
|
1768
|
+
sharedAp = sharedAperture.Topology()
|
1768
1769
|
if useInternalVertex == True:
|
1769
|
-
vst = Topology.InternalVertex(
|
1770
|
+
vst = Topology.InternalVertex(sharedAp, tolerance)
|
1770
1771
|
else:
|
1771
|
-
vst =
|
1772
|
-
d1 =
|
1772
|
+
vst = sharedAp.CenterOfMass()
|
1773
|
+
d1 = sharedAp.GetDictionary()
|
1774
|
+
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
1773
1775
|
if storeBRep:
|
1774
1776
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAperture), Topology.Type(sharedAperture), Topology.TypeAsString(sharedAperture)])
|
1775
1777
|
d3 = mergeDictionaries2([d1, d2])
|
1776
1778
|
_ = vst.SetDictionary(d3)
|
1777
1779
|
else:
|
1778
1780
|
_ = vst.SetDictionary(d1)
|
1779
|
-
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
1780
1781
|
vertices.append(vst)
|
1781
1782
|
tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
|
1782
1783
|
tempd = Dictionary.ByKeysValues(["relationship"],["Via Shared Apertures"])
|
@@ -2041,6 +2042,13 @@ class Graph:
|
|
2041
2042
|
v2 = topFaces[j].CenterOfMass()
|
2042
2043
|
e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance)
|
2043
2044
|
mDict = mergeDictionaries(sharedt)
|
2045
|
+
if not mDict == None:
|
2046
|
+
keys = (Dictionary.Keys(mDict) or [])+["relationship"]
|
2047
|
+
values = (Dictionary.Values(mDict) or [])+["Direct"]
|
2048
|
+
else:
|
2049
|
+
keys = ["relationship"]
|
2050
|
+
values = ["Direct"]
|
2051
|
+
mDict = Dictionary.ByKeysValues(keys, values)
|
2044
2052
|
if mDict:
|
2045
2053
|
e.SetDictionary(mDict)
|
2046
2054
|
edges.append(e)
|
@@ -2472,6 +2480,13 @@ class Graph:
|
|
2472
2480
|
v2 = topEdges[j].CenterOfMass()
|
2473
2481
|
e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance)
|
2474
2482
|
mDict = mergeDictionaries(sharedt)
|
2483
|
+
if not mDict == None:
|
2484
|
+
keys = (Dictionary.Keys(mDict) or [])+["relationship"]
|
2485
|
+
values = (Dictionary.Values(mDict) or [])+["Direct"]
|
2486
|
+
else:
|
2487
|
+
keys = ["relationship"]
|
2488
|
+
values = ["Direct"]
|
2489
|
+
mDict = Dictionary.ByKeysValues(keys, values)
|
2475
2490
|
if mDict:
|
2476
2491
|
e.SetDictionary(mDict)
|
2477
2492
|
edges.append(e)
|
@@ -2594,11 +2609,12 @@ class Graph:
|
|
2594
2609
|
edges.append(tempe)
|
2595
2610
|
if viaSharedApertures:
|
2596
2611
|
for sharedAperture in sharedApertures:
|
2612
|
+
sharedTop = sharedAperture.Topology()
|
2597
2613
|
if useInternalVertex == True:
|
2598
|
-
vst = Topology.InternalVertex(
|
2614
|
+
vst = Topology.InternalVertex(sharedTop, tolerance)
|
2599
2615
|
else:
|
2600
|
-
vst =
|
2601
|
-
d1 =
|
2616
|
+
vst = sharedTop.CenterOfMass()
|
2617
|
+
d1 = sharedTop.GetDictionary()
|
2602
2618
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
2603
2619
|
if storeBRep:
|
2604
2620
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(sharedAperture)), Topology.Type(Aperture.Topology(sharedAperture)), Topology.TypeAsString(Aperture.Topology(sharedAperture))])
|
@@ -2670,7 +2686,6 @@ class Graph:
|
|
2670
2686
|
vst = content.CenterOfMass()
|
2671
2687
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
2672
2688
|
d1 = content.GetDictionary()
|
2673
|
-
vst = topologic.Vertex.ByCoordinates(vst.X(), vst.Y(), vst.Z())
|
2674
2689
|
if storeBRep:
|
2675
2690
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2676
2691
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2914,6 +2929,7 @@ class Graph:
|
|
2914
2929
|
if not isinstance(topology, topologic.Topology):
|
2915
2930
|
print("Graph.ByTopology - Error: The input topology is not a valid topology. Returning None.")
|
2916
2931
|
return None
|
2932
|
+
topology = Topology.Copy(topology)
|
2917
2933
|
graph = None
|
2918
2934
|
item = [topology, None, None, None, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, None, useInternalVertex, storeBRep, tolerance]
|
2919
2935
|
vertices = []
|
@@ -4392,6 +4408,66 @@ class Graph:
|
|
4392
4408
|
create_gexf_file(nodes, edges, defaultEdgeType, node_attributes, edge_attributes, path)
|
4393
4409
|
return True
|
4394
4410
|
|
4411
|
+
@staticmethod
|
4412
|
+
def ExportToJSON(graph, path, vertexLabelKey="", edgeLabelKey="", indent=4, sortKeys=False, mantissa=6, overwrite=False):
|
4413
|
+
"""
|
4414
|
+
Exports the input graph to a JSON file.
|
4415
|
+
|
4416
|
+
Parameters
|
4417
|
+
----------
|
4418
|
+
graph : topologic.Graph
|
4419
|
+
The input graph.
|
4420
|
+
path : str
|
4421
|
+
The path to the JSON file.
|
4422
|
+
vertexLabelKey : str , optional
|
4423
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
4424
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
4425
|
+
edgeLabelKey : str , optional
|
4426
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
4427
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
4428
|
+
indent : int , optional
|
4429
|
+
The desired amount of indent spaces to use. The default is 4.
|
4430
|
+
sortKeys : bool , optional
|
4431
|
+
If set to True, the keys will be sorted. Otherwise, they won't be. The default is False.
|
4432
|
+
mantissa : int , optional
|
4433
|
+
The desired length of the mantissa. The default is 6.
|
4434
|
+
overwrite : bool , optional
|
4435
|
+
If set to True the ouptut file will overwrite any pre-existing file. Otherwise, it won't. The default is False.
|
4436
|
+
|
4437
|
+
Returns
|
4438
|
+
-------
|
4439
|
+
bool
|
4440
|
+
The status of exporting the JSON file. If True, the operation was successful. Otherwise, it was unsuccesful.
|
4441
|
+
|
4442
|
+
"""
|
4443
|
+
import json
|
4444
|
+
from os.path import exists
|
4445
|
+
# Make sure the file extension is .json
|
4446
|
+
ext = path[len(path)-5:len(path)]
|
4447
|
+
if ext.lower() != ".json":
|
4448
|
+
path = path+".json"
|
4449
|
+
if not overwrite and exists(path):
|
4450
|
+
print("Graph.ExportToJSON - Error: a file already exists at the specified path and overwrite is set to False. Returning None.")
|
4451
|
+
return None
|
4452
|
+
f = None
|
4453
|
+
try:
|
4454
|
+
if overwrite == True:
|
4455
|
+
f = open(path, "w")
|
4456
|
+
else:
|
4457
|
+
f = open(path, "x") # Try to create a new File
|
4458
|
+
except:
|
4459
|
+
raise Exception("Graph.ExportToJSON - Error: Could not create a new file at the following location: "+path)
|
4460
|
+
if (f):
|
4461
|
+
jsondata = Graph.JSONData(graph, vertexLabelKey=vertexLabelKey, edgeLabelKey=edgeLabelKey, mantissa=mantissa)
|
4462
|
+
if jsondata != None:
|
4463
|
+
json.dump(jsondata, f, indent=indent, sort_keys=sortKeys)
|
4464
|
+
f.close()
|
4465
|
+
return True
|
4466
|
+
else:
|
4467
|
+
f.close()
|
4468
|
+
return False
|
4469
|
+
return False
|
4470
|
+
|
4395
4471
|
@staticmethod
|
4396
4472
|
def Flatten(graph, layout="spring", k=0.8, seed=None, iterations=50, rootVertex=None, tolerance=0.0001):
|
4397
4473
|
"""
|
@@ -5036,6 +5112,122 @@ class Graph:
|
|
5036
5112
|
_ = graph.IsolatedVertices(vertices)
|
5037
5113
|
return vertices
|
5038
5114
|
|
5115
|
+
@staticmethod
|
5116
|
+
def JSONData(graph, vertexLabelKey="", edgeLabelKey="", mantissa=6):
|
5117
|
+
"""
|
5118
|
+
Converts the input graph into JSON data.
|
5119
|
+
|
5120
|
+
Parameters
|
5121
|
+
----------
|
5122
|
+
graph : topologic.Graph
|
5123
|
+
The input graph.
|
5124
|
+
vertexLabelKey : str , optional
|
5125
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
5126
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
5127
|
+
edgeLabelKey : str , optional
|
5128
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
5129
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
5130
|
+
mantissa : int , optional
|
5131
|
+
The desired length of the mantissa. The default is 6.
|
5132
|
+
|
5133
|
+
Returns
|
5134
|
+
-------
|
5135
|
+
dict
|
5136
|
+
The JSON data
|
5137
|
+
|
5138
|
+
"""
|
5139
|
+
from topologicpy.Vertex import Vertex
|
5140
|
+
from topologicpy.Edge import Edge
|
5141
|
+
from topologicpy.Topology import Topology
|
5142
|
+
from topologicpy.Dictionary import Dictionary
|
5143
|
+
from topologicpy.Helper import Helper
|
5144
|
+
|
5145
|
+
vertices = Graph.Vertices(graph)
|
5146
|
+
j_data = {}
|
5147
|
+
j_data['nodes'] = {}
|
5148
|
+
j_data['edges'] = {}
|
5149
|
+
n = len(str(len(vertices)))
|
5150
|
+
v_labels = []
|
5151
|
+
v_dicts = []
|
5152
|
+
for i, v in enumerate(vertices):
|
5153
|
+
d = Topology.Dictionary(v)
|
5154
|
+
d = Dictionary.SetValueAtKey(d, "x", Vertex.X(v, mantissa=mantissa))
|
5155
|
+
d = Dictionary.SetValueAtKey(d, "y", Vertex.Y(v, mantissa=mantissa))
|
5156
|
+
d = Dictionary.SetValueAtKey(d, "z", Vertex.Z(v, mantissa=mantissa))
|
5157
|
+
v_dict = Dictionary.PythonDictionary(d)
|
5158
|
+
v_label = Dictionary.ValueAtKey(d, vertexLabelKey)
|
5159
|
+
if isinstance(v_label, str):
|
5160
|
+
v_label = Dictionary.ValueAtKey(d, vertexLabelKey)
|
5161
|
+
else:
|
5162
|
+
v_label = "Vertex_"+str(i).zfill(n)
|
5163
|
+
v_labels.append(v_label)
|
5164
|
+
v_dicts.append(v_dict)
|
5165
|
+
v_labels = Helper.MakeUnique(v_labels)
|
5166
|
+
for i, v_label in enumerate(v_labels):
|
5167
|
+
j_data['nodes'][v_label] = v_dicts[i]
|
5168
|
+
|
5169
|
+
edges = Graph.Edges(graph)
|
5170
|
+
n = len(str(len(edges)))
|
5171
|
+
e_labels = []
|
5172
|
+
e_dicts = []
|
5173
|
+
for i, e in enumerate(edges):
|
5174
|
+
sv = Edge.StartVertex(e)
|
5175
|
+
ev = Edge.EndVertex(e)
|
5176
|
+
svi = Vertex.Index(sv, vertices)
|
5177
|
+
evi = Vertex.Index(ev, vertices)
|
5178
|
+
sv_label = v_labels[svi]
|
5179
|
+
ev_label = v_labels[evi]
|
5180
|
+
d = Topology.Dictionary(e)
|
5181
|
+
|
5182
|
+
d = Dictionary.SetValueAtKey(d, "source", sv_label)
|
5183
|
+
d = Dictionary.SetValueAtKey(d, "target", ev_label)
|
5184
|
+
e_dict = Dictionary.PythonDictionary(d)
|
5185
|
+
e_label = Dictionary.ValueAtKey(d, edgeLabelKey)
|
5186
|
+
if isinstance(e_label, str):
|
5187
|
+
e_label = Dictionary.ValueAtKey(d, edgeLabelKey)
|
5188
|
+
else:
|
5189
|
+
e_label = "Edge_"+str(i).zfill(n)
|
5190
|
+
e_labels.append(e_label)
|
5191
|
+
e_dicts.append(e_dict)
|
5192
|
+
e_labels = Helper.MakeUnique(e_labels)
|
5193
|
+
for i, e_label in enumerate(e_labels):
|
5194
|
+
j_data['edges'][e_label] = e_dicts[i]
|
5195
|
+
|
5196
|
+
return j_data
|
5197
|
+
|
5198
|
+
@staticmethod
|
5199
|
+
def JSONString(graph, vertexLabelKey="", edgeLabelKey="", indent=4, sortKeys=False, mantissa=6):
|
5200
|
+
"""
|
5201
|
+
Converts the input graph into JSON data.
|
5202
|
+
|
5203
|
+
Parameters
|
5204
|
+
----------
|
5205
|
+
graph : topologic.Graph
|
5206
|
+
The input graph.
|
5207
|
+
vertexLabelKey : str , optional
|
5208
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
5209
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
5210
|
+
edgeLabelKey : str , optional
|
5211
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
5212
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
5213
|
+
indent : int , optional
|
5214
|
+
The desired amount of indent spaces to use. The default is 4.
|
5215
|
+
sortKeys : bool , optional
|
5216
|
+
If set to True, the keys will be sorted. Otherwise, they won't be. The default is False.
|
5217
|
+
mantissa : int , optional
|
5218
|
+
The desired length of the mantissa. The default is 6.
|
5219
|
+
|
5220
|
+
Returns
|
5221
|
+
-------
|
5222
|
+
str
|
5223
|
+
The JSON str
|
5224
|
+
|
5225
|
+
"""
|
5226
|
+
import json
|
5227
|
+
json_data = Graph.JSONData(graph, vertexLabelKey=vertexLabelKey, edgeLabelKey=edgeLabelKey, mantissa=mantissa)
|
5228
|
+
json_string = json.dumps(json_data, indent=indent, sort_keys=sortKeys)
|
5229
|
+
return json_string
|
5230
|
+
|
5039
5231
|
@staticmethod
|
5040
5232
|
def LocalClusteringCoefficient(graph, vertices=None, mantissa=6):
|
5041
5233
|
"""
|
topologicpy/Helper.py
CHANGED
@@ -232,7 +232,42 @@ class Helper:
|
|
232
232
|
merged_list.append(listA[i])
|
233
233
|
|
234
234
|
return merged_list
|
235
|
+
|
236
|
+
@staticmethod
|
237
|
+
def MakeUnique(listA):
|
238
|
+
"""
|
239
|
+
Forces the strings in the input list to be unique if they have duplicates.
|
240
|
+
|
241
|
+
Parameters
|
242
|
+
----------
|
243
|
+
listA : list
|
244
|
+
The input list of strings.
|
245
|
+
|
246
|
+
Returns
|
247
|
+
-------
|
248
|
+
list
|
249
|
+
The input list, but with each item ensured to be unique if they have duplicates.
|
235
250
|
|
251
|
+
"""
|
252
|
+
# Create a dictionary to store counts of each string
|
253
|
+
counts = {}
|
254
|
+
# Create a list to store modified strings
|
255
|
+
unique_strings = []
|
256
|
+
|
257
|
+
for string in listA:
|
258
|
+
# If the string already exists in the counts dictionary
|
259
|
+
if string in counts:
|
260
|
+
# Increment the count
|
261
|
+
counts[string] += 1
|
262
|
+
# Append the modified string with underscore and count
|
263
|
+
unique_strings.append(f"{string}_{counts[string]}")
|
264
|
+
else:
|
265
|
+
# If it's the first occurrence of the string, add it to the counts dictionary
|
266
|
+
counts[string] = 0
|
267
|
+
unique_strings.append(string)
|
268
|
+
|
269
|
+
return unique_strings
|
270
|
+
|
236
271
|
@staticmethod
|
237
272
|
def Normalize(listA, mantissa: int = 6):
|
238
273
|
"""
|
@@ -268,6 +303,40 @@ class Helper:
|
|
268
303
|
normalized_list = [round((x - min_val) / (max_val - min_val), mantissa) for x in l]
|
269
304
|
return normalized_list
|
270
305
|
|
306
|
+
@staticmethod
|
307
|
+
def Position(item, listA):
|
308
|
+
"""
|
309
|
+
Returns the position of the item in the list or the position it would have been inserts.
|
310
|
+
item is assumed to be numeric. listA is assumed to contain only numeric values and sorted from lowest to highest value.
|
311
|
+
|
312
|
+
Parameters
|
313
|
+
----------
|
314
|
+
item : int or float
|
315
|
+
The input number to be positioned.
|
316
|
+
listA : list
|
317
|
+
The input sorted list.
|
318
|
+
|
319
|
+
Returns
|
320
|
+
-------
|
321
|
+
int
|
322
|
+
The position of the item within the list.
|
323
|
+
|
324
|
+
"""
|
325
|
+
left = 0
|
326
|
+
right = len(listA) - 1
|
327
|
+
|
328
|
+
while left <= right:
|
329
|
+
mid = (left + right) // 2
|
330
|
+
if listA[mid] == item:
|
331
|
+
return mid
|
332
|
+
elif listA[mid] < item:
|
333
|
+
left = mid + 1
|
334
|
+
else:
|
335
|
+
right = mid - 1
|
336
|
+
|
337
|
+
# If the target is not found, return the position where it would be inserted
|
338
|
+
return left
|
339
|
+
|
271
340
|
@staticmethod
|
272
341
|
def Repeat(listA):
|
273
342
|
"""
|
topologicpy/Vertex.py
CHANGED
@@ -1513,6 +1513,8 @@ class Vertex(Topology):
|
|
1513
1513
|
if not isinstance(face, topologic.Face):
|
1514
1514
|
return None
|
1515
1515
|
eq = Face.PlaneEquation(face, mantissa= mantissa)
|
1516
|
+
if direction == None:
|
1517
|
+
direction = Face.Normal(face)
|
1516
1518
|
pt = project_point_onto_plane(Vertex.Coordinates(vertex), [eq["a"], eq["b"], eq["c"], eq["d"]], direction)
|
1517
1519
|
return Vertex.ByCoordinates(pt[0], pt[1], pt[2])
|
1518
1520
|
|
topologicpy/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.2
|
4
4
|
Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
@@ -8,10 +8,10 @@ topologicpy/DGL.py,sha256=-FDDTANjQb4fBtLHI433_KPmmGlTEPE7boYybXkoPuI,138321
|
|
8
8
|
topologicpy/Dictionary.py,sha256=vGhiXPu7e7GsgQyTsX6rZBncnnrDlcYfM9xRb9h-l3U,24799
|
9
9
|
topologicpy/Edge.py,sha256=C4VKk8leXTQySsGKCE4RSt3HiUhA12Ny_rGhEr71LWY,50009
|
10
10
|
topologicpy/EnergyModel.py,sha256=VPWkMP2uhJORiVqEomb2Dlx5VgKcVUbqnZBZX1IpF_Y,51771
|
11
|
-
topologicpy/Face.py,sha256=
|
12
|
-
topologicpy/Graph.py,sha256=
|
11
|
+
topologicpy/Face.py,sha256=81sURmH5TjbvSUzzSTGWPwb4jjqle4vplPeEo4Cwuvk,82576
|
12
|
+
topologicpy/Graph.py,sha256=kGaEI8ayPFxa1cg-rHG_dwisEBP5Ujzbwp_jhk6h0XM,329184
|
13
13
|
topologicpy/Grid.py,sha256=q6uAs8MGbdteYNbjqRjqlhFMquYAvSngwzxsFl9-338,17371
|
14
|
-
topologicpy/Helper.py,sha256=
|
14
|
+
topologicpy/Helper.py,sha256=dsMU4BAt6zKsYG-YiT_OE4kX2rq3dtl3AqMMd35-6DA,18250
|
15
15
|
topologicpy/Honeybee.py,sha256=p5OZi8tGPxUNH91_8peChEkYJdg5vpRyeqHVz8S9OS0,20356
|
16
16
|
topologicpy/Matrix.py,sha256=1aH7QKP6eNUbUXmZbB7e_4dw1ZSVQ8bsOsKJXtQq3_4,8357
|
17
17
|
topologicpy/Neo4j.py,sha256=4B_lYgZIDztqINkHL_J6gsfkZQ043wEsZpD_9uPYOMU,19356
|
@@ -21,9 +21,9 @@ topologicpy/Shell.py,sha256=ebXCT8pDq3lbWWHZ2yWASAU4mpINoYNT4C3gW1NuAeo,76292
|
|
21
21
|
topologicpy/Speckle.py,sha256=zKqiHYuw7498W_9UWvDn2xsdBskhahNjJejxegMpbJA,14773
|
22
22
|
topologicpy/Topology.py,sha256=7zmDexNyS9v4hQLPj7YWbrcYgKBk9DCsqzM1BHhgcJE,305269
|
23
23
|
topologicpy/Vector.py,sha256=EZ4vJbZfxcUVtKkmiUJnOM_II2Z4l6_zEWTJyfNEtiY,30362
|
24
|
-
topologicpy/Vertex.py,sha256=
|
24
|
+
topologicpy/Vertex.py,sha256=bzjLi-4XSg2Jg9hO9iH4g1CpF-_CHzjAd3kdDYi78ao,66449
|
25
25
|
topologicpy/Wire.py,sha256=RUeD_bDfUpc5iLZtUMuK-e6lXpvSRHBHuEzxJUBrbaY,131490
|
26
|
-
topologicpy/__init__.py,sha256=
|
26
|
+
topologicpy/__init__.py,sha256=zMF9ijEMKVNNMXX0ZXgQKr8J8NWG5Ljxjrk27bwcKlU,1444
|
27
27
|
topologicpy/bin/linux/topologic/__init__.py,sha256=XlFReDf3FWlYdM9uXtanYPIafgPb6GVTQczS_xJAXD0,60
|
28
28
|
topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0,sha256=ANok9DQKcnWcLd9T_LAt-i-X4nsYYy16q9kQlcTre1E,2996488
|
29
29
|
topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0,sha256=OJ3XesL79du8LeBHrsleGPXub6OpJdOilxha0mwjqQo,1378768
|
@@ -84,8 +84,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
|
|
84
84
|
topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
|
85
85
|
topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
|
86
86
|
topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
|
87
|
-
topologicpy-0.5.
|
88
|
-
topologicpy-0.5.
|
89
|
-
topologicpy-0.5.
|
90
|
-
topologicpy-0.5.
|
91
|
-
topologicpy-0.5.
|
87
|
+
topologicpy-0.5.2.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
|
88
|
+
topologicpy-0.5.2.dist-info/METADATA,sha256=Zjqt31LlO5-8ME6sOs7Ml10tNh4aqTkd65VVd3klXo8,7277
|
89
|
+
topologicpy-0.5.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
90
|
+
topologicpy-0.5.2.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
91
|
+
topologicpy-0.5.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|