topologicpy 0.7.65__py3-none-any.whl → 0.7.67__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/Plotly.py CHANGED
@@ -932,6 +932,8 @@ class Plotly:
932
932
  data = []
933
933
  v_list = []
934
934
 
935
+ if not isinstance(colorScale, str):
936
+ colorScale = "viridis"
935
937
  if Topology.Type(topology) == Topology.TypeID("Vertex"):
936
938
  tp_vertices = [topology]
937
939
  else:
topologicpy/Shell.py CHANGED
@@ -1520,7 +1520,7 @@ class Shell():
1520
1520
  origin = Topology.Centroid(face)
1521
1521
  normal = Face.Normal(face, mantissa=mantissa)
1522
1522
  flat_face = Topology.Flatten(face, origin=origin, direction=normal)
1523
- roof = Wire.Roof(flat_face, angle=angle, tolerance=tolerance)
1523
+ roof = Wire.Roof(flat_face, angle=angle, boundary=True, tolerance=tolerance)
1524
1524
  if not roof:
1525
1525
  return None
1526
1526
  shell = Shell.Skeleton(flat_face, tolerance=tolerance)
topologicpy/Topology.py CHANGED
@@ -245,7 +245,7 @@ class Topology():
245
245
 
246
246
  for aperture in apertures:
247
247
  d = Topology.Dictionary(aperture)
248
- d = Dictionary.SetValueAtKey(d, "type", "aperture")
248
+ d = Dictionary.SetValueAtKey(d, "type", "Aperture")
249
249
  aperture = Topology.SetDictionary(aperture, d)
250
250
 
251
251
  topology = Topology.AddContent(topology, apertures, subTopologyType=subTopologyType, tolerance=tolerance)
@@ -864,7 +864,7 @@ class Topology():
864
864
  d = Topology.Dictionary(content)
865
865
  if len(Dictionary.Keys(d)) > 0:
866
866
  type = Dictionary.ValueAtKey(d,"type")
867
- if type == "aperture":
867
+ if "aperture" in type.lower():
868
868
  apertures.append(content)
869
869
  elif subTopologyType.lower() == "vertex":
870
870
  subTopologies = Topology.Vertices(topology)
@@ -3033,16 +3033,14 @@ class Topology():
3033
3033
  Returns
3034
3034
  -------
3035
3035
  list
3036
- The list of imported topologies.
3036
+ The list of imported topologies (Warning: the list could contain 0, 1, or many topologies, but this method will always return a list)
3037
3037
 
3038
3038
  """
3039
3039
  if not file:
3040
3040
  print("Topology.ByJSONFile - Error: the input file parameter is not a valid file. Returning None.")
3041
3041
  return None
3042
- json_string = json.load(file)
3043
- #jsonData = json.load(file)
3044
- #jsonString = json.dumps(jsonData)
3045
- return Topology.ByJSONString(json_string, tolerance=tolerance)
3042
+ json_dict = json.load(file)
3043
+ return Topology.ByJSONDictionary(json_dict, tolerance=tolerance)
3046
3044
 
3047
3045
  @staticmethod
3048
3046
  def ByJSONPath(path, tolerance=0.0001):
@@ -3067,26 +3065,26 @@ class Topology():
3067
3065
  print("Topology.ByJSONPath - Error: the input path parameter is not a valid path. Returning None.")
3068
3066
  return None
3069
3067
  with open(path) as file:
3070
- json_string = json.load(file)
3071
- entities = Topology.ByJSONString(json_string, tolerance=tolerance)
3068
+ json_dict = json.load(file)
3069
+ entities = Topology.ByJSONDictionary(json_dict, tolerance=tolerance)
3072
3070
  return entities
3073
3071
 
3074
3072
  @staticmethod
3075
- def ByJSONString(string, tolerance=0.0001):
3073
+ def ByJSONDictionary(jsonDictionary, tolerance=0.0001):
3076
3074
  """
3077
- Imports the topology from a JSON string.
3075
+ Imports the topology from a JSON dictionary.
3078
3076
 
3079
3077
  Parameters
3080
3078
  ----------
3081
- string : str
3082
- The input JSON string.
3079
+ jsonDictionary : dict
3080
+ The input JSON dictionary.
3083
3081
  tolerance : float , optional
3084
3082
  The desired tolerance. The default is 0.0001.
3085
3083
 
3086
3084
  Returns
3087
3085
  -------
3088
- list or topologicpy.Topology
3089
- The list of imported topologies. If the list only contains one element, it returns that element.
3086
+ list
3087
+ The list of imported topologies (Warning: the list could contain 0, 1, or many topologies, but this method will always return a list)
3090
3088
 
3091
3089
  """
3092
3090
  from topologicpy.Vertex import Vertex
@@ -3110,9 +3108,7 @@ class Topology():
3110
3108
  vertex_apertures = []
3111
3109
  edge_apertures = []
3112
3110
  face_apertures = []
3113
- # Step 2: Create Entities and handle apertures
3114
- json_dictionary = json.loads(string)
3115
- for entity in json_dictionary:
3111
+ for entity in jsonDictionary:
3116
3112
  entity_type = entity['type']
3117
3113
  entity_dict = Dictionary.ByKeysValues(keys=list(entity['dictionary'].keys()),
3118
3114
  values=list(entity['dictionary'].values()))
@@ -3280,6 +3276,28 @@ class Topology():
3280
3276
  entity = Topology.AddApertures(entity, vertex_apertures, subTopologyType="Vertex", tolerance=0.001)
3281
3277
  top_level_list.append(entity)
3282
3278
  return top_level_list
3279
+
3280
+ @staticmethod
3281
+ def ByJSONString(string, tolerance=0.0001):
3282
+ """
3283
+ Imports the topology from a JSON string.
3284
+
3285
+ Parameters
3286
+ ----------
3287
+ string : str
3288
+ The input JSON string.
3289
+ tolerance : float , optional
3290
+ The desired tolerance. The default is 0.0001.
3291
+
3292
+ Returns
3293
+ -------
3294
+ list
3295
+ The list of imported topologies (Warning: the list could contain 0, 1, or many topologies, but this method will always return a list)
3296
+
3297
+ """
3298
+
3299
+ json_dict = json.loads(string)
3300
+ return Topology.ByJSONDictionary(json_dict, tolerance=tolerance)
3283
3301
 
3284
3302
  @staticmethod
3285
3303
  def ByOBJFile(objFile, mtlFile = None,
topologicpy/Wire.py CHANGED
@@ -2910,7 +2910,7 @@ class Wire():
2910
2910
  return return_wire
2911
2911
 
2912
2912
  @staticmethod
2913
- def Roof(face, angle: float = 45, tolerance: float = 0.001):
2913
+ def Roof(face, angle: float = 45, boundary: bool = True, tolerance: float = 0.001):
2914
2914
  """
2915
2915
  Creates a hipped roof through a straight skeleton. This method is contributed by 高熙鹏 xipeng gao <gaoxipeng1998@gmail.com>
2916
2916
  This algorithm depends on the polyskel code which is included in the library. Polyskel code is found at: https://github.com/Botffy/polyskel
@@ -2921,6 +2921,8 @@ class Wire():
2921
2921
  The input face.
2922
2922
  angle : float , optioal
2923
2923
  The desired angle in degrees of the roof. The default is 45.
2924
+ boundary : bool , optional
2925
+ If set to True the original boundary is returned as part of the roof. Otherwise it is not. The default is True.
2924
2926
  tolerance : float , optional
2925
2927
  The desired tolerance. The default is 0.001. (This is set to a larger number as it was found to work better)
2926
2928
 
@@ -2977,7 +2979,7 @@ class Wire():
2977
2979
  edges.append(e)
2978
2980
  return edges
2979
2981
 
2980
- def face_to_skeleton(face, angle=0):
2982
+ def face_to_skeleton(face, angle=0, boundary=True):
2981
2983
  normal = Face.Normal(face)
2982
2984
  eb_wire = Face.ExternalBoundary(face)
2983
2985
  ib_wires = Face.InternalBoundaries(face)
@@ -3003,7 +3005,10 @@ class Wire():
3003
3005
  return None
3004
3006
  slope = math.tan(math.radians(angle))
3005
3007
  roofEdges = subtrees_to_edges(skeleton, zero_coordinates, slope)
3006
- roofEdges = Helper.Flatten(roofEdges)+Topology.Edges(face)
3008
+ if boundary == True:
3009
+ roofEdges = Helper.Flatten(roofEdges)+Topology.Edges(face)
3010
+ else:
3011
+ roofEdges = Helper.Flatten(roofEdges)
3007
3012
  roofTopology = Topology.SelfMerge(Cluster.ByTopologies(roofEdges), tolerance=tolerance)
3008
3013
  return roofTopology
3009
3014
 
@@ -3016,7 +3021,7 @@ class Wire():
3016
3021
  normal = Face.Normal(face)
3017
3022
  flat_face = Topology.Flatten(face, origin=origin, direction=normal)
3018
3023
  d = Topology.Dictionary(flat_face)
3019
- roof = face_to_skeleton(flat_face, angle)
3024
+ roof = face_to_skeleton(flat_face, angle=angle, boundary=boundary)
3020
3025
  if not roof:
3021
3026
  return None
3022
3027
  roof = Topology.Unflatten(roof, origin=origin, direction=normal)
@@ -3114,7 +3119,7 @@ class Wire():
3114
3119
  return new_wire
3115
3120
 
3116
3121
  @staticmethod
3117
- def Skeleton(face, tolerance=0.001):
3122
+ def Skeleton(face, boundary: bool = True, tolerance: float = 0.001):
3118
3123
  """
3119
3124
  Creates a straight skeleton. This method is contributed by 高熙鹏 xipeng gao <gaoxipeng1998@gmail.com>
3120
3125
  This algorithm depends on the polyskel code which is included in the library. Polyskel code is found at: https://github.com/Botffy/polyskel
@@ -3123,6 +3128,8 @@ class Wire():
3123
3128
  ----------
3124
3129
  face : topologic_core.Face
3125
3130
  The input face.
3131
+ boundary : bool , optional
3132
+ If set to True the original boundary is returned as part of the roof. Otherwise it is not. The default is True.
3126
3133
  tolerance : float , optional
3127
3134
  The desired tolerance. The default is 0.001. (This is set to a larger number as it was found to work better)
3128
3135
 
@@ -3134,7 +3141,7 @@ class Wire():
3134
3141
  """
3135
3142
  if not Topology.IsInstance(face, "Face"):
3136
3143
  return None
3137
- return Wire.Roof(face, angle=0, tolerance=tolerance)
3144
+ return Wire.Roof(face, angle=0, boundary=boundary, tolerance=tolerance)
3138
3145
 
3139
3146
  @staticmethod
3140
3147
  def Spiral(origin = None, radiusA : float = 0.05, radiusB : float = 0.5, height : float = 1, turns : int = 10, sides : int = 36, clockwise : bool = False, reverse : bool = False, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001):
topologicpy/__init__.py CHANGED
@@ -20,3 +20,6 @@ from sys import platform
20
20
  from .version import __version__
21
21
 
22
22
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
23
+
24
+ # Set an alias for ease of access
25
+ version = __version__
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.65'
1
+ __version__ = '0.7.67'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.65
3
+ Version: 0.7.67
4
4
  Summary: An AI-Powered Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  License: AGPL v3 License
@@ -10,27 +10,27 @@ topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
10
10
  topologicpy/Dictionary.py,sha256=cURg452wwk2WeSxWY46ncgAUo5XD1c2c5EtO6ESZHaY,27304
11
11
  topologicpy/Edge.py,sha256=FACD8Bm2nL2uTHIeRMVXfRF0cYeqhZ-lCZPHAfjAIPg,66927
12
12
  topologicpy/EnergyModel.py,sha256=NM3_nAdY9_YDtbp9CaEZ0x0xVsetTqVDzm_VSjmq_mI,53746
13
- topologicpy/Face.py,sha256=emRTWbaLZeU3E0MprqpltTxC4ckv42h36enOcUMcLpU,124144
14
- topologicpy/Graph.py,sha256=4b8bzlyXmh0Ef9rjiEjl8wmh_9vAxoE5xiSiGvGjG9Q,411392
13
+ topologicpy/Face.py,sha256=lCjahpvNpaI-yNm_VN1-4HxjPEkpPIbRnyyj7H6DsPc,124354
14
+ topologicpy/Graph.py,sha256=IZrWxXnA--e0fmMjkdyj7Xxj945zT4gVMK-Nyieas8o,382597
15
15
  topologicpy/Grid.py,sha256=3-sn7CHWGcXk18XCnHjsUttNJTWwmN63g_Insj__p04,18218
16
16
  topologicpy/Helper.py,sha256=i-AfI29NMsZXBaymjilfvxQbuS3wpYbpPw4RWu1YCHs,16358
17
17
  topologicpy/Honeybee.py,sha256=Oc8mfGBNSjs6wxkPzCKmEw1ZPQPbp9XtiYWaAF62oSk,21893
18
18
  topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
19
19
  topologicpy/Neo4j.py,sha256=t52hgE9cVsqkGc7m7fjRsLnyfRHakVHwdvF4ms7ow78,22342
20
- topologicpy/Plotly.py,sha256=k-gluqX4Na3zlYCDl_6A0gqeFoGR-0Oy6fLiT-Zqlyk,108362
20
+ topologicpy/Plotly.py,sha256=P6wQ2W9Urm5Rrx5_Bh8hwiFDSFQYzN_hJDUj-y3BO0c,108441
21
21
  topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
22
22
  topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
23
- topologicpy/Shell.py,sha256=joahFtpRQTWJpQOmi3qU4Xe0Sx2XXeayHlXTNx8CzMk,87610
23
+ topologicpy/Shell.py,sha256=iX9jLbpylRqt24jtzEH6kSWvA5JvbhAY_w880PxJXP8,87625
24
24
  topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
25
25
  topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
26
- topologicpy/Topology.py,sha256=DsRPV0iWUY2NIlxdvLLDBkkDY3xw8oYvmzQEEfJUusQ,398136
26
+ topologicpy/Topology.py,sha256=7HUdFQZ2V-xRHLXzRXaN7pEZHWAv6yv7Zn7ou642mYY,398747
27
27
  topologicpy/Vector.py,sha256=A1g83zDHep58iVPY8WQ8iHNrSOfGWFEzvVeDuMnjDNY,33078
28
28
  topologicpy/Vertex.py,sha256=bLY60YWoMsgCgHk7F7k9F93Sq2FJ6AzUcTfJ83NZfHA,71107
29
- topologicpy/Wire.py,sha256=68KGFO6jere1aj5lci0W67kDRThXLMko8oY68q-ZP_A,171939
30
- topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
31
- topologicpy/version.py,sha256=4-LUGtsfz8i419m9JYP1wXtHIMULgrganMwzGAvPIkU,23
32
- topologicpy-0.7.65.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
- topologicpy-0.7.65.dist-info/METADATA,sha256=BzRukyNwXpaXv7OWSodC4FUsGbC5LMvLaGsAj10xvV8,10493
34
- topologicpy-0.7.65.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
35
- topologicpy-0.7.65.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
- topologicpy-0.7.65.dist-info/RECORD,,
29
+ topologicpy/Wire.py,sha256=BIWv-NIDd31F1EMdX20rHGr_QPhut7SNyqkZmHpv93Q,172480
30
+ topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
31
+ topologicpy/version.py,sha256=lLx7SH29wIbpawsGm3Hr19wrLnvr39XEY2lKATjP0-M,23
32
+ topologicpy-0.7.67.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
33
+ topologicpy-0.7.67.dist-info/METADATA,sha256=UWDuYpsLxboxLOcBpAoqXCaFS0vR2cHrgBnD_ywyCys,10493
34
+ topologicpy-0.7.67.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
35
+ topologicpy-0.7.67.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
36
+ topologicpy-0.7.67.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5