topologicpy 0.8.9__py3-none-any.whl → 0.8.10__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/BVH.py +1 -1
- topologicpy/Cell.py +2 -2
- topologicpy/CellComplex.py +2 -2
- topologicpy/Edge.py +23 -23
- topologicpy/Face.py +6 -6
- topologicpy/Graph.py +8 -8
- topologicpy/Helper.py +55 -0
- topologicpy/Polyskel.py +3 -3
- topologicpy/Shell.py +4 -4
- topologicpy/Topology.py +10 -10
- topologicpy/Vector.py +13 -13
- topologicpy/Vertex.py +6 -6
- topologicpy/Wire.py +26 -26
- topologicpy/version.py +1 -1
- {topologicpy-0.8.9.dist-info → topologicpy-0.8.10.dist-info}/METADATA +1 -1
- topologicpy-0.8.10.dist-info/RECORD +36 -0
- topologicpy-0.8.9.dist-info/RECORD +0 -36
- {topologicpy-0.8.9.dist-info → topologicpy-0.8.10.dist-info}/LICENSE +0 -0
- {topologicpy-0.8.9.dist-info → topologicpy-0.8.10.dist-info}/WHEEL +0 -0
- {topologicpy-0.8.9.dist-info → topologicpy-0.8.10.dist-info}/top_level.txt +0 -0
topologicpy/BVH.py
CHANGED
@@ -282,7 +282,7 @@ class BVH:
|
|
282
282
|
# Add an edge from the parent to this vertex (if a parent exists)
|
283
283
|
if parent_vertex is not None:
|
284
284
|
d = Vertex.Distance(parent_vertex, current_vertex)
|
285
|
-
if d
|
285
|
+
if d <= tolerance:
|
286
286
|
current_vertex = Topology.Translate(current_vertex, tolerance*random.uniform(2,50), tolerance*random.uniform(2,50), tolerance*random.uniform(2,50))
|
287
287
|
edge = Edge.ByVertices(parent_vertex, current_vertex, tolerance=tolerance)
|
288
288
|
graph = Graph.AddEdge(graph, edge, silent=True)
|
topologicpy/Cell.py
CHANGED
@@ -998,14 +998,14 @@ class Cell():
|
|
998
998
|
verticalFaces.append(aFace)
|
999
999
|
verticalApertures += getApertures(aFace)
|
1000
1000
|
elif aCode == 1:
|
1001
|
-
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin)
|
1001
|
+
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin) <= tolerance:
|
1002
1002
|
bottomHorizontalFaces.append(aFace)
|
1003
1003
|
bottomHorizontalApertures += getApertures(aFace)
|
1004
1004
|
else:
|
1005
1005
|
topHorizontalFaces.append(aFace)
|
1006
1006
|
topHorizontalApertures += getApertures(aFace)
|
1007
1007
|
elif aCode == 2:
|
1008
|
-
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax)
|
1008
|
+
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax) <= tolerance:
|
1009
1009
|
topHorizontalFaces.append(aFace)
|
1010
1010
|
topHorizontalApertures += getApertures(aFace)
|
1011
1011
|
else:
|
topologicpy/CellComplex.py
CHANGED
@@ -546,7 +546,7 @@ class CellComplex():
|
|
546
546
|
internalVerticalApertures += getApertures(aFace)
|
547
547
|
elif aCode == 1:
|
548
548
|
if n == 1:
|
549
|
-
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin)
|
549
|
+
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMin) <= tolerance:
|
550
550
|
bottomHorizontalFaces.append(aFace)
|
551
551
|
bottomHorizontalApertures += getApertures(aFace)
|
552
552
|
else:
|
@@ -557,7 +557,7 @@ class CellComplex():
|
|
557
557
|
internalHorizontalApertures += getApertures(aFace)
|
558
558
|
elif aCode == 2:
|
559
559
|
if n == 1:
|
560
|
-
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax)
|
560
|
+
if abs(Vertex.Z(Topology.Centroid(aFace)) - zMax) <= tolerance:
|
561
561
|
topHorizontalFaces.append(aFace)
|
562
562
|
topHorizontalApertures += getApertures(aFace)
|
563
563
|
else:
|
topologicpy/Edge.py
CHANGED
@@ -153,15 +153,15 @@ class Edge():
|
|
153
153
|
|
154
154
|
shared_vertex = None
|
155
155
|
|
156
|
-
if Vertex.Distance(start1, start2)
|
156
|
+
if Vertex.Distance(start1, start2) <= tolerance:
|
157
157
|
shared_vertex = start1
|
158
|
-
elif Vertex.Distance(start1, end2)
|
158
|
+
elif Vertex.Distance(start1, end2) <= tolerance:
|
159
159
|
shared_vertex = start1
|
160
160
|
edge2 = Edge.Reverse(edge2)
|
161
|
-
elif Vertex.Distance(end1, start2)
|
161
|
+
elif Vertex.Distance(end1, start2) <= tolerance:
|
162
162
|
shared_vertex = start2
|
163
163
|
edge1 = Edge.Reverse(edge1)
|
164
|
-
elif Vertex.Distance(end1, end2)
|
164
|
+
elif Vertex.Distance(end1, end2) <= tolerance:
|
165
165
|
shared_vertex = end1
|
166
166
|
edge1 = Edge.Reverse(edge1)
|
167
167
|
edge2 = Edge.Reverse(edge2)
|
@@ -176,10 +176,10 @@ class Edge():
|
|
176
176
|
if not Topology.IsInstance(edgeB, "Edge"):
|
177
177
|
print("Edge.Bisect - Error: The input edgeB parameter is not a valid topologic edge. Returning None.")
|
178
178
|
return None
|
179
|
-
if Edge.Length(edgeA)
|
179
|
+
if Edge.Length(edgeA) <= tolerance:
|
180
180
|
print("Edge.Bisect - Error: The input edgeA parameter is shorter than the input tolerance parameter. Returning None.")
|
181
181
|
return None
|
182
|
-
if Edge.Length(edgeB)
|
182
|
+
if Edge.Length(edgeB) <= tolerance:
|
183
183
|
print("Edge.Bisect - Error: The input edgeB parameter is shorter than the input tolerance parameter. Returning None.")
|
184
184
|
return None
|
185
185
|
|
@@ -313,7 +313,7 @@ class Edge():
|
|
313
313
|
if not silent:
|
314
314
|
print("Edge.ByStartVertexEndVertex - Error: The input vertexA and vertexB parameters are the same vertex. Returning None.")
|
315
315
|
return None
|
316
|
-
if Vertex.Distance(vertexA, vertexB)
|
316
|
+
if Vertex.Distance(vertexA, vertexB) <= tolerance:
|
317
317
|
if not silent:
|
318
318
|
print("Edge.ByStartVertexEndVertex - Error: The distance between the input vertexA and vertexB parameters is less than the input tolerance. Returning None.")
|
319
319
|
return None
|
@@ -360,7 +360,7 @@ class Edge():
|
|
360
360
|
print("Edge.ByVertexDirectionLength - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
361
361
|
return None
|
362
362
|
|
363
|
-
if length
|
363
|
+
if length <= tolerance:
|
364
364
|
if not silent:
|
365
365
|
print("Edge.ByVertexDirectionLength - Error: The input edge parameter must not be less than the input tolerance parameter. Returning None.")
|
366
366
|
return None
|
@@ -646,7 +646,7 @@ class Edge():
|
|
646
646
|
print("Edge.Extend - Error: The input edge parameter is not a valid topologic edge. Returning None.")
|
647
647
|
return None
|
648
648
|
distance = abs(distance)
|
649
|
-
if distance
|
649
|
+
if distance <= tolerance:
|
650
650
|
return edge
|
651
651
|
sv = Edge.StartVertex(edge)
|
652
652
|
ev = Edge.EndVertex(edge)
|
@@ -810,11 +810,11 @@ class Edge():
|
|
810
810
|
evb = Edge.EndVertex(edges[i])
|
811
811
|
dsvsv = Vertex.Distance(sva, svb)
|
812
812
|
devev = Vertex.Distance(eva, evb)
|
813
|
-
if dsvsv
|
813
|
+
if dsvsv <= tolerance and devev <= tolerance:
|
814
814
|
return i
|
815
815
|
dsvev = Vertex.Distance(sva, evb)
|
816
816
|
devsv = Vertex.Distance(eva, svb)
|
817
|
-
if dsvev
|
817
|
+
if dsvev <= tolerance and devsv <= tolerance:
|
818
818
|
return i
|
819
819
|
return None
|
820
820
|
|
@@ -856,7 +856,7 @@ class Edge():
|
|
856
856
|
distances.append(Vertex.Distance(pair[0], pair[1]))
|
857
857
|
v_list = Helper.Sort(v_list, distances)
|
858
858
|
closest_pair = v_list[0]
|
859
|
-
if Vertex.Distance(closest_pair[0], closest_pair[1])
|
859
|
+
if Vertex.Distance(closest_pair[0], closest_pair[1]) <= tolerance:
|
860
860
|
return Topology.Centroid(Cluster.ByTopologies(closest_pair))
|
861
861
|
|
862
862
|
if Edge.IsCollinear(edgeA, edgeB, tolerance=tolerance):
|
@@ -915,11 +915,11 @@ class Edge():
|
|
915
915
|
if not Topology.IsInstance(edgeB, "Edge"):
|
916
916
|
print("Edge.IsCollinear - Error: The input parameter edgeB is not a valid edge. Returning None")
|
917
917
|
return None
|
918
|
-
if Edge.Length(edgeA)
|
919
|
-
print("Edge.IsCollinear - Error: The length of edgeA is less than the tolerance. Returning None")
|
918
|
+
if Edge.Length(edgeA) <= tolerance:
|
919
|
+
print("Edge.IsCollinear - Error: The length of edgeA is less than or equal the tolerance. Returning None")
|
920
920
|
return None
|
921
|
-
if Edge.Length(edgeB)
|
922
|
-
print("Edge.IsCollinear - Error: The length of edgeB is less than the tolerance. Returning None")
|
921
|
+
if Edge.Length(edgeB) <= tolerance:
|
922
|
+
print("Edge.IsCollinear - Error: The length of edgeB is less than or equal to the tolerance. Returning None")
|
923
923
|
return None
|
924
924
|
|
925
925
|
# Get start and end points of the first edge
|
@@ -962,7 +962,7 @@ class Edge():
|
|
962
962
|
distance_end = distance_from_line(end_b, start_a_coords, direction_a)
|
963
963
|
|
964
964
|
# Check if both distances are within tolerance
|
965
|
-
return bool(distance_start
|
965
|
+
return bool(distance_start <= tolerance) and bool(distance_end <= tolerance)
|
966
966
|
|
967
967
|
@staticmethod
|
968
968
|
def IsCoplanar(edgeA, edgeB, mantissa: int = 6, tolerance: float = 0.0001):
|
@@ -996,11 +996,11 @@ class Edge():
|
|
996
996
|
if not Topology.IsInstance(edgeB, "Edge"):
|
997
997
|
print("Edge.IsCoplanar - Error: The input parameter edgeB is not a valid edge. Returning None")
|
998
998
|
return None
|
999
|
-
if Edge.Length(edgeA)
|
1000
|
-
print("Edge.IsCoplanar - Error: The length of edgeA is less than the tolerance. Returning None")
|
999
|
+
if Edge.Length(edgeA) <= tolerance:
|
1000
|
+
print("Edge.IsCoplanar - Error: The length of edgeA is less than or equal to the tolerance. Returning None")
|
1001
1001
|
return None
|
1002
|
-
if Edge.Length(edgeB)
|
1003
|
-
print("Edge.IsCoplanar - Error: The length of edgeB is less than the tolerance. Returning None")
|
1002
|
+
if Edge.Length(edgeB) <= tolerance:
|
1003
|
+
print("Edge.IsCoplanar - Error: The length of edgeB is less than or equal to the tolerance. Returning None")
|
1004
1004
|
return None
|
1005
1005
|
|
1006
1006
|
# Extract points
|
@@ -1513,8 +1513,8 @@ class Edge():
|
|
1513
1513
|
distance = abs(distance)
|
1514
1514
|
if distance == 0:
|
1515
1515
|
return edge
|
1516
|
-
if distance
|
1517
|
-
print("Edge.Trim - Warning: The input distance parameter is less than the input tolerance parameter. Returning the input edge.")
|
1516
|
+
if distance <= tolerance:
|
1517
|
+
print("Edge.Trim - Warning: The input distance parameter is less than or equal to the input tolerance parameter. Returning the input edge.")
|
1518
1518
|
return edge
|
1519
1519
|
sv = Edge.StartVertex(edge)
|
1520
1520
|
ev = Edge.EndVertex(edge)
|
topologicpy/Face.py
CHANGED
@@ -325,7 +325,7 @@ class Face():
|
|
325
325
|
print("Face.ByOffset - Warning: The input face parameter is not a valid face. Returning None.")
|
326
326
|
return None
|
327
327
|
|
328
|
-
if abs(Face.Normal(face)[2] + 1)
|
328
|
+
if abs(Face.Normal(face)[2] + 1) <= tolerance:
|
329
329
|
reverse = not(reverse)
|
330
330
|
eb = Face.Wire(face)
|
331
331
|
|
@@ -494,7 +494,7 @@ class Face():
|
|
494
494
|
# We want this difference to be as close to 0 as possible
|
495
495
|
loss = (new_area - area) ** 2
|
496
496
|
# If the loss is less than the tolerance, accept the result and return a loss of 0.
|
497
|
-
if loss
|
497
|
+
if loss <= tolerance:
|
498
498
|
return 0
|
499
499
|
# Otherwise, return the actual loss value.
|
500
500
|
return loss
|
@@ -1622,7 +1622,7 @@ class Face():
|
|
1622
1622
|
dV = direction
|
1623
1623
|
uV = Vector.Normalize(dV)
|
1624
1624
|
dot = sum([i*j for (i, j) in zip(uV, faceNormal)])
|
1625
|
-
if dot
|
1625
|
+
if dot <= tolerance:
|
1626
1626
|
return False
|
1627
1627
|
return True
|
1628
1628
|
|
@@ -2278,7 +2278,7 @@ class Face():
|
|
2278
2278
|
def vertex_part_of_face(vertex, face, tolerance=0.0001):
|
2279
2279
|
vertices = Topology.Vertices(face)
|
2280
2280
|
for v in vertices:
|
2281
|
-
if Vertex.Distance(vertex, v)
|
2281
|
+
if Vertex.Distance(vertex, v) <= tolerance:
|
2282
2282
|
return True
|
2283
2283
|
return False
|
2284
2284
|
|
@@ -3040,9 +3040,9 @@ class Face():
|
|
3040
3040
|
if not silent:
|
3041
3041
|
print("Face.NormalEdge - Error: The input face parameter is not a valid face. Retuning None.")
|
3042
3042
|
return None
|
3043
|
-
if length
|
3043
|
+
if length <= tolerance:
|
3044
3044
|
if not silent:
|
3045
|
-
print("Face.NormalEdge - Error: The input length parameter is less than the input tolerance. Retuning None.")
|
3045
|
+
print("Face.NormalEdge - Error: The input length parameter is less than or equal to the input tolerance. Retuning None.")
|
3046
3046
|
return None
|
3047
3047
|
iv = Face.InternalVertex(face)
|
3048
3048
|
u, v = Face.VertexParameters(face, iv)
|
topologicpy/Graph.py
CHANGED
@@ -299,7 +299,7 @@ class Graph:
|
|
299
299
|
unique = True
|
300
300
|
returnVertex = vertex
|
301
301
|
for gv in graph_vertices:
|
302
|
-
if (Vertex.Distance(vertex, gv)
|
302
|
+
if (Vertex.Distance(vertex, gv) <= tolerance):
|
303
303
|
if transferVertexDictionaries == True:
|
304
304
|
gd = Topology.Dictionary(gv)
|
305
305
|
vd = Topology.Dictionary(vertex)
|
@@ -7943,7 +7943,7 @@ class Graph:
|
|
7943
7943
|
incoming_edges = []
|
7944
7944
|
for edge in edges:
|
7945
7945
|
ev = Edge.EndVertex(edge)
|
7946
|
-
if Vertex.Distance(vertex, ev)
|
7946
|
+
if Vertex.Distance(vertex, ev) <= tolerance:
|
7947
7947
|
incoming_edges.append(edge)
|
7948
7948
|
return incoming_edges
|
7949
7949
|
|
@@ -8751,7 +8751,7 @@ class Graph:
|
|
8751
8751
|
longest_path = Topology.SelfMerge(Cluster.ByTopologies(new_edges), tolerance=tolerance)
|
8752
8752
|
|
8753
8753
|
sv = Topology.Vertices(longest_path)[0]
|
8754
|
-
if Vertex.Distance(sv, vertexB)
|
8754
|
+
if Vertex.Distance(sv, vertexB) <= tolerance: # Wire is reversed. Re-reverse it
|
8755
8755
|
if Topology.IsInstance(longest_path, "Edge"):
|
8756
8756
|
longest_path = Edge.Reverse(longest_path)
|
8757
8757
|
elif Topology.IsInstance(longest_path, "Wire"):
|
@@ -9048,7 +9048,7 @@ class Graph:
|
|
9048
9048
|
|
9049
9049
|
def vertexInList(vertex, vertexList, tolerance=0.0001):
|
9050
9050
|
for v in vertexList:
|
9051
|
-
if Vertex.Distance(v, vertex)
|
9051
|
+
if Vertex.Distance(v, vertex) <= tolerance:
|
9052
9052
|
return True
|
9053
9053
|
return False
|
9054
9054
|
|
@@ -9382,7 +9382,7 @@ class Graph:
|
|
9382
9382
|
outgoing_edges = []
|
9383
9383
|
for edge in edges:
|
9384
9384
|
sv = Edge.StartVertex(edge)
|
9385
|
-
if Vertex.Distance(vertex, sv)
|
9385
|
+
if Vertex.Distance(vertex, sv) <= tolerance:
|
9386
9386
|
outgoing_edges.append(edge)
|
9387
9387
|
return outgoing_edges
|
9388
9388
|
|
@@ -9481,7 +9481,7 @@ class Graph:
|
|
9481
9481
|
new_scores[i] = alpha * incoming_score + (1 - alpha) / num_vertices
|
9482
9482
|
|
9483
9483
|
# Check for convergence
|
9484
|
-
if all(abs(new_scores[i] - scores[i])
|
9484
|
+
if all(abs(new_scores[i] - scores[i]) <= tolerance for i in range(len(vertices))):
|
9485
9485
|
break
|
9486
9486
|
|
9487
9487
|
scores = new_scores
|
@@ -9938,7 +9938,7 @@ class Graph:
|
|
9938
9938
|
if Topology.IsInstance(shortest_path, "Edge"):
|
9939
9939
|
shortest_path = Wire.ByEdges([shortest_path])
|
9940
9940
|
sv = Topology.Vertices(shortest_path)[0]
|
9941
|
-
if Vertex.Distance(sv, gev)
|
9941
|
+
if Vertex.Distance(sv, gev) <= tolerance: # Path is reversed. Correct it.
|
9942
9942
|
if Topology.IsInstance(shortest_path, "Wire"):
|
9943
9943
|
shortest_path = Wire.Reverse(shortest_path)
|
9944
9944
|
shortest_path = Wire.OrientEdges(shortest_path, Wire.StartVertex(shortest_path), tolerance=tolerance)
|
@@ -10491,7 +10491,7 @@ class Graph:
|
|
10491
10491
|
if parent:
|
10492
10492
|
edge = Graph.Edge(graph, parent, vertex, tolerance=tolerance)
|
10493
10493
|
ev = Edge.EndVertex(edge)
|
10494
|
-
if Vertex.Distance(parent, ev)
|
10494
|
+
if Vertex.Distance(parent, ev) <= tolerance:
|
10495
10495
|
edge = Edge.Reverse(edge)
|
10496
10496
|
edges.append(edge)
|
10497
10497
|
if parent == None:
|
topologicpy/Helper.py
CHANGED
@@ -35,6 +35,61 @@ except:
|
|
35
35
|
warnings.warn("Helper - Error: Could not import numpy.")
|
36
36
|
|
37
37
|
class Helper:
|
38
|
+
@staticmethod
|
39
|
+
def BinAndAverage(listA, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
|
40
|
+
"""
|
41
|
+
Groups numbers within a specified tolerance into bins, calculates the average
|
42
|
+
of each bin, and returns a sorted list of these averages.
|
43
|
+
|
44
|
+
Parameters
|
45
|
+
----------
|
46
|
+
listA : list
|
47
|
+
The input list.
|
48
|
+
mantissa : int , optional
|
49
|
+
The desired length of the mantissa. The default is 6
|
50
|
+
tolerance : float , optional
|
51
|
+
The desired tolerance. The default is 0.0001.
|
52
|
+
silent : bool , optional
|
53
|
+
If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
|
54
|
+
|
55
|
+
Returns
|
56
|
+
-------
|
57
|
+
list
|
58
|
+
The sorted list of bin averages.
|
59
|
+
|
60
|
+
"""
|
61
|
+
if not isinstance(listA, list):
|
62
|
+
if not silent:
|
63
|
+
print("Helper.BinAndAverage = Error: The input listA parameter is not a valid list. Returning None.")
|
64
|
+
return None
|
65
|
+
|
66
|
+
if len(listA) < 1:
|
67
|
+
if not silent:
|
68
|
+
print("Helper.BinAndAverage = Error: The input listA parameter is not an empty list. Returning None.")
|
69
|
+
return None
|
70
|
+
|
71
|
+
if len(listA) == 1:
|
72
|
+
return listA
|
73
|
+
|
74
|
+
# Sort numbers to facilitate grouping
|
75
|
+
listA = sorted(listA)
|
76
|
+
bins = []
|
77
|
+
current_bin = [listA[0]]
|
78
|
+
|
79
|
+
# Group numbers into bins based on tolerance
|
80
|
+
for num in listA[1:]:
|
81
|
+
if abs(num - current_bin[-1]) <= tolerance:
|
82
|
+
current_bin.append(num)
|
83
|
+
else:
|
84
|
+
bins.append(current_bin)
|
85
|
+
current_bin = [num]
|
86
|
+
bins.append(current_bin) # Add the last bin
|
87
|
+
|
88
|
+
# Calculate averages of each bin
|
89
|
+
bin_averages = [round(sum(bin) / len(bin), mantissa) for bin in bins]
|
90
|
+
|
91
|
+
return sorted(bin_averages)
|
92
|
+
|
38
93
|
@staticmethod
|
39
94
|
def ClosestMatch(item, listA):
|
40
95
|
"""
|
topologicpy/Polyskel.py
CHANGED
@@ -137,7 +137,7 @@ class Line2:
|
|
137
137
|
def intersect(self, other):
|
138
138
|
# Line intersection formula
|
139
139
|
det = self.v.x * other.v.y - self.v.y * other.v.x
|
140
|
-
if abs(det)
|
140
|
+
if abs(det) <= EPSILON:
|
141
141
|
return None # Lines are parallel
|
142
142
|
|
143
143
|
dx = other.p.x - self.p.x
|
@@ -323,8 +323,8 @@ class _LAVertex:
|
|
323
323
|
# check eligibility of b
|
324
324
|
# a valid b should lie within the area limited by the edge and the bisectors of its two vertices:
|
325
325
|
xleft = _cross(edge.bisector_left.v.normalized(), (b - edge.bisector_left.p).normalized()) > -EPSILON
|
326
|
-
xright = _cross(edge.bisector_right.v.normalized(), (b - edge.bisector_right.p).normalized())
|
327
|
-
xedge = _cross(edge.edge.v.normalized(), (b - edge.edge.p).normalized())
|
326
|
+
xright = _cross(edge.bisector_right.v.normalized(), (b - edge.bisector_right.p).normalized()) <= EPSILON
|
327
|
+
xedge = _cross(edge.edge.v.normalized(), (b - edge.edge.p).normalized()) <= EPSILON
|
328
328
|
|
329
329
|
if not (xleft and xright and xedge):
|
330
330
|
log.debug("\t\tDiscarded candidate %s (%s-%s-%s)", b, xleft, xright, xedge)
|
topologicpy/Shell.py
CHANGED
@@ -1247,7 +1247,7 @@ class Shell():
|
|
1247
1247
|
return None
|
1248
1248
|
if toAngle < fromAngle:
|
1249
1249
|
toAngle += 360
|
1250
|
-
if abs(toAngle-fromAngle)
|
1250
|
+
if abs(toAngle-fromAngle) <= tolerance:
|
1251
1251
|
return None
|
1252
1252
|
fromAngle = math.radians(fromAngle)
|
1253
1253
|
toAngle = math.radians(toAngle)
|
@@ -1258,14 +1258,14 @@ class Shell():
|
|
1258
1258
|
temp = radiusA
|
1259
1259
|
radiusA = radiusB
|
1260
1260
|
radiusB = temp
|
1261
|
-
if abs(radiusA - radiusB)
|
1261
|
+
if abs(radiusA - radiusB) <= tolerance or radiusA <= tolerance:
|
1262
1262
|
return None
|
1263
1263
|
radiusRange = radiusA - radiusB
|
1264
1264
|
sides = int(abs(math.floor(sides)))
|
1265
1265
|
if sides < 3:
|
1266
1266
|
return None
|
1267
1267
|
rings = int(abs(rings))
|
1268
|
-
if radiusB
|
1268
|
+
if radiusB <= tolerance:
|
1269
1269
|
radiusB = 0
|
1270
1270
|
xOffset = 0
|
1271
1271
|
yOffset = 0
|
@@ -1516,7 +1516,7 @@ class Shell():
|
|
1516
1516
|
angle = abs(angle)
|
1517
1517
|
if angle >= 90-tolerance:
|
1518
1518
|
return None
|
1519
|
-
if angle
|
1519
|
+
if angle <= tolerance:
|
1520
1520
|
return None
|
1521
1521
|
origin = Topology.Centroid(face)
|
1522
1522
|
normal = Face.Normal(face, mantissa=mantissa)
|
topologicpy/Topology.py
CHANGED
@@ -291,7 +291,7 @@ class Topology():
|
|
291
291
|
subTopology = subTopologies[i]
|
292
292
|
if exclusive == True and usedTopologies[i] == 1:
|
293
293
|
continue
|
294
|
-
if Vertex.Distance(apCenter, subTopology)
|
294
|
+
if Vertex.Distance(apCenter, subTopology) <= tolerance:
|
295
295
|
context = topologic.Context.ByTopologyParameters(subTopology, 0.5, 0.5, 0.5)
|
296
296
|
_ = Aperture.ByTopologyContext(aperture, context)
|
297
297
|
if exclusive == True:
|
@@ -1288,7 +1288,7 @@ class Topology():
|
|
1288
1288
|
axes : str , optional
|
1289
1289
|
Sets what axes are to be used for rotating the bounding box. This can be any permutation or substring of "xyz". It is not case sensitive. The default is "xyz".
|
1290
1290
|
mantissa : int , optional
|
1291
|
-
The desired length of the mantissa. The default is 6
|
1291
|
+
The desired length of the mantissa. The default is 6.
|
1292
1292
|
tolerance : float , optional
|
1293
1293
|
The desired tolerance. The default is 0.0001.
|
1294
1294
|
|
@@ -1444,7 +1444,7 @@ class Topology():
|
|
1444
1444
|
|
1445
1445
|
baseWire = Wire.ByVertices([vb1, vb2, vb3, vb4], close=True)
|
1446
1446
|
baseFace = Face.ByWire(baseWire, tolerance=tolerance)
|
1447
|
-
if abs(z_max - z_min)
|
1447
|
+
if abs(z_max - z_min) <= tolerance:
|
1448
1448
|
box = baseFace
|
1449
1449
|
else:
|
1450
1450
|
box = Cell.ByThickenedFace(baseFace, planarize=False, thickness=abs(z_max - z_min), bothSides=False)
|
@@ -6735,7 +6735,7 @@ class Topology():
|
|
6735
6735
|
max_area = max(face_areas)
|
6736
6736
|
max_faces = []
|
6737
6737
|
for i, face_area in enumerate(face_areas):
|
6738
|
-
if abs(max_area - face_area)
|
6738
|
+
if abs(max_area - face_area) <= tolerance:
|
6739
6739
|
max_faces.append(faces[i])
|
6740
6740
|
return max_faces
|
6741
6741
|
|
@@ -6784,7 +6784,7 @@ class Topology():
|
|
6784
6784
|
max_length = max(edge_lengths)
|
6785
6785
|
max_edges = []
|
6786
6786
|
for i, edge_length in enumerate(edge_lengths):
|
6787
|
-
if abs(max_length - edge_length)
|
6787
|
+
if abs(max_length - edge_length) <= tolerance:
|
6788
6788
|
max_edges.append(edges[i])
|
6789
6789
|
return max_edges
|
6790
6790
|
|
@@ -8349,7 +8349,7 @@ class Topology():
|
|
8349
8349
|
min_length = min(edge_lengths)
|
8350
8350
|
min_edges = []
|
8351
8351
|
for i, edge_length in enumerate(edge_lengths):
|
8352
|
-
if abs(min_length - edge_length)
|
8352
|
+
if abs(min_length - edge_length) <= tolerance:
|
8353
8353
|
min_edges.append(edges[i])
|
8354
8354
|
return min_edges
|
8355
8355
|
|
@@ -8816,7 +8816,7 @@ class Topology():
|
|
8816
8816
|
min_area = min(face_areas)
|
8817
8817
|
min_faces = []
|
8818
8818
|
for i, face_area in enumerate(face_areas):
|
8819
|
-
if abs(min_area - face_area)
|
8819
|
+
if abs(min_area - face_area) <= tolerance:
|
8820
8820
|
min_faces.append(faces[i])
|
8821
8821
|
return min_faces
|
8822
8822
|
|
@@ -9585,7 +9585,7 @@ class Topology():
|
|
9585
9585
|
for vertex in vertices:
|
9586
9586
|
for selector in selectors:
|
9587
9587
|
d = Vertex.Distance(selector, vertex)
|
9588
|
-
if d
|
9588
|
+
if d <= tolerance:
|
9589
9589
|
vertex = Topology.SetDictionary(vertex, Topology.Dictionary(selector), silent=True)
|
9590
9590
|
break
|
9591
9591
|
if tranEdges == True:
|
@@ -9593,7 +9593,7 @@ class Topology():
|
|
9593
9593
|
for selector in selectors:
|
9594
9594
|
for edge in edges:
|
9595
9595
|
d = Vertex.Distance(selector, edge)
|
9596
|
-
if d
|
9596
|
+
if d <= tolerance:
|
9597
9597
|
|
9598
9598
|
edge = Topology.SetDictionary(edge, Topology.Dictionary(selector), silent=True)
|
9599
9599
|
break
|
@@ -9602,7 +9602,7 @@ class Topology():
|
|
9602
9602
|
for face in faces:
|
9603
9603
|
for selector in selectors:
|
9604
9604
|
d = Vertex.Distance(selector, face)
|
9605
|
-
if d
|
9605
|
+
if d <= tolerance:
|
9606
9606
|
face = Topology.SetDictionary(face, Topology.Dictionary(selector), silent=True)
|
9607
9607
|
break
|
9608
9608
|
if tranCells == True:
|
topologicpy/Vector.py
CHANGED
@@ -345,11 +345,11 @@ class Vector(list):
|
|
345
345
|
if not silent:
|
346
346
|
print("Vector.Coordinates - Error: The input vectorB parameter is not a valid vector. Returning Nonne.")
|
347
347
|
return None
|
348
|
-
if abs(vectorA[0])
|
348
|
+
if abs(vectorA[0]) <= tolerance and abs(vectorA[1]) <= tolerance:
|
349
349
|
if not silent:
|
350
350
|
print("Vector.CompassAngle - Error: The input vectorA parameter is vertical in the Z Axis. Returning Nonne.")
|
351
351
|
return None
|
352
|
-
if abs(vectorB[0])
|
352
|
+
if abs(vectorB[0]) <= tolerance and abs(vectorB[1]) <= tolerance:
|
353
353
|
if not silent:
|
354
354
|
print("Vector.CompassAngle - Error: The input vectorB parameter is vertical in the Z Axis. Returning Nonne.")
|
355
355
|
return None
|
@@ -404,7 +404,7 @@ class Vector(list):
|
|
404
404
|
x, y, z = vector
|
405
405
|
|
406
406
|
# Handle the origin
|
407
|
-
if abs(x)
|
407
|
+
if abs(x) <= tolerance and abs(y) <= tolerance and abs(z) <= tolerance:
|
408
408
|
return "Origin"
|
409
409
|
|
410
410
|
# Normalize vector to prevent magnitude bias
|
@@ -412,9 +412,9 @@ class Vector(list):
|
|
412
412
|
x, y, z = x / magnitude, y / magnitude, z / magnitude
|
413
413
|
|
414
414
|
# Apply tolerance to components
|
415
|
-
x = 0 if abs(x)
|
416
|
-
y = 0 if abs(y)
|
417
|
-
z = 0 if abs(z)
|
415
|
+
x = 0 if abs(x) <= tolerance else x
|
416
|
+
y = 0 if abs(y) <= tolerance else y
|
417
|
+
z = 0 if abs(z) <= tolerance else z
|
418
418
|
|
419
419
|
# Compass-based direction in the XY-plane
|
420
420
|
if x == 0 and y > 0:
|
@@ -553,18 +553,18 @@ class Vector(list):
|
|
553
553
|
if not silent:
|
554
554
|
print("Vector.Cross - Error: The input vectorB parameter is not a valid vector. Returning None.")
|
555
555
|
return None
|
556
|
-
if Vector.Magnitude(vector=vectorA, mantissa=mantissa)
|
556
|
+
if Vector.Magnitude(vector=vectorA, mantissa=mantissa) <= tolerance:
|
557
557
|
if not silent:
|
558
558
|
print("Vector.Cross - Error: The magnitude of the input vectorA parameter is less than the input tolerance parameter. Returning None.")
|
559
559
|
return None
|
560
|
-
if Vector.Magnitude(vector=vectorB, mantissa=mantissa)
|
560
|
+
if Vector.Magnitude(vector=vectorB, mantissa=mantissa) <= tolerance:
|
561
561
|
if not silent:
|
562
562
|
print("Vector.Cross - Error: The magnitude of the input vectorB parameter is less than the input tolerance parameter. Returning None.")
|
563
563
|
return None
|
564
564
|
vecA = np.array(vectorA)
|
565
565
|
vecB = np.array(vectorB)
|
566
566
|
vecC = list(np.cross(vecA, vecB))
|
567
|
-
if Vector.Magnitude(vecC)
|
567
|
+
if Vector.Magnitude(vecC) <= tolerance:
|
568
568
|
return [0, 0, 0]
|
569
569
|
return [round(vecC[0], mantissa), round(vecC[1], mantissa), round(vecC[2], mantissa)]
|
570
570
|
|
@@ -600,11 +600,11 @@ class Vector(list):
|
|
600
600
|
if not silent:
|
601
601
|
print("Vector.Dot - Error: The input vectorB parameter is not a valid vector. Returning None.")
|
602
602
|
return None
|
603
|
-
if Vector.Magnitude(vector=vectorA, mantissa=mantissa)
|
603
|
+
if Vector.Magnitude(vector=vectorA, mantissa=mantissa) <= tolerance:
|
604
604
|
if not silent:
|
605
605
|
print("Vector.Dot - Error: The magnitude of the input vectorA parameter is less than the input tolerance parameter. Returning None.")
|
606
606
|
return None
|
607
|
-
if Vector.Magnitude(vector=vectorB, mantissa=mantissa)
|
607
|
+
if Vector.Magnitude(vector=vectorB, mantissa=mantissa) <= tolerance:
|
608
608
|
if not silent:
|
609
609
|
print("Vector.Dot - Error: The magnitude of the input vectorB parameter is less than the input tolerance parameter. Returning None.")
|
610
610
|
return None
|
@@ -763,7 +763,7 @@ class Vector(list):
|
|
763
763
|
True if the input vectors are the same. False otherwise.
|
764
764
|
|
765
765
|
"""
|
766
|
-
return all(abs(a - b)
|
766
|
+
return all(abs(a - b) <= tolerance for a, b in zip(vectorA, vectorB))
|
767
767
|
|
768
768
|
@staticmethod
|
769
769
|
def Length(vector, mantissa: int = 6):
|
@@ -825,7 +825,7 @@ class Vector(list):
|
|
825
825
|
The created vector that multiplies the input vector by the input magnitude.
|
826
826
|
|
827
827
|
"""
|
828
|
-
if abs(magnitude)
|
828
|
+
if abs(magnitude) <= tolerance:
|
829
829
|
return [0.0] * len(vector)
|
830
830
|
scaled_vector = [component * (magnitude) for component in vector]
|
831
831
|
return scaled_vector
|
topologicpy/Vertex.py
CHANGED
@@ -801,7 +801,7 @@ class Vertex():
|
|
801
801
|
|
802
802
|
other_vertex = vertices[i]
|
803
803
|
distance = np.linalg.norm(np.array(vertex) - np.array(other_vertex))
|
804
|
-
if distance
|
804
|
+
if distance <= tolerance:
|
805
805
|
# Choose the coordinate with the least amount of decimal points
|
806
806
|
if count_decimal_points(other_vertex) < count_decimal_points(fused_vertex):
|
807
807
|
fused_vertex = other_vertex
|
@@ -870,7 +870,7 @@ class Vertex():
|
|
870
870
|
incoming_edges = []
|
871
871
|
for edge in edges:
|
872
872
|
ev = Edge.EndVertex(edge)
|
873
|
-
if Vertex.Distance(vertex, ev)
|
873
|
+
if Vertex.Distance(vertex, ev) <= tolerance:
|
874
874
|
incoming_edges.append(edge)
|
875
875
|
return incoming_edges
|
876
876
|
|
@@ -911,7 +911,7 @@ class Vertex():
|
|
911
911
|
return i
|
912
912
|
else:
|
913
913
|
d = Vertex.Distance(vertex, vertices[i])
|
914
|
-
if d
|
914
|
+
if d <= tolerance:
|
915
915
|
return i
|
916
916
|
return None
|
917
917
|
|
@@ -967,7 +967,7 @@ class Vertex():
|
|
967
967
|
|
968
968
|
n_p = nearest_points[0]
|
969
969
|
n_d = n_p[0]
|
970
|
-
if n_d
|
970
|
+
if n_d <= tolerance:
|
971
971
|
return n_p[1]
|
972
972
|
|
973
973
|
# Calculate the weights for each nearest point based on inverse distance
|
@@ -1138,7 +1138,7 @@ class Vertex():
|
|
1138
1138
|
return None
|
1139
1139
|
|
1140
1140
|
if Topology.IsInstance(topology, "Vertex"):
|
1141
|
-
return Vertex.Distance(vertex, topology)
|
1141
|
+
return Vertex.Distance(vertex, topology) <= tolerance
|
1142
1142
|
elif Topology.IsInstance(topology, "Edge"):
|
1143
1143
|
try:
|
1144
1144
|
parameter = Edge.ParameterAtVertex(topology, vertex)
|
@@ -1502,7 +1502,7 @@ class Vertex():
|
|
1502
1502
|
outgoing_edges = []
|
1503
1503
|
for edge in edges:
|
1504
1504
|
sv = Edge.StartVertex(edge)
|
1505
|
-
if Vertex.Distance(vertex, sv)
|
1505
|
+
if Vertex.Distance(vertex, sv) <= tolerance:
|
1506
1506
|
outgoing_edges.append(edge)
|
1507
1507
|
return outgoing_edges
|
1508
1508
|
|
topologicpy/Wire.py
CHANGED
@@ -774,7 +774,7 @@ class Wire():
|
|
774
774
|
# We want this difference to be as close to 0 as possible
|
775
775
|
loss = (new_area - area) ** 2
|
776
776
|
# If the loss is less than the tolerance, accept the result and return a loss of 0.
|
777
|
-
if loss
|
777
|
+
if loss <= tolerance:
|
778
778
|
return 0
|
779
779
|
# Otherwise, return the actual loss value.
|
780
780
|
return loss
|
@@ -960,10 +960,10 @@ class Wire():
|
|
960
960
|
print("Wire.Circle - Error: The input placement parameter is not a recognized string. Returning None.")
|
961
961
|
return None
|
962
962
|
radius = abs(radius)
|
963
|
-
if radius
|
963
|
+
if radius <= tolerance:
|
964
964
|
return None
|
965
965
|
|
966
|
-
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2]))
|
966
|
+
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) <= tolerance:
|
967
967
|
return None
|
968
968
|
baseV = []
|
969
969
|
xList = []
|
@@ -971,7 +971,7 @@ class Wire():
|
|
971
971
|
|
972
972
|
if toAngle < fromAngle:
|
973
973
|
toAngle += 360
|
974
|
-
if abs(toAngle-fromAngle)
|
974
|
+
if abs(toAngle-fromAngle) <= tolerance:
|
975
975
|
return None
|
976
976
|
angleRange = toAngle - fromAngle
|
977
977
|
fromAngle = math.radians(fromAngle)
|
@@ -1057,7 +1057,7 @@ class Wire():
|
|
1057
1057
|
if i1 == None or i2 == None:
|
1058
1058
|
print("Wire.Close - Error: Something went wrong. Returning None.")
|
1059
1059
|
return None
|
1060
|
-
if d
|
1060
|
+
if d <= tolerance:
|
1061
1061
|
g_vertices[i1] = Vertex.Coordinates(end)
|
1062
1062
|
g_vertices[i2] = Vertex.Coordinates(end)
|
1063
1063
|
else:
|
@@ -1780,7 +1780,7 @@ class Wire():
|
|
1780
1780
|
|
1781
1781
|
def vIndex(v, vList, tolerance=0.0001):
|
1782
1782
|
for i in range(len(vList)):
|
1783
|
-
if Vertex.Distance(v, vList[i])
|
1783
|
+
if Vertex.Distance(v, vList[i]) <= tolerance:
|
1784
1784
|
return i+1
|
1785
1785
|
return None
|
1786
1786
|
|
@@ -2080,7 +2080,7 @@ class Wire():
|
|
2080
2080
|
return None
|
2081
2081
|
if placement.lower() not in ["center", "lowerleft"]:
|
2082
2082
|
return None
|
2083
|
-
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2]))
|
2083
|
+
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) <= tolerance:
|
2084
2084
|
return None
|
2085
2085
|
width = abs(width)
|
2086
2086
|
length = abs(length)
|
@@ -2089,7 +2089,7 @@ class Wire():
|
|
2089
2089
|
majorAxisLength=abs(majorAxisLength)
|
2090
2090
|
minorAxisLength=abs(minorAxisLength)
|
2091
2091
|
sides = abs(sides)
|
2092
|
-
if width
|
2092
|
+
if width <= tolerance or length <= tolerance or focalLength <= tolerance or eccentricity <= tolerance or majorAxisLength <= tolerance or minorAxisLength <= tolerance or sides < 3:
|
2093
2093
|
return None
|
2094
2094
|
if inputMode == 1:
|
2095
2095
|
w = width
|
@@ -2127,7 +2127,7 @@ class Wire():
|
|
2127
2127
|
|
2128
2128
|
if toAngle < fromAngle:
|
2129
2129
|
toAngle += 360
|
2130
|
-
if abs(toAngle - fromAngle)
|
2130
|
+
if abs(toAngle - fromAngle) <= tolerance:
|
2131
2131
|
return None
|
2132
2132
|
|
2133
2133
|
angleRange = toAngle - fromAngle
|
@@ -2310,7 +2310,7 @@ class Wire():
|
|
2310
2310
|
if len(edges) == 2:
|
2311
2311
|
for edge in edges:
|
2312
2312
|
ev = Edge.EndVertex(edge)
|
2313
|
-
if Vertex.Distance(v, ev)
|
2313
|
+
if Vertex.Distance(v, ev) <= tolerance:
|
2314
2314
|
edge0 = edge
|
2315
2315
|
else:
|
2316
2316
|
edge1 = edge
|
@@ -3184,7 +3184,7 @@ class Wire():
|
|
3184
3184
|
if len(edges) == 2:
|
3185
3185
|
for edge in edges:
|
3186
3186
|
ev = Edge.EndVertex(edge)
|
3187
|
-
if Vertex.Distance(v, ev)
|
3187
|
+
if Vertex.Distance(v, ev) <= tolerance:
|
3188
3188
|
edge0 = edge
|
3189
3189
|
else:
|
3190
3190
|
edge1 = edge
|
@@ -3378,10 +3378,10 @@ class Wire():
|
|
3378
3378
|
while remaining_edges:
|
3379
3379
|
next_edge = None
|
3380
3380
|
for edge in remaining_edges:
|
3381
|
-
if Vertex.Distance(Edge.StartVertex(edge), current_vertex)
|
3381
|
+
if Vertex.Distance(Edge.StartVertex(edge), current_vertex) <= tolerance:
|
3382
3382
|
next_edge = edge
|
3383
3383
|
break
|
3384
|
-
elif Vertex.Distance(Edge.EndVertex(edge), current_vertex)
|
3384
|
+
elif Vertex.Distance(Edge.EndVertex(edge), current_vertex) <= tolerance:
|
3385
3385
|
next_edge = Edge.Reverse(edge)
|
3386
3386
|
break
|
3387
3387
|
|
@@ -3565,10 +3565,10 @@ class Wire():
|
|
3565
3565
|
return None
|
3566
3566
|
width = abs(width)
|
3567
3567
|
length = abs(length)
|
3568
|
-
if width
|
3568
|
+
if width <= tolerance or length <= tolerance:
|
3569
3569
|
print("Wire.Rectangle - Error: One or more of the specified dimensions is below the tolerance value. Returning None.")
|
3570
3570
|
return None
|
3571
|
-
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2]))
|
3571
|
+
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) <= tolerance:
|
3572
3572
|
print("Wire.Rectangle - Error: The direction vector magnitude is below the tolerance value. Returning None.")
|
3573
3573
|
return None
|
3574
3574
|
xOffset = 0
|
@@ -4155,7 +4155,7 @@ class Wire():
|
|
4155
4155
|
sorted_areas = sorted([(area, idx) for area, idx in areas[1:-1] if area is not None])
|
4156
4156
|
|
4157
4157
|
# Remove points with area below the tolerance threshold
|
4158
|
-
remove_indices = {idx for area, idx in sorted_areas if area
|
4158
|
+
remove_indices = {idx for area, idx in sorted_areas if area <= tolerance}
|
4159
4159
|
|
4160
4160
|
# Construct the simplified list of points
|
4161
4161
|
simplified_points = [point for i, point in enumerate(points) if i not in remove_indices]
|
@@ -4322,7 +4322,7 @@ class Wire():
|
|
4322
4322
|
if not placement.lower() in ["center", "lowerleft", "upperleft", "lowerright", "upperright"]:
|
4323
4323
|
print("Wire.Spiral - Error: the input placement string is not one of center, lowerleft, upperleft, lowerright, or upperright. Returning None.")
|
4324
4324
|
return None
|
4325
|
-
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2]))
|
4325
|
+
if (abs(direction[0]) + abs(direction[1]) + abs(direction[2])) <= tolerance:
|
4326
4326
|
print("Wire.Spiral - Error: the input direction vector is not a valid direction. Returning None.")
|
4327
4327
|
return None
|
4328
4328
|
|
@@ -4534,7 +4534,7 @@ class Wire():
|
|
4534
4534
|
print("Wire.Squircle - Error: The input placement parameter is not a recognized string. Returning None.")
|
4535
4535
|
return None
|
4536
4536
|
radius = abs(radius)
|
4537
|
-
if radius
|
4537
|
+
if radius <= tolerance:
|
4538
4538
|
return None
|
4539
4539
|
|
4540
4540
|
if a <= 0:
|
@@ -4602,7 +4602,7 @@ class Wire():
|
|
4602
4602
|
return None
|
4603
4603
|
radiusA = abs(radiusA)
|
4604
4604
|
radiusB = abs(radiusB)
|
4605
|
-
if radiusA
|
4605
|
+
if radiusA <= tolerance or radiusB <= tolerance:
|
4606
4606
|
return None
|
4607
4607
|
rays = abs(rays)
|
4608
4608
|
if rays < 3:
|
@@ -4741,7 +4741,7 @@ class Wire():
|
|
4741
4741
|
widthA = abs(widthA)
|
4742
4742
|
widthB = abs(widthB)
|
4743
4743
|
length = abs(length)
|
4744
|
-
if widthA
|
4744
|
+
if widthA <= tolerance or widthB <= tolerance or length <= tolerance:
|
4745
4745
|
return None
|
4746
4746
|
if not placement.lower() in ["center", "lowerleft", "upperleft", "lowerright", "upperright"]:
|
4747
4747
|
return None
|
@@ -4950,7 +4950,7 @@ class Wire():
|
|
4950
4950
|
print("Wire.VertexDistance - Error: The input vertex parameter is not a valid topologic vertex. Returning None.")
|
4951
4951
|
return None
|
4952
4952
|
wire_length = Wire.Length(wire)
|
4953
|
-
if wire_length
|
4953
|
+
if wire_length <= tolerance:
|
4954
4954
|
print("Wire.VertexDistance: The input wire parameter is a degenerate topologic wire. Returning None.")
|
4955
4955
|
return None
|
4956
4956
|
if not Topology.IsInstance(origin, "Vertex"):
|
@@ -5030,12 +5030,12 @@ class Wire():
|
|
5030
5030
|
print("Wire.VertexByDistance - Error: The input wire parameter is not a valid topologic wire. Returning None.")
|
5031
5031
|
return None
|
5032
5032
|
wire_length = Wire.Length(wire)
|
5033
|
-
if wire_length
|
5033
|
+
if wire_length <= tolerance:
|
5034
5034
|
print("Wire.VertexByDistance: The input wire parameter is a degenerate topologic wire. Returning None.")
|
5035
5035
|
return None
|
5036
|
-
if abs(distance)
|
5036
|
+
if abs(distance) <= tolerance:
|
5037
5037
|
return Wire.StartVertex(wire)
|
5038
|
-
if abs(distance - wire_length)
|
5038
|
+
if abs(distance - wire_length) <= tolerance:
|
5039
5039
|
return Wire.EndVertex(wire)
|
5040
5040
|
if not Wire.IsManifold(wire):
|
5041
5041
|
print("Wire.VertexAtParameter - Error: The input wire parameter is non-manifold. Returning None.")
|
@@ -5048,9 +5048,9 @@ class Wire():
|
|
5048
5048
|
if not Vertex.IsInternal(origin, wire, tolerance=tolerance):
|
5049
5049
|
print("Wire.VertexByDistance - Error: The input origin parameter is not internal to the input wire parameter. Returning None.")
|
5050
5050
|
return None
|
5051
|
-
if Vertex.Distance(Wire.StartVertex(wire), origin)
|
5051
|
+
if Vertex.Distance(Wire.StartVertex(wire), origin) <= tolerance:
|
5052
5052
|
u = distance/wire_length
|
5053
|
-
elif Vertex.Distance(Wire.EndVertex(wire), origin)
|
5053
|
+
elif Vertex.Distance(Wire.EndVertex(wire), origin) <= tolerance:
|
5054
5054
|
u = 1 - distance/wire_length
|
5055
5055
|
else:
|
5056
5056
|
d = Wire.VertexDistance(wire, origin) + distance
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.8.
|
1
|
+
__version__ = '0.8.10'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.10
|
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
|
@@ -0,0 +1,36 @@
|
|
1
|
+
topologicpy/ANN.py,sha256=m_WxD1lgQqDhUpaM20Lia6TmJACDYaAE96wigsi-99U,47932
|
2
|
+
topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
|
3
|
+
topologicpy/BVH.py,sha256=1q2lR5eDs7Wnwv7M-Kr7Cj3GG_iy7d1ddaZqWGHdX-w,12932
|
4
|
+
topologicpy/Cell.py,sha256=Wwr2RsNEagfdt4Uz0GYosRTgNQj0pc5NOlzEWbL7cjQ,114343
|
5
|
+
topologicpy/CellComplex.py,sha256=23bO0RYFIg6MOyt3PMFayaK523Alt8aHhc6UyJO02X0,51610
|
6
|
+
topologicpy/Cluster.py,sha256=o5jdMRpcGfSGGiXQdFg-e9XcnBF5AqTj3xb1nSpwJWE,58606
|
7
|
+
topologicpy/Color.py,sha256=q9xsGmxFMz7sQKmygwSVS12GaTRB-OT0-_i6t3-cthE,20307
|
8
|
+
topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
|
9
|
+
topologicpy/DGL.py,sha256=M_znFtyPBJJz-iXLYZs2wwBj24fhevIo739dGha0chM,139041
|
10
|
+
topologicpy/Dictionary.py,sha256=t0O7Du-iPq46FyKqZfcjHfsUK1E8GS_e67R2V5cpkbw,33186
|
11
|
+
topologicpy/Edge.py,sha256=yxkCVDYBflJNEYxnjMmlyvbkpg8TNy7y5bSH3yQ4jzs,71418
|
12
|
+
topologicpy/EnergyModel.py,sha256=UoQ9Jm-hYsN383CbcLKw-y6BKitRHj0uyh84yQ-8ACg,53856
|
13
|
+
topologicpy/Face.py,sha256=a6rPTdgf4yhoH29kwV_48U_XYtdvNWdHnkErmMBp2CU,180759
|
14
|
+
topologicpy/Graph.py,sha256=6pRgWtkq9a5p7uXiPq2O4yMEJZG6H7A5wA44bjGOP3s,497470
|
15
|
+
topologicpy/Grid.py,sha256=2s9cSlWldivn1i9EUz4OOokJyANveqmRe_vR93CAndI,18245
|
16
|
+
topologicpy/Helper.py,sha256=4H5KPiv_eiEs489UOOyGLe9RaeoZIfmMh3mk_YCHmXg,29100
|
17
|
+
topologicpy/Honeybee.py,sha256=Y_El6M8x3ixvvIe_VcRiwj_4C89ZZg5_WlT7adbCkpw,21849
|
18
|
+
topologicpy/Matrix.py,sha256=ydw0EH4rZcGBFeLmBHPIyuk57DVKKL3M1GcArkFsYxM,10941
|
19
|
+
topologicpy/Neo4j.py,sha256=BKOF29fRgXmdpMGkrNzuYbyqgCJ6ElPPMYlfTxXiVbc,22392
|
20
|
+
topologicpy/Plotly.py,sha256=xfd_c2Mcam5KP-gDD-esl42RVXW5TSJsUCCqhUg1VFk,115788
|
21
|
+
topologicpy/Polyskel.py,sha256=DDUayC29LI1EkxdK09F0DgGyH-NCOU1LE3J2Imz0rEI,19832
|
22
|
+
topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
|
23
|
+
topologicpy/Shell.py,sha256=--dJoSdz6BapxVEyG2DI0W5apO_xwLORj5qmR15yl2Y,87983
|
24
|
+
topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
|
25
|
+
topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
|
26
|
+
topologicpy/Topology.py,sha256=zFNNxiXRsDURF4FABfU3aG0mEp-qYYmxjADksYXRIgI,463941
|
27
|
+
topologicpy/Vector.py,sha256=rwMKNJQs7SsWc7bhGuxHAjkJA8s0w46xnY0Xo2zOPR0,39590
|
28
|
+
topologicpy/Vertex.py,sha256=70bee44uuf1d-uk3kL_pKPJKduJLdjve14mmLpcaT3s,78511
|
29
|
+
topologicpy/Wire.py,sha256=CYd8M774E6Pv9vDIrOoKWV6nKo2tNOi3xREQL9WE808,233433
|
30
|
+
topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
|
31
|
+
topologicpy/version.py,sha256=xfh7QQ1d8queik59T_oYOabvDZyIi-O8o2ByZ-QACcQ,23
|
32
|
+
topologicpy-0.8.10.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
33
|
+
topologicpy-0.8.10.dist-info/METADATA,sha256=MDU41HIFzabAK1nEmY8rsdZDpwG3vwgBi7PMc9Tzp_Y,10513
|
34
|
+
topologicpy-0.8.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
35
|
+
topologicpy-0.8.10.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
36
|
+
topologicpy-0.8.10.dist-info/RECORD,,
|
@@ -1,36 +0,0 @@
|
|
1
|
-
topologicpy/ANN.py,sha256=m_WxD1lgQqDhUpaM20Lia6TmJACDYaAE96wigsi-99U,47932
|
2
|
-
topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
|
3
|
-
topologicpy/BVH.py,sha256=mKVCAu9K8qzcWXtPDVH5usXZV1DNNNJl4n3rU5Lh1ZM,12931
|
4
|
-
topologicpy/Cell.py,sha256=9bF1pS0oyYmUzyXZ4zAQrwJPrQ7KeHRAo8OZudp_2Kg,114341
|
5
|
-
topologicpy/CellComplex.py,sha256=-s8RKGa2H1eqLO7g6qyQvvuFMFJ0aIgXvIr9kOVgpjA,51608
|
6
|
-
topologicpy/Cluster.py,sha256=o5jdMRpcGfSGGiXQdFg-e9XcnBF5AqTj3xb1nSpwJWE,58606
|
7
|
-
topologicpy/Color.py,sha256=q9xsGmxFMz7sQKmygwSVS12GaTRB-OT0-_i6t3-cthE,20307
|
8
|
-
topologicpy/Context.py,sha256=ppApYKngZZCQBFWaxIMi2z2dokY23c935IDCBosxDAE,3055
|
9
|
-
topologicpy/DGL.py,sha256=M_znFtyPBJJz-iXLYZs2wwBj24fhevIo739dGha0chM,139041
|
10
|
-
topologicpy/Dictionary.py,sha256=t0O7Du-iPq46FyKqZfcjHfsUK1E8GS_e67R2V5cpkbw,33186
|
11
|
-
topologicpy/Edge.py,sha256=lWwJdQkAhiH5POB7TN6HSLv03g2jXHzBU7e2fE3eAno,71340
|
12
|
-
topologicpy/EnergyModel.py,sha256=UoQ9Jm-hYsN383CbcLKw-y6BKitRHj0uyh84yQ-8ACg,53856
|
13
|
-
topologicpy/Face.py,sha256=D1g4O5i5QMPZvIoX06Z-FsyNsYBDkCiHWJp00uqnr5o,180742
|
14
|
-
topologicpy/Graph.py,sha256=yjD778MyWFLmUEryGFEzFZOJmnrZwkqrVYvpmH76Oxs,497462
|
15
|
-
topologicpy/Grid.py,sha256=2s9cSlWldivn1i9EUz4OOokJyANveqmRe_vR93CAndI,18245
|
16
|
-
topologicpy/Helper.py,sha256=DAAE_Ie_ekeMnCvcW08xXRwSAGCkjrS4lbz-o3ELuY4,27172
|
17
|
-
topologicpy/Honeybee.py,sha256=Y_El6M8x3ixvvIe_VcRiwj_4C89ZZg5_WlT7adbCkpw,21849
|
18
|
-
topologicpy/Matrix.py,sha256=ydw0EH4rZcGBFeLmBHPIyuk57DVKKL3M1GcArkFsYxM,10941
|
19
|
-
topologicpy/Neo4j.py,sha256=BKOF29fRgXmdpMGkrNzuYbyqgCJ6ElPPMYlfTxXiVbc,22392
|
20
|
-
topologicpy/Plotly.py,sha256=xfd_c2Mcam5KP-gDD-esl42RVXW5TSJsUCCqhUg1VFk,115788
|
21
|
-
topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
|
22
|
-
topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
|
23
|
-
topologicpy/Shell.py,sha256=fLRnQ79vtdBDRW1Xn8Gaap34XheGbw7UBFd-ALJ2Y1g,87978
|
24
|
-
topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
|
25
|
-
topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
|
26
|
-
topologicpy/Topology.py,sha256=qw64d3Ct6u7W8Fy_-JIg3_xsyOzDIQ1hdnpxF2p_wH4,463931
|
27
|
-
topologicpy/Vector.py,sha256=3gW0Y7mTcpc6ctjSfRWQXGKjIyHASKrMyIyPDT0kO2E,39573
|
28
|
-
topologicpy/Vertex.py,sha256=8_7iGDPlNWsiNfxcuNRO5u7P07i1Y58Gprw7KtA2Wmw,78505
|
29
|
-
topologicpy/Wire.py,sha256=Pt2li4cZ1omQKcMDCOqdB01ZKqjA4KBR0K3lGNVUoDs,233398
|
30
|
-
topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
|
31
|
-
topologicpy/version.py,sha256=NlRwwFdz-gLvpPJ1P15liW62rdqtILNRJEm3y_yv3z8,22
|
32
|
-
topologicpy-0.8.9.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
33
|
-
topologicpy-0.8.9.dist-info/METADATA,sha256=cFgD49CaDIZRj1a8FDEMkyw2dINg6WQZxTqbp55p--4,10512
|
34
|
-
topologicpy-0.8.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
35
|
-
topologicpy-0.8.9.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
36
|
-
topologicpy-0.8.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|