topologicpy 0.7.54__py3-none-any.whl → 0.7.56__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 +1 -6
- topologicpy/CellComplex.py +1 -6
- topologicpy/Dictionary.py +7 -3
- topologicpy/EnergyModel.py +6 -8
- topologicpy/Graph.py +160 -112
- topologicpy/Honeybee.py +2 -3
- topologicpy/Neo4j.py +285 -341
- topologicpy/Plotly.py +13 -10
- topologicpy/Topology.py +19 -488
- topologicpy/version.py +1 -1
- {topologicpy-0.7.54.dist-info → topologicpy-0.7.56.dist-info}/METADATA +1 -1
- {topologicpy-0.7.54.dist-info → topologicpy-0.7.56.dist-info}/RECORD +15 -15
- {topologicpy-0.7.54.dist-info → topologicpy-0.7.56.dist-info}/WHEEL +1 -1
- {topologicpy-0.7.54.dist-info → topologicpy-0.7.56.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.54.dist-info → topologicpy-0.7.56.dist-info}/top_level.txt +0 -0
topologicpy/Graph.py
CHANGED
@@ -2382,6 +2382,7 @@ class Graph:
|
|
2382
2382
|
toOutposts: bool = False,
|
2383
2383
|
idKey: str = "TOPOLOGIC_ID",
|
2384
2384
|
outpostsKey: str = "outposts",
|
2385
|
+
vertexCategoryKey: str = "category",
|
2385
2386
|
useInternalVertex: bool =True,
|
2386
2387
|
storeBREP: bool =False,
|
2387
2388
|
mantissa: int = 6,
|
@@ -2413,6 +2414,16 @@ class Graph:
|
|
2413
2414
|
The key to use to find outpost by ID. It is case insensitive. The default is "TOPOLOGIC_ID".
|
2414
2415
|
outpostsKey : str , optional
|
2415
2416
|
The key to use to find the list of outposts. It is case insensitive. The default is "outposts".
|
2417
|
+
vertexCategoryKey : str , optional
|
2418
|
+
The key under which to store the node type. Node types are:
|
2419
|
+
0 : main topology
|
2420
|
+
1 : shared topology
|
2421
|
+
2 : shared aperture
|
2422
|
+
3 : exterior topology
|
2423
|
+
4 : exterior aperture
|
2424
|
+
5 : content
|
2425
|
+
6 : outpost
|
2426
|
+
The default is "node_type".
|
2416
2427
|
useInternalVertex : bool , optional
|
2417
2428
|
If set to True, use an internal vertex to represent the subtopology. Otherwise, use its centroid. The default is False.
|
2418
2429
|
storeBREP : bool , optional
|
@@ -2592,8 +2603,7 @@ class Graph:
|
|
2592
2603
|
if len(sharedt) > 0:
|
2593
2604
|
apertureExists = False
|
2594
2605
|
for x in sharedt:
|
2595
|
-
apList =
|
2596
|
-
_ = x.Apertures(apList)
|
2606
|
+
apList = Topology.Apertures(x)
|
2597
2607
|
if len(apList) > 0:
|
2598
2608
|
apTopList = []
|
2599
2609
|
for ap in apList:
|
@@ -2635,15 +2645,25 @@ class Graph:
|
|
2635
2645
|
vop = Topology.CenterOfMass(outpost)
|
2636
2646
|
vcc = Topology.CenterOfMass(topology)
|
2637
2647
|
d1 = Topology.Dictionary(vcc)
|
2648
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
2638
2649
|
if storeBREP:
|
2639
2650
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
2640
2651
|
d3 = mergeDictionaries2([d1, d2])
|
2641
2652
|
_ = vcc.SetDictionary(d3)
|
2642
2653
|
else:
|
2643
2654
|
_ = vcc.SetDictionary(d1)
|
2655
|
+
d1 = Topology.Dictionary(vop)
|
2656
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 6) # outpost
|
2657
|
+
if storeBREP:
|
2658
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(outpost), Topology.Type(outpost), Topology.TypeAsString(outpost)])
|
2659
|
+
d3 = mergeDictionaries2([d1, d2])
|
2660
|
+
_ = vop.SetDictionary(d3)
|
2661
|
+
else:
|
2662
|
+
_ = vop.SetDictionary(d1)
|
2644
2663
|
vertices.append(vcc)
|
2664
|
+
vertices.append(vop)
|
2645
2665
|
tempe = Edge.ByStartVertexEndVertex(vcc, vop, tolerance=tolerance)
|
2646
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2666
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
2647
2667
|
_ = tempe.SetDictionary(tempd)
|
2648
2668
|
edges.append(tempe)
|
2649
2669
|
|
@@ -2655,14 +2675,6 @@ class Graph:
|
|
2655
2675
|
vCell = Topology.InternalVertex(aCell, tolerance=tolerance)
|
2656
2676
|
else:
|
2657
2677
|
vCell = aCell.CenterOfMass()
|
2658
|
-
d1 = aCell.GetDictionary()
|
2659
|
-
if storeBREP:
|
2660
|
-
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aCell), Topology.Type(aCell), Topology.TypeAsString(aCell)])
|
2661
|
-
d3 = mergeDictionaries2([d1, d2])
|
2662
|
-
_ = vCell.SetDictionary(d3)
|
2663
|
-
else:
|
2664
|
-
_ = vCell.SetDictionary(d1)
|
2665
|
-
vertices.append(vCell)
|
2666
2678
|
faces = []
|
2667
2679
|
_ = aCell.Faces(None, faces)
|
2668
2680
|
sharedTopologies = []
|
@@ -2676,14 +2688,12 @@ class Graph:
|
|
2676
2688
|
_ = aFace.Cells(topology, cells1)
|
2677
2689
|
if len(cells1) > 1:
|
2678
2690
|
sharedTopologies.append(aFace)
|
2679
|
-
apertures =
|
2680
|
-
_ = aFace.Apertures(apertures)
|
2691
|
+
apertures = Topology.Apertures(aFace)
|
2681
2692
|
for anAperture in apertures:
|
2682
2693
|
sharedApertures.append(anAperture)
|
2683
2694
|
else:
|
2684
2695
|
exteriorTopologies.append(aFace)
|
2685
|
-
apertures =
|
2686
|
-
_ = aFace.Apertures(apertures)
|
2696
|
+
apertures = Topology.Apertures(aFace)
|
2687
2697
|
for anAperture in apertures:
|
2688
2698
|
exteriorApertures.append(anAperture)
|
2689
2699
|
|
@@ -2694,6 +2704,7 @@ class Graph:
|
|
2694
2704
|
else:
|
2695
2705
|
vst = sharedTopology.CenterOfMass()
|
2696
2706
|
d1 = sharedTopology.GetDictionary()
|
2707
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 1) # shared topology
|
2697
2708
|
if storeBREP:
|
2698
2709
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
2699
2710
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2702,7 +2713,7 @@ class Graph:
|
|
2702
2713
|
_ = vst.SetDictionary(d1)
|
2703
2714
|
vertices.append(vst)
|
2704
2715
|
tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
|
2705
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2716
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Topologies"])
|
2706
2717
|
_ = tempe.SetDictionary(tempd)
|
2707
2718
|
edges.append(tempe)
|
2708
2719
|
if toContents:
|
@@ -2716,6 +2727,7 @@ class Graph:
|
|
2716
2727
|
else:
|
2717
2728
|
vst2 = content.CenterOfMass()
|
2718
2729
|
d1 = content.GetDictionary()
|
2730
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
2719
2731
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa), Vertex.Y(vst2, mantissa=mantissa), Vertex.Z(vst2, mantissa=mantissa))
|
2720
2732
|
if storeBREP:
|
2721
2733
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2725,17 +2737,17 @@ class Graph:
|
|
2725
2737
|
_ = vst2.SetDictionary(d1)
|
2726
2738
|
vertices.append(vst2)
|
2727
2739
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
2728
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2740
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
2729
2741
|
_ = tempe.SetDictionary(tempd)
|
2730
2742
|
edges.append(tempe)
|
2731
2743
|
if viaSharedApertures:
|
2732
|
-
for
|
2733
|
-
sharedAp = sharedAperture.Topology()
|
2744
|
+
for sharedAp in sharedApertures:
|
2734
2745
|
if useInternalVertex == True:
|
2735
2746
|
vsa = Topology.InternalVertex(sharedAp, tolerance)
|
2736
2747
|
else:
|
2737
2748
|
vsa = sharedAp.CenterOfMass()
|
2738
2749
|
d1 = sharedAp.GetDictionary()
|
2750
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 2) # shared aperture
|
2739
2751
|
vsa = Vertex.ByCoordinates(Vertex.X(vsa, mantissa=mantissa)+(tolerance*100), Vertex.Y(vsa, mantissa=mantissa)+(tolerance*100), Vertex.Z(vsa, mantissa=mantissa)+(tolerance*100))
|
2740
2752
|
if storeBREP:
|
2741
2753
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
@@ -2745,7 +2757,7 @@ class Graph:
|
|
2745
2757
|
_ = vsa.SetDictionary(d1)
|
2746
2758
|
vertices.append(vsa)
|
2747
2759
|
tempe = Edge.ByStartVertexEndVertex(vCell, vsa, tolerance=tolerance)
|
2748
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2760
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Apertures"])
|
2749
2761
|
_ = tempe.SetDictionary(tempd)
|
2750
2762
|
edges.append(tempe)
|
2751
2763
|
if toExteriorTopologies:
|
@@ -2756,6 +2768,7 @@ class Graph:
|
|
2756
2768
|
vet = exteriorTopology.CenterOfMass()
|
2757
2769
|
_ = vet.SetDictionary(exteriorTopology.GetDictionary())
|
2758
2770
|
d1 = exteriorTopology.GetDictionary()
|
2771
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 3) # exterior topology
|
2759
2772
|
if storeBREP:
|
2760
2773
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
2761
2774
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2764,7 +2777,7 @@ class Graph:
|
|
2764
2777
|
_ = vet.SetDictionary(d1)
|
2765
2778
|
vertices.append(vet)
|
2766
2779
|
tempe = Edge.ByStartVertexEndVertex(vCell, vet, tolerance=tolerance)
|
2767
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2780
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Topologies"])
|
2768
2781
|
_ = tempe.SetDictionary(tempd)
|
2769
2782
|
edges.append(tempe)
|
2770
2783
|
if toContents:
|
@@ -2778,6 +2791,7 @@ class Graph:
|
|
2778
2791
|
else:
|
2779
2792
|
vst2 = content.CenterOfMass()
|
2780
2793
|
d1 = content.GetDictionary()
|
2794
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
2781
2795
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2782
2796
|
if storeBREP:
|
2783
2797
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2787,17 +2801,17 @@ class Graph:
|
|
2787
2801
|
_ = vst2.SetDictionary(d1)
|
2788
2802
|
vertices.append(vst2)
|
2789
2803
|
tempe = Edge.ByStartVertexEndVertex(vet, vst2, tolerance=tolerance)
|
2790
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2804
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
2791
2805
|
_ = tempe.SetDictionary(tempd)
|
2792
2806
|
edges.append(tempe)
|
2793
2807
|
if toExteriorApertures:
|
2794
|
-
for
|
2795
|
-
exTop = exteriorAperture.Topology()
|
2808
|
+
for exTop in exteriorApertures:
|
2796
2809
|
if useInternalVertex == True:
|
2797
2810
|
vea = Topology.InternalVertex(exTop, tolerance)
|
2798
2811
|
else:
|
2799
2812
|
vea = exTop.CenterOfMass()
|
2800
2813
|
d1 = exTop.GetDictionary()
|
2814
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
2801
2815
|
vea = Vertex.ByCoordinates(Vertex.X(vea, mantissa=mantissa)+(tolerance*100), Vertex.Y(vea, mantissa=mantissa)+(tolerance*100), Vertex.Z(vea, mantissa=mantissa)+(tolerance*100))
|
2802
2816
|
if storeBREP:
|
2803
2817
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -2807,7 +2821,7 @@ class Graph:
|
|
2807
2821
|
_ = vea.SetDictionary(d1)
|
2808
2822
|
vertices.append(vea)
|
2809
2823
|
tempe = Edge.ByStartVertexEndVertex(vCell, vea, tolerance=tolerance)
|
2810
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2824
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
2811
2825
|
_ = tempe.SetDictionary(tempd)
|
2812
2826
|
edges.append(tempe)
|
2813
2827
|
if toContents:
|
@@ -2822,6 +2836,7 @@ class Graph:
|
|
2822
2836
|
vcn = content.CenterOfMass()
|
2823
2837
|
vcn = Vertex.ByCoordinates(Vertex.X(vcn, mantissa=mantissa)+(tolerance*100), Vertex.Y(vcn, mantissa=mantissa)+(tolerance*100), Vertex.Z(vcn, mantissa=mantissa)+(tolerance*100))
|
2824
2838
|
d1 = content.GetDictionary()
|
2839
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
2825
2840
|
if storeBREP:
|
2826
2841
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2827
2842
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2830,7 +2845,7 @@ class Graph:
|
|
2830
2845
|
_ = vcn.SetDictionary(d1)
|
2831
2846
|
vertices.append(vcn)
|
2832
2847
|
tempe = Edge.ByStartVertexEndVertex(vCell, vcn, tolerance=tolerance)
|
2833
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2848
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
2834
2849
|
_ = tempe.SetDictionary(tempd)
|
2835
2850
|
edges.append(tempe)
|
2836
2851
|
|
@@ -2840,6 +2855,7 @@ class Graph:
|
|
2840
2855
|
else:
|
2841
2856
|
vCell = aCell.CenterOfMass()
|
2842
2857
|
d1 = aCell.GetDictionary()
|
2858
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
2843
2859
|
if storeBREP:
|
2844
2860
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aCell), Topology.Type(aCell), Topology.TypeAsString(aCell)])
|
2845
2861
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2858,6 +2874,7 @@ class Graph:
|
|
2858
2874
|
else:
|
2859
2875
|
vCell = topology.CenterOfMass()
|
2860
2876
|
d1 = topology.GetDictionary()
|
2877
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
2861
2878
|
if storeBREP:
|
2862
2879
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
2863
2880
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2886,9 +2903,18 @@ class Graph:
|
|
2886
2903
|
else:
|
2887
2904
|
vop = Topology.CenterOfMass(outpost)
|
2888
2905
|
tempe = Edge.ByStartVertexEndVertex(vCell, vop, tolerance=tolerance)
|
2889
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2906
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
2890
2907
|
_ = tempe.SetDictionary(tempd)
|
2891
2908
|
edges.append(tempe)
|
2909
|
+
d1 = outpost.GetDictionary()
|
2910
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 6) # outpost
|
2911
|
+
if storeBREP:
|
2912
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(outpost), Topology.Type(outpost), Topology.TypeAsString(outpost)])
|
2913
|
+
d3 = mergeDictionaries2([d1, d2])
|
2914
|
+
_ = vop.SetDictionary(d3)
|
2915
|
+
else:
|
2916
|
+
_ = vop.SetDictionary(d1)
|
2917
|
+
vertices.append(vop)
|
2892
2918
|
if any([toExteriorTopologies, toExteriorApertures, toContents]):
|
2893
2919
|
faces = Topology.Faces(topology)
|
2894
2920
|
exteriorTopologies = []
|
@@ -2905,6 +2931,8 @@ class Graph:
|
|
2905
2931
|
else:
|
2906
2932
|
vst = exteriorTopology.CenterOfMass()
|
2907
2933
|
d1 = exteriorTopology.GetDictionary()
|
2934
|
+
d1 = topology.GetDictionary()
|
2935
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 3) # exterior topology
|
2908
2936
|
if storeBREP:
|
2909
2937
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
2910
2938
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2913,7 +2941,7 @@ class Graph:
|
|
2913
2941
|
_ = vst.SetDictionary(d1)
|
2914
2942
|
vertices.append(vst)
|
2915
2943
|
tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
|
2916
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2944
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Topologies"])
|
2917
2945
|
_ = tempe.SetDictionary(tempd)
|
2918
2946
|
edges.append(tempe)
|
2919
2947
|
if toContents:
|
@@ -2928,6 +2956,7 @@ class Graph:
|
|
2928
2956
|
vst2 = content.CenterOfMass()
|
2929
2957
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2930
2958
|
d1 = content.GetDictionary()
|
2959
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
2931
2960
|
if storeBREP:
|
2932
2961
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2933
2962
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2936,17 +2965,17 @@ class Graph:
|
|
2936
2965
|
_ = vst2.SetDictionary(d1)
|
2937
2966
|
vertices.append(vst2)
|
2938
2967
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
2939
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2968
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
2940
2969
|
_ = tempe.SetDictionary(tempd)
|
2941
2970
|
edges.append(tempe)
|
2942
2971
|
if toExteriorApertures:
|
2943
|
-
for
|
2944
|
-
exTop = exteriorAperture.Topology()
|
2972
|
+
for exTop in exteriorApertures:
|
2945
2973
|
if useInternalVertex == True:
|
2946
2974
|
vst = Topology.InternalVertex(exTop, tolerance)
|
2947
2975
|
else:
|
2948
2976
|
vst = exTop.CenterOfMass()
|
2949
2977
|
d1 = exTop.GetDictionary()
|
2978
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
2950
2979
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2951
2980
|
if storeBREP:
|
2952
2981
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -2956,7 +2985,7 @@ class Graph:
|
|
2956
2985
|
_ = vst.SetDictionary(d1)
|
2957
2986
|
vertices.append(vst)
|
2958
2987
|
tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
|
2959
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
2988
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
2960
2989
|
_ = tempe.SetDictionary(tempd)
|
2961
2990
|
edges.append(tempe)
|
2962
2991
|
if toContents:
|
@@ -2971,6 +3000,7 @@ class Graph:
|
|
2971
3000
|
vst = content.CenterOfMass()
|
2972
3001
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2973
3002
|
d1 = content.GetDictionary()
|
3003
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
2974
3004
|
if storeBREP:
|
2975
3005
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2976
3006
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2979,15 +3009,13 @@ class Graph:
|
|
2979
3009
|
_ = vst.SetDictionary(d1)
|
2980
3010
|
vertices.append(vst)
|
2981
3011
|
tempe = Edge.ByStartVertexEndVertex(vCell, vst, tolerance=tolerance)
|
2982
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3012
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
2983
3013
|
_ = tempe.SetDictionary(tempd)
|
2984
3014
|
edges.append(tempe)
|
2985
3015
|
return [vertices, edges]
|
2986
3016
|
|
2987
3017
|
def processShell(item):
|
2988
|
-
from topologicpy.Face import Face
|
2989
3018
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBREP, tolerance = item
|
2990
|
-
graph = None
|
2991
3019
|
edges = []
|
2992
3020
|
vertices = []
|
2993
3021
|
facemat = []
|
@@ -3044,15 +3072,11 @@ class Graph:
|
|
3044
3072
|
if len(sharedt) > 0:
|
3045
3073
|
apertureExists = False
|
3046
3074
|
for x in sharedt:
|
3047
|
-
apList =
|
3048
|
-
_ = x.Apertures(apList)
|
3075
|
+
apList = Topology.Apertures(x)
|
3049
3076
|
if len(apList) > 0:
|
3050
3077
|
apertureExists = True
|
3051
3078
|
break
|
3052
3079
|
if apertureExists:
|
3053
|
-
apTopList = []
|
3054
|
-
for ap in apList:
|
3055
|
-
apTopList.append(ap.Topology())
|
3056
3080
|
if useInternalVertex == True:
|
3057
3081
|
v1 = Topology.InternalVertex(topFaces[i], tolerance=tolerance)
|
3058
3082
|
v2 = Topology.InternalVertex(topFaces[j], tolerance=tolerance)
|
@@ -3060,7 +3084,7 @@ class Graph:
|
|
3060
3084
|
v1 = topFaces[i].CenterOfMass()
|
3061
3085
|
v2 = topFaces[j].CenterOfMass()
|
3062
3086
|
e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance)
|
3063
|
-
mDict = mergeDictionaries(
|
3087
|
+
mDict = mergeDictionaries(apList)
|
3064
3088
|
if mDict:
|
3065
3089
|
e.SetDictionary(mDict)
|
3066
3090
|
edges.append(e)
|
@@ -3074,7 +3098,6 @@ class Graph:
|
|
3074
3098
|
else:
|
3075
3099
|
vFace = aFace.CenterOfMass()
|
3076
3100
|
_ = vFace.SetDictionary(aFace.GetDictionary())
|
3077
|
-
vertices.append(vFace)
|
3078
3101
|
fEdges = []
|
3079
3102
|
_ = aFace.Edges(None, fEdges)
|
3080
3103
|
sharedTopologies = []
|
@@ -3086,14 +3109,12 @@ class Graph:
|
|
3086
3109
|
_ = anEdge.Faces(topology, faces)
|
3087
3110
|
if len(faces) > 1:
|
3088
3111
|
sharedTopologies.append(anEdge)
|
3089
|
-
apertures =
|
3090
|
-
_ = anEdge.Apertures(apertures)
|
3112
|
+
apertures = Topology.Apertures(anEdge)
|
3091
3113
|
for anAperture in apertures:
|
3092
3114
|
sharedApertures.append(anAperture)
|
3093
3115
|
else:
|
3094
3116
|
exteriorTopologies.append(anEdge)
|
3095
|
-
apertures =
|
3096
|
-
_ = anEdge.Apertures(apertures)
|
3117
|
+
apertures = Topology.Apertures(anEdge)
|
3097
3118
|
for anAperture in apertures:
|
3098
3119
|
exteriorApertures.append(anAperture)
|
3099
3120
|
if viaSharedTopologies:
|
@@ -3103,6 +3124,7 @@ class Graph:
|
|
3103
3124
|
else:
|
3104
3125
|
vst = sharedTopology.CenterOfMass()
|
3105
3126
|
d1 = sharedTopology.GetDictionary()
|
3127
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 1) # shared topology
|
3106
3128
|
if storeBREP:
|
3107
3129
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
3108
3130
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3111,7 +3133,7 @@ class Graph:
|
|
3111
3133
|
_ = vst.SetDictionary(d1)
|
3112
3134
|
vertices.append(vst)
|
3113
3135
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3114
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3136
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Topologies"])
|
3115
3137
|
_ = tempe.SetDictionary(tempd)
|
3116
3138
|
edges.append(tempe)
|
3117
3139
|
if toContents:
|
@@ -3126,6 +3148,7 @@ class Graph:
|
|
3126
3148
|
vst2 = content.CenterOfMass()
|
3127
3149
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3128
3150
|
d1 = content.GetDictionary()
|
3151
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3129
3152
|
if storeBREP:
|
3130
3153
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3131
3154
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3134,17 +3157,17 @@ class Graph:
|
|
3134
3157
|
_ = vst2.SetDictionary(d1)
|
3135
3158
|
vertices.append(vst2)
|
3136
3159
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3137
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3160
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3138
3161
|
_ = tempe.SetDictionary(tempd)
|
3139
3162
|
edges.append(tempe)
|
3140
3163
|
if viaSharedApertures:
|
3141
|
-
for
|
3142
|
-
sharedAp = Aperture.Topology(sharedAperture)
|
3164
|
+
for sharedAp in sharedApertures:
|
3143
3165
|
if useInternalVertex == True:
|
3144
3166
|
vst = Topology.InternalVertex(sharedAp, tolerance)
|
3145
3167
|
else:
|
3146
3168
|
vst = sharedAp.CenterOfMass()
|
3147
3169
|
d1 = sharedAp.GetDictionary()
|
3170
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 2) # shared aperture
|
3148
3171
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3149
3172
|
if storeBREP:
|
3150
3173
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
@@ -3154,7 +3177,7 @@ class Graph:
|
|
3154
3177
|
_ = vst.SetDictionary(d1)
|
3155
3178
|
vertices.append(vst)
|
3156
3179
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3157
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3180
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Apertures"])
|
3158
3181
|
_ = tempe.SetDictionary(tempd)
|
3159
3182
|
edges.append(tempe)
|
3160
3183
|
if toExteriorTopologies:
|
@@ -3164,6 +3187,7 @@ class Graph:
|
|
3164
3187
|
else:
|
3165
3188
|
vst = exteriorTopology.CenterOfMass()
|
3166
3189
|
d1 = exteriorTopology.GetDictionary()
|
3190
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 3) # exterior topology
|
3167
3191
|
if storeBREP:
|
3168
3192
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
3169
3193
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3172,7 +3196,7 @@ class Graph:
|
|
3172
3196
|
_ = vst.SetDictionary(d1)
|
3173
3197
|
vertices.append(vst)
|
3174
3198
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3175
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3199
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
3176
3200
|
_ = tempe.SetDictionary(tempd)
|
3177
3201
|
edges.append(tempe)
|
3178
3202
|
if toContents:
|
@@ -3187,6 +3211,7 @@ class Graph:
|
|
3187
3211
|
vst2 = content.CenterOfMass()
|
3188
3212
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3189
3213
|
d1 = content.GetDictionary()
|
3214
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3190
3215
|
if storeBREP:
|
3191
3216
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3192
3217
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3195,17 +3220,17 @@ class Graph:
|
|
3195
3220
|
_ = vst2.SetDictionary(d1)
|
3196
3221
|
vertices.append(vst2)
|
3197
3222
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3198
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3223
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3199
3224
|
_ = tempe.SetDictionary(tempd)
|
3200
3225
|
edges.append(tempe)
|
3201
3226
|
if toExteriorApertures:
|
3202
|
-
for
|
3203
|
-
exTop = exteriorAperture.Topology()
|
3227
|
+
for exTop in exteriorApertures:
|
3204
3228
|
if useInternalVertex == True:
|
3205
3229
|
vst = Topology.InternalVertex(exTop, tolerance)
|
3206
3230
|
else:
|
3207
3231
|
vst = exTop.CenterOfMass()
|
3208
3232
|
d1 = exTop.GetDictionary()
|
3233
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
3209
3234
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3210
3235
|
if storeBREP:
|
3211
3236
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -3215,7 +3240,7 @@ class Graph:
|
|
3215
3240
|
_ = vst.SetDictionary(d1)
|
3216
3241
|
vertices.append(vst)
|
3217
3242
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3218
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3243
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
3219
3244
|
_ = tempe.SetDictionary(tempd)
|
3220
3245
|
edges.append(tempe)
|
3221
3246
|
if toContents:
|
@@ -3230,6 +3255,7 @@ class Graph:
|
|
3230
3255
|
vst = content.CenterOfMass()
|
3231
3256
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3232
3257
|
d1 = content.GetDictionary()
|
3258
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3233
3259
|
if storeBREP:
|
3234
3260
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3235
3261
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3238,7 +3264,7 @@ class Graph:
|
|
3238
3264
|
_ = vst.SetDictionary(d1)
|
3239
3265
|
vertices.append(vst)
|
3240
3266
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3241
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3267
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3242
3268
|
_ = tempe.SetDictionary(tempd)
|
3243
3269
|
edges.append(tempe)
|
3244
3270
|
|
@@ -3248,6 +3274,7 @@ class Graph:
|
|
3248
3274
|
else:
|
3249
3275
|
vFace = aFace.CenterOfMass()
|
3250
3276
|
d1 = aFace.GetDictionary()
|
3277
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3251
3278
|
if storeBREP:
|
3252
3279
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(aFace), Topology.Type(aFace), Topology.TypeAsString(aFace)])
|
3253
3280
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3278,6 +3305,7 @@ class Graph:
|
|
3278
3305
|
vop = Topology.CenterOfMass(outpost)
|
3279
3306
|
vcc = Topology.CenterOfMass(topology)
|
3280
3307
|
d1 = Topology.Dictionary(vcc)
|
3308
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3281
3309
|
if storeBREP:
|
3282
3310
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3283
3311
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3285,16 +3313,23 @@ class Graph:
|
|
3285
3313
|
else:
|
3286
3314
|
_ = vcc.SetDictionary(d1)
|
3287
3315
|
vertices.append(vcc)
|
3316
|
+
d1 = Topology.Dictionary(vop)
|
3317
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 6) # outpost
|
3318
|
+
if storeBREP:
|
3319
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3320
|
+
d3 = mergeDictionaries2([d1, d2])
|
3321
|
+
_ = vop.SetDictionary(d3)
|
3322
|
+
else:
|
3323
|
+
_ = vop.SetDictionary(d1)
|
3324
|
+
vertices.append(vcc)
|
3288
3325
|
tempe = Edge.ByStartVertexEndVertex(vcc, vop, tolerance=tolerance)
|
3289
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3326
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
3290
3327
|
_ = tempe.SetDictionary(tempd)
|
3291
3328
|
edges.append(tempe)
|
3292
3329
|
return [vertices, edges]
|
3293
3330
|
|
3294
3331
|
def processFace(item):
|
3295
|
-
from topologicpy.Face import Face
|
3296
3332
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBREP, tolerance = item
|
3297
|
-
graph = None
|
3298
3333
|
vertices = []
|
3299
3334
|
edges = []
|
3300
3335
|
|
@@ -3303,6 +3338,7 @@ class Graph:
|
|
3303
3338
|
else:
|
3304
3339
|
vFace = topology.CenterOfMass()
|
3305
3340
|
d1 = topology.GetDictionary()
|
3341
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3306
3342
|
if storeBREP:
|
3307
3343
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3308
3344
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3331,7 +3367,7 @@ class Graph:
|
|
3331
3367
|
else:
|
3332
3368
|
vop = Topology.CenterOfMass(outpost)
|
3333
3369
|
tempe = Edge.ByStartVertexEndVertex(vFace, vop, tolerance=tolerance)
|
3334
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3370
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
3335
3371
|
_ = tempe.SetDictionary(tempd)
|
3336
3372
|
edges.append(tempe)
|
3337
3373
|
if (toExteriorTopologies == True) or (toExteriorApertures == True) or (toContents == True):
|
@@ -3342,8 +3378,7 @@ class Graph:
|
|
3342
3378
|
|
3343
3379
|
for anEdge in fEdges:
|
3344
3380
|
exteriorTopologies.append(anEdge)
|
3345
|
-
apertures =
|
3346
|
-
_ = anEdge.Apertures(apertures)
|
3381
|
+
apertures = Topology.Apertures(anEdge)
|
3347
3382
|
for anAperture in apertures:
|
3348
3383
|
exteriorApertures.append(anAperture)
|
3349
3384
|
if toExteriorTopologies:
|
@@ -3353,6 +3388,7 @@ class Graph:
|
|
3353
3388
|
else:
|
3354
3389
|
vst = exteriorTopology.CenterOfMass()
|
3355
3390
|
d1 = exteriorTopology.GetDictionary()
|
3391
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 3) # exterior topology
|
3356
3392
|
if storeBREP:
|
3357
3393
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
3358
3394
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3361,7 +3397,7 @@ class Graph:
|
|
3361
3397
|
_ = vst.SetDictionary(d1)
|
3362
3398
|
vertices.append(vst)
|
3363
3399
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3364
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3400
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Topologies"])
|
3365
3401
|
_ = tempe.SetDictionary(tempd)
|
3366
3402
|
edges.append(tempe)
|
3367
3403
|
if toContents:
|
@@ -3376,6 +3412,7 @@ class Graph:
|
|
3376
3412
|
vst2 = content.CenterOfMass()
|
3377
3413
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3378
3414
|
d1 = content.GetDictionary()
|
3415
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3379
3416
|
if storeBREP:
|
3380
3417
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3381
3418
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3384,17 +3421,17 @@ class Graph:
|
|
3384
3421
|
_ = vst2.SetDictionary(d1)
|
3385
3422
|
vertices.append(vst2)
|
3386
3423
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3387
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3424
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3388
3425
|
_ = tempe.SetDictionary(tempd)
|
3389
3426
|
edges.append(tempe)
|
3390
3427
|
if toExteriorApertures:
|
3391
|
-
for
|
3392
|
-
exTop = exteriorAperture.Topology()
|
3428
|
+
for exTop in exteriorApertures:
|
3393
3429
|
if useInternalVertex == True:
|
3394
3430
|
vst = Topology.InternalVertex(exTop, tolerance)
|
3395
3431
|
else:
|
3396
3432
|
vst = exTop.CenterOfMass()
|
3397
3433
|
d1 = exTop.GetDictionary()
|
3434
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
3398
3435
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3399
3436
|
if storeBREP:
|
3400
3437
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -3404,7 +3441,7 @@ class Graph:
|
|
3404
3441
|
_ = vst.SetDictionary(d1)
|
3405
3442
|
vertices.append(vst)
|
3406
3443
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3407
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3444
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
3408
3445
|
_ = tempe.SetDictionary(tempd)
|
3409
3446
|
edges.append(tempe)
|
3410
3447
|
if toContents:
|
@@ -3419,6 +3456,7 @@ class Graph:
|
|
3419
3456
|
vst = content.CenterOfMass()
|
3420
3457
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3421
3458
|
d1 = content.GetDictionary()
|
3459
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3422
3460
|
if storeBREP:
|
3423
3461
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3424
3462
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3427,14 +3465,13 @@ class Graph:
|
|
3427
3465
|
_ = vst.SetDictionary(d1)
|
3428
3466
|
vertices.append(vst)
|
3429
3467
|
tempe = Edge.ByStartVertexEndVertex(vFace, vst, tolerance=tolerance)
|
3430
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3468
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3431
3469
|
_ = tempe.SetDictionary(tempd)
|
3432
3470
|
edges.append(tempe)
|
3433
3471
|
return [vertices, edges]
|
3434
3472
|
|
3435
3473
|
def processWire(item):
|
3436
3474
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBREP, tolerance = item
|
3437
|
-
graph = None
|
3438
3475
|
edges = []
|
3439
3476
|
vertices = []
|
3440
3477
|
edgemat = []
|
@@ -3493,8 +3530,7 @@ class Graph:
|
|
3493
3530
|
if len(sharedt) > 0:
|
3494
3531
|
apertureExists = False
|
3495
3532
|
for x in sharedt:
|
3496
|
-
apList =
|
3497
|
-
_ = x.Apertures(apList)
|
3533
|
+
apList = Topology.Apertures(x)
|
3498
3534
|
if len(apList) > 0:
|
3499
3535
|
apertureExists = True
|
3500
3536
|
break
|
@@ -3508,10 +3544,7 @@ class Graph:
|
|
3508
3544
|
except:
|
3509
3545
|
v2 = topEdges[j].CenterOfMass()
|
3510
3546
|
e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance)
|
3511
|
-
|
3512
|
-
for ap in apList:
|
3513
|
-
apTopologies.append(ap.Topology())
|
3514
|
-
mDict = mergeDictionaries(apTopologies)
|
3547
|
+
mDict = mergeDictionaries(apList)
|
3515
3548
|
if mDict:
|
3516
3549
|
e.SetDictionary(mDict)
|
3517
3550
|
edges.append(e)
|
@@ -3524,14 +3557,15 @@ class Graph:
|
|
3524
3557
|
vEdge = Edge.VertexByParameter(anEdge, 0.5)
|
3525
3558
|
except:
|
3526
3559
|
vEdge = anEdge.CenterOfMass()
|
3527
|
-
d1 = anEdge.GetDictionary()
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3531
|
-
|
3532
|
-
|
3533
|
-
|
3534
|
-
|
3560
|
+
# d1 = anEdge.GetDictionary()
|
3561
|
+
# d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3562
|
+
# if storeBREP:
|
3563
|
+
# d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(anEdge), Topology.Type(anEdge), Topology.TypeAsString(anEdge)])
|
3564
|
+
# d3 = mergeDictionaries2([d1, d2])
|
3565
|
+
# _ = vEdge.SetDictionary(d3)
|
3566
|
+
# else:
|
3567
|
+
# _ = vEdge.SetDictionary(d1)
|
3568
|
+
# vertices.append(vEdge)
|
3535
3569
|
eVertices = []
|
3536
3570
|
_ = anEdge.Vertices(None, eVertices)
|
3537
3571
|
sharedTopologies = []
|
@@ -3545,20 +3579,19 @@ class Graph:
|
|
3545
3579
|
_ = aVertex.Edges(topology, tempEdges)
|
3546
3580
|
if len(tempEdges) > 1:
|
3547
3581
|
sharedTopologies.append(aVertex)
|
3548
|
-
apertures =
|
3549
|
-
_ = aVertex.Apertures(apertures)
|
3582
|
+
apertures = Topology.Apertures(aVertex)
|
3550
3583
|
for anAperture in apertures:
|
3551
3584
|
sharedApertures.append(anAperture)
|
3552
3585
|
else:
|
3553
3586
|
exteriorTopologies.append(aVertex)
|
3554
|
-
apertures =
|
3555
|
-
_ = aVertex.Apertures(apertures)
|
3587
|
+
apertures = Topology.Apertures(aVertex)
|
3556
3588
|
for anAperture in apertures:
|
3557
3589
|
exteriorApertures.append(anAperture)
|
3558
3590
|
if viaSharedTopologies:
|
3559
3591
|
for sharedTopology in sharedTopologies:
|
3560
3592
|
vst = sharedTopology.CenterOfMass()
|
3561
3593
|
d1 = sharedTopology.GetDictionary()
|
3594
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 1) # shared topology
|
3562
3595
|
if storeBREP:
|
3563
3596
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedTopology), Topology.Type(sharedTopology), Topology.TypeAsString(sharedTopology)])
|
3564
3597
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3567,7 +3600,7 @@ class Graph:
|
|
3567
3600
|
_ = vst.SetDictionary(d1)
|
3568
3601
|
vertices.append(vst)
|
3569
3602
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3570
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3603
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Topologies"])
|
3571
3604
|
_ = tempe.SetDictionary(tempd)
|
3572
3605
|
edges.append(tempe)
|
3573
3606
|
if toContents:
|
@@ -3582,6 +3615,7 @@ class Graph:
|
|
3582
3615
|
vst2 = content.CenterOfMass()
|
3583
3616
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3584
3617
|
d1 = content.GetDictionary()
|
3618
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3585
3619
|
if storeBREP:
|
3586
3620
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3587
3621
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3590,17 +3624,17 @@ class Graph:
|
|
3590
3624
|
_ = vst2.SetDictionary(d1)
|
3591
3625
|
vertices.append(vst2)
|
3592
3626
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3593
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3627
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3594
3628
|
_ = tempe.SetDictionary(tempd)
|
3595
3629
|
edges.append(tempe)
|
3596
3630
|
if viaSharedApertures:
|
3597
|
-
for
|
3598
|
-
sharedAp = sharedAperture.Topology()
|
3631
|
+
for sharedAp in sharedApertures:
|
3599
3632
|
if useInternalVertex == True:
|
3600
3633
|
vst = Topology.InternalVertex(sharedAp, tolerance)
|
3601
3634
|
else:
|
3602
3635
|
vst = sharedAp.CenterOfMass()
|
3603
3636
|
d1 = sharedAp.GetDictionary()
|
3637
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 2) # shared aperture
|
3604
3638
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3605
3639
|
if storeBREP:
|
3606
3640
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
@@ -3610,7 +3644,7 @@ class Graph:
|
|
3610
3644
|
_ = vst.SetDictionary(d1)
|
3611
3645
|
vertices.append(vst)
|
3612
3646
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3613
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3647
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["Via_Shared_Apertures"])
|
3614
3648
|
_ = tempe.SetDictionary(tempd)
|
3615
3649
|
edges.append(tempe)
|
3616
3650
|
if toExteriorTopologies:
|
@@ -3618,7 +3652,7 @@ class Graph:
|
|
3618
3652
|
vst = exteriorTopology
|
3619
3653
|
vertices.append(exteriorTopology)
|
3620
3654
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3621
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3655
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Topologies"])
|
3622
3656
|
_ = tempe.SetDictionary(tempd)
|
3623
3657
|
edges.append(tempe)
|
3624
3658
|
if toContents:
|
@@ -3633,6 +3667,7 @@ class Graph:
|
|
3633
3667
|
vst2 = content.CenterOfMass()
|
3634
3668
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3635
3669
|
d1 = content.GetDictionary()
|
3670
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3636
3671
|
if storeBREP:
|
3637
3672
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3638
3673
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3641,17 +3676,17 @@ class Graph:
|
|
3641
3676
|
_ = vst2.SetDictionary(d1)
|
3642
3677
|
vertices.append(vst2)
|
3643
3678
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3644
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3679
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3645
3680
|
_ = tempe.SetDictionary(tempd)
|
3646
3681
|
edges.append(tempe)
|
3647
3682
|
if toExteriorApertures:
|
3648
|
-
for
|
3649
|
-
exTop = exteriorAperture.Topology()
|
3683
|
+
for exTop in exteriorApertures:
|
3650
3684
|
if useInternalVertex == True:
|
3651
3685
|
vst = Topology.InternalVertex(exTop, tolerance)
|
3652
3686
|
else:
|
3653
3687
|
vst = exTop.CenterOfMass()
|
3654
3688
|
d1 = exTop.GetDictionary()
|
3689
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
3655
3690
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3656
3691
|
if storeBREP:
|
3657
3692
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -3661,7 +3696,7 @@ class Graph:
|
|
3661
3696
|
_ = vst.SetDictionary(d1)
|
3662
3697
|
vertices.append(vst)
|
3663
3698
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3664
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3699
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
3665
3700
|
_ = tempe.SetDictionary(tempd)
|
3666
3701
|
edges.append(tempe)
|
3667
3702
|
if toContents:
|
@@ -3676,6 +3711,7 @@ class Graph:
|
|
3676
3711
|
vst = content.CenterOfMass()
|
3677
3712
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3678
3713
|
d1 = content.GetDictionary()
|
3714
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3679
3715
|
if storeBREP:
|
3680
3716
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3681
3717
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3684,7 +3720,7 @@ class Graph:
|
|
3684
3720
|
_ = vst.SetDictionary(d1)
|
3685
3721
|
vertices.append(vst)
|
3686
3722
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3687
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3723
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3688
3724
|
_ = tempe.SetDictionary(tempd)
|
3689
3725
|
edges.append(tempe)
|
3690
3726
|
for anEdge in topEdges:
|
@@ -3693,6 +3729,7 @@ class Graph:
|
|
3693
3729
|
except:
|
3694
3730
|
vEdge = anEdge.CenterOfMass()
|
3695
3731
|
d1 = anEdge.GetDictionary()
|
3732
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topologuy
|
3696
3733
|
if storeBREP:
|
3697
3734
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(anEdge), Topology.Type(anEdge), Topology.TypeAsString(anEdge)])
|
3698
3735
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3724,6 +3761,7 @@ class Graph:
|
|
3724
3761
|
vop = Topology.CenterOfMass(outpost)
|
3725
3762
|
vcc = Topology.CenterOfMass(topology)
|
3726
3763
|
d1 = Topology.Dictionary(vcc)
|
3764
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3727
3765
|
if storeBREP:
|
3728
3766
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3729
3767
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3731,8 +3769,17 @@ class Graph:
|
|
3731
3769
|
else:
|
3732
3770
|
_ = vcc.SetDictionary(d1)
|
3733
3771
|
vertices.append(vcc)
|
3772
|
+
d1 = Topology.Dictionary(vop)
|
3773
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 6) # outpost
|
3774
|
+
if storeBREP:
|
3775
|
+
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3776
|
+
d3 = mergeDictionaries2([d1, d2])
|
3777
|
+
_ = vop.SetDictionary(d3)
|
3778
|
+
else:
|
3779
|
+
_ = vop.SetDictionary(d1)
|
3780
|
+
vertices.append(vop)
|
3734
3781
|
tempe = Edge.ByStartVertexEndVertex(vcc, vop, tolerance=tolerance)
|
3735
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3782
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
3736
3783
|
_ = tempe.SetDictionary(tempd)
|
3737
3784
|
edges.append(tempe)
|
3738
3785
|
|
@@ -3740,7 +3787,6 @@ class Graph:
|
|
3740
3787
|
|
3741
3788
|
def processEdge(item):
|
3742
3789
|
topology, others, outpostsKey, idKey, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, toOutposts, useInternalVertex, storeBREP, tolerance = item
|
3743
|
-
graph = None
|
3744
3790
|
vertices = []
|
3745
3791
|
edges = []
|
3746
3792
|
|
@@ -3753,6 +3799,7 @@ class Graph:
|
|
3753
3799
|
vEdge = topology.CenterOfMass()
|
3754
3800
|
|
3755
3801
|
d1 = vEdge.GetDictionary()
|
3802
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 0) # main topology
|
3756
3803
|
if storeBREP:
|
3757
3804
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(topology), Topology.Type(topology), Topology.TypeAsString(topology)])
|
3758
3805
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3783,7 +3830,7 @@ class Graph:
|
|
3783
3830
|
else:
|
3784
3831
|
vop = Topology.CenterOfMass(outpost)
|
3785
3832
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vop, tolerance=tolerance)
|
3786
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3833
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
3787
3834
|
_ = tempe.SetDictionary(tempd)
|
3788
3835
|
edges.append(tempe)
|
3789
3836
|
|
@@ -3794,8 +3841,7 @@ class Graph:
|
|
3794
3841
|
exteriorApertures = []
|
3795
3842
|
for aVertex in eVertices:
|
3796
3843
|
exteriorTopologies.append(aVertex)
|
3797
|
-
apertures =
|
3798
|
-
_ = aVertex.Apertures(apertures)
|
3844
|
+
apertures = Topology.Apertures(aVertex)
|
3799
3845
|
for anAperture in apertures:
|
3800
3846
|
exteriorApertures.append(anAperture)
|
3801
3847
|
if toExteriorTopologies:
|
@@ -3805,6 +3851,7 @@ class Graph:
|
|
3805
3851
|
else:
|
3806
3852
|
vst = exteriorTopology.CenterOfMass()
|
3807
3853
|
d1 = exteriorTopology.GetDictionary()
|
3854
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 3) # exterior topology
|
3808
3855
|
if storeBREP:
|
3809
3856
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exteriorTopology), Topology.Type(exteriorTopology), Topology.TypeAsString(exteriorTopology)])
|
3810
3857
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3813,7 +3860,7 @@ class Graph:
|
|
3813
3860
|
_ = vst.SetDictionary(d1)
|
3814
3861
|
vertices.append(vst)
|
3815
3862
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3816
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3863
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Topologies"])
|
3817
3864
|
_ = tempe.SetDictionary(tempd)
|
3818
3865
|
edges.append(tempe)
|
3819
3866
|
if toContents:
|
@@ -3828,6 +3875,7 @@ class Graph:
|
|
3828
3875
|
vst2 = content.CenterOfMass()
|
3829
3876
|
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3830
3877
|
d1 = content.GetDictionary()
|
3878
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3831
3879
|
if storeBREP:
|
3832
3880
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3833
3881
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3836,17 +3884,17 @@ class Graph:
|
|
3836
3884
|
_ = vst2.SetDictionary(d1)
|
3837
3885
|
vertices.append(vst2)
|
3838
3886
|
tempe = Edge.ByStartVertexEndVertex(vst, vst2, tolerance=tolerance)
|
3839
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3887
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3840
3888
|
_ = tempe.SetDictionary(tempd)
|
3841
3889
|
edges.append(tempe)
|
3842
3890
|
if toExteriorApertures:
|
3843
|
-
for
|
3844
|
-
exTop = exteriorAperture.Topology()
|
3891
|
+
for exTop in exteriorApertures:
|
3845
3892
|
if useInternalVertex == True:
|
3846
3893
|
vst = Topology.InternalVertex(exTop, tolerance)
|
3847
3894
|
else:
|
3848
3895
|
vst = exTop.CenterOfMass()
|
3849
3896
|
d1 = exTop.GetDictionary()
|
3897
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 4) # exterior aperture
|
3850
3898
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3851
3899
|
if storeBREP:
|
3852
3900
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
@@ -3857,7 +3905,7 @@ class Graph:
|
|
3857
3905
|
_ = vst.SetDictionary(exTop.GetDictionary())
|
3858
3906
|
vertices.append(vst)
|
3859
3907
|
tempe = Edge.ByStartVertexEndVertex(vEdge, vst, tolerance=tolerance)
|
3860
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3908
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Exterior_Apertures"])
|
3861
3909
|
_ = tempe.SetDictionary(tempd)
|
3862
3910
|
edges.append(tempe)
|
3863
3911
|
|
@@ -3879,6 +3927,7 @@ class Graph:
|
|
3879
3927
|
else:
|
3880
3928
|
vst = content.CenterOfMass()
|
3881
3929
|
d1 = content.GetDictionary()
|
3930
|
+
d1 = Dictionary.SetValueAtKey(d1, vertexCategoryKey, 5) # content
|
3882
3931
|
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3883
3932
|
if storeBREP:
|
3884
3933
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3888,7 +3937,7 @@ class Graph:
|
|
3888
3937
|
_ = vst.SetDictionary(d1)
|
3889
3938
|
vertices.append(vst)
|
3890
3939
|
tempe = Edge.ByStartVertexEndVertex(topology, vst, tolerance=tolerance)
|
3891
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3940
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Contents"])
|
3892
3941
|
_ = tempe.SetDictionary(tempd)
|
3893
3942
|
edges.append(tempe)
|
3894
3943
|
|
@@ -3913,7 +3962,7 @@ class Graph:
|
|
3913
3962
|
else:
|
3914
3963
|
vop = Topology.CenterOfMass(outpost)
|
3915
3964
|
tempe = Edge.ByStartVertexEndVertex(topology, vop, tolerance=tolerance)
|
3916
|
-
tempd = Dictionary.ByKeysValues(["relationship"],["
|
3965
|
+
tempd = Dictionary.ByKeysValues(["relationship"],["To_Outposts"])
|
3917
3966
|
_ = tempe.SetDictionary(tempd)
|
3918
3967
|
edges.append(tempe)
|
3919
3968
|
|
@@ -3923,7 +3972,6 @@ class Graph:
|
|
3923
3972
|
if not Topology.IsInstance(topology, "Topology"):
|
3924
3973
|
print("Graph.ByTopology - Error: The input topology is not a valid topology. Returning None.")
|
3925
3974
|
return None
|
3926
|
-
graph = None
|
3927
3975
|
item = [topology, None, None, None, direct, directApertures, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents, None, useInternalVertex, storeBREP, tolerance]
|
3928
3976
|
vertices = []
|
3929
3977
|
edges = []
|