topologicpy 0.7.6__py3-none-any.whl → 0.7.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- topologicpy/Graph.py +336 -191
- topologicpy/Grid.py +13 -4
- topologicpy/version.py +1 -1
- {topologicpy-0.7.6.dist-info → topologicpy-0.7.8.dist-info}/METADATA +1 -1
- {topologicpy-0.7.6.dist-info → topologicpy-0.7.8.dist-info}/RECORD +8 -8
- {topologicpy-0.7.6.dist-info → topologicpy-0.7.8.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.6.dist-info → topologicpy-0.7.8.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.6.dist-info → topologicpy-0.7.8.dist-info}/top_level.txt +0 -0
topologicpy/Graph.py
CHANGED
@@ -536,26 +536,35 @@ class Graph:
|
|
536
536
|
|
537
537
|
@staticmethod
|
538
538
|
def BOTGraph(graph,
|
539
|
-
bidirectional=False,
|
540
|
-
includeAttributes=False,
|
541
|
-
includeLabel=False,
|
542
|
-
includeGeometry=False,
|
543
|
-
siteLabel = "Site_0001",
|
544
|
-
siteDictionary = None,
|
545
|
-
buildingLabel = "Building_0001",
|
546
|
-
buildingDictionary = None ,
|
547
|
-
storeyPrefix = "Storey",
|
548
|
-
floorLevels =[],
|
549
|
-
|
550
|
-
typeKey="type",
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
539
|
+
bidirectional: bool = False,
|
540
|
+
includeAttributes: bool = False,
|
541
|
+
includeLabel: bool = False,
|
542
|
+
includeGeometry: bool = False,
|
543
|
+
siteLabel: str = "Site_0001",
|
544
|
+
siteDictionary: dict = None,
|
545
|
+
buildingLabel: str = "Building_0001",
|
546
|
+
buildingDictionary: dict = None ,
|
547
|
+
storeyPrefix: str = "Storey",
|
548
|
+
floorLevels: list = [],
|
549
|
+
vertexLabelKey: str = "label",
|
550
|
+
typeKey: str = "type",
|
551
|
+
verticesKey: str = "vertices",
|
552
|
+
edgesKey: str = "edges",
|
553
|
+
edgeLabelKey: str = "",
|
554
|
+
sourceKey: str = "source",
|
555
|
+
targetKey: str = "target",
|
556
|
+
xKey: str = "hasX",
|
557
|
+
yKey: str = "hasY",
|
558
|
+
zKey: str = "hasZ",
|
559
|
+
geometryKey: str = "brep",
|
560
|
+
spaceType: str = "space",
|
561
|
+
wallType: str = "wall",
|
562
|
+
slabType: str = "slab",
|
563
|
+
doorType: str = "door",
|
564
|
+
windowType: str = "window",
|
565
|
+
contentType: str = "content",
|
566
|
+
namespace: str = "http://github.com/wassimj/topologicpy/resources",
|
567
|
+
mantissa: int = 6
|
559
568
|
):
|
560
569
|
"""
|
561
570
|
Creates an RDF graph according to the BOT ontology. See https://w3c-lbd-cg.github.io/bot/.
|
@@ -584,9 +593,29 @@ class Graph:
|
|
584
593
|
The desired prefixed to use for each building storey. The default is "Storey".
|
585
594
|
floorLevels : list , optional
|
586
595
|
The list of floor levels. This should be a numeric list, sorted from lowest to highest.
|
587
|
-
If not provided, floorLevels will be computed automatically based on the vertices'
|
588
|
-
|
589
|
-
The
|
596
|
+
If not provided, floorLevels will be computed automatically based on the vertices' (zKey)) attribute. See below.
|
597
|
+
verticesKey : str , optional
|
598
|
+
The desired key name to call vertices. The default is "vertices".
|
599
|
+
edgesKey : str , optional
|
600
|
+
The desired key name to call edges. The default is "edges".
|
601
|
+
vertexLabelKey : str , optional
|
602
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
603
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
604
|
+
edgeLabelKey : str , optional
|
605
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
606
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
607
|
+
sourceKey : str , optional
|
608
|
+
The dictionary key used to store the source vertex. The default is "source".
|
609
|
+
targetKey : str , optional
|
610
|
+
The dictionary key used to store the target vertex. The default is "target".
|
611
|
+
xKey : str , optional
|
612
|
+
The desired key name to use for x-coordinates. The default is "hasX".
|
613
|
+
yKey : str , optional
|
614
|
+
The desired key name to use for y-coordinates. The default is "hasY".
|
615
|
+
zKey : str , optional
|
616
|
+
The desired key name to use for z-coordinates. The default is "hasZ".
|
617
|
+
geometryKey : str , optional
|
618
|
+
The desired key name to use for geometry. The default is "brep".
|
590
619
|
typeKey : str , optional
|
591
620
|
The dictionary key to use to look up the type of the node. The default is "type".
|
592
621
|
geometryKey : str , optional
|
@@ -603,7 +632,12 @@ class Graph:
|
|
603
632
|
The dictionary string value to use to look up vertices of type "window". The default is "window".
|
604
633
|
contentType : str , optional
|
605
634
|
The dictionary string value to use to look up vertices of type "content". The default is "contents".
|
635
|
+
namespace : str , optional
|
636
|
+
The desired namespace to use in the BOT graph. The default is "http://github.com/wassimj/topologicpy/resources".
|
637
|
+
mantissa : int , optional
|
638
|
+
The desired length of the mantissa. The default is 6.
|
606
639
|
|
640
|
+
|
607
641
|
Returns
|
608
642
|
-------
|
609
643
|
rdflib.graph.Graph
|
@@ -637,7 +671,20 @@ class Graph:
|
|
637
671
|
|
638
672
|
if floorLevels == None:
|
639
673
|
floorLevels = []
|
640
|
-
|
674
|
+
|
675
|
+
json_data = Graph.JSONData(graph,
|
676
|
+
verticesKey=verticesKey,
|
677
|
+
edgesKey=edgesKey,
|
678
|
+
vertexLabelKey=vertexLabelKey,
|
679
|
+
edgeLabelKey=edgeLabelKey,
|
680
|
+
sourceKey=sourceKey,
|
681
|
+
targetKey=targetKey,
|
682
|
+
xKey=xKey,
|
683
|
+
yKey=yKey,
|
684
|
+
zKey=zKey,
|
685
|
+
geometryKey=geometryKey,
|
686
|
+
mantissa=mantissa)
|
687
|
+
|
641
688
|
# Create an empty RDF graph
|
642
689
|
bot_graph = RDFGraph()
|
643
690
|
|
@@ -660,28 +707,41 @@ class Graph:
|
|
660
707
|
keys = Dictionary.Keys(siteDictionary)
|
661
708
|
for key in keys:
|
662
709
|
value = Dictionary.ValueAtKey(siteDictionary, key)
|
663
|
-
if not (key ==
|
664
|
-
|
710
|
+
if not (key == vertexLabelKey) and not (key == typeKey):
|
711
|
+
if isinstance(value, float):
|
712
|
+
datatype = XSD.float
|
713
|
+
elif isinstance(value, bool):
|
714
|
+
datatype = XSD.boolean
|
715
|
+
elif isinstance(value, int):
|
716
|
+
datatype = XSD.integer
|
717
|
+
elif isinstance(value, str):
|
718
|
+
datatype = XSD.string
|
719
|
+
bot_graph.add((site_uri, top[key], Literal(value, datatype=datatype)))
|
665
720
|
# Add building
|
666
721
|
building_uri = URIRef(buildingLabel)
|
667
722
|
bot_graph.add((building_uri, rdf.type, bot.Building))
|
668
723
|
if includeLabel:
|
669
724
|
bot_graph.add((building_uri, RDFS.label, Literal(buildingLabel)))
|
670
725
|
if Topology.IsInstance(buildingDictionary, "Dictionary"):
|
671
|
-
keys = Dictionary.Keys(
|
726
|
+
keys = Dictionary.Keys(siteDictionary)
|
672
727
|
for key in keys:
|
673
|
-
value = Dictionary.ValueAtKey(
|
674
|
-
if key ==
|
675
|
-
if
|
676
|
-
|
677
|
-
elif
|
678
|
-
|
728
|
+
value = Dictionary.ValueAtKey(siteDictionary, key)
|
729
|
+
if not (key == vertexLabelKey) and not (key == typeKey):
|
730
|
+
if isinstance(value, float):
|
731
|
+
datatype = XSD.float
|
732
|
+
elif isinstance(value, bool):
|
733
|
+
datatype = XSD.boolean
|
734
|
+
elif isinstance(value, int):
|
735
|
+
datatype = XSD.integer
|
736
|
+
elif isinstance(value, str):
|
737
|
+
datatype = XSD.string
|
738
|
+
bot_graph.add((building_uri, top[key], Literal(value, datatype=datatype)))
|
679
739
|
# Add stories
|
680
740
|
# if floor levels are not given, then need to be computed
|
681
741
|
if len(floorLevels) == 0:
|
682
|
-
for node, attributes in json_data[
|
742
|
+
for node, attributes in json_data[verticesKey].items():
|
683
743
|
if slabType.lower() in attributes[typeKey].lower():
|
684
|
-
floorLevels.append(attributes[
|
744
|
+
floorLevels.append(attributes[zKey])
|
685
745
|
floorLevels = list(set(floorLevels))
|
686
746
|
floorLevels.sort()
|
687
747
|
floorLevels = floorLevels[:-1]
|
@@ -705,12 +765,12 @@ class Graph:
|
|
705
765
|
bot_graph.add((storey_uri, bot.isPartOf, building_uri)) # might not be needed
|
706
766
|
|
707
767
|
# Add vertices as RDF resources
|
708
|
-
for node, attributes in json_data[
|
768
|
+
for node, attributes in json_data[verticesKey].items():
|
709
769
|
node_uri = URIRef(top[node])
|
710
770
|
if spaceType.lower() in attributes[typeKey].lower():
|
711
771
|
bot_graph.add((node_uri, rdf.type, bot.Space))
|
712
772
|
# Find the storey it is on
|
713
|
-
z = attributes[
|
773
|
+
z = attributes[zKey]
|
714
774
|
level = Helper.Position(z, floorLevels)
|
715
775
|
if level > len(storey_uris):
|
716
776
|
level = len(storey_uris)
|
@@ -731,46 +791,42 @@ class Graph:
|
|
731
791
|
|
732
792
|
if includeAttributes:
|
733
793
|
for key, value in attributes.items():
|
734
|
-
if key == "brepType":
|
735
|
-
print("Key = brepType, Value =", value, value.__class__)
|
736
794
|
if key == geometryKey:
|
737
795
|
if includeGeometry:
|
738
796
|
bot_graph.add((node_uri, bot.hasSimpleGeometry, Literal(value)))
|
739
|
-
if key ==
|
797
|
+
if key == vertexLabelKey:
|
740
798
|
if includeLabel:
|
741
799
|
bot_graph.add((node_uri, RDFS.label, Literal(value)))
|
742
800
|
elif key != typeKey and key != geometryKey:
|
743
801
|
if isinstance(value, float):
|
744
802
|
datatype = XSD.float
|
745
803
|
elif isinstance(value, bool):
|
746
|
-
print("got boolean")
|
747
804
|
datatype = XSD.boolean
|
748
805
|
elif isinstance(value, int):
|
749
|
-
print("got integer")
|
750
806
|
datatype = XSD.integer
|
751
807
|
elif isinstance(value, str):
|
752
808
|
datatype = XSD.string
|
753
809
|
bot_graph.add((node_uri, top[key], Literal(value, datatype=datatype)))
|
754
810
|
if includeLabel:
|
755
811
|
for key, value in attributes.items():
|
756
|
-
if key ==
|
812
|
+
if key == vertexLabelKey:
|
757
813
|
bot_graph.add((node_uri, RDFS.label, Literal(value)))
|
758
814
|
|
759
815
|
# Add edges as RDF triples
|
760
|
-
for edge, attributes in json_data[
|
761
|
-
source = attributes[
|
762
|
-
target = attributes[
|
816
|
+
for edge, attributes in json_data[edgesKey].items():
|
817
|
+
source = attributes[sourceKey]
|
818
|
+
target = attributes[targetKey]
|
763
819
|
source_uri = URIRef(top[source])
|
764
820
|
target_uri = URIRef(top[target])
|
765
|
-
if spaceType.lower() in json_data[
|
821
|
+
if spaceType.lower() in json_data[verticesKey][source][typeKey].lower() and spaceType.lower() in json_data[verticesKey][target][typeKey].lower():
|
766
822
|
bot_graph.add((source_uri, bot.adjacentTo, target_uri))
|
767
823
|
if bidirectional:
|
768
824
|
bot_graph.add((target_uri, bot.adjacentTo, source_uri))
|
769
|
-
elif spaceType.lower() in json_data[
|
825
|
+
elif spaceType.lower() in json_data[verticesKey][source][typeKey].lower() and wallType.lower() in json_data[verticesKey][target][typeKey].lower():
|
770
826
|
bot_graph.add((target_uri, bot.interfaceOf, source_uri))
|
771
|
-
elif spaceType.lower() in json_data[
|
827
|
+
elif spaceType.lower() in json_data[verticesKey][source][typeKey].lower() and slabType.lower() in json_data['vertices'][target][typeKey].lower():
|
772
828
|
bot_graph.add((target_uri, bot.interfaceOf, source_uri))
|
773
|
-
elif spaceType.lower() in json_data[
|
829
|
+
elif spaceType.lower() in json_data[verticesKey][source][typeKey].lower() and contentType.lower() in json_data[verticesKey][target][typeKey].lower():
|
774
830
|
bot_graph.add((source_uri, bot.containsElement, target_uri))
|
775
831
|
if bidirectional:
|
776
832
|
bot_graph.add((target_uri, bot.isPartOf, source_uri))
|
@@ -782,26 +838,36 @@ class Graph:
|
|
782
838
|
|
783
839
|
@staticmethod
|
784
840
|
def BOTString(graph,
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
841
|
+
format="turtle",
|
842
|
+
bidirectional: bool = False,
|
843
|
+
includeAttributes: bool = False,
|
844
|
+
includeLabel: bool = False,
|
845
|
+
includeGeometry: bool = False,
|
846
|
+
siteLabel: str = "Site_0001",
|
847
|
+
siteDictionary: dict = None,
|
848
|
+
buildingLabel: str = "Building_0001",
|
849
|
+
buildingDictionary: dict = None ,
|
850
|
+
storeyPrefix: str = "Storey",
|
851
|
+
floorLevels: list = [],
|
852
|
+
vertexLabelKey: str = "label",
|
853
|
+
typeKey: str = "type",
|
854
|
+
verticesKey: str = "vertices",
|
855
|
+
edgesKey: str = "edges",
|
856
|
+
edgeLabelKey: str = "",
|
857
|
+
sourceKey: str = "source",
|
858
|
+
targetKey: str = "target",
|
859
|
+
xKey: str = "hasX",
|
860
|
+
yKey: str = "hasY",
|
861
|
+
zKey: str = "hasZ",
|
862
|
+
geometryKey: str = "brep",
|
863
|
+
spaceType: str = "space",
|
864
|
+
wallType: str = "wall",
|
865
|
+
slabType: str = "slab",
|
866
|
+
doorType: str = "door",
|
867
|
+
windowType: str = "window",
|
868
|
+
contentType: str = "content",
|
869
|
+
namespace: str = "http://github.com/wassimj/topologicpy/resources",
|
870
|
+
mantissa: int = 6
|
805
871
|
):
|
806
872
|
|
807
873
|
"""
|
@@ -841,11 +907,33 @@ class Graph:
|
|
841
907
|
The desired prefixed to use for each building storey. The default is "Storey".
|
842
908
|
floorLevels : list , optional
|
843
909
|
The list of floor levels. This should be a numeric list, sorted from lowest to highest.
|
844
|
-
If not provided, floorLevels will be computed automatically based on the vertices'
|
910
|
+
If not provided, floorLevels will be computed automatically based on the vertices' (zKey)) attribute. See below.
|
911
|
+
verticesKey : str , optional
|
912
|
+
The desired key name to call vertices. The default is "vertices".
|
913
|
+
edgesKey : str , optional
|
914
|
+
The desired key name to call edges. The default is "edges".
|
915
|
+
vertexLabelKey : str , optional
|
916
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
917
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
918
|
+
edgeLabelKey : str , optional
|
919
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
920
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
921
|
+
sourceKey : str , optional
|
922
|
+
The dictionary key used to store the source vertex. The default is "source".
|
923
|
+
targetKey : str , optional
|
924
|
+
The dictionary key used to store the target vertex. The default is "target".
|
925
|
+
xKey : str , optional
|
926
|
+
The desired key name to use for x-coordinates. The default is "hasX".
|
927
|
+
yKey : str , optional
|
928
|
+
The desired key name to use for y-coordinates. The default is "hasY".
|
929
|
+
zKey : str , optional
|
930
|
+
The desired key name to use for z-coordinates. The default is "hasZ".
|
931
|
+
geometryKey : str , optional
|
932
|
+
The desired key name to use for geometry. The default is "brep".
|
845
933
|
typeKey : str , optional
|
846
934
|
The dictionary key to use to look up the type of the node. The default is "type".
|
847
|
-
|
848
|
-
The dictionary key to use to look up the
|
935
|
+
geometryKey : str , optional
|
936
|
+
The dictionary key to use to look up the geometry of the node. The default is "brep".
|
849
937
|
spaceType : str , optional
|
850
938
|
The dictionary string value to use to look up vertices of type "space". The default is "space".
|
851
939
|
wallType : str , optional
|
@@ -858,6 +946,10 @@ class Graph:
|
|
858
946
|
The dictionary string value to use to look up vertices of type "window". The default is "window".
|
859
947
|
contentType : str , optional
|
860
948
|
The dictionary string value to use to look up vertices of type "content". The default is "contents".
|
949
|
+
namespace : str , optional
|
950
|
+
The desired namespace to use in the BOT graph. The default is "http://github.com/wassimj/topologicpy/resources".
|
951
|
+
mantissa : int , optional
|
952
|
+
The desired length of the mantissa. The default is 6.
|
861
953
|
|
862
954
|
|
863
955
|
Returns
|
@@ -866,27 +958,36 @@ class Graph:
|
|
866
958
|
The rdf graph serialized string using the BOT ontology.
|
867
959
|
"""
|
868
960
|
|
869
|
-
bot_graph = Graph.BOTGraph(graph,
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
961
|
+
bot_graph = Graph.BOTGraph(graph= graph,
|
962
|
+
bidirectional= bidirectional,
|
963
|
+
includeAttributes= includeAttributes,
|
964
|
+
includeLabel= includeLabel,
|
965
|
+
includeGeometry= includeGeometry,
|
966
|
+
siteLabel= siteLabel,
|
967
|
+
siteDictionary= siteDictionary,
|
968
|
+
buildingLabel= buildingLabel,
|
969
|
+
buildingDictionary= buildingDictionary,
|
970
|
+
storeyPrefix= storeyPrefix,
|
971
|
+
floorLevels= floorLevels,
|
972
|
+
vertexLabelKey= vertexLabelKey,
|
973
|
+
typeKey= typeKey,
|
974
|
+
verticesKey= verticesKey,
|
975
|
+
edgesKey= edgesKey,
|
976
|
+
edgeLabelKey= edgeLabelKey,
|
977
|
+
sourceKey= sourceKey,
|
978
|
+
targetKey= targetKey,
|
979
|
+
xKey= xKey,
|
980
|
+
yKey= yKey,
|
981
|
+
zKey= zKey,
|
982
|
+
geometryKey= geometryKey,
|
983
|
+
spaceType= spaceType,
|
984
|
+
wallType= wallType,
|
985
|
+
slabType= slabType,
|
986
|
+
doorType= doorType,
|
987
|
+
windowType= windowType,
|
988
|
+
contentType= contentType,
|
989
|
+
namespace= namespace,
|
990
|
+
mantissa= mantissa)
|
890
991
|
return bot_graph.serialize(format=format)
|
891
992
|
|
892
993
|
@staticmethod
|
@@ -2020,7 +2121,21 @@ class Graph:
|
|
2020
2121
|
return Graph.ByVerticesEdges(g_vertices, g_edges)
|
2021
2122
|
|
2022
2123
|
@staticmethod
|
2023
|
-
def ByTopology(topology,
|
2124
|
+
def ByTopology(topology,
|
2125
|
+
direct: bool = True,
|
2126
|
+
directApertures: bool = False,
|
2127
|
+
viaSharedTopologies: bool = False,
|
2128
|
+
viaSharedApertures: bool = False,
|
2129
|
+
toExteriorTopologies: bool = False,
|
2130
|
+
toExteriorApertures: bool = False,
|
2131
|
+
toContents: bool = False,
|
2132
|
+
toOutposts: bool = False,
|
2133
|
+
idKey: str = "TOPOLOGIC_ID",
|
2134
|
+
outpostsKey: str = "outposts",
|
2135
|
+
useInternalVertex: bool =True,
|
2136
|
+
storeBREP: bool =False,
|
2137
|
+
mantissa: int = 6,
|
2138
|
+
tolerance: float = 0.0001):
|
2024
2139
|
"""
|
2025
2140
|
Creates a graph.See https://en.wikipedia.org/wiki/Graph_(discrete_mathematics).
|
2026
2141
|
|
@@ -2352,7 +2467,7 @@ class Graph:
|
|
2352
2467
|
else:
|
2353
2468
|
vst2 = content.CenterOfMass()
|
2354
2469
|
d1 = content.GetDictionary()
|
2355
|
-
vst2 = Vertex.ByCoordinates(
|
2470
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa), Vertex.Y(vst2, mantissa=mantissa), Vertex.Z(vst2, mantissa=mantissa))
|
2356
2471
|
if storeBREP:
|
2357
2472
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2358
2473
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2372,7 +2487,7 @@ class Graph:
|
|
2372
2487
|
else:
|
2373
2488
|
vsa = sharedAp.CenterOfMass()
|
2374
2489
|
d1 = sharedAp.GetDictionary()
|
2375
|
-
vsa = Vertex.ByCoordinates(
|
2490
|
+
vsa = Vertex.ByCoordinates(Vertex.X(vsa, mantissa=mantissa)+(tolerance*100), Vertex.Y(vsa, mantissa=mantissa)+(tolerance*100), Vertex.Z(vsa, mantissa=mantissa)+(tolerance*100))
|
2376
2491
|
if storeBREP:
|
2377
2492
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
2378
2493
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2414,7 +2529,7 @@ class Graph:
|
|
2414
2529
|
else:
|
2415
2530
|
vst2 = content.CenterOfMass()
|
2416
2531
|
d1 = content.GetDictionary()
|
2417
|
-
vst2 = Vertex.ByCoordinates(
|
2532
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2418
2533
|
if storeBREP:
|
2419
2534
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
2420
2535
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2434,7 +2549,7 @@ class Graph:
|
|
2434
2549
|
else:
|
2435
2550
|
vea = exTop.CenterOfMass()
|
2436
2551
|
d1 = exTop.GetDictionary()
|
2437
|
-
vea = Vertex.ByCoordinates(
|
2552
|
+
vea = Vertex.ByCoordinates(Vertex.X(vea, mantissa=mantissa)+(tolerance*100), Vertex.Y(vea, mantissa=mantissa)+(tolerance*100), Vertex.Z(vea, mantissa=mantissa)+(tolerance*100))
|
2438
2553
|
if storeBREP:
|
2439
2554
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
2440
2555
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2456,7 +2571,7 @@ class Graph:
|
|
2456
2571
|
vcn = Topology.InternalVertex(content, tolerance)
|
2457
2572
|
else:
|
2458
2573
|
vcn = content.CenterOfMass()
|
2459
|
-
vcn = Vertex.ByCoordinates(
|
2574
|
+
vcn = Vertex.ByCoordinates(Vertex.X(vcn, mantissa=mantissa)+(tolerance*100), Vertex.Y(vcn, mantissa=mantissa)+(tolerance*100), Vertex.Z(vcn, mantissa=mantissa)+(tolerance*100))
|
2460
2575
|
d1 = content.GetDictionary()
|
2461
2576
|
if storeBREP:
|
2462
2577
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2562,7 +2677,7 @@ class Graph:
|
|
2562
2677
|
vst2 = Topology.InternalVertex(content, tolerance)
|
2563
2678
|
else:
|
2564
2679
|
vst2 = content.CenterOfMass()
|
2565
|
-
vst2 = Vertex.ByCoordinates(
|
2680
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2566
2681
|
d1 = content.GetDictionary()
|
2567
2682
|
if storeBREP:
|
2568
2683
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2583,7 +2698,7 @@ class Graph:
|
|
2583
2698
|
else:
|
2584
2699
|
vst = exTop.CenterOfMass()
|
2585
2700
|
d1 = exTop.GetDictionary()
|
2586
|
-
vst = Vertex.ByCoordinates(
|
2701
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2587
2702
|
if storeBREP:
|
2588
2703
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
2589
2704
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2605,7 +2720,7 @@ class Graph:
|
|
2605
2720
|
vst = Topology.InternalVertex(content, tolerance)
|
2606
2721
|
else:
|
2607
2722
|
vst = content.CenterOfMass()
|
2608
|
-
vst = Vertex.ByCoordinates(
|
2723
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2609
2724
|
d1 = content.GetDictionary()
|
2610
2725
|
if storeBREP:
|
2611
2726
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2760,7 +2875,7 @@ class Graph:
|
|
2760
2875
|
vst2 = Topology.InternalVertex(content, tolerance)
|
2761
2876
|
else:
|
2762
2877
|
vst2 = content.CenterOfMass()
|
2763
|
-
vst2 = Vertex.ByCoordinates(
|
2878
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2764
2879
|
d1 = content.GetDictionary()
|
2765
2880
|
if storeBREP:
|
2766
2881
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2781,7 +2896,7 @@ class Graph:
|
|
2781
2896
|
else:
|
2782
2897
|
vst = sharedAp.CenterOfMass()
|
2783
2898
|
d1 = sharedAp.GetDictionary()
|
2784
|
-
vst = Vertex.ByCoordinates(
|
2899
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2785
2900
|
if storeBREP:
|
2786
2901
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
2787
2902
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2821,7 +2936,7 @@ class Graph:
|
|
2821
2936
|
vst2 = Topology.InternalVertex(content, tolerance)
|
2822
2937
|
else:
|
2823
2938
|
vst2 = content.CenterOfMass()
|
2824
|
-
vst2 = Vertex.ByCoordinates(
|
2939
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
2825
2940
|
d1 = content.GetDictionary()
|
2826
2941
|
if storeBREP:
|
2827
2942
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -2842,7 +2957,7 @@ class Graph:
|
|
2842
2957
|
else:
|
2843
2958
|
vst = exTop.CenterOfMass()
|
2844
2959
|
d1 = exTop.GetDictionary()
|
2845
|
-
vst = Vertex.ByCoordinates(
|
2960
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2846
2961
|
if storeBREP:
|
2847
2962
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
2848
2963
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -2864,7 +2979,7 @@ class Graph:
|
|
2864
2979
|
vst = Topology.InternalVertex(content, tolerance)
|
2865
2980
|
else:
|
2866
2981
|
vst = content.CenterOfMass()
|
2867
|
-
vst = Vertex.ByCoordinates(
|
2982
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
2868
2983
|
d1 = content.GetDictionary()
|
2869
2984
|
if storeBREP:
|
2870
2985
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3010,7 +3125,7 @@ class Graph:
|
|
3010
3125
|
vst2 = Topology.InternalVertex(content, tolerance)
|
3011
3126
|
else:
|
3012
3127
|
vst2 = content.CenterOfMass()
|
3013
|
-
vst2 = Vertex.ByCoordinates(
|
3128
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3014
3129
|
d1 = content.GetDictionary()
|
3015
3130
|
if storeBREP:
|
3016
3131
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3031,7 +3146,7 @@ class Graph:
|
|
3031
3146
|
else:
|
3032
3147
|
vst = exTop.CenterOfMass()
|
3033
3148
|
d1 = exTop.GetDictionary()
|
3034
|
-
vst = Vertex.ByCoordinates(
|
3149
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3035
3150
|
if storeBREP:
|
3036
3151
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
3037
3152
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3053,7 +3168,7 @@ class Graph:
|
|
3053
3168
|
vst = Topology.InternalVertex(content, tolerance)
|
3054
3169
|
else:
|
3055
3170
|
vst = content.CenterOfMass()
|
3056
|
-
vst = Vertex.ByCoordinates(
|
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))
|
3057
3172
|
d1 = content.GetDictionary()
|
3058
3173
|
if storeBREP:
|
3059
3174
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3216,7 +3331,7 @@ class Graph:
|
|
3216
3331
|
vst2 = Topology.InternalVertex(content, tolerance)
|
3217
3332
|
else:
|
3218
3333
|
vst2 = content.CenterOfMass()
|
3219
|
-
vst2 = Vertex.ByCoordinates(
|
3334
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3220
3335
|
d1 = content.GetDictionary()
|
3221
3336
|
if storeBREP:
|
3222
3337
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3237,7 +3352,7 @@ class Graph:
|
|
3237
3352
|
else:
|
3238
3353
|
vst = sharedAp.CenterOfMass()
|
3239
3354
|
d1 = sharedAp.GetDictionary()
|
3240
|
-
vst = Vertex.ByCoordinates(
|
3355
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3241
3356
|
if storeBREP:
|
3242
3357
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(sharedAp), Topology.Type(sharedAp), Topology.TypeAsString(sharedAp)])
|
3243
3358
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3267,7 +3382,7 @@ class Graph:
|
|
3267
3382
|
vst2 = Topology.InternalVertex(content, tolerance)
|
3268
3383
|
else:
|
3269
3384
|
vst2 = content.CenterOfMass()
|
3270
|
-
vst2 = Vertex.ByCoordinates(
|
3385
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3271
3386
|
d1 = content.GetDictionary()
|
3272
3387
|
if storeBREP:
|
3273
3388
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3288,7 +3403,7 @@ class Graph:
|
|
3288
3403
|
else:
|
3289
3404
|
vst = exTop.CenterOfMass()
|
3290
3405
|
d1 = exTop.GetDictionary()
|
3291
|
-
vst = Vertex.ByCoordinates(
|
3406
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3292
3407
|
if storeBREP:
|
3293
3408
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
3294
3409
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3310,7 +3425,7 @@ class Graph:
|
|
3310
3425
|
vst = Topology.InternalVertex(content, tolerance)
|
3311
3426
|
else:
|
3312
3427
|
vst = content.CenterOfMass()
|
3313
|
-
vst = Vertex.ByCoordinates(
|
3428
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3314
3429
|
d1 = content.GetDictionary()
|
3315
3430
|
if storeBREP:
|
3316
3431
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3462,7 +3577,7 @@ class Graph:
|
|
3462
3577
|
vst2 = Topology.InternalVertex(content, tolerance)
|
3463
3578
|
else:
|
3464
3579
|
vst2 = content.CenterOfMass()
|
3465
|
-
vst2 = Vertex.ByCoordinates(
|
3580
|
+
vst2 = Vertex.ByCoordinates(Vertex.X(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst2, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst2, mantissa=mantissa)+(tolerance*100))
|
3466
3581
|
d1 = content.GetDictionary()
|
3467
3582
|
if storeBREP:
|
3468
3583
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
@@ -3483,7 +3598,7 @@ class Graph:
|
|
3483
3598
|
else:
|
3484
3599
|
vst = exTop.CenterOfMass()
|
3485
3600
|
d1 = exTop.GetDictionary()
|
3486
|
-
vst = Vertex.ByCoordinates(
|
3601
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3487
3602
|
if storeBREP:
|
3488
3603
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(exTop), Topology.Type(exTop), Topology.TypeAsString(exTop)])
|
3489
3604
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -3515,7 +3630,7 @@ class Graph:
|
|
3515
3630
|
else:
|
3516
3631
|
vst = content.CenterOfMass()
|
3517
3632
|
d1 = content.GetDictionary()
|
3518
|
-
vst = Vertex.ByCoordinates(
|
3633
|
+
vst = Vertex.ByCoordinates(Vertex.X(vst, mantissa=mantissa)+(tolerance*100), Vertex.Y(vst, mantissa=mantissa)+(tolerance*100), Vertex.Z(vst, mantissa=mantissa)+(tolerance*100))
|
3519
3634
|
if storeBREP:
|
3520
3635
|
d2 = Dictionary.ByKeysValues(["brep", "brepType", "brepTypeString"], [Topology.BREPString(content), Topology.Type(content), Topology.TypeAsString(content)])
|
3521
3636
|
d3 = mergeDictionaries2([d1, d2])
|
@@ -4358,38 +4473,49 @@ class Graph:
|
|
4358
4473
|
|
4359
4474
|
@staticmethod
|
4360
4475
|
def ExportToBOT(graph,
|
4361
|
-
path,
|
4362
|
-
format="turtle",
|
4363
|
-
|
4364
|
-
|
4365
|
-
|
4366
|
-
|
4367
|
-
|
4368
|
-
|
4369
|
-
|
4370
|
-
|
4371
|
-
|
4372
|
-
|
4373
|
-
|
4374
|
-
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4379
|
-
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4476
|
+
path: str,
|
4477
|
+
format: str = "turtle",
|
4478
|
+
overwrite: bool = False,
|
4479
|
+
bidirectional: bool = False,
|
4480
|
+
includeAttributes: bool = False,
|
4481
|
+
includeLabel: bool = False,
|
4482
|
+
includeGeometry: bool = False,
|
4483
|
+
siteLabel: str = "Site_0001",
|
4484
|
+
siteDictionary: dict = None,
|
4485
|
+
buildingLabel: str = "Building_0001",
|
4486
|
+
buildingDictionary: dict = None ,
|
4487
|
+
storeyPrefix: str = "Storey",
|
4488
|
+
floorLevels: list = [],
|
4489
|
+
vertexLabelKey: str = "label",
|
4490
|
+
typeKey: str = "type",
|
4491
|
+
verticesKey: str = "vertices",
|
4492
|
+
edgesKey: str = "edges",
|
4493
|
+
edgeLabelKey: str = "",
|
4494
|
+
sourceKey: str = "source",
|
4495
|
+
targetKey: str = "target",
|
4496
|
+
xKey: str = "hasX",
|
4497
|
+
yKey: str = "hasY",
|
4498
|
+
zKey: str = "hasZ",
|
4499
|
+
geometryKey: str = "brep",
|
4500
|
+
spaceType: str = "space",
|
4501
|
+
wallType: str = "wall",
|
4502
|
+
slabType: str = "slab",
|
4503
|
+
doorType: str = "door",
|
4504
|
+
windowType: str = "window",
|
4505
|
+
contentType: str = "content",
|
4506
|
+
namespace: str = "http://github.com/wassimj/topologicpy/resources",
|
4507
|
+
mantissa: int = 6
|
4384
4508
|
):
|
4385
4509
|
|
4386
4510
|
"""
|
4387
|
-
|
4511
|
+
Exports the input graph to an RDF graph serialized according to the BOT ontology. See https://w3c-lbd-cg.github.io/bot/.
|
4388
4512
|
|
4389
4513
|
Parameters
|
4390
4514
|
----------
|
4391
4515
|
graph : topologic_core.Graph
|
4392
4516
|
The input graph.
|
4517
|
+
path : str
|
4518
|
+
The desired path to where the RDF/BOT file will be saved.
|
4393
4519
|
format : str , optional
|
4394
4520
|
The desired output format, the options are listed below. Thde default is "turtle".
|
4395
4521
|
turtle, ttl or turtle2 : Turtle, turtle2 is just turtle with more spacing & linebreaks
|
@@ -4400,10 +4526,6 @@ class Graph:
|
|
4400
4526
|
trig : Trig , Turtle-like format for RDF triples + context (RDF quads) and thus multiple graphs
|
4401
4527
|
trix : Trix , RDF/XML-like format for RDF quads
|
4402
4528
|
nquads : N-Quads , N-Triples-like format for RDF quads
|
4403
|
-
namespace : str , optional
|
4404
|
-
The desired namespace for creating IRIs for entities. The default is "http://github.com/wassimj/topologicpy/resources".
|
4405
|
-
path : str
|
4406
|
-
The desired path to where the RDF/BOT file will be saved.
|
4407
4529
|
overwrite : bool , optional
|
4408
4530
|
If set to True, any existing file is overwritten. Otherwise, it is not. The default is False.
|
4409
4531
|
bidirectional : bool , optional
|
@@ -4413,7 +4535,7 @@ class Graph:
|
|
4413
4535
|
includeLabel : bool , optional
|
4414
4536
|
If set to True, a label is attached to each node. Otherwise, it is not. The default is False.
|
4415
4537
|
includeGeometry : bool , optional
|
4416
|
-
If set to True, the geometry associated with vertices in the graph are written out. Otherwise,
|
4538
|
+
If set to True, the geometry associated with vertices in the graph are written out. Otherwise, they are not. The default is False.
|
4417
4539
|
siteLabel : str , optional
|
4418
4540
|
The desired site label. The default is "Site_0001".
|
4419
4541
|
siteDictionary : dict , optional
|
@@ -4426,35 +4548,49 @@ class Graph:
|
|
4426
4548
|
The desired prefixed to use for each building storey. The default is "Storey".
|
4427
4549
|
floorLevels : list , optional
|
4428
4550
|
The list of floor levels. This should be a numeric list, sorted from lowest to highest.
|
4429
|
-
If not provided, floorLevels will be computed automatically based on the
|
4551
|
+
If not provided, floorLevels will be computed automatically based on the vertices' (zKey)) attribute. See below.
|
4552
|
+
verticesKey : str , optional
|
4553
|
+
The desired key name to call vertices. The default is "vertices".
|
4554
|
+
edgesKey : str , optional
|
4555
|
+
The desired key name to call edges. The default is "edges".
|
4556
|
+
vertexLabelKey : str , optional
|
4557
|
+
If set to a valid string, the vertex label will be set to the value at this key. Otherwise it will be set to Vertex_XXXX where XXXX is a sequential unique number.
|
4558
|
+
Note: If vertex labels are not unique, they will be forced to be unique.
|
4559
|
+
edgeLabelKey : str , optional
|
4560
|
+
If set to a valid string, the edge label will be set to the value at this key. Otherwise it will be set to Edge_XXXX where XXXX is a sequential unique number.
|
4561
|
+
Note: If edge labels are not unique, they will be forced to be unique.
|
4562
|
+
sourceKey : str , optional
|
4563
|
+
The dictionary key used to store the source vertex. The default is "source".
|
4564
|
+
targetKey : str , optional
|
4565
|
+
The dictionary key used to store the target vertex. The default is "target".
|
4566
|
+
xKey : str , optional
|
4567
|
+
The desired key name to use for x-coordinates. The default is "hasX".
|
4568
|
+
yKey : str , optional
|
4569
|
+
The desired key name to use for y-coordinates. The default is "hasY".
|
4570
|
+
zKey : str , optional
|
4571
|
+
The desired key name to use for z-coordinates. The default is "hasZ".
|
4572
|
+
geometryKey : str , optional
|
4573
|
+
The desired key name to use for geometry. The default is "brep".
|
4430
4574
|
typeKey : str , optional
|
4431
4575
|
The dictionary key to use to look up the type of the node. The default is "type".
|
4432
|
-
labelKey : str , optional
|
4433
|
-
The dictionary key to use to look up the label of the node. The default is "label".
|
4434
4576
|
geometryKey : str , optional
|
4435
|
-
The dictionary key to use to look up the
|
4577
|
+
The dictionary key to use to look up the geometry of the node. The default is "brep".
|
4436
4578
|
spaceType : str , optional
|
4437
|
-
The dictionary string value to use to look up
|
4579
|
+
The dictionary string value to use to look up vertices of type "space". The default is "space".
|
4438
4580
|
wallType : str , optional
|
4439
|
-
The dictionary string value to use to look up
|
4581
|
+
The dictionary string value to use to look up vertices of type "wall". The default is "wall".
|
4440
4582
|
slabType : str , optional
|
4441
|
-
The dictionary string value to use to look up
|
4583
|
+
The dictionary string value to use to look up vertices of type "slab". The default is "slab".
|
4442
4584
|
doorType : str , optional
|
4443
|
-
The dictionary string value to use to look up
|
4585
|
+
The dictionary string value to use to look up vertices of type "door". The default is "door".
|
4444
4586
|
windowType : str , optional
|
4445
|
-
The dictionary string value to use to look up
|
4587
|
+
The dictionary string value to use to look up vertices of type "window". The default is "window".
|
4446
4588
|
contentType : str , optional
|
4447
|
-
The dictionary string value to use to look up
|
4448
|
-
|
4449
|
-
The desired
|
4450
|
-
|
4451
|
-
|
4452
|
-
json-ld : JSON-LD , There are further options for compact syntax and other JSON-LD variants
|
4453
|
-
ntriples, nt or nt11 : N-Triples , nt11 is exactly like nt, only utf8 encoded
|
4454
|
-
n3 : Notation-3 , N3 is a superset of Turtle that also caters for rules and a few other things
|
4455
|
-
trig : Trig , Turtle-like format for RDF triples + context (RDF quads) and thus multiple graphs
|
4456
|
-
trix : Trix , RDF/XML-like format for RDF quads
|
4457
|
-
nquads : N-Quads , N-Triples-like format for RDF quads
|
4589
|
+
The dictionary string value to use to look up vertices of type "content". The default is "contents".
|
4590
|
+
namespace : str , optional
|
4591
|
+
The desired namespace to use in the BOT graph. The default is "http://github.com/wassimj/topologicpy/resources".
|
4592
|
+
mantissa : int , optional
|
4593
|
+
The desired length of the mantissa. The default is 6.
|
4458
4594
|
|
4459
4595
|
Returns
|
4460
4596
|
-------
|
@@ -4462,28 +4598,37 @@ class Graph:
|
|
4462
4598
|
The rdf graph serialized string using the BOT ontology.
|
4463
4599
|
"""
|
4464
4600
|
from os.path import exists
|
4465
|
-
bot_graph = Graph.BOTGraph(graph,
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
|
4480
|
-
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
4484
|
-
|
4485
|
-
|
4486
|
-
|
4601
|
+
bot_graph = Graph.BOTGraph(graph= graph,
|
4602
|
+
bidirectional= bidirectional,
|
4603
|
+
includeAttributes= includeAttributes,
|
4604
|
+
includeLabel= includeLabel,
|
4605
|
+
includeGeometry= includeGeometry,
|
4606
|
+
siteLabel= siteLabel,
|
4607
|
+
siteDictionary= siteDictionary,
|
4608
|
+
buildingLabel= buildingLabel,
|
4609
|
+
buildingDictionary= buildingDictionary,
|
4610
|
+
storeyPrefix= storeyPrefix,
|
4611
|
+
floorLevels= floorLevels,
|
4612
|
+
vertexLabelKey= vertexLabelKey,
|
4613
|
+
typeKey= typeKey,
|
4614
|
+
verticesKey= verticesKey,
|
4615
|
+
edgesKey= edgesKey,
|
4616
|
+
edgeLabelKey= edgeLabelKey,
|
4617
|
+
sourceKey= sourceKey,
|
4618
|
+
targetKey= targetKey,
|
4619
|
+
xKey= xKey,
|
4620
|
+
yKey= yKey,
|
4621
|
+
zKey= zKey,
|
4622
|
+
geometryKey= geometryKey,
|
4623
|
+
spaceType= spaceType,
|
4624
|
+
wallType= wallType,
|
4625
|
+
slabType= slabType,
|
4626
|
+
doorType= doorType,
|
4627
|
+
windowType= windowType,
|
4628
|
+
contentType= contentType,
|
4629
|
+
namespace= namespace,
|
4630
|
+
mantissa= mantissa)
|
4631
|
+
|
4487
4632
|
if "turtle" in format.lower() or "ttl" in format.lower() or "turtle2" in format.lower():
|
4488
4633
|
ext = ".ttl"
|
4489
4634
|
elif "xml" in format.lower() or "pretty=xml" in format.lower() or "rdf/xml" in format.lower():
|
@@ -6032,7 +6177,7 @@ class Graph:
|
|
6032
6177
|
d = Dictionary.SetValueAtKey(d, zKey, Vertex.Z(v, mantissa=mantissa))
|
6033
6178
|
if geometryKey:
|
6034
6179
|
v_d = Topology.Dictionary(v)
|
6035
|
-
brep = Dictionary.ValueAtKey(v_d,
|
6180
|
+
brep = Dictionary.ValueAtKey(v_d, geometryKey)
|
6036
6181
|
if brep:
|
6037
6182
|
d = Dictionary.SetValueAtKey(d, geometryKey, brep)
|
6038
6183
|
v_dict = Dictionary.PythonDictionary(d)
|
topologicpy/Grid.py
CHANGED
@@ -215,7 +215,13 @@ class Grid():
|
|
215
215
|
|
216
216
|
|
217
217
|
@staticmethod
|
218
|
-
def VerticesByDistances(face=None,
|
218
|
+
def VerticesByDistances(face=None,
|
219
|
+
origin=None,
|
220
|
+
uRange: list = [-0.5,-0.25,0, 0.25,0.5],
|
221
|
+
vRange: list = [-0.5,-0.25,0,0.25,0.5],
|
222
|
+
clip: bool = False,
|
223
|
+
mantissa: int = 6,
|
224
|
+
tolerance: float = 0.0001):
|
219
225
|
"""
|
220
226
|
Creates a grid (cluster of vertices).
|
221
227
|
|
@@ -231,6 +237,8 @@ class Grid():
|
|
231
237
|
A list of distances for the *v* grid lines from the vOrigin. The default is [-0.5,-0.25,0, 0.25,0.5].
|
232
238
|
clip : bool , optional
|
233
239
|
If True the grid will be clipped by the shape of the input face. The default is False.
|
240
|
+
mantissa : int , optional
|
241
|
+
The desired length of the mantissa. The default is 6.
|
234
242
|
tolerance : float , optional
|
235
243
|
The desired tolerance. The default is 0.0001.
|
236
244
|
|
@@ -247,6 +255,7 @@ class Grid():
|
|
247
255
|
from topologicpy.Topology import Topology
|
248
256
|
from topologicpy.Dictionary import Dictionary
|
249
257
|
from topologicpy.Vector import Vector
|
258
|
+
|
250
259
|
if len(uRange) < 1 or len(vRange) < 1:
|
251
260
|
return None
|
252
261
|
if not origin:
|
@@ -266,8 +275,8 @@ class Grid():
|
|
266
275
|
v3 = Vertex.ByCoordinates(0, 0, 0)
|
267
276
|
v4 = Vertex.ByCoordinates(0,max(vRange),0)
|
268
277
|
|
269
|
-
uVector = [
|
270
|
-
vVector = [
|
278
|
+
uVector = [Vertex.X(v2, mantissa=mantissa)-Vertex.X(v1, mantissa=mantissa), Vertex.Y(v2, mantissa=mantissa)-Vertex.Y(v1, mantissa=mantissa),Vertex.Z(v2, mantissa=mantissa)-Vertex.Z(v1, mantissa=mantissa)]
|
279
|
+
vVector = [Vertex.X(v4, mantissa=mantissa)-Vertex.X(v3, mantissa=mantissa), Vertex.Y(v4, mantissa=mantissa)-Vertex.Y(v3, mantissa=mantissa),Vertex.Z(v4, mantissa=mantissa)-Vertex.Z(v3, mantissa=mantissa)]
|
271
280
|
gridVertices = []
|
272
281
|
if len(uRange) > 0:
|
273
282
|
uRange.sort()
|
@@ -277,7 +286,7 @@ class Grid():
|
|
277
286
|
for v in vRange:
|
278
287
|
uTempVec = Vector.Multiply(uuVector, u, tolerance)
|
279
288
|
vTempVec = Vector.Multiply(uvVector, v, tolerance)
|
280
|
-
gridVertex = Vertex.ByCoordinates(
|
289
|
+
gridVertex = Vertex.ByCoordinates(Vertex.X(origin, mantissa=mantissa)+uTempVec[0], Vertex.Y(origin, mantissa=mantissa)+vTempVec[1], Vertex.Z(origin, mantissa=mantissa)+uTempVec[2])
|
281
290
|
if clip and Topology.IsInstance(face, "Face"):
|
282
291
|
gridVertex = gridVertex.Intersect(face, False)
|
283
292
|
if Topology.IsInstance(gridVertex, "Vertex"):
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.7.
|
1
|
+
__version__ = '0.7.8'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.8
|
4
4
|
Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
License: GNU AFFERO GENERAL PUBLIC LICENSE
|
@@ -9,8 +9,8 @@ topologicpy/Dictionary.py,sha256=pMbfE2RYGCNpVr2x58qiHRc-aBWnp1jLlyzwS9nz6-w,258
|
|
9
9
|
topologicpy/Edge.py,sha256=KCQm9QfwjsYO4yKE4p4elpha9c4MY6EWAEaK_6mTAjo,52239
|
10
10
|
topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
|
11
11
|
topologicpy/Face.py,sha256=uPVVFF6CLzEW2JaTllQJp7nBsS2w3wAz7qwfujWTQAk,97474
|
12
|
-
topologicpy/Graph.py,sha256=
|
13
|
-
topologicpy/Grid.py,sha256=
|
12
|
+
topologicpy/Graph.py,sha256=51VViKQaYIuaMOoU3SQtzi7LJ6yisloY7wU-Ypj1gJo,380319
|
13
|
+
topologicpy/Grid.py,sha256=2uDFDxg4NqROC-7bNi1BjK5Uz__BPH13afJ-VDBRW0M,18466
|
14
14
|
topologicpy/Helper.py,sha256=07V9IFu5ilMpvAdZVhIbdBOjBJSRTtJ0BfR1IoRaRXU,17743
|
15
15
|
topologicpy/Honeybee.py,sha256=dlr5OEH93q51ZmEgvi8PXGfCHBDAjIZ1cm38Rft1Bz4,20235
|
16
16
|
topologicpy/Matrix.py,sha256=VV-kbT0Qt5QO38HRFJmD4IMnQUzYbLjBF4xaFAqLh3Q,8352
|
@@ -25,9 +25,9 @@ topologicpy/Vector.py,sha256=2OXmty9CKZZzfsg5T4ckml-lPUUvgDvqokcKDsZVN9Y,29806
|
|
25
25
|
topologicpy/Vertex.py,sha256=WjQZf-r8h_Cjwkt_qNN483FCUql20fbv72Ymiq7ZYtw,67462
|
26
26
|
topologicpy/Wire.py,sha256=efqePp91BvAdj4JitSW_f-xeGoTFg_AxP5g5pmbBVFw,139047
|
27
27
|
topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
|
28
|
-
topologicpy/version.py,sha256=
|
29
|
-
topologicpy-0.7.
|
30
|
-
topologicpy-0.7.
|
31
|
-
topologicpy-0.7.
|
32
|
-
topologicpy-0.7.
|
33
|
-
topologicpy-0.7.
|
28
|
+
topologicpy/version.py,sha256=a7wkX95rB7MKSi7_39xJlxtx2D_-UcZRwY8dnpzjx6w,22
|
29
|
+
topologicpy-0.7.8.dist-info/LICENSE,sha256=TfPDBt3ar0uv_f9cqCDMZ5rIzW3CY8anRRd4PkL6ejs,34522
|
30
|
+
topologicpy-0.7.8.dist-info/METADATA,sha256=5ElQumbM_dp9q0pHrGBTf585bMtBm5yQ8Is1dCFKnuE,46950
|
31
|
+
topologicpy-0.7.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
32
|
+
topologicpy-0.7.8.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
33
|
+
topologicpy-0.7.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|