topologicpy 0.7.11__py3-none-any.whl → 0.7.12__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/Vertex.py +78 -0
- topologicpy/Wire.py +13 -17
- topologicpy/version.py +1 -1
- {topologicpy-0.7.11.dist-info → topologicpy-0.7.12.dist-info}/METADATA +6 -5
- {topologicpy-0.7.11.dist-info → topologicpy-0.7.12.dist-info}/RECORD +8 -8
- {topologicpy-0.7.11.dist-info → topologicpy-0.7.12.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.11.dist-info → topologicpy-0.7.12.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.11.dist-info → topologicpy-0.7.12.dist-info}/top_level.txt +0 -0
topologicpy/Vertex.py
CHANGED
@@ -747,6 +747,45 @@ class Vertex():
|
|
747
747
|
return_vertices = [Vertex.ByCoordinates(list(coord)) for coord in fused_vertices]
|
748
748
|
return return_vertices
|
749
749
|
|
750
|
+
@staticmethod
|
751
|
+
def IncomingEdges(vertex, hostTopology, tolerance: float = 0.0001) -> list:
|
752
|
+
"""
|
753
|
+
Returns the incoming edges connected to a vertex. An edge is considered incoming if its end vertex is
|
754
|
+
coincident with the input vertex.
|
755
|
+
|
756
|
+
Parameters
|
757
|
+
----------
|
758
|
+
vertex : topologic_core.Vertex
|
759
|
+
The input vertex.
|
760
|
+
hostTopology : topologic_core.Topology
|
761
|
+
The input host topology to which the vertex belongs.
|
762
|
+
tolerance : float , optional
|
763
|
+
The desired tolerance. The default is 0.0001.
|
764
|
+
|
765
|
+
Returns
|
766
|
+
-------
|
767
|
+
list
|
768
|
+
The list of incoming edges
|
769
|
+
|
770
|
+
"""
|
771
|
+
from topologicpy.Edge import Edge
|
772
|
+
from topologicpy.Topology import Topology
|
773
|
+
|
774
|
+
if not Topology.IsInstance(vertex, "Vertex"):
|
775
|
+
print("Vertex.IncomingEdges - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
776
|
+
return None
|
777
|
+
if not Topology.IsInstance(hostTopology, "Topology"):
|
778
|
+
print("Vertex.IncomingEdges - Error: The input graph parameter is not a valid graph. Returning None.")
|
779
|
+
return None
|
780
|
+
|
781
|
+
edges = Topology.SuperTopologies(vertex, hostTopology=hostTopology, topologyType="Edge")
|
782
|
+
incoming_edges = []
|
783
|
+
for edge in edges:
|
784
|
+
ev = Edge.EndVertex(edge)
|
785
|
+
if Vertex.Distance(vertex, ev) < tolerance:
|
786
|
+
incoming_edges.append(edge)
|
787
|
+
return incoming_edges
|
788
|
+
|
750
789
|
@staticmethod
|
751
790
|
def Index(vertex, vertices: list, strict: bool = False, tolerance: float = 0.0001) -> int:
|
752
791
|
"""
|
@@ -1335,6 +1374,45 @@ class Vertex():
|
|
1335
1374
|
"""
|
1336
1375
|
return Vertex.ByCoordinates(0, 0, 0)
|
1337
1376
|
|
1377
|
+
@staticmethod
|
1378
|
+
def OutgoingEdges(vertex, hostTopology, tolerance: float = 0.0001) -> list:
|
1379
|
+
"""
|
1380
|
+
Returns the outgoing edges connected to a vertex. An edge is considered incoming if its start vertex is
|
1381
|
+
coincident with the input vertex.
|
1382
|
+
|
1383
|
+
Parameters
|
1384
|
+
----------
|
1385
|
+
vertex : topologic_core.Vertex
|
1386
|
+
The input vertex.
|
1387
|
+
hostTopology : topologic_core.Topology
|
1388
|
+
The input host topology to which the vertex belongs.
|
1389
|
+
tolerance : float , optional
|
1390
|
+
The desired tolerance. The default is 0.0001.
|
1391
|
+
|
1392
|
+
Returns
|
1393
|
+
-------
|
1394
|
+
list
|
1395
|
+
The list of outgoing edges
|
1396
|
+
|
1397
|
+
"""
|
1398
|
+
from topologicpy.Edge import Edge
|
1399
|
+
from topologicpy.Topology import Topology
|
1400
|
+
|
1401
|
+
if not Topology.IsInstance(vertex, "Vertex"):
|
1402
|
+
print("Vertex.OutgoingEdges - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
1403
|
+
return None
|
1404
|
+
if not Topology.IsInstance(hostTopology, "Topology"):
|
1405
|
+
print("Vertex.OutgoingEdges - Error: The input graph parameter is not a valid graph. Returning None.")
|
1406
|
+
return None
|
1407
|
+
|
1408
|
+
edges = Topology.SuperTopologies(vertex, hostTopology=hostTopology, topologyType="Edge")
|
1409
|
+
outgoing_edges = []
|
1410
|
+
for edge in edges:
|
1411
|
+
sv = Edge.StartVertex(edge)
|
1412
|
+
if Vertex.Distance(vertex, sv) < tolerance:
|
1413
|
+
outgoing_edges.append(edge)
|
1414
|
+
return outgoing_edges
|
1415
|
+
|
1338
1416
|
@staticmethod
|
1339
1417
|
def PerpendicularDistance(vertex, face, mantissa: int = 6):
|
1340
1418
|
"""
|
topologicpy/Wire.py
CHANGED
@@ -1478,11 +1478,12 @@ class Wire(Topology):
|
|
1478
1478
|
# Unflatten the wire
|
1479
1479
|
return_wire = Topology.Unflatten(flat_wire, origin=Vertex.Origin(), direction=normal)
|
1480
1480
|
return return_wire
|
1481
|
-
|
1481
|
+
|
1482
1482
|
@staticmethod
|
1483
1483
|
def InteriorAngles(wire, tolerance: float = 0.0001, mantissa: int = 6) -> list:
|
1484
1484
|
"""
|
1485
1485
|
Returns the interior angles of the input wire in degrees. The wire must be planar, manifold, and closed.
|
1486
|
+
This code has been contributed by Yidan Xue.
|
1486
1487
|
|
1487
1488
|
Parameters
|
1488
1489
|
----------
|
@@ -1519,27 +1520,22 @@ class Wire(Topology):
|
|
1519
1520
|
normal = Face.Normal(f)
|
1520
1521
|
origin = Topology.Centroid(f)
|
1521
1522
|
w = Topology.Flatten(wire, origin=origin, direction=normal)
|
1522
|
-
flat_f = Topology.Flatten(f, origin=origin, direction=normal)
|
1523
|
-
flat_normal = Face.Normal(flat_f)
|
1524
|
-
if flat_normal[2] < 0:
|
1525
|
-
w = Topology.Rotate(w, origin=origin, axis=[1,0,0], angle=180)
|
1526
1523
|
angles = []
|
1527
1524
|
edges = Topology.Edges(w)
|
1525
|
+
e1 = edges[len(edges)-1]
|
1526
|
+
e2 = edges[0]
|
1527
|
+
a = Vector.CompassAngle(Vector.Reverse(Edge.Direction(e1)), Edge.Direction(e2))
|
1528
|
+
angles.append(a)
|
1528
1529
|
for i in range(len(edges)-1):
|
1529
1530
|
e1 = edges[i]
|
1530
1531
|
e2 = edges[i+1]
|
1531
|
-
a =
|
1532
|
-
angles.append(a)
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
# return angles
|
1539
|
-
# else:
|
1540
|
-
# angles = [360-ang for ang in angles]
|
1541
|
-
# return angles
|
1542
|
-
return angles
|
1532
|
+
a = Vector.CompassAngle(Vector.Reverse(Edge.Direction(e1)), Edge.Direction(e2))
|
1533
|
+
angles.append(round(a, mantissa))
|
1534
|
+
if abs(sum(angles)-(len(angles)-2)*180)<tolerance:
|
1535
|
+
return angles
|
1536
|
+
else:
|
1537
|
+
angles = [360-ang for ang in angles]
|
1538
|
+
return angles
|
1543
1539
|
|
1544
1540
|
@staticmethod
|
1545
1541
|
def Interpolate(wires: list, n: int = 5, outputType: str = "default", mapping: str = "default", tolerance: float = 0.0001):
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.7.
|
1
|
+
__version__ = '0.7.12'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.12
|
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
|
License: MIT License
|
@@ -27,7 +27,7 @@ License: MIT License
|
|
27
27
|
|
28
28
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
29
29
|
Project-URL: Bug Tracker, https://github.com/wassimj/TopologicPy/issues
|
30
|
-
Project-URL: Documentation, https://
|
30
|
+
Project-URL: Documentation, https://topologicpy.readthedocs.io
|
31
31
|
Classifier: Programming Language :: Python :: 3
|
32
32
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
33
33
|
Classifier: Operating System :: OS Independent
|
@@ -40,6 +40,7 @@ Requires-Dist: pandas
|
|
40
40
|
Requires-Dist: tqdm
|
41
41
|
Requires-Dist: plotly
|
42
42
|
Requires-Dist: lark
|
43
|
+
Requires-Dist: specklepy
|
43
44
|
Requires-Dist: topologic-core >=7.0.1
|
44
45
|
Provides-Extra: test
|
45
46
|
Requires-Dist: pytest-xdist >=2.4.0 ; extra == 'test'
|
@@ -105,8 +106,8 @@ topologicpy depends on the following python libraries which will be installed au
|
|
105
106
|
1. Start using the API
|
106
107
|
|
107
108
|
## API Documentation
|
108
|
-
API documentation can be found at [https://
|
109
|
+
API documentation can be found at [https://topologicpy.readthedocs.io](https://topologicpy.readthedocs.io)
|
109
110
|
|
110
|
-
topologicpy:
|
111
|
+
topologicpy: © 2024 Wassim Jabi
|
111
112
|
|
112
|
-
Topologic:
|
113
|
+
Topologic: © 2024 Cardiff University and UCL
|
@@ -22,12 +22,12 @@ topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
|
|
22
22
|
topologicpy/Sun.py,sha256=3tYb8kssU882lE1gEWg2mxDvCCY_LAVElkyUT6wa-ZU,36935
|
23
23
|
topologicpy/Topology.py,sha256=sXvhiMShOjOp0aILjEU6uNDqKm3zEAEdrN_IJgDK47c,308819
|
24
24
|
topologicpy/Vector.py,sha256=2OXmty9CKZZzfsg5T4ckml-lPUUvgDvqokcKDsZVN9Y,29806
|
25
|
-
topologicpy/Vertex.py,sha256=
|
26
|
-
topologicpy/Wire.py,sha256=
|
25
|
+
topologicpy/Vertex.py,sha256=rueGIe6YY6kFFzCcbe2YHUDWOMTTHvumaYtApAoWrNQ,70462
|
26
|
+
topologicpy/Wire.py,sha256=rmS841P_bbMMow10h7k0tAwL19eIbtA3q5weIcv4DHs,139316
|
27
27
|
topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
|
28
|
-
topologicpy/version.py,sha256=
|
29
|
-
topologicpy-0.7.
|
30
|
-
topologicpy-0.7.
|
31
|
-
topologicpy-0.7.
|
32
|
-
topologicpy-0.7.
|
33
|
-
topologicpy-0.7.
|
28
|
+
topologicpy/version.py,sha256=CatnPF7yPLD2d-GM4uSODskCctBnNw6bxogl_dJlCwA,23
|
29
|
+
topologicpy-0.7.12.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
|
30
|
+
topologicpy-0.7.12.dist-info/METADATA,sha256=VzaA4JismCnxZAyxHIN90KLCmgxEM5UHQX5lJiI60Yw,8410
|
31
|
+
topologicpy-0.7.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
32
|
+
topologicpy-0.7.12.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
33
|
+
topologicpy-0.7.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|