topologicpy 0.4.38__py3-none-any.whl → 0.4.40__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/Cell.py +2 -1
- topologicpy/CellComplex.py +12 -17
- topologicpy/Edge.py +2 -1
- topologicpy/EnergyModel.py +1 -2
- topologicpy/Face.py +46 -65
- topologicpy/Graph.py +62 -60
- topologicpy/Plotly.py +12 -12
- topologicpy/Shell.py +11 -6
- topologicpy/Topology.py +33 -158
- topologicpy/Vertex.py +131 -11
- topologicpy/Wire.py +35 -25
- topologicpy/__init__.py +1 -1
- {topologicpy-0.4.38.dist-info → topologicpy-0.4.40.dist-info}/METADATA +1 -1
- {topologicpy-0.4.38.dist-info → topologicpy-0.4.40.dist-info}/RECORD +17 -17
- {topologicpy-0.4.38.dist-info → topologicpy-0.4.40.dist-info}/WHEEL +1 -1
- {topologicpy-0.4.38.dist-info → topologicpy-0.4.40.dist-info}/LICENSE +0 -0
- {topologicpy-0.4.38.dist-info → topologicpy-0.4.40.dist-info}/top_level.txt +0 -0
topologicpy/Graph.py
CHANGED
|
@@ -1203,7 +1203,7 @@ class Graph:
|
|
|
1203
1203
|
vcc = Topology.CenterOfMass(topology)
|
|
1204
1204
|
d1 = Topology.Dictionary(vcc)
|
|
1205
1205
|
if storeBRep:
|
|
1206
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1206
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
1207
1207
|
d3 = mergeDictionaries2([d1, d2])
|
|
1208
1208
|
_ = vcc.SetDictionary(d3)
|
|
1209
1209
|
else:
|
|
@@ -1225,7 +1225,7 @@ class Graph:
|
|
|
1225
1225
|
vCell = aCell.CenterOfMass()
|
|
1226
1226
|
d1 = aCell.GetDictionary()
|
|
1227
1227
|
if storeBRep:
|
|
1228
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1228
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aCell), Topology.Type(aCell), Topology.TypeAsString(aCell)])
|
|
1229
1229
|
d3 = mergeDictionaries2([d1, d2])
|
|
1230
1230
|
_ = vCell.SetDictionary(d3)
|
|
1231
1231
|
else:
|
|
@@ -1262,7 +1262,7 @@ class Graph:
|
|
|
1262
1262
|
vst = sharedTopology.CenterOfMass()
|
|
1263
1263
|
d1 = sharedTopology.GetDictionary()
|
|
1264
1264
|
if storeBRep:
|
|
1265
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1265
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
|
1266
1266
|
d3 = mergeDictionaries2([d1, d2])
|
|
1267
1267
|
_ = vst.SetDictionary(d3)
|
|
1268
1268
|
else:
|
|
@@ -1283,7 +1283,7 @@ class Graph:
|
|
|
1283
1283
|
d1 = content.GetDictionary()
|
|
1284
1284
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X(), vst2.Y(), vst2.Z())
|
|
1285
1285
|
if storeBRep:
|
|
1286
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1286
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1287
1287
|
d3 = mergeDictionaries2([d1, d2])
|
|
1288
1288
|
_ = vst2.SetDictionary(d3)
|
|
1289
1289
|
else:
|
|
@@ -1301,7 +1301,7 @@ class Graph:
|
|
|
1301
1301
|
vst = sharedAperture.Topology().CenterOfMass()
|
|
1302
1302
|
d1 = sharedAperture.Topology().GetDictionary()
|
|
1303
1303
|
if storeBRep:
|
|
1304
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1304
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAperture), Topology.Type(sharedAperture), Topology.TypeAsString(sharedAperture)])
|
|
1305
1305
|
d3 = mergeDictionaries2([d1, d2])
|
|
1306
1306
|
_ = vst.SetDictionary(d3)
|
|
1307
1307
|
else:
|
|
@@ -1321,7 +1321,7 @@ class Graph:
|
|
|
1321
1321
|
_ = vst.SetDictionary(exteriorTopology.GetDictionary())
|
|
1322
1322
|
d1 = exteriorTopology.GetDictionary()
|
|
1323
1323
|
if storeBRep:
|
|
1324
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1324
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
|
1325
1325
|
d3 = mergeDictionaries2([d1, d2])
|
|
1326
1326
|
_ = vst.SetDictionary(d3)
|
|
1327
1327
|
else:
|
|
@@ -1342,7 +1342,7 @@ class Graph:
|
|
|
1342
1342
|
d1 = content.GetDictionary()
|
|
1343
1343
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
1344
1344
|
if storeBRep:
|
|
1345
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1345
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1346
1346
|
d3 = mergeDictionaries2([d1, d2])
|
|
1347
1347
|
_ = vst2.SetDictionary(d3)
|
|
1348
1348
|
else:
|
|
@@ -1362,7 +1362,7 @@ class Graph:
|
|
|
1362
1362
|
d1 = exteriorAperture.Topology().GetDictionary()
|
|
1363
1363
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1364
1364
|
if storeBRep:
|
|
1365
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1365
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorAperture), Topology.Type(exteriorAperture), Topology.TypeAsString(exteriorAperture)])
|
|
1366
1366
|
d3 = mergeDictionaries2([d1, d2])
|
|
1367
1367
|
_ = vst.SetDictionary(d3)
|
|
1368
1368
|
else:
|
|
@@ -1383,7 +1383,7 @@ class Graph:
|
|
|
1383
1383
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1384
1384
|
d1 = content.GetDictionary()
|
|
1385
1385
|
if storeBRep:
|
|
1386
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1386
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1387
1387
|
d3 = mergeDictionaries2([d1, d2])
|
|
1388
1388
|
_ = vst.SetDictionary(d3)
|
|
1389
1389
|
else:
|
|
@@ -1401,7 +1401,7 @@ class Graph:
|
|
|
1401
1401
|
vCell = aCell.CenterOfMass()
|
|
1402
1402
|
d1 = aCell.GetDictionary()
|
|
1403
1403
|
if storeBRep:
|
|
1404
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1404
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aCell), Topology.Type(aCell), Topology.TypeAsString(aCell)])
|
|
1405
1405
|
d3 = mergeDictionaries2([d1, d2])
|
|
1406
1406
|
_ = vCell.SetDictionary(d3)
|
|
1407
1407
|
else:
|
|
@@ -1419,7 +1419,7 @@ class Graph:
|
|
|
1419
1419
|
vCell = topology.CenterOfMass()
|
|
1420
1420
|
d1 = topology.GetDictionary()
|
|
1421
1421
|
if storeBRep:
|
|
1422
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1422
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
1423
1423
|
d3 = mergeDictionaries2([d1, d2])
|
|
1424
1424
|
_ = vCell.SetDictionary(d3)
|
|
1425
1425
|
else:
|
|
@@ -1463,7 +1463,7 @@ class Graph:
|
|
|
1463
1463
|
vst = exteriorTopology.CenterOfMass()
|
|
1464
1464
|
d1 = exteriorTopology.GetDictionary()
|
|
1465
1465
|
if storeBRep:
|
|
1466
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1466
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
|
1467
1467
|
d3 = mergeDictionaries2([d1, d2])
|
|
1468
1468
|
_ = vst.SetDictionary(d3)
|
|
1469
1469
|
else:
|
|
@@ -1484,7 +1484,7 @@ class Graph:
|
|
|
1484
1484
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
1485
1485
|
d1 = content.GetDictionary()
|
|
1486
1486
|
if storeBRep:
|
|
1487
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1487
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1488
1488
|
d3 = mergeDictionaries2([d1, d2])
|
|
1489
1489
|
_ = vst2.SetDictionary(d3)
|
|
1490
1490
|
else:
|
|
@@ -1504,7 +1504,7 @@ class Graph:
|
|
|
1504
1504
|
d1 = exteriorAperture.Topology().GetDictionary()
|
|
1505
1505
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1506
1506
|
if storeBRep:
|
|
1507
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1507
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(exteriorAperture)), Topology.Type(Aperture.Topology(exteriorAperture)), Topology.TypeAsString(Aperture.Topology(exteriorAperture))])
|
|
1508
1508
|
d3 = mergeDictionaries2([d1, d2])
|
|
1509
1509
|
_ = vst.SetDictionary(d3)
|
|
1510
1510
|
else:
|
|
@@ -1525,7 +1525,7 @@ class Graph:
|
|
|
1525
1525
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1526
1526
|
d1 = content.GetDictionary()
|
|
1527
1527
|
if storeBRep:
|
|
1528
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1528
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1529
1529
|
d3 = mergeDictionaries2([d1, d2])
|
|
1530
1530
|
_ = vst.SetDictionary(d3)
|
|
1531
1531
|
else:
|
|
@@ -1538,6 +1538,7 @@ class Graph:
|
|
|
1538
1538
|
return [vertices, edges]
|
|
1539
1539
|
|
|
1540
1540
|
def processShell(item):
|
|
1541
|
+
from topologicpy.Face import Face
|
|
1541
1542
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBRep, tolerance = item
|
|
1542
1543
|
graph = None
|
|
1543
1544
|
edges = []
|
|
@@ -1560,8 +1561,8 @@ class Graph:
|
|
|
1560
1561
|
sharedt = Topology.SharedEdges(topFaces[i], topFaces[j])
|
|
1561
1562
|
if len(sharedt) > 0:
|
|
1562
1563
|
if useInternalVertex == True:
|
|
1563
|
-
v1 =
|
|
1564
|
-
v2 =
|
|
1564
|
+
v1 = Face.InternalVertex(topFaces[i], tolerance)
|
|
1565
|
+
v2 = Face.InternalVertex(topFaces[j], tolerance)
|
|
1565
1566
|
else:
|
|
1566
1567
|
v1 = topFaces[i].CenterOfMass()
|
|
1567
1568
|
v2 = topFaces[j].CenterOfMass()
|
|
@@ -1599,8 +1600,8 @@ class Graph:
|
|
|
1599
1600
|
for ap in apList:
|
|
1600
1601
|
apTopList.append(ap.Topology())
|
|
1601
1602
|
if useInternalVertex == True:
|
|
1602
|
-
v1 =
|
|
1603
|
-
v2 =
|
|
1603
|
+
v1 = Face.InternalVertex(topFaces[i], tolerance)
|
|
1604
|
+
v2 = Face.InternalVertex(topFaces[j], tolerance)
|
|
1604
1605
|
else:
|
|
1605
1606
|
v1 = topFaces[i].CenterOfMass()
|
|
1606
1607
|
v2 = topFaces[j].CenterOfMass()
|
|
@@ -1615,7 +1616,7 @@ class Graph:
|
|
|
1615
1616
|
if (viaSharedTopologies == True) or (viaSharedApertures == True) or (toExteriorTopologies == True) or (toExteriorApertures == True) or (toContents == True):
|
|
1616
1617
|
for aFace in topFaces:
|
|
1617
1618
|
if useInternalVertex == True:
|
|
1618
|
-
vFace =
|
|
1619
|
+
vFace = Face.InternalVertex(aFace, tolerance)
|
|
1619
1620
|
else:
|
|
1620
1621
|
vFace = aFace.CenterOfMass()
|
|
1621
1622
|
_ = vFace.SetDictionary(aFace.GetDictionary())
|
|
@@ -1649,7 +1650,7 @@ class Graph:
|
|
|
1649
1650
|
vst = sharedTopology.CenterOfMass()
|
|
1650
1651
|
d1 = sharedTopology.GetDictionary()
|
|
1651
1652
|
if storeBRep:
|
|
1652
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1653
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
|
1653
1654
|
d3 = mergeDictionaries2([d1, d2])
|
|
1654
1655
|
_ = vst.SetDictionary(d3)
|
|
1655
1656
|
else:
|
|
@@ -1670,7 +1671,7 @@ class Graph:
|
|
|
1670
1671
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
1671
1672
|
d1 = content.GetDictionary()
|
|
1672
1673
|
if storeBRep:
|
|
1673
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1674
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1674
1675
|
d3 = mergeDictionaries2([d1, d2])
|
|
1675
1676
|
_ = vst2.SetDictionary(d3)
|
|
1676
1677
|
else:
|
|
@@ -1689,7 +1690,7 @@ class Graph:
|
|
|
1689
1690
|
d1 = sharedAperture.Topology().GetDictionary()
|
|
1690
1691
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1691
1692
|
if storeBRep:
|
|
1692
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1693
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(sharedAperture)), Topology.Type(Aperture.Topology(sharedAperture)), Topology.TypeAsString(Aperture.Topology(sharedAperture))])
|
|
1693
1694
|
d3 = mergeDictionaries2([d1, d2])
|
|
1694
1695
|
_ = vst.SetDictionary(d3)
|
|
1695
1696
|
else:
|
|
@@ -1707,7 +1708,7 @@ class Graph:
|
|
|
1707
1708
|
vst = exteriorTopology.CenterOfMass()
|
|
1708
1709
|
d1 = exteriorTopology.GetDictionary()
|
|
1709
1710
|
if storeBRep:
|
|
1710
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1711
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
|
1711
1712
|
d3 = mergeDictionaries2([d1, d2])
|
|
1712
1713
|
_ = vst.SetDictionary(d3)
|
|
1713
1714
|
else:
|
|
@@ -1728,7 +1729,7 @@ class Graph:
|
|
|
1728
1729
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
1729
1730
|
d1 = content.GetDictionary()
|
|
1730
1731
|
if storeBRep:
|
|
1731
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1732
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1732
1733
|
d3 = mergeDictionaries2([d1, d2])
|
|
1733
1734
|
_ = vst2.SetDictionary(d3)
|
|
1734
1735
|
else:
|
|
@@ -1748,7 +1749,7 @@ class Graph:
|
|
|
1748
1749
|
d1 = exteriorAperture.Topology().GetDictionary()
|
|
1749
1750
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1750
1751
|
if storeBRep:
|
|
1751
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1752
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(exteriorAperture)), Topology.Type(Aperture.Topology(exteriorAperture)), Topology.TypeAsString(Aperture.Topology(exteriorAperture))])
|
|
1752
1753
|
d3 = mergeDictionaries2([d1, d2])
|
|
1753
1754
|
_ = vst.SetDictionary(d3)
|
|
1754
1755
|
else:
|
|
@@ -1769,7 +1770,7 @@ class Graph:
|
|
|
1769
1770
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1770
1771
|
d1 = content.GetDictionary()
|
|
1771
1772
|
if storeBRep:
|
|
1772
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1773
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1773
1774
|
d3 = mergeDictionaries2([d1, d2])
|
|
1774
1775
|
_ = vst.SetDictionary(d3)
|
|
1775
1776
|
else:
|
|
@@ -1787,7 +1788,7 @@ class Graph:
|
|
|
1787
1788
|
vFace = aFace.CenterOfMass()
|
|
1788
1789
|
d1 = aFace.GetDictionary()
|
|
1789
1790
|
if storeBRep:
|
|
1790
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1791
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aFace), Topology.Type(aFace), Topology.TypeAsString(aFace)])
|
|
1791
1792
|
d3 = mergeDictionaries2([d1, d2])
|
|
1792
1793
|
_ = vFace.SetDictionary(d3)
|
|
1793
1794
|
else:
|
|
@@ -1814,7 +1815,7 @@ class Graph:
|
|
|
1814
1815
|
vcc = Topology.CenterOfMass(topology)
|
|
1815
1816
|
d1 = Topology.Dictionary(vcc)
|
|
1816
1817
|
if storeBRep:
|
|
1817
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1818
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
1818
1819
|
d3 = mergeDictionaries2([d1, d2])
|
|
1819
1820
|
_ = vcc.SetDictionary(d3)
|
|
1820
1821
|
else:
|
|
@@ -1827,18 +1828,19 @@ class Graph:
|
|
|
1827
1828
|
return [vertices, edges]
|
|
1828
1829
|
|
|
1829
1830
|
def processFace(item):
|
|
1831
|
+
from topologic.Face import Face
|
|
1830
1832
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBRep, tolerance = item
|
|
1831
1833
|
graph = None
|
|
1832
1834
|
vertices = []
|
|
1833
1835
|
edges = []
|
|
1834
1836
|
|
|
1835
1837
|
if useInternalVertex == True:
|
|
1836
|
-
vFace =
|
|
1838
|
+
vFace = Face.InternalVertex(topology, tolerance)
|
|
1837
1839
|
else:
|
|
1838
1840
|
vFace = topology.CenterOfMass()
|
|
1839
1841
|
d1 = topology.GetDictionary()
|
|
1840
1842
|
if storeBRep:
|
|
1841
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1843
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
1842
1844
|
d3 = mergeDictionaries2([d1, d2])
|
|
1843
1845
|
_ = vFace.SetDictionary(d3)
|
|
1844
1846
|
else:
|
|
@@ -1885,7 +1887,7 @@ class Graph:
|
|
|
1885
1887
|
vst = exteriorTopology.CenterOfMass()
|
|
1886
1888
|
d1 = exteriorTopology.GetDictionary()
|
|
1887
1889
|
if storeBRep:
|
|
1888
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1890
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
|
1889
1891
|
d3 = mergeDictionaries2([d1, d2])
|
|
1890
1892
|
_ = vst.SetDictionary(d3)
|
|
1891
1893
|
else:
|
|
@@ -1906,7 +1908,7 @@ class Graph:
|
|
|
1906
1908
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
1907
1909
|
d1 = content.GetDictionary()
|
|
1908
1910
|
if storeBRep:
|
|
1909
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1911
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1910
1912
|
d3 = mergeDictionaries2([d1, d2])
|
|
1911
1913
|
_ = vst2.SetDictionary(d3)
|
|
1912
1914
|
else:
|
|
@@ -1926,7 +1928,7 @@ class Graph:
|
|
|
1926
1928
|
d1 = exteriorAperture.Topology().GetDictionary()
|
|
1927
1929
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1928
1930
|
if storeBRep:
|
|
1929
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1931
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(exteriorAperture)), Topology.Type(Aperture.Topology(exteriorAperture)), Topology.TypeAsString(Aperture.Topology(exteriorAperture))])
|
|
1930
1932
|
d3 = mergeDictionaries2([d1, d2])
|
|
1931
1933
|
_ = vst.SetDictionary(d3)
|
|
1932
1934
|
else:
|
|
@@ -1947,7 +1949,7 @@ class Graph:
|
|
|
1947
1949
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
1948
1950
|
d1 = content.GetDictionary()
|
|
1949
1951
|
if storeBRep:
|
|
1950
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
1952
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
1951
1953
|
d3 = mergeDictionaries2([d1, d2])
|
|
1952
1954
|
_ = vst.SetDictionary(d3)
|
|
1953
1955
|
else:
|
|
@@ -2046,7 +2048,7 @@ class Graph:
|
|
|
2046
2048
|
vEdge = anEdge.CenterOfMass()
|
|
2047
2049
|
d1 = anEdge.GetDictionary()
|
|
2048
2050
|
if storeBRep:
|
|
2049
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2051
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(anEdge), Topology.Type(anEdge), Topology.TypeAsString(anEdge)])
|
|
2050
2052
|
d3 = mergeDictionaries2([d1, d2])
|
|
2051
2053
|
_ = vEdge.SetDictionary(d3)
|
|
2052
2054
|
else:
|
|
@@ -2080,7 +2082,7 @@ class Graph:
|
|
|
2080
2082
|
vst = sharedTopology.CenterOfMass()
|
|
2081
2083
|
d1 = sharedTopology.GetDictionary()
|
|
2082
2084
|
if storeBRep:
|
|
2083
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2085
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
|
2084
2086
|
d3 = mergeDictionaries2([d1, d2])
|
|
2085
2087
|
_ = vst.SetDictionary(d3)
|
|
2086
2088
|
else:
|
|
@@ -2101,7 +2103,7 @@ class Graph:
|
|
|
2101
2103
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
2102
2104
|
d1 = content.GetDictionary()
|
|
2103
2105
|
if storeBRep:
|
|
2104
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2106
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
2105
2107
|
d3 = mergeDictionaries2([d1, d2])
|
|
2106
2108
|
_ = vst2.SetDictionary(d3)
|
|
2107
2109
|
else:
|
|
@@ -2120,7 +2122,7 @@ class Graph:
|
|
|
2120
2122
|
d1 = sharedAperture.Topology().GetDictionary()
|
|
2121
2123
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
2122
2124
|
if storeBRep:
|
|
2123
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2125
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(sharedAperture)), Topology.Type(Aperture.Topology(sharedAperture)), Topology.TypeAsString(Aperture.Topology(sharedAperture))])
|
|
2124
2126
|
d3 = mergeDictionaries2([d1, d2])
|
|
2125
2127
|
_ = vst.SetDictionary(d3)
|
|
2126
2128
|
else:
|
|
@@ -2149,7 +2151,7 @@ class Graph:
|
|
|
2149
2151
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
2150
2152
|
d1 = content.GetDictionary()
|
|
2151
2153
|
if storeBRep:
|
|
2152
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2154
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
2153
2155
|
d3 = mergeDictionaries2([d1, d2])
|
|
2154
2156
|
_ = vst2.SetDictionary(d3)
|
|
2155
2157
|
else:
|
|
@@ -2169,7 +2171,7 @@ class Graph:
|
|
|
2169
2171
|
d1 = extTop.GetDictionary()
|
|
2170
2172
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
2171
2173
|
if storeBRep:
|
|
2172
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2174
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(extTop), Topology.Type(extTop), Topology.TypeAsString(extTop)])
|
|
2173
2175
|
d3 = mergeDictionaries2([d1, d2])
|
|
2174
2176
|
_ = vst.SetDictionary(d3)
|
|
2175
2177
|
else:
|
|
@@ -2191,7 +2193,7 @@ class Graph:
|
|
|
2191
2193
|
d1 = content.GetDictionary()
|
|
2192
2194
|
vst = topologic.Vertex.ByCoordinates(vst.X(), vst.Y(), vst.Z())
|
|
2193
2195
|
if storeBRep:
|
|
2194
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2196
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
2195
2197
|
d3 = mergeDictionaries2([d1, d2])
|
|
2196
2198
|
_ = vst.SetDictionary(d3)
|
|
2197
2199
|
else:
|
|
@@ -2208,7 +2210,7 @@ class Graph:
|
|
|
2208
2210
|
vEdge = anEdge.CenterOfMass()
|
|
2209
2211
|
d1 = anEdge.GetDictionary()
|
|
2210
2212
|
if storeBRep:
|
|
2211
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2213
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(anEdge), Topology.Type(anEdge), Topology.TypeAsString(anEdge)])
|
|
2212
2214
|
d3 = mergeDictionaries2([d1, d2])
|
|
2213
2215
|
_ = vEdge.SetDictionary(d3)
|
|
2214
2216
|
else:
|
|
@@ -2236,7 +2238,7 @@ class Graph:
|
|
|
2236
2238
|
vcc = Topology.CenterOfMass(topology)
|
|
2237
2239
|
d1 = Topology.Dictionary(vcc)
|
|
2238
2240
|
if storeBRep:
|
|
2239
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2241
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
2240
2242
|
d3 = mergeDictionaries2([d1, d2])
|
|
2241
2243
|
_ = vcc.SetDictionary(d3)
|
|
2242
2244
|
else:
|
|
@@ -2265,7 +2267,7 @@ class Graph:
|
|
|
2265
2267
|
|
|
2266
2268
|
d1 = vEdge.GetDictionary()
|
|
2267
2269
|
if storeBRep:
|
|
2268
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2270
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
|
2269
2271
|
d3 = mergeDictionaries2([d1, d2])
|
|
2270
2272
|
_ = vEdge.SetDictionary(d3)
|
|
2271
2273
|
else:
|
|
@@ -2314,7 +2316,7 @@ class Graph:
|
|
|
2314
2316
|
vst = exteriorTopology.CenterOfMass()
|
|
2315
2317
|
d1 = exteriorTopology.GetDictionary()
|
|
2316
2318
|
if storeBRep:
|
|
2317
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2319
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
|
2318
2320
|
d3 = mergeDictionaries2([d1, d2])
|
|
2319
2321
|
_ = vst.SetDictionary(d3)
|
|
2320
2322
|
else:
|
|
@@ -2335,7 +2337,7 @@ class Graph:
|
|
|
2335
2337
|
vst2 = topologic.Vertex.ByCoordinates(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
|
|
2336
2338
|
d1 = content.GetDictionary()
|
|
2337
2339
|
if storeBRep:
|
|
2338
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2340
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
2339
2341
|
d3 = mergeDictionaries2([d1, d2])
|
|
2340
2342
|
_ = vst2.SetDictionary(d3)
|
|
2341
2343
|
else:
|
|
@@ -2355,7 +2357,7 @@ class Graph:
|
|
|
2355
2357
|
d1 = exteriorAperture.Topology().GetDictionary()
|
|
2356
2358
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
2357
2359
|
if storeBRep:
|
|
2358
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2360
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(Aperture.Topology(exteriorAperture)), Topology.Type(Aperture.Topology(exteriorAperture)), Topology.TypeAsString(Aperture.Topology(exteriorAperture))])
|
|
2359
2361
|
d3 = mergeDictionaries2([d1, d2])
|
|
2360
2362
|
_ = vst.SetDictionary(d3)
|
|
2361
2363
|
else:
|
|
@@ -2385,7 +2387,7 @@ class Graph:
|
|
|
2385
2387
|
d1 = content.GetDictionary()
|
|
2386
2388
|
vst = topologic.Vertex.ByCoordinates(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
|
|
2387
2389
|
if storeBRep:
|
|
2388
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.
|
|
2390
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
|
2389
2391
|
d3 = mergeDictionaries2([d1, d2])
|
|
2390
2392
|
_ = vst.SetDictionary(d3)
|
|
2391
2393
|
else:
|
|
@@ -3068,27 +3070,27 @@ class Graph:
|
|
|
3068
3070
|
if ext.lower() != ".csv":
|
|
3069
3071
|
graphsPath = graphsPath+".csv"
|
|
3070
3072
|
|
|
3071
|
-
if not overwrite and exists(graphsPath):
|
|
3072
|
-
print("DGL.ExportToCSV_GC - Error: a file already exists at the specified graphs path and overwrite is set to False. Returning None.")
|
|
3073
|
-
return None
|
|
3073
|
+
#if not overwrite and exists(graphsPath):
|
|
3074
|
+
#print("DGL.ExportToCSV_GC - Error: a file already exists at the specified graphs path and overwrite is set to False. Returning None.")
|
|
3075
|
+
#return None
|
|
3074
3076
|
|
|
3075
3077
|
# Make sure the file extension is .csv
|
|
3076
3078
|
ext = edgesPath[len(edgesPath)-4:len(edgesPath)]
|
|
3077
3079
|
if ext.lower() != ".csv":
|
|
3078
3080
|
edgesPath = edgesPath+".csv"
|
|
3079
3081
|
|
|
3080
|
-
if not overwrite and exists(edgesPath):
|
|
3081
|
-
print("DGL.ExportToCSV_GC - Error: a file already exists at the specified edges path and overwrite is set to False. Returning None.")
|
|
3082
|
-
return None
|
|
3082
|
+
#if not overwrite and exists(edgesPath):
|
|
3083
|
+
#print("DGL.ExportToCSV_GC - Error: a file already exists at the specified edges path and overwrite is set to False. Returning None.")
|
|
3084
|
+
#return None
|
|
3083
3085
|
|
|
3084
3086
|
# Make sure the file extension is .csv
|
|
3085
3087
|
ext = nodesPath[len(nodesPath)-4:len(nodesPath)]
|
|
3086
3088
|
if ext.lower() != ".csv":
|
|
3087
3089
|
nodesPath = nodesPath+".csv"
|
|
3088
3090
|
|
|
3089
|
-
if not overwrite and exists(nodesPath):
|
|
3090
|
-
print("DGL.ExportToCSV_GC - Error: a file already exists at the specified nodes path and overwrite is set to False. Returning None.")
|
|
3091
|
-
return None
|
|
3091
|
+
#if not overwrite and exists(nodesPath):
|
|
3092
|
+
#print("DGL.ExportToCSV_GC - Error: a file already exists at the specified nodes path and overwrite is set to False. Returning None.")
|
|
3093
|
+
#return None
|
|
3092
3094
|
|
|
3093
3095
|
for graph_index, graph in enumerate(graphs):
|
|
3094
3096
|
graph_label = graphLabels[graph_index]
|
|
@@ -3138,7 +3140,7 @@ class Graph:
|
|
|
3138
3140
|
for key in keys:
|
|
3139
3141
|
if key != nodeLabelKey and (key in node_columns):
|
|
3140
3142
|
value = Dictionary.ValueAtKey(d, key)
|
|
3141
|
-
if
|
|
3143
|
+
if value == None:
|
|
3142
3144
|
value = 'None'
|
|
3143
3145
|
single_node_data.append(value)
|
|
3144
3146
|
node_data.append(single_node_data)
|
|
@@ -4234,7 +4236,7 @@ class Graph:
|
|
|
4234
4236
|
for edge in edges:
|
|
4235
4237
|
d = Dictionary.Dictionary(edge)
|
|
4236
4238
|
value = Dictionary.ValueAtKey(d, edgeKey)
|
|
4237
|
-
if
|
|
4239
|
+
if value == None or not isinstance(value, int) or not isinstance(value, float):
|
|
4238
4240
|
return None
|
|
4239
4241
|
values.append(value)
|
|
4240
4242
|
else:
|
topologicpy/Plotly.py
CHANGED
|
@@ -255,9 +255,9 @@ class Plotly:
|
|
|
255
255
|
vertices = Graph.Vertices(graph)
|
|
256
256
|
if vertexLabelKey or vertexGroupKey:
|
|
257
257
|
for v in vertices:
|
|
258
|
-
Xn=[Vertex.X(v) for v in vertices] # x-coordinates of nodes
|
|
259
|
-
Yn=[Vertex.Y(v) for v in vertices] # y-coordinates of nodes
|
|
260
|
-
Zn=[Vertex.Z(v) for v in vertices] # x-coordinates of nodes
|
|
258
|
+
Xn=[round(Vertex.X(v),4) for v in vertices] # x-coordinates of nodes
|
|
259
|
+
Yn=[round(Vertex.Y(v),4) for v in vertices] # y-coordinates of nodes
|
|
260
|
+
Zn=[round(Vertex.Z(v),4) for v in vertices] # x-coordinates of nodes
|
|
261
261
|
v_label = ""
|
|
262
262
|
v_group = ""
|
|
263
263
|
d = Topology.Dictionary(v)
|
|
@@ -282,9 +282,9 @@ class Plotly:
|
|
|
282
282
|
v_labels.append(v_label)
|
|
283
283
|
else:
|
|
284
284
|
for v in vertices:
|
|
285
|
-
Xn=[Vertex.X(v) for v in vertices] # x-coordinates of nodes
|
|
286
|
-
Yn=[Vertex.Y(v) for v in vertices] # y-coordinates of nodes
|
|
287
|
-
Zn=[Vertex.Z(v) for v in vertices] # x-coordinates of nodes
|
|
285
|
+
Xn=[round(Vertex.X(v),4) for v in vertices] # x-coordinates of nodes
|
|
286
|
+
Yn=[round(Vertex.Y(v),4) for v in vertices] # y-coordinates of nodes
|
|
287
|
+
Zn=[round(Vertex.Z(v),4) for v in vertices] # x-coordinates of nodes
|
|
288
288
|
if len(list(set(v_groupList))) < 2:
|
|
289
289
|
v_groupList = vertexColor
|
|
290
290
|
if len(v_labels) < 1:
|
|
@@ -320,9 +320,9 @@ class Plotly:
|
|
|
320
320
|
for e in edges:
|
|
321
321
|
sv = Edge.StartVertex(e)
|
|
322
322
|
ev = Edge.EndVertex(e)
|
|
323
|
-
Xe+=[Vertex.X(sv),Vertex.X(ev), None] # x-coordinates of edge ends
|
|
324
|
-
Ye+=[Vertex.Y(sv),Vertex.Y(ev), None] # y-coordinates of edge ends
|
|
325
|
-
Ze+=[Vertex.Z(sv),Vertex.Z(ev), None] # z-coordinates of edge ends
|
|
323
|
+
Xe+=[round(Vertex.X(sv),4), round(Vertex.X(ev),4), None] # x-coordinates of edge ends
|
|
324
|
+
Ye+=[round(Vertex.Y(sv),4), round(Vertex.Y(ev),4), None] # y-coordinates of edge ends
|
|
325
|
+
Ze+=[round(Vertex.Z(sv),4), round(Vertex.Z(ev),4), None] # z-coordinates of edge ends
|
|
326
326
|
e_label = ""
|
|
327
327
|
e_group = ""
|
|
328
328
|
d = Topology.Dictionary(e)
|
|
@@ -346,9 +346,9 @@ class Plotly:
|
|
|
346
346
|
for e in edges:
|
|
347
347
|
sv = Edge.StartVertex(e)
|
|
348
348
|
ev = Edge.EndVertex(e)
|
|
349
|
-
Xe+=[Vertex.X(sv),Vertex.X(ev), None] # x-coordinates of edge ends
|
|
350
|
-
Ye+=[Vertex.Y(sv),Vertex.Y(ev), None] # y-coordinates of edge ends
|
|
351
|
-
Ze+=[Vertex.Z(sv),Vertex.Z(ev), None] # z-coordinates of edge ends
|
|
349
|
+
Xe+=[round(Vertex.X(sv),4), round(Vertex.X(ev),4), None] # x-coordinates of edge ends
|
|
350
|
+
Ye+=[round(Vertex.Y(sv),4), round(Vertex.Y(ev),4), None] # y-coordinates of edge ends
|
|
351
|
+
Ze+=[round(Vertex.Z(sv),4), round(Vertex.Z(ev),4), None] # z-coordinates of edge ends
|
|
352
352
|
|
|
353
353
|
if len(list(set(e_groupList))) < 2:
|
|
354
354
|
e_groupList = edgeColor
|
topologicpy/Shell.py
CHANGED
|
@@ -3,6 +3,8 @@ import topologicpy
|
|
|
3
3
|
import topologic
|
|
4
4
|
from topologicpy.Topology import Topology
|
|
5
5
|
import math
|
|
6
|
+
import sys
|
|
7
|
+
import subprocess
|
|
6
8
|
try:
|
|
7
9
|
from tqdm.auto import tqdm
|
|
8
10
|
except:
|
|
@@ -121,15 +123,18 @@ class Shell(Topology):
|
|
|
121
123
|
break;
|
|
122
124
|
if flag == False:
|
|
123
125
|
walls.append(w1)
|
|
126
|
+
print("Walls:", walls)
|
|
124
127
|
for wall in walls:
|
|
125
128
|
skeleton = Wire.Skeleton(wall)
|
|
129
|
+
print("1. Skeleton:", skeleton, "facesCluster:", facesCluster)
|
|
126
130
|
skeleton = Topology.Difference(skeleton, facesCluster)
|
|
131
|
+
print("2. Skeleton:", skeleton, "Face.Wire(wall):", fFace.Wire(wall))
|
|
127
132
|
skeleton = Topology.Difference(skeleton, Face.Wire(wall))
|
|
133
|
+
print("3. Skeleton:", skeleton)
|
|
128
134
|
skeletons.append(skeleton)
|
|
129
135
|
print("Finished all tiles")
|
|
130
136
|
if len(skeletons) > 0:
|
|
131
137
|
skeleton_cluster = Cluster.ByTopologies(skeletons+[internalBoundary])
|
|
132
|
-
Topology.Show(skeleton_cluster)
|
|
133
138
|
skEdges = Topology.SelfMerge(Cluster.ByTopologies(removeShards(Topology.Edges(skeleton_cluster), skeleton_cluster, maximumGap=maximumGap)))
|
|
134
139
|
if isinstance(skEdges, topologic.Edge):
|
|
135
140
|
skEdges = extendEdges([skEdges], skEdges, maximumGap=maximumGap)
|
|
@@ -143,7 +148,6 @@ class Shell(Topology):
|
|
|
143
148
|
#print("ShellByDisjointFaces - Error: Could not derive central skeleton of interior walls. Returning None.")
|
|
144
149
|
#return None
|
|
145
150
|
|
|
146
|
-
Topology.Show(skeleton_cluster)
|
|
147
151
|
shell = Topology.Slice(internalBoundary, skeleton_cluster)
|
|
148
152
|
#Topology.Show(shell)
|
|
149
153
|
if mergeJunctions == True:
|
|
@@ -857,6 +861,7 @@ class Shell(Topology):
|
|
|
857
861
|
"""
|
|
858
862
|
from topologicpy.Vertex import Vertex
|
|
859
863
|
from topologicpy.Face import Face
|
|
864
|
+
from topologicpy.Topology import Topology
|
|
860
865
|
if not isinstance(origin, topologic.Vertex):
|
|
861
866
|
origin = Vertex.ByCoordinates(0,0,0)
|
|
862
867
|
uOffset = float(360)/float(sides)
|
|
@@ -993,9 +998,9 @@ class Shell(Topology):
|
|
|
993
998
|
else:
|
|
994
999
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Z-Axis
|
|
995
1000
|
zeroOrigin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
996
|
-
returnTopology =
|
|
997
|
-
returnTopology =
|
|
998
|
-
returnTopology =
|
|
1001
|
+
returnTopology = Topology.Rotate(returnTopology, zeroOrigin, 0, 1, 0, theta)
|
|
1002
|
+
returnTopology = Topology.Rotate(returnTopology, zeroOrigin, 0, 0, 1, phi)
|
|
1003
|
+
returnTopology = Topology.Translate(returnTopology, origin.X()+xOffset, origin.Y()+yOffset, origin.Z()+zOffset)
|
|
999
1004
|
return returnTopology
|
|
1000
1005
|
|
|
1001
1006
|
@staticmethod
|
|
@@ -1415,7 +1420,7 @@ class Shell(Topology):
|
|
|
1415
1420
|
aFace = topologic.Face.ByExternalBoundary(Topology.RemoveCollinearEdges(aWire, angTolerance))
|
|
1416
1421
|
except:
|
|
1417
1422
|
aFace = topologic.Face.ByExternalBoundary(Wire.Planarize(Topology.RemoveCollinearEdges(aWire, angTolerance)))
|
|
1418
|
-
anArea =
|
|
1423
|
+
anArea = Face.Area(aFace)
|
|
1419
1424
|
faces.append(aFace)
|
|
1420
1425
|
areas.append(anArea)
|
|
1421
1426
|
max_index = areas.index(max(areas))
|