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 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
- labelKey="label",
550
- typeKey="type",
551
- geometryKey="brep",
552
- spaceType = "space",
553
- wallType = "wall",
554
- slabType = "slab",
555
- doorType = "door",
556
- windowType = "window",
557
- contentType = "content",
558
- namespace = "http://github.com/wassimj/topologicpy/resources"
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' 'z' attribute.
588
- labelKey : str , optional
589
- The dictionary key to use to look up the label of the node. The default is "label".
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
- json_data = Graph.JSONData(graph, vertexLabelKey=labelKey)
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 == labelKey) and not (key == typeKey):
664
- bot_graph.add((site_uri, bot[key], Literal(value)))
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(buildingDictionary)
726
+ keys = Dictionary.Keys(siteDictionary)
672
727
  for key in keys:
673
- value = Dictionary.ValueAtKey(buildingDictionary, key)
674
- if key == labelKey:
675
- if includeLabel:
676
- bot_graph.add((building_uri, RDFS.label, Literal(value)))
677
- elif key != typeKey:
678
- bot_graph.add((building_uri, bot[key], Literal(value)))
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['vertices'].items():
742
+ for node, attributes in json_data[verticesKey].items():
683
743
  if slabType.lower() in attributes[typeKey].lower():
684
- floorLevels.append(attributes["z"])
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['vertices'].items():
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["z"]
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 == labelKey:
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 == labelKey:
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['edges'].items():
761
- source = attributes["source"]
762
- target = attributes["target"]
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['vertices'][source][typeKey].lower() and spaceType.lower() in json_data['vertices'][target][typeKey].lower():
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['vertices'][source][typeKey].lower() and wallType.lower() in json_data['vertices'][target][typeKey].lower():
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['vertices'][source][typeKey].lower() and slabType.lower() in json_data['vertices'][target][typeKey].lower():
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['vertices'][source][typeKey].lower() and contentType.lower() in json_data['vertices'][target][typeKey].lower():
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
- format="turtle",
786
- bidirectional=False,
787
- includeAttributes=False,
788
- includeLabel=False,
789
- includeGeometry=False,
790
- siteLabel = "Site_0001",
791
- siteDictionary = None,
792
- buildingLabel = "Building_0001",
793
- buildingDictionary = None ,
794
- storeyPrefix = "Storey",
795
- floorLevels =[],
796
- labelKey="label",
797
- typeKey="type",
798
- geometryKey="brep",
799
- spaceType = "space",
800
- wallType = "wall",
801
- slabType = "slab",
802
- doorType = "door",
803
- windowType = "window",
804
- contentType = "content",
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' 'z' attribute.
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
- labelKey : str , optional
848
- The dictionary key to use to look up the label of the node. The default is "label".
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
- bidirectional=bidirectional,
871
- includeAttributes=includeAttributes,
872
- includeLabel=includeLabel,
873
- includeGeometry=includeGeometry,
874
- siteLabel=siteLabel,
875
- siteDictionary=siteDictionary,
876
- buildingLabel=buildingLabel,
877
- buildingDictionary=buildingDictionary,
878
- storeyPrefix=storeyPrefix,
879
- floorLevels=floorLevels,
880
- labelKey=labelKey,
881
- typeKey=typeKey,
882
- geometryKey=geometryKey,
883
- spaceType = spaceType,
884
- wallType = wallType,
885
- slabType = slabType,
886
- doorType = doorType,
887
- windowType = windowType,
888
- contentType = contentType
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, direct=True, directApertures=False, viaSharedTopologies=False, viaSharedApertures=False, toExteriorTopologies=False, toExteriorApertures=False, toContents=False, toOutposts=False, idKey="TOPOLOGIC_ID", outpostsKey="outposts", useInternalVertex=True, storeBREP=False, tolerance=0.0001):
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(vst2.X(), vst2.Y(), vst2.Z())
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(vsa.X()+(tolerance*100), vsa.Y()+(tolerance*100), vsa.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vea.X()+(tolerance*100), vea.Y()+(tolerance*100), vea.Z()+(tolerance*100))
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(vcn.X()+(tolerance*100), vcn.Y()+(tolerance*100), vcn.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst2.X()+(tolerance*100), vst2.Y()+(tolerance*100), vst2.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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(vst.X()+(tolerance*100), vst.Y()+(tolerance*100), vst.Z()+(tolerance*100))
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
- namespace = "http://github.com/wassimj/topologicpy/resources",
4364
- overwrite = False,
4365
- bidirectional=False,
4366
- includeAttributes=False,
4367
- includeLabel=False,
4368
- includeGeometry=False,
4369
- siteLabel = "Site_0001",
4370
- siteDictionary = None,
4371
- buildingLabel = "Building_0001",
4372
- buildingDictionary = None ,
4373
- storeyPrefix = "Storey",
4374
- floorLevels =[],
4375
- labelKey="label",
4376
- typeKey="type",
4377
- geometryKey="brep",
4378
- spaceType = "space",
4379
- wallType = "wall",
4380
- slabType = "slab",
4381
- doorType = "door",
4382
- windowType = "window",
4383
- contentType = "content",
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
- Returns an RDF graph serialized string according to the BOT ontology. See https://w3c-lbd-cg.github.io/bot/.
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, it is not. The default is False.
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 nodes' 'z' attribute.
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 label of the node. The default is "brep".
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 nodes of type "space". The default is "space".
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 nodes of type "wall". The default is "wall".
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 nodes of type "slab". The default is "slab".
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 nodes of type "door". The default is "door".
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 nodes of type "window". The default is "window".
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 nodes of type "content". The default is "contents".
4448
- format : str , optional
4449
- The desired output format, the options are listed below. Thde default is "turtle".
4450
- turtle, ttl or turtle2 : Turtle, turtle2 is just turtle with more spacing & linebreaks
4451
- xml or pretty-xml : RDF/XML, Was the default format, rdflib < 6.0.0
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
- bidirectional=bidirectional,
4467
- includeAttributes=includeAttributes,
4468
- includeLabel=includeLabel,
4469
- includeGeometry=includeGeometry,
4470
- siteLabel=siteLabel,
4471
- siteDictionary=siteDictionary,
4472
- buildingLabel=buildingLabel,
4473
- buildingDictionary=buildingDictionary,
4474
- storeyPrefix=storeyPrefix,
4475
- floorLevels=floorLevels,
4476
- labelKey=labelKey,
4477
- typeKey=typeKey,
4478
- geometryKey=geometryKey,
4479
- spaceType = spaceType,
4480
- wallType = wallType,
4481
- slabType = slabType,
4482
- doorType = doorType,
4483
- windowType = windowType,
4484
- contentType = contentType,
4485
- namespace = namespace
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,"brep")
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, origin=None, uRange=[-0.5,-0.25,0, 0.25,0.5], vRange=[-0.5,-0.25,0,0.25,0.5], clip=False, tolerance=0.0001):
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 = [v2.X()-v1.X(), v2.Y()-v1.Y(),v2.Z()-v1.Z()]
270
- vVector = [v4.X()-v3.X(), v4.Y()-v3.Y(),v4.Z()-v3.Z()]
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(origin.X()+uTempVec[0], origin.Y()+vTempVec[1], origin.Z()+uTempVec[2])
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.6'
1
+ __version__ = '0.7.8'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.6
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=pw1nG4z1CZJshA7dACPRUHvOkAyQ6pV1U758MU0Z9xM,369948
13
- topologicpy/Grid.py,sha256=9izbPCocfS0SoI31_D5lUFlzTYwFPHJAfBhYQ1CyPqE,17770
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=d_J-fGYyd_4FzGfbl6boN5XBrvTLiweHV0VC0aFvYVY,22
29
- topologicpy-0.7.6.dist-info/LICENSE,sha256=TfPDBt3ar0uv_f9cqCDMZ5rIzW3CY8anRRd4PkL6ejs,34522
30
- topologicpy-0.7.6.dist-info/METADATA,sha256=rZXhsrENM1-_IUT73GdvtHvZc99fdVrTw-F0eNy6TJE,46950
31
- topologicpy-0.7.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
32
- topologicpy-0.7.6.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
33
- topologicpy-0.7.6.dist-info/RECORD,,
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,,