topologicpy 0.4.96__py3-none-any.whl → 0.4.97__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/Shell.py CHANGED
@@ -659,18 +659,18 @@ class Shell(Topology):
659
659
 
660
660
  """
661
661
 
662
- from topologicpy.Wire import Wire
662
+ from topologicpy.Vertex import Vertex
663
663
 
664
664
  if not isinstance(shell, topologic.Shell):
665
665
  return None
666
666
  if not isinstance(vertex, topologic.Vertex):
667
667
  return None
668
668
  boundary = Shell.ExternalBoundary(shell, tolerance=tolerance)
669
- if Wire.IsInternal(wire=boundary, vertex=vertex, tolerance=tolerance):
669
+ if Vertex.IsInternal(vertex, boundary, tolerance=tolerance):
670
670
  return True
671
671
  internal_boundaries = Shell.InternalBoundaries(shell, tolerance=tolerance)
672
672
  for ib in internal_boundaries:
673
- if Wire.IsInternal(wire=ib, vertex=vertex, tolerance=tolerance):
673
+ if Vertex.IsInternal(vertex, ib, tolerance=tolerance):
674
674
  return True
675
675
  return False
676
676
 
topologicpy/Topology.py CHANGED
@@ -914,7 +914,15 @@ class Topology():
914
914
  return None
915
915
  # Edge:
916
916
  elif isinstance(topologyA, topologic.Edge):
917
- if isinstance(topologyB, topologic.Shell):
917
+ if isinstance(topologyB, topologic.Wire):
918
+ vertices = Topology.Vertices(topologyB)
919
+ edges = Topology.Edges(topologyB)
920
+ intersections = [topologyA.Intersect(x) for x in vertices]
921
+ intersections += [topologyA.Intersect(x) for x in edges]
922
+ intersections = [x for x in intersections if not x == None]
923
+ if len(intersections) == 0:
924
+ return None
925
+ elif isinstance(topologyB, topologic.Shell):
918
926
  vertices = Topology.Vertices(topologyB)
919
927
  edges = Topology.Edges(topologyB)
920
928
  faces = Topology.Faces(topologyB)
topologicpy/Wire.py CHANGED
@@ -2906,6 +2906,21 @@ class Wire(Topology):
2906
2906
 
2907
2907
  """
2908
2908
  from topologicpy.Vertex import Vertex
2909
+ def compute_u(u):
2910
+ def count_decimal_places(number):
2911
+ try:
2912
+ # Convert the number to a string to analyze decimal places
2913
+ num_str = str(number)
2914
+ # Split the number into integer and decimal parts
2915
+ integer_part, decimal_part = num_str.split('.')
2916
+ # Return the length of the decimal part
2917
+ return len(decimal_part)
2918
+ except ValueError:
2919
+ # If there's no decimal part, return 0
2920
+ return 0
2921
+ dp = count_decimal_places(u)
2922
+ u = -(int(u) - u)
2923
+ return round(u,dp)
2909
2924
 
2910
2925
  if not isinstance(wire, topologic.Wire):
2911
2926
  print("Wire.VertexByDistance - Error: The input wire parameter is not a valid topologic wire. Returning None.")
@@ -2918,9 +2933,9 @@ class Wire(Topology):
2918
2933
  return Wire.StartVertex(wire)
2919
2934
  if abs(distance - wire_length) < tolerance:
2920
2935
  return Wire.EndVertex(wire)
2921
- if abs(distance) > wire_length:
2922
- print("Wire.VertexByDistance - Error: The input distance parameter is larger than the wire's length. Returning None.")
2923
- return None
2936
+ # if abs(distance) > wire_length:
2937
+ # print("Wire.VertexByDistance - Error: The input distance parameter is larger than the wire's length. Returning None.")
2938
+ # return None
2924
2939
  if not Wire.IsManifold(wire):
2925
2940
  print("Wire.VertexAtParameter - Error: The input wire parameter is non-manifold. Returning None.")
2926
2941
  return None
@@ -2929,17 +2944,18 @@ class Wire(Topology):
2929
2944
  if not isinstance(origin, topologic.Vertex):
2930
2945
  print("Wire.VertexByDistance - Error: The input origin parameter is not a valid topologic vertex. Returning None.")
2931
2946
  return None
2932
- if not Wire.IsInternal(wire, origin, tolerance=tolerance):
2947
+ if not Vertex.IsInternal(origin, wire, tolerance=tolerance):
2933
2948
  print("Wire.VertexByDistance - Error: The input origin parameter is not internal to the input wire parameter. Returning None.")
2934
2949
  return None
2935
- if distance < 0:
2936
- if Wire.VertexDistance(wire, Wire.StartVertex(wire), origin) < abs(distance):
2937
- print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
2938
- return None
2939
- else:
2940
- if Wire.VertexDistance(wire, Wire.EndVertex(wire), origin) < distance:
2941
- print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
2942
- return None
2950
+ # if distance < 0:
2951
+ # if Wire.VertexDistance(wire, Wire.StartVertex(wire), origin) < abs(distance):
2952
+ # print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
2953
+ # return None
2954
+ # else:
2955
+ # if Wire.VertexDistance(wire, Wire.EndVertex(wire), origin) < distance:
2956
+ # print("Wire.VertexDistance:", Wire.VertexDistance(wire, Wire.EndVertex(wire), origin))
2957
+ # print("Wire.VertexByDistance - Error: The resulting vertex would fall outside the wire. Returning None.")
2958
+ # return None
2943
2959
 
2944
2960
  if Vertex.Distance(Wire.StartVertex(wire), origin) < tolerance:
2945
2961
  u = distance/wire_length
@@ -2948,7 +2964,8 @@ class Wire(Topology):
2948
2964
  else:
2949
2965
  d = Wire.VertexDistance(wire, origin) + distance
2950
2966
  u = d/wire_length
2951
- return Wire.VertexByParameter(wire, u=u)
2967
+
2968
+ return Wire.VertexByParameter(wire, u=compute_u(u))
2952
2969
 
2953
2970
  @staticmethod
2954
2971
  def VertexByParameter(wire: topologic.Wire, u: float = 0) -> topologic.Vertex:
topologicpy/__init__.py CHANGED
@@ -18,7 +18,7 @@ import sys
18
18
  import os, re
19
19
  from sys import platform
20
20
 
21
- __version__ = '0.4.96'
21
+ __version__ = '0.4.97'
22
22
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
23
23
 
24
24
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.96
3
+ Version: 0.4.97
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
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -17,13 +17,13 @@ topologicpy/Matrix.py,sha256=1aH7QKP6eNUbUXmZbB7e_4dw1ZSVQ8bsOsKJXtQq3_4,8357
17
17
  topologicpy/Neo4j.py,sha256=Wd3GRuTt66AkzJscLNIJCBQhd8y1OntX_9u4_33XQKw,19341
18
18
  topologicpy/Plotly.py,sha256=W4nuHVy7xUnRGJRcE2iPl0mLU0dp58CTHC1_YldfZ6I,96904
19
19
  topologicpy/Polyskel.py,sha256=-M47SAFWrFOheZ9KWUEgYOmCn-V_rfKPKvU8KY4B-1s,16450
20
- topologicpy/Shell.py,sha256=LJjdTfXcYNJalu2gAwpmFnxs8re7OBAThGn8irvlbqg,76317
20
+ topologicpy/Shell.py,sha256=Oim9SrR9xYe_hSa5JvXWzmbWnoqQMbYTvRBi60MoCPk,76301
21
21
  topologicpy/Speckle.py,sha256=zKqiHYuw7498W_9UWvDn2xsdBskhahNjJejxegMpbJA,14773
22
- topologicpy/Topology.py,sha256=iRQjNVxC87C8Qi6ykGnsZooxg960FcmjVRqSXCgcQx8,299669
22
+ topologicpy/Topology.py,sha256=8h3mlzzJGCw1q8dR10Q2Picn4HnmwE7QQDFTIdlL9Vg,300139
23
23
  topologicpy/Vector.py,sha256=OtPPz0N_bKpXsGNOHYZTEXKHPAy9MgTG1NgoKmh8f0s,30347
24
24
  topologicpy/Vertex.py,sha256=b3oPfMNFAXHcrcvOdd1LSFdO8BUeXEVVsQuks_uWtVY,66016
25
- topologicpy/Wire.py,sha256=px0IB2Y6TIF5QKb4LkQ4ZAjWAgu76eDefT6vnyQ0idM,131506
26
- topologicpy/__init__.py,sha256=MESltIVetyEsa0zFlilCBcXiUpaalL3H4fI_0IXSr1c,1445
25
+ topologicpy/Wire.py,sha256=GxT43Cptvztrrh3g5_6c45CEz319HRZFovJ--8XkUXM,132346
26
+ topologicpy/__init__.py,sha256=FyhIu7MzmQ3SjqEPrCoL9KOYguHtEvYwrEhESiPYauU,1445
27
27
  topologicpy/bin/linux/topologic/__init__.py,sha256=XlFReDf3FWlYdM9uXtanYPIafgPb6GVTQczS_xJAXD0,60
28
28
  topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0,sha256=ANok9DQKcnWcLd9T_LAt-i-X4nsYYy16q9kQlcTre1E,2996488
29
29
  topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0,sha256=OJ3XesL79du8LeBHrsleGPXub6OpJdOilxha0mwjqQo,1378768
@@ -84,8 +84,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
84
84
  topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
85
85
  topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
86
86
  topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
87
- topologicpy-0.4.96.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
88
- topologicpy-0.4.96.dist-info/METADATA,sha256=whQaEfI0A_W1FHAhYtkMe6wU96JH0GYQHSRqQ7q4sJs,7278
89
- topologicpy-0.4.96.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
90
- topologicpy-0.4.96.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
91
- topologicpy-0.4.96.dist-info/RECORD,,
87
+ topologicpy-0.4.97.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
88
+ topologicpy-0.4.97.dist-info/METADATA,sha256=fNypu2RWHH2tzuF-oxmVLGThQb-6WhumiFNbnBJUHEI,7278
89
+ topologicpy-0.4.97.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
90
+ topologicpy-0.4.97.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
91
+ topologicpy-0.4.97.dist-info/RECORD,,