topologicpy 0.8.49__py3-none-any.whl → 0.8.50__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/Graph.py +49 -5
- topologicpy/Topology.py +31 -18
- topologicpy/version.py +1 -1
- {topologicpy-0.8.49.dist-info → topologicpy-0.8.50.dist-info}/METADATA +1 -1
- {topologicpy-0.8.49.dist-info → topologicpy-0.8.50.dist-info}/RECORD +8 -8
- {topologicpy-0.8.49.dist-info → topologicpy-0.8.50.dist-info}/WHEEL +0 -0
- {topologicpy-0.8.49.dist-info → topologicpy-0.8.50.dist-info}/licenses/LICENSE +0 -0
- {topologicpy-0.8.49.dist-info → topologicpy-0.8.50.dist-info}/top_level.txt +0 -0
topologicpy/Graph.py
CHANGED
@@ -838,6 +838,47 @@ class Graph:
|
|
838
838
|
adjList.append(tempRow)
|
839
839
|
return adjList
|
840
840
|
|
841
|
+
@staticmethod
|
842
|
+
def AdjacentEdges(graph, edge, silent: bool = False):
|
843
|
+
"""
|
844
|
+
Returns the list of edges connected to the input edge.
|
845
|
+
|
846
|
+
Parameters
|
847
|
+
----------
|
848
|
+
graph : topologic_core.Graph
|
849
|
+
The input graph.
|
850
|
+
edge : topologic_core.Edge
|
851
|
+
the input edge.
|
852
|
+
silent : bool , optional
|
853
|
+
If set to True, error and warning messages are suppressed. Default is False.
|
854
|
+
|
855
|
+
Returns
|
856
|
+
-------
|
857
|
+
list
|
858
|
+
The list of adjacent edges.
|
859
|
+
|
860
|
+
"""
|
861
|
+
from topologicpy.Edge import Edge
|
862
|
+
from topologicpy.Topology import Topology
|
863
|
+
|
864
|
+
if not Topology.IsInstance(graph, "Graph"):
|
865
|
+
if not silent:
|
866
|
+
print("Graph.AdjacentEdges - Error: The input graph is not a valid graph. Returning None.")
|
867
|
+
return None
|
868
|
+
if not Topology.IsInstance(edge, "Edge"):
|
869
|
+
if not silent:
|
870
|
+
print("Graph.AdjacentEdges - Error: The input edge is not a valid edge. Returning None.")
|
871
|
+
return None
|
872
|
+
edges = []
|
873
|
+
sv = Edge.StartVertex(edge)
|
874
|
+
ev = Edge.EndVertex(edge)
|
875
|
+
edges.extend(Graph.Edges(graph, [sv]))
|
876
|
+
edges.extend(Graph.Edges(graph, [ev]))
|
877
|
+
print(edges)
|
878
|
+
edges = [e for e in edges if not Topology.IsSame(e, edge)]
|
879
|
+
# Complete the algorithm here
|
880
|
+
return edges
|
881
|
+
|
841
882
|
@staticmethod
|
842
883
|
def AdjacentVertices(graph, vertex, silent: bool = False):
|
843
884
|
"""
|
@@ -12464,7 +12505,7 @@ class Graph:
|
|
12464
12505
|
|
12465
12506
|
@staticmethod
|
12466
12507
|
def Quotient(topology,
|
12467
|
-
topologyType: str =
|
12508
|
+
topologyType: str = "vertex",
|
12468
12509
|
key: str = None,
|
12469
12510
|
groupLabelKey: str = None,
|
12470
12511
|
groupCountKey: str = "count",
|
@@ -12480,8 +12521,8 @@ class Graph:
|
|
12480
12521
|
|
12481
12522
|
Parameters
|
12482
12523
|
----------
|
12483
|
-
topology : topologic_core.Topology
|
12484
|
-
The input topology.
|
12524
|
+
topology : topologic_core.Topology or topologic_core.Graph
|
12525
|
+
The input topology or graph.
|
12485
12526
|
topologyType : str
|
12486
12527
|
The type of subtopology for which to search. This can be one of "vertex", "edge", "face", "cell". It is case-insensitive.
|
12487
12528
|
key : str , optional
|
@@ -12510,9 +12551,9 @@ class Graph:
|
|
12510
12551
|
from topologicpy.Edge import Edge
|
12511
12552
|
from topologicpy.Graph import Graph
|
12512
12553
|
|
12513
|
-
if not Topology.IsInstance(topology, "Topology"):
|
12554
|
+
if not Topology.IsInstance(topology, "Topology") and not Topology.IsInstance(topology, "Graph"):
|
12514
12555
|
if not silent:
|
12515
|
-
print("Graph.Quotient - Error: The input topology parameter is not a valid Topology. Returning None.")
|
12556
|
+
print("Graph.Quotient - Error: The input topology parameter is not a valid Topology or Graph. Returning None.")
|
12516
12557
|
return None
|
12517
12558
|
if topologyType.lower() not in {"vertex", "edge", "face", "cell"}:
|
12518
12559
|
if not silent:
|
@@ -12676,6 +12717,8 @@ class Graph:
|
|
12676
12717
|
|
12677
12718
|
group_vertices.append(v)
|
12678
12719
|
|
12720
|
+
group_vertices = Vertex.Separate(group_vertices, minDistance = 0.1, strength=0.5, silent=silent)
|
12721
|
+
|
12679
12722
|
# 7) Edges, with optional weights
|
12680
12723
|
edges = []
|
12681
12724
|
for (a, b), w in group_edges.items():
|
@@ -12691,6 +12734,7 @@ class Graph:
|
|
12691
12734
|
except Exception:
|
12692
12735
|
continue
|
12693
12736
|
|
12737
|
+
|
12694
12738
|
return Graph.ByVerticesEdges(group_vertices, edges)
|
12695
12739
|
|
12696
12740
|
@staticmethod
|
topologicpy/Topology.py
CHANGED
@@ -339,7 +339,7 @@ class Topology():
|
|
339
339
|
|
340
340
|
Parameters
|
341
341
|
----------
|
342
|
-
topology : topologic_core.Topology
|
342
|
+
topology : topologic_core.Topology or topologic_core.graph
|
343
343
|
The input topology.
|
344
344
|
hostTopology : topologic_core.Topology
|
345
345
|
The host topology in which to search.
|
@@ -352,11 +352,14 @@ class Topology():
|
|
352
352
|
The list of adjacent topologies.
|
353
353
|
|
354
354
|
"""
|
355
|
+
|
356
|
+
from topologicpy.Graph import Graph
|
357
|
+
|
355
358
|
if not Topology.IsInstance(topology, "Topology"):
|
356
359
|
print("Topology.AdjacentTopologies - Error: the input topology parameter is not a valid topology. Returning None.")
|
357
360
|
return None
|
358
|
-
if not Topology.IsInstance(hostTopology, "Topology"):
|
359
|
-
print("Topology.AdjacentTopologies - Error: the input hostTopology parameter is not a valid topology. Returning None.")
|
361
|
+
if not Topology.IsInstance(hostTopology, "Topology") and not Topology.IsInstance(hostTopology, "Graph"):
|
362
|
+
print("Topology.AdjacentTopologies - Error: the input hostTopology parameter is not a valid topology or graph. Returning None.")
|
360
363
|
return None
|
361
364
|
if not topologyType:
|
362
365
|
topologyType = Topology.TypeAsString(topology).lower()
|
@@ -370,21 +373,28 @@ class Topology():
|
|
370
373
|
error = False
|
371
374
|
if Topology.IsInstance(topology, "Vertex"):
|
372
375
|
if topologyType.lower() == "vertex":
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
+
if Topology.IsInstance(hostTopology, "graph"):
|
377
|
+
adjacentTopologies = Graph.AdjacentVertices(hostTopology, topology)
|
378
|
+
else:
|
376
379
|
try:
|
377
|
-
_ = topology.
|
380
|
+
_ = topology.AdjacentVertices(hostTopology, adjacentTopologies) # Hook to Core
|
378
381
|
except:
|
379
|
-
|
382
|
+
try:
|
383
|
+
_ = topology.Vertices(hostTopology, adjacentTopologies) # Hook to Core
|
384
|
+
except:
|
385
|
+
error = True
|
380
386
|
elif topologyType.lower() == "edge":
|
381
|
-
|
382
|
-
|
383
|
-
|
387
|
+
if Topology.IsInstance(hostTopology, "graph"):
|
388
|
+
adjacentTopologies = Graph.Edges(hostTopology, [topology])
|
389
|
+
print("Topology.AdjacentTopologies - adjacentTopologies:", adjacentTopologies)
|
390
|
+
else:
|
384
391
|
try:
|
385
|
-
_ =
|
392
|
+
_ = topologic.VertexUtility.AdjacentEdges(topology, hostTopology, adjacentTopologies) # Hook to Core
|
386
393
|
except:
|
387
|
-
|
394
|
+
try:
|
395
|
+
_ = topology.Edges(hostTopology, adjacentTopologies) # Hook to Core
|
396
|
+
except:
|
397
|
+
error = True
|
388
398
|
elif topologyType.lower() == "wire":
|
389
399
|
try:
|
390
400
|
_ = topologic.VertexUtility.AdjacentWires(topology, hostTopology, adjacentTopologies) # Hook to Core
|
@@ -432,10 +442,13 @@ class Topology():
|
|
432
442
|
except:
|
433
443
|
error = True
|
434
444
|
elif topologyType.lower() == "edge":
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
445
|
+
if Topology.IsInstance(hostTopology, "graph"):
|
446
|
+
adjacentTopologies = Graph.AdjacentEdges(hostTopology, topology)
|
447
|
+
else:
|
448
|
+
try:
|
449
|
+
_ = topology.AdjacentEdges(hostTopology, adjacentTopologies) # Hook to Core
|
450
|
+
except:
|
451
|
+
error = True
|
439
452
|
elif topologyType.lower() == "wire":
|
440
453
|
try:
|
441
454
|
_ = topologic.EdgeUtility.AdjacentWires(topology, adjacentTopologies) # Hook to Core
|
@@ -5391,7 +5404,7 @@ class Topology():
|
|
5391
5404
|
tVertices = []
|
5392
5405
|
if transposeAxes:
|
5393
5406
|
for v in vertices:
|
5394
|
-
tVertices.append([v[0], v[2], v[1]])
|
5407
|
+
tVertices.append([v[0], -v[2], v[1]])
|
5395
5408
|
vertices = tVertices
|
5396
5409
|
for v in vertices:
|
5397
5410
|
lines.append("v " + str(v[0]) + " " + str(v[1]) + " " + str(v[2]))
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.8.
|
1
|
+
__version__ = '0.8.50'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.50
|
4
4
|
Summary: An AI-Powered Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
License: AGPL v3 License
|
@@ -12,7 +12,7 @@ topologicpy/Dictionary.py,sha256=Z4YQ88tONWd-0X0dENQ8IZqIOa9mbBqhJkTBsHmft2g,446
|
|
12
12
|
topologicpy/Edge.py,sha256=DifItuyabFDUFC7CVMlt2DeMFMNaGOqCg43iU9CPP0A,74029
|
13
13
|
topologicpy/EnergyModel.py,sha256=IiBJNx7F9-8TPMaQn1iQON1ZtTv2nT5kbZHxM_gBCTQ,53773
|
14
14
|
topologicpy/Face.py,sha256=aX9EcR3JGbLITElhd25J0Z8m9U8KkmbYivGg3oZN-Uw,202296
|
15
|
-
topologicpy/Graph.py,sha256=
|
15
|
+
topologicpy/Graph.py,sha256=Idp-Wmm_ziofg_mJyJHhw6Qm0xRd-etTzaVNxp3EreU,686857
|
16
16
|
topologicpy/Grid.py,sha256=3OsBMyHh4w8gpFOTMKHMNTpo62V0CwRNu5cwm87yDUA,18421
|
17
17
|
topologicpy/Helper.py,sha256=aGmndgmEztjVNU-wW9OoHDel7wzapprM0TjA7f2AoS8,31188
|
18
18
|
topologicpy/Honeybee.py,sha256=C7Am0kCK3a5rt7Jpu2EIgqeR114ZJWtsx4_DBcr5hQA,21716
|
@@ -25,14 +25,14 @@ topologicpy/ShapeGrammar.py,sha256=KYsKDLXWdflAcYMAIz84AUF-GMkbTmaBDd2-ovbilqU,2
|
|
25
25
|
topologicpy/Shell.py,sha256=e6R7JdzYL1ubO0xXJs5P_UiiNHccN5SjQhQfGPPgHBg,96793
|
26
26
|
topologicpy/Speckle.py,sha256=-eiTqJugd7pHiHpD3pDUcDO6CGhVyPV14HFRzaqEoaw,18187
|
27
27
|
topologicpy/Sun.py,sha256=8S6dhCKfOhUGVny-jEk87Q08anLYMB1JEBKRGCklvbQ,36670
|
28
|
-
topologicpy/Topology.py,sha256=
|
28
|
+
topologicpy/Topology.py,sha256=MoEszjDhEiCVYTO4IFxYsYjYj4Vg5TnWUcnoPMNj-Nc,471350
|
29
29
|
topologicpy/Vector.py,sha256=pEC8YY3TeHGfGdeNgvdHjgMDwxGabp5aWjwYC1HSvMk,42236
|
30
30
|
topologicpy/Vertex.py,sha256=0f6HouARKaCuxhdxsUEYi8T9giJycnWhQ8Cn70YILBA,84885
|
31
31
|
topologicpy/Wire.py,sha256=gjgQUGHdBdXUIijgZc_VIW0E39w-smaVhhdl0jF63fQ,230466
|
32
32
|
topologicpy/__init__.py,sha256=RMftibjgAnHB1vdL-muo71RwMS4972JCxHuRHOlU428,928
|
33
|
-
topologicpy/version.py,sha256=
|
34
|
-
topologicpy-0.8.
|
35
|
-
topologicpy-0.8.
|
36
|
-
topologicpy-0.8.
|
37
|
-
topologicpy-0.8.
|
38
|
-
topologicpy-0.8.
|
33
|
+
topologicpy/version.py,sha256=jLQwp8ZJ2hrMvKdSSwJuigGT_jHflNoJKrmd0A0MBrM,23
|
34
|
+
topologicpy-0.8.50.dist-info/licenses/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
35
|
+
topologicpy-0.8.50.dist-info/METADATA,sha256=bOOGHTn6e-sOwgpqkBLm1YWvhnNNUMdjgfQZzqLHM9g,10535
|
36
|
+
topologicpy-0.8.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
37
|
+
topologicpy-0.8.50.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
38
|
+
topologicpy-0.8.50.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|