topologicpy 0.8.29__py3-none-any.whl → 0.8.31__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/Wire.py CHANGED
@@ -146,7 +146,7 @@ class Wire():
146
146
  vertices = []
147
147
  for arc_point in arc_points:
148
148
  vertices.append(Vertex.ByCoordinates(list(arc_point)))
149
- arc = Wire.ByVertices(vertices, close=False, tolerance=tolerance)
149
+ arc = Wire.ByVertices(vertices, close=False, tolerance=tolerance, silent=silent)
150
150
  if not Topology.IsInstance(arc, "Wire"):
151
151
  if not silent:
152
152
  print("Wire.Arc - Error: Could not create an arc. Returning None.")
@@ -204,10 +204,10 @@ class Wire():
204
204
  print("Wire.ArcByEdge - Warning: Could not create an arc. Returning the original edge.")
205
205
  return edge
206
206
  cv = Edge.EndVertex(norm)
207
- return Wire.Arc(sv, cv, ev, sides=sides, close=close)
207
+ return Wire.Arc(sv, cv, ev, sides=sides, close=close, tolerance=tolerance, silent=silent)
208
208
 
209
209
  @staticmethod
210
- def BoundingRectangle(topology, optimize: int = 0, mantissa: int = 6, tolerance=0.0001):
210
+ def BoundingRectangle(topology, optimize: int = 0, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
211
211
  """
212
212
  Returns a wire representing a bounding rectangle of the input topology. The returned wire contains a dictionary with key "zrot" that represents rotations around the Z axis. If applied the resulting wire will become axis-aligned.
213
213
 
@@ -223,7 +223,9 @@ class Wire():
223
223
  The desired length of the mantissa. The default is 6.
224
224
  tolerance : float , optional
225
225
  The desired tolerance. The default is 0.0001.
226
-
226
+ silent : bool , optional
227
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
228
+
227
229
  Returns
228
230
  -------
229
231
  topologic_core.Wire
@@ -251,11 +253,14 @@ class Wire():
251
253
  return [x_min, y_min, maxX, maxY]
252
254
 
253
255
  if not Topology.IsInstance(topology, "Topology"):
256
+ if not silent:
257
+ print("Wire.BoundingRectangle - Error: The input topology parameter is not a valid topology. Returning None.")
254
258
  return None
255
259
 
256
260
  vertices = Topology.SubTopologies(topology=topology, subTopologyType="vertex")
257
261
  if Vertex.AreCollinear(vertices, mantissa=mantissa, tolerance=tolerance):
258
- print("Wire.BoundingRectangle - Error: All vertices of the input topology parameter are collinear and thus no bounding rectangle can be created. Returning None.")
262
+ if not silent:
263
+ print("Wire.BoundingRectangle - Error: All vertices of the input topology parameter are collinear and thus no bounding rectangle can be created. Returning None.")
259
264
  return None
260
265
  start = time.time()
261
266
  period = 0
@@ -266,15 +271,18 @@ class Wire():
266
271
  end = time.time()
267
272
  period = end - start
268
273
  if result == True:
269
- print("Wire.BoundingRectangle - Error: Could not find three vertices that are not colinear within 30 seconds. Returning None.")
274
+ if not silent:
275
+ print("Wire.BoundingRectangle - Error: Could not find three vertices that are not colinear within 30 seconds. Returning None.")
270
276
  return None
271
- w = Wire.ByVertices(vList, close=True, tolerance=tolerance)
277
+ w = Wire.ByVertices(vList, close=True, tolerance=tolerance, silent=silent)
272
278
  if not Topology.IsInstance(w, "Wire"):
273
- print("Wire.BoundingRectangle - Error: Could not create wire from three vertices. Returning None.")
279
+ if not silent:
280
+ print("Wire.BoundingRectangle - Error: Could not create wire from three vertices. Returning None.")
274
281
  return None
275
282
  f = Face.ByWire(w, tolerance=tolerance)
276
283
  if not Topology.IsInstance(f, "Face"):
277
- print("Wire.BoundingRectangle - Error: Could not create face from wire. Returning None.")
284
+ if not silent:
285
+ print("Wire.BoundingRectangle - Error: Could not create face from wire. Returning None.")
278
286
  return None
279
287
  f_origin = Topology.Centroid(f)
280
288
  normal = Face.Normal(f, mantissa=mantissa)
@@ -329,7 +337,7 @@ class Wire():
329
337
  vb3 = Vertex.ByCoordinates(maxX, maxY, 0)
330
338
  vb4 = Vertex.ByCoordinates(x_min, maxY, 0)
331
339
 
332
- boundingRectangle = Wire.ByVertices([vb1, vb2, vb3, vb4], close=True)
340
+ boundingRectangle = Wire.ByVertices([vb1, vb2, vb3, vb4], close=True, tolerance=tolerance, silent=silent)
333
341
  boundingRectangle = Topology.Rotate(boundingRectangle, origin=origin, axis=[0, 0, 1], angle=-best_z)
334
342
  boundingRectangle = Topology.Unflatten(boundingRectangle, origin=f_origin, direction=normal)
335
343
  dictionary = Dictionary.ByKeysValues(["zrot"], [best_z])
@@ -598,7 +606,7 @@ class Wire():
598
606
  # #w_e = Edge.SetLength(w_e, Edge.Length(w_e)+(2*epsilon), bothSides = True)
599
607
  # wire_edges.append(w_e)
600
608
 
601
- return_wire = Wire.ByVertices(final_vertices, close=Wire.IsClosed(wire), tolerance=tolerance)
609
+ return_wire = Wire.ByVertices(final_vertices, close=Wire.IsClosed(wire), tolerance=tolerance, silent=silent)
602
610
  #wire_edges = Topology.Edges(wire_edges)
603
611
  wire_edges = [Edge.SetLength(w_e, Edge.Length(w_e)+(2*epsilon), bothSides=True) for w_e in Topology.Edges(return_wire)]
604
612
  return_wire_edges = Topology.Edges(return_wire)
@@ -838,7 +846,7 @@ class Wire():
838
846
  return return_wire
839
847
 
840
848
  @staticmethod
841
- def ByVertices(vertices: list, close: bool = True, tolerance: float = 0.0001):
849
+ def ByVertices(vertices: list, close: bool = True, tolerance: float = 0.0001, silent: bool = False):
842
850
  """
843
851
  Creates a wire from the input list of vertices.
844
852
 
@@ -850,6 +858,8 @@ class Wire():
850
858
  If True the last vertex will be connected to the first vertex to close the wire. The default is True.
851
859
  tolerance : float , optional
852
860
  The desired tolerance. The default is 0.0001.
861
+ silent : bool , optional
862
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
853
863
 
854
864
  Returns
855
865
  -------
@@ -865,19 +875,20 @@ class Wire():
865
875
  return None
866
876
  vertexList = [x for x in vertices if Topology.IsInstance(x, "Vertex")]
867
877
  if len(vertexList) < 2:
868
- print("Wire.ByVertices - Error: The number of vertices is less than 2. Returning None.")
878
+ if not silent:
879
+ print("Wire.ByVertices - Error: The number of vertices is less than 2. Returning None.")
869
880
  return None
870
881
  edges = []
871
882
  for i in range(len(vertexList)-1):
872
883
  v1 = vertexList[i]
873
884
  v2 = vertexList[i+1]
874
- e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance, silent=True)
885
+ e = Edge.ByVertices([v1, v2], tolerance=tolerance, silent=silent)
875
886
  if Topology.IsInstance(e, "Edge"):
876
887
  edges.append(e)
877
888
  if close:
878
889
  v1 = vertexList[-1]
879
890
  v2 = vertexList[0]
880
- e = Edge.ByStartVertexEndVertex(v1, v2, tolerance=tolerance, silent=True)
891
+ e = Edge.ByVertices([v1, v2], tolerance=tolerance, silent=silent)
881
892
  if Topology.IsInstance(e, "Edge"):
882
893
  edges.append(e)
883
894
  if len(edges) < 1:
@@ -890,7 +901,7 @@ class Wire():
890
901
  return wire
891
902
 
892
903
  @staticmethod
893
- def ByVerticesCluster(cluster, close: bool = True, tolerance: float = 0.0001):
904
+ def ByVerticesCluster(cluster, close: bool = True, tolerance: float = 0.0001, silent: bool = False):
894
905
  """
895
906
  Creates a wire from the input cluster of vertices.
896
907
 
@@ -902,7 +913,9 @@ class Wire():
902
913
  If True the last vertex will be connected to the first vertex to close the wire. The default is True.
903
914
  tolerance : float , optional
904
915
  The desired tolerance. The default is 0.0001
905
-
916
+ silent : bool , optional
917
+ If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
918
+
906
919
  Returns
907
920
  -------
908
921
  topologic_core.Wire
@@ -912,9 +925,11 @@ class Wire():
912
925
  from topologicpy.Topology import Topology
913
926
 
914
927
  if not Topology.IsInstance(cluster, "Cluster"):
928
+ if not silent:
929
+ print("Wire.ByVerticesCluster - Error: The input cluster parameter is not a valid cluster. Returning None.")
915
930
  return None
916
931
  vertices = Topology.Vertices(cluster)
917
- return Wire.ByVertices(vertices, close=close, tolerance=tolerance)
932
+ return Wire.ByVertices(vertices, close=close, tolerance=tolerance, silent=silent)
918
933
 
919
934
  @staticmethod
920
935
  def Circle(origin= None, radius: float = 0.5, sides: int = 16, fromAngle: float = 0.0, toAngle: float = 360.0, close: bool = True, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001):
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.8.29'
1
+ __version__ = '0.8.31'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topologicpy
3
- Version: 0.8.29
3
+ Version: 0.8.31
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
@@ -1,38 +1,38 @@
1
1
  topologicpy/ANN.py,sha256=DrNAhNHp-jSvsPc1fb7KVPU46cYmejAvghhknOM430Y,47932
2
2
  topologicpy/Aperture.py,sha256=wNn5miB_IrGCBYuQ18HXQYRva20dUC3id4AJCulL7to,2723
3
- topologicpy/BVH.py,sha256=PAezG_P_W5_FUjUGB-HRRb4bzesE9DW89G2Vm-6ChWw,12932
4
- topologicpy/CSG.py,sha256=6vawdxs0_r7i9ElnwDO1Mouv_yPOTBr_4IhBnfVsBHk,15680
5
- topologicpy/Cell.py,sha256=F8ifMa-3NI5GYRx86J0cokgdoLduBiaw5DIKQFMHtCs,119904
3
+ topologicpy/BVH.py,sha256=ti-23A2HIxaqnJ3C9GWhCjQev9qQwdrSfZVfXVZujYE,13127
4
+ topologicpy/CSG.py,sha256=hqFPg3RvAnRgzwyyWbc4N80ZYO9AfvbWn0RsjXvaz8k,15695
5
+ topologicpy/Cell.py,sha256=qFA1PWpPT65b2ThgMdJOamak7dGdIYwISbDvFhnniOU,120281
6
6
  topologicpy/CellComplex.py,sha256=5O15NirkK2M1AvNcq9Z8N5lNb-hD9kGNXIJXWJJuj7k,59931
7
- topologicpy/Cluster.py,sha256=BSaLcHe4TinFTIwjFo4660rPX2y9Lqly2hv48WCq6fE,58606
7
+ topologicpy/Cluster.py,sha256=Wv81yPlQ3Qlnylpvs2aBVNV77M0Z9oHTUfTeLbAuX74,58790
8
8
  topologicpy/Color.py,sha256=ZVVQRKGjebY9aOU1gpN_AbssdRRiVKlZV3f8TrsTNgg,20307
9
9
  topologicpy/Context.py,sha256=G3CwMvN8Jw2rnQRwB-n4MaQq_wLS0vPimbXKwsdMJ80,3055
10
10
  topologicpy/DGL.py,sha256=HQXy9iDnrvWGDxaBfe5pRbweQ2zLBvAf6UdjfhKkQYI,139041
11
11
  topologicpy/Dictionary.py,sha256=Lf24WHW8q_RCq0l8VpT3XJTn6UuStY66JI4Lb4W08jI,34126
12
- topologicpy/Edge.py,sha256=pu4tZbRbK8qx2oqRbwHAeKuwU2X8JFGPSJjJMTJw8Q0,71418
12
+ topologicpy/Edge.py,sha256=45gad3RjbQoABRiIMftMJReOms-JEcDih1J0ocqgHKQ,72626
13
13
  topologicpy/EnergyModel.py,sha256=Pyb28gDDwhzlQIH0xqAygqS0P3SJxWyyV7OWS_AAfRs,53856
14
- topologicpy/Face.py,sha256=E1ffqvCNDWKFnFiDrEu70KWPGMGjtD3SoIxu4Yokn_I,186106
15
- topologicpy/Graph.py,sha256=t_2lHDUdQHsG-PYVjeRZtqfjKv6eD8jI8ZJl9uQW_GU,574360
14
+ topologicpy/Face.py,sha256=8SIGiBOfQClQJD5rfMqVvIelqbxhV291qCJYNZuiwoY,188438
15
+ topologicpy/Graph.py,sha256=0w3GP1CuJyE6xq1mALB93R3s4OFJnF6k9HkRZDhwkoQ,581043
16
16
  topologicpy/Grid.py,sha256=EbI2NcYhQDpD5mItd7A1Lpr8Puuf87vZPWuoh7_gChQ,18483
17
17
  topologicpy/Helper.py,sha256=JdvC30WMrla46mTj5TdwCV_bRv-6y8vK5Bkx0prluy4,29100
18
18
  topologicpy/Honeybee.py,sha256=yctkwfdupKnp7bAOjP1Z4YaYpRrWoMEb4gz9Z5zaWwE,21751
19
19
  topologicpy/Matrix.py,sha256=BHGDRkBn1pf5DkRoY8feAhDGHTF3bjFM4jluiEb_A0w,22779
20
20
  topologicpy/Neo4j.py,sha256=vNMaqTWerwr-3luLjYEXNhf8T97aFee6x5sIKBHY73s,22392
21
- topologicpy/Plotly.py,sha256=FIFahDnWhvbQ--VJjy3lQGl5735w8hDzZNrVkCkpZFE,119455
21
+ topologicpy/Plotly.py,sha256=5E6M2N0MbdkA5iMZ_Y71PaPB9wilEneYVUba8RqeKe0,119400
22
22
  topologicpy/Polyskel.py,sha256=oVfM4lqSMPTjnkHfsRU9VI8Blt6Vf0LVPkD9ebz7Wmw,27082
23
23
  topologicpy/PyG.py,sha256=zvV6jtnol_aFiN6JRoMpYwBVfOU2aFs9gdWSdEo6mtU,109757
24
- topologicpy/ShapeGrammar.py,sha256=JwE__VcKum5X3r33WwToEWtpJdFuhzZYyNhU2ob15ss,21194
24
+ topologicpy/ShapeGrammar.py,sha256=ay2kOkMvoa_KqGd_ZCLgDk0hmyMniI636N_YbMsyM60,23259
25
25
  topologicpy/Shell.py,sha256=h8S2nP1e0JtMxeOdAFZVhOYTJWTW8vlZRM5lxK0gu2o,89577
26
26
  topologicpy/Speckle.py,sha256=-eiTqJugd7pHiHpD3pDUcDO6CGhVyPV14HFRzaqEoaw,18187
27
27
  topologicpy/Sun.py,sha256=_VBBAUIDhvpkp72JBZlv7k9qx9jYubm3yM56UZ1Nc6c,36837
28
- topologicpy/Topology.py,sha256=UN1BnwS4G0DN5oLb6rLFUHEPxTj7PR6KzH-AnJQ0NHQ,478331
28
+ topologicpy/Topology.py,sha256=SJn82mDawV3nXxl4NUIyzoN8-WXEhkqQ7A_8S2o89fM,457609
29
29
  topologicpy/Vector.py,sha256=mx7fgABdioikPWM9HzXKzmqfx3u_XBcU_jlLD4qK2x8,42407
30
30
  topologicpy/Vertex.py,sha256=UMDhERrLH6b4WOu4pl0UgYzcfp9-NvmASLtKXwetO_4,84687
31
- topologicpy/Wire.py,sha256=eRs4PM7h4yU5v6umPh0oBJR4cN8BwsqlVroaFdnvK4w,228499
31
+ topologicpy/Wire.py,sha256=fvJI6N7kYsOf872RZP_4nFAb1GcXSJaeP-54wLAkmKY,229592
32
32
  topologicpy/__init__.py,sha256=RMftibjgAnHB1vdL-muo71RwMS4972JCxHuRHOlU428,928
33
- topologicpy/version.py,sha256=c72Y0CCfU5Qgxq7demxoD7bRlDWidTBPnLUByhWGtHU,23
34
- topologicpy-0.8.29.dist-info/licenses/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
35
- topologicpy-0.8.29.dist-info/METADATA,sha256=ahE6eaRHVYotJtOLSidVqD3l81GOrkKbBhlSnJauDsk,10535
36
- topologicpy-0.8.29.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
37
- topologicpy-0.8.29.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
38
- topologicpy-0.8.29.dist-info/RECORD,,
33
+ topologicpy/version.py,sha256=o3E8wJcmudXGEckMsKAcHE_CIjibc5RGcbR7O2YgqcY,23
34
+ topologicpy-0.8.31.dist-info/licenses/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
35
+ topologicpy-0.8.31.dist-info/METADATA,sha256=cHKREK307DJbrnqE8snD38liLjBNG5jY1eSb1IoT3xc,10535
36
+ topologicpy-0.8.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ topologicpy-0.8.31.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
38
+ topologicpy-0.8.31.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5