topologicpy 0.4.39__py3-none-any.whl → 0.4.40__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/Cell.py +2 -1
- topologicpy/CellComplex.py +12 -17
- topologicpy/Edge.py +2 -1
- topologicpy/EnergyModel.py +1 -2
- topologicpy/Face.py +46 -65
- topologicpy/Graph.py +62 -60
- topologicpy/Plotly.py +12 -12
- topologicpy/Shell.py +11 -6
- topologicpy/Topology.py +33 -15
- topologicpy/Vertex.py +131 -11
- topologicpy/Wire.py +35 -25
- topologicpy/__init__.py +1 -1
- {topologicpy-0.4.39.dist-info → topologicpy-0.4.40.dist-info}/METADATA +1 -1
- {topologicpy-0.4.39.dist-info → topologicpy-0.4.40.dist-info}/RECORD +17 -17
- {topologicpy-0.4.39.dist-info → topologicpy-0.4.40.dist-info}/WHEEL +1 -1
- {topologicpy-0.4.39.dist-info → topologicpy-0.4.40.dist-info}/LICENSE +0 -0
- {topologicpy-0.4.39.dist-info → topologicpy-0.4.40.dist-info}/top_level.txt +0 -0
topologicpy/Topology.py
CHANGED
|
@@ -1429,7 +1429,7 @@ class Topology():
|
|
|
1429
1429
|
url = '/dns/'+url+'/tcp/'+port+'/https'
|
|
1430
1430
|
client = ipfshttpclient.connect(url)
|
|
1431
1431
|
brepString = client.cat(hash_).decode("utf-8")
|
|
1432
|
-
topology = Topology.
|
|
1432
|
+
topology = Topology.ByBREPString(brepString)
|
|
1433
1433
|
return topology
|
|
1434
1434
|
'''
|
|
1435
1435
|
@staticmethod
|
|
@@ -1850,12 +1850,10 @@ class Topology():
|
|
|
1850
1850
|
if not path:
|
|
1851
1851
|
print("Topology.ByJSONPath - Error: the input path is not a valid path. Returning None.")
|
|
1852
1852
|
return None
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
return None
|
|
1858
|
-
return Topology.ByJSONFile(file=file, tolerance=tolerance)
|
|
1853
|
+
data = None
|
|
1854
|
+
with open(path) as file:
|
|
1855
|
+
data = Topology.ByJSONFile(file=file, tolerance=tolerance)
|
|
1856
|
+
return data
|
|
1859
1857
|
|
|
1860
1858
|
@staticmethod
|
|
1861
1859
|
def ByOBJString(string, transposeAxes = True, progressBar=False, renderer="notebook", tolerance=0.0001):
|
|
@@ -2773,7 +2771,7 @@ class Topology():
|
|
|
2773
2771
|
except:
|
|
2774
2772
|
raise Exception("Error: Could not create a new file at the following location: "+path)
|
|
2775
2773
|
if (f):
|
|
2776
|
-
s =
|
|
2774
|
+
s = Topology.BREPString(topology, version)
|
|
2777
2775
|
f.write(s)
|
|
2778
2776
|
f.close()
|
|
2779
2777
|
return True
|
|
@@ -2820,7 +2818,7 @@ class Topology():
|
|
|
2820
2818
|
except:
|
|
2821
2819
|
raise Exception("Error: Could not create a new file at the following location: "+path)
|
|
2822
2820
|
if (f):
|
|
2823
|
-
topString = topology.
|
|
2821
|
+
topString = topology.BREPString()
|
|
2824
2822
|
f.write(topString)
|
|
2825
2823
|
f.close()
|
|
2826
2824
|
return True
|
|
@@ -3996,7 +3994,7 @@ class Topology():
|
|
|
3996
3994
|
try:
|
|
3997
3995
|
newTopology = Topology.Translate(topology, x, y, z)
|
|
3998
3996
|
except:
|
|
3999
|
-
print("ERROR: (Topologic>TopologyUtility.Place) operation failed. Returning None.")
|
|
3997
|
+
print("Topology.Place - ERROR: (Topologic>TopologyUtility.Place) operation failed. Returning None.")
|
|
4000
3998
|
newTopology = None
|
|
4001
3999
|
return newTopology
|
|
4002
4000
|
|
|
@@ -4550,7 +4548,7 @@ class Topology():
|
|
|
4550
4548
|
return new_topology
|
|
4551
4549
|
|
|
4552
4550
|
@staticmethod
|
|
4553
|
-
def Rotate(topology, origin=None, x=0, y=0, z=1, degree=0):
|
|
4551
|
+
def Rotate(topology, origin=None, x=0, y=0, z=1, degree=0, angTolerance=0.001):
|
|
4554
4552
|
"""
|
|
4555
4553
|
Rotates the input topology
|
|
4556
4554
|
|
|
@@ -4568,6 +4566,8 @@ class Topology():
|
|
|
4568
4566
|
The 'z' component of the rotation axis. The default is 0.
|
|
4569
4567
|
degree : float , optional
|
|
4570
4568
|
The angle of rotation in degrees. The default is 0.
|
|
4569
|
+
angTolerance : float , optional
|
|
4570
|
+
The angle tolerance in degrees under which no rotation is carried out. The default is 0.001 degrees.
|
|
4571
4571
|
|
|
4572
4572
|
Returns
|
|
4573
4573
|
-------
|
|
@@ -4576,13 +4576,21 @@ class Topology():
|
|
|
4576
4576
|
|
|
4577
4577
|
"""
|
|
4578
4578
|
from topologicpy.Vertex import Vertex
|
|
4579
|
+
from topologicpy.Topology import Topology
|
|
4579
4580
|
if not isinstance(topology, topologic.Topology):
|
|
4580
4581
|
return None
|
|
4581
4582
|
if not origin:
|
|
4582
4583
|
origin = Vertex.ByCoordinates(0,0,0)
|
|
4583
4584
|
if not isinstance(origin, topologic.Vertex):
|
|
4584
4585
|
return None
|
|
4585
|
-
|
|
4586
|
+
returnTopology = topology
|
|
4587
|
+
if abs(degree) >= angTolerance:
|
|
4588
|
+
try:
|
|
4589
|
+
returnTopology = topologic.TopologyUtility.Rotate(topology, origin, x, y, z, degree)
|
|
4590
|
+
except:
|
|
4591
|
+
print("Topology.Rotate - Error: (topologic.TopologyUtility.Rotate) operation failed. Returning None.")
|
|
4592
|
+
return None
|
|
4593
|
+
return returnTopology
|
|
4586
4594
|
|
|
4587
4595
|
@staticmethod
|
|
4588
4596
|
def Scale(topology, origin=None, x=1, y=1, z=1):
|
|
@@ -4619,7 +4627,7 @@ class Topology():
|
|
|
4619
4627
|
try:
|
|
4620
4628
|
newTopology = topologic.TopologyUtility.Scale(topology, origin, x, y, z)
|
|
4621
4629
|
except:
|
|
4622
|
-
print("ERROR: (Topologic>TopologyUtility.Scale) operation failed. Returning None.")
|
|
4630
|
+
print("Topology.Scale - ERROR: (Topologic>TopologyUtility.Scale) operation failed. Returning None.")
|
|
4623
4631
|
newTopology = None
|
|
4624
4632
|
return newTopology
|
|
4625
4633
|
|
|
@@ -5227,7 +5235,9 @@ class Topology():
|
|
|
5227
5235
|
topologies = []
|
|
5228
5236
|
unit_degree = degree / float(sides)
|
|
5229
5237
|
for i in range(sides+1):
|
|
5230
|
-
|
|
5238
|
+
tempTopology = Topology.Rotate(topology, origin, direction[0], direction[1], direction[2], unit_degree*i)
|
|
5239
|
+
if tempTopology:
|
|
5240
|
+
topologies.append(tempTopology)
|
|
5231
5241
|
returnTopology = None
|
|
5232
5242
|
if topology.Type() == topologic.Vertex.Type():
|
|
5233
5243
|
returnTopology = Wire.ByVertices(topologies, False)
|
|
@@ -5318,7 +5328,15 @@ class Topology():
|
|
|
5318
5328
|
if not isinstance(topology, topologic.Topology):
|
|
5319
5329
|
print("Topology.BREPString - Error: the input topology is not a valid topology. Returning None.")
|
|
5320
5330
|
return None
|
|
5321
|
-
|
|
5331
|
+
st = None
|
|
5332
|
+
try:
|
|
5333
|
+
st = topologic.Topology.String(topology, version)
|
|
5334
|
+
except:
|
|
5335
|
+
try:
|
|
5336
|
+
st = topologic.Topology.BREPString(topology, version)
|
|
5337
|
+
except:
|
|
5338
|
+
st = None
|
|
5339
|
+
return st
|
|
5322
5340
|
|
|
5323
5341
|
@staticmethod
|
|
5324
5342
|
def Vertices(topology):
|
topologicpy/Vertex.py
CHANGED
|
@@ -296,9 +296,9 @@ class Vertex(Topology):
|
|
|
296
296
|
return vertices
|
|
297
297
|
|
|
298
298
|
@staticmethod
|
|
299
|
-
def Distance(vertex: topologic.Vertex, topology: topologic.Topology, mantissa: int = 4) -> float:
|
|
299
|
+
def Distance(vertex: topologic.Vertex, topology: topologic.Topology, includeCentroid: bool =True, mantissa: int = 4) -> float:
|
|
300
300
|
"""
|
|
301
|
-
Returns the distance between the input vertex and the input topology.
|
|
301
|
+
Returns the distance between the input vertex and the input topology. This method returns the distance to the closest sub-topology in the input topology, optionally including its centroid.
|
|
302
302
|
|
|
303
303
|
Parameters
|
|
304
304
|
----------
|
|
@@ -306,6 +306,8 @@ class Vertex(Topology):
|
|
|
306
306
|
The input vertex.
|
|
307
307
|
topology : topologic.Topology
|
|
308
308
|
The input topology.
|
|
309
|
+
includeCentroid : bool
|
|
310
|
+
If set to True, the centroid of the input topology will be considered in finding the nearest subTopology to the input vertex. The default is True.
|
|
309
311
|
mantissa: int , optional
|
|
310
312
|
The desired length of the mantissa. The default is 4.
|
|
311
313
|
|
|
@@ -315,9 +317,126 @@ class Vertex(Topology):
|
|
|
315
317
|
The distance between the input vertex and the input topology.
|
|
316
318
|
|
|
317
319
|
"""
|
|
320
|
+
import numpy as np
|
|
321
|
+
from topologicpy.Edge import Edge
|
|
322
|
+
from topologicpy.Wire import Wire
|
|
323
|
+
from topologicpy.Face import Face
|
|
324
|
+
from topologicpy.Shell import Shell
|
|
325
|
+
from topologicpy.Cell import Cell
|
|
326
|
+
from topologicpy.Cluster import Cluster
|
|
327
|
+
|
|
328
|
+
def distance_point_to_point(point1, point2):
|
|
329
|
+
# Convert input points to NumPy arrays
|
|
330
|
+
point1 = np.array(point1)
|
|
331
|
+
point2 = np.array(point2)
|
|
332
|
+
|
|
333
|
+
# Calculate the Euclidean distance
|
|
334
|
+
distance = np.linalg.norm(point1 - point2)
|
|
335
|
+
|
|
336
|
+
return distance
|
|
337
|
+
|
|
338
|
+
def distance_point_to_line(point, line_start, line_end):
|
|
339
|
+
# Convert input points to NumPy arrays for vector operations
|
|
340
|
+
point = np.array(point)
|
|
341
|
+
line_start = np.array(line_start)
|
|
342
|
+
line_end = np.array(line_end)
|
|
343
|
+
|
|
344
|
+
# Calculate the direction vector of the edge
|
|
345
|
+
line_direction = line_end - line_start
|
|
346
|
+
|
|
347
|
+
# Vector from the edge's starting point to the point
|
|
348
|
+
point_to_start = point - line_start
|
|
349
|
+
|
|
350
|
+
# Calculate the parameter 't' where the projection of the point onto the edge occurs
|
|
351
|
+
t = np.dot(point_to_start, line_direction) / np.dot(line_direction, line_direction)
|
|
352
|
+
|
|
353
|
+
# Check if 't' is outside the range [0, 1], and if so, calculate distance to closest endpoint
|
|
354
|
+
if t < 0:
|
|
355
|
+
return np.linalg.norm(point - line_start)
|
|
356
|
+
elif t > 1:
|
|
357
|
+
return np.linalg.norm(point - line_end)
|
|
358
|
+
|
|
359
|
+
# Calculate the closest point on the edge to the given point
|
|
360
|
+
closest_point = line_start + t * line_direction
|
|
361
|
+
|
|
362
|
+
# Calculate the distance between the closest point and the given point
|
|
363
|
+
distance = np.linalg.norm(point - closest_point)
|
|
364
|
+
|
|
365
|
+
return distance
|
|
366
|
+
|
|
367
|
+
def distance_point_to_plane(point, plane_point, plane_normal):
|
|
368
|
+
# Convert input points and normal vector to NumPy arrays
|
|
369
|
+
point = np.array(point)
|
|
370
|
+
plane_point = np.array(plane_point)
|
|
371
|
+
plane_normal = np.array(plane_normal)
|
|
372
|
+
|
|
373
|
+
# Calculate the vector from the plane point to the given point
|
|
374
|
+
point_to_plane = point - plane_point
|
|
375
|
+
|
|
376
|
+
# Calculate the distance as the projection of the point-to-plane vector onto the plane's normal
|
|
377
|
+
distance = np.abs(np.dot(point_to_plane, plane_normal) / np.linalg.norm(plane_normal))
|
|
378
|
+
|
|
379
|
+
return distance
|
|
380
|
+
|
|
381
|
+
def distance_to_vertex(vertexA, vertexB):
|
|
382
|
+
a = (Vertex.X(vertexA), Vertex.Y(vertexA), Vertex.Z(vertexA))
|
|
383
|
+
b = (Vertex.X(vertexB), Vertex.Y(vertexB), Vertex.Z(vertexB))
|
|
384
|
+
return distance_point_to_point(a,b)
|
|
385
|
+
|
|
386
|
+
def distance_to_edge(vertex, edge):
|
|
387
|
+
a = (Vertex.X(vertex), Vertex.Y(vertex), Vertex.Z(vertex))
|
|
388
|
+
sv = Edge.StartVertex(edge)
|
|
389
|
+
ev = Edge.EndVertex(edge)
|
|
390
|
+
svp = (Vertex.X(sv), Vertex.Y(sv), Vertex.Z(sv))
|
|
391
|
+
evp = (Vertex.X(ev), Vertex.Y(ev), Vertex.Z(ev))
|
|
392
|
+
return distance_point_to_line(a,svp, evp)
|
|
393
|
+
|
|
394
|
+
def distance_to_face(vertex, face):
|
|
395
|
+
a = (Vertex.X(vertex), Vertex.Y(vertex), Vertex.Z(vertex))
|
|
396
|
+
c = Topology.Centroid(face)
|
|
397
|
+
c = (Vertex.X(c), Vertex.Y(c), Vertex.Z(c))
|
|
398
|
+
n = Face.Normal(face)
|
|
399
|
+
n = (n[0], n[1], n[2])
|
|
400
|
+
return distance_point_to_plane(a, c, n)
|
|
401
|
+
|
|
318
402
|
if not isinstance(vertex, topologic.Vertex) or not isinstance(topology, topologic.Topology):
|
|
319
403
|
return None
|
|
320
|
-
|
|
404
|
+
if isinstance(topology, topologic.Vertex):
|
|
405
|
+
return round(distance_to_vertex(vertex,topology), mantissa)
|
|
406
|
+
elif isinstance(topology, topologic.Edge):
|
|
407
|
+
return round(distance_to_edge(vertex,topology), mantissa)
|
|
408
|
+
elif isinstance(topology, topologic.Wire):
|
|
409
|
+
vertices = Topology.Vertices(topology)
|
|
410
|
+
distances = [distance_to_vertex(vertex, v) for v in vertices]
|
|
411
|
+
edges = Topology.Edges(topology)
|
|
412
|
+
distances += [distance_to_edge(vertex, e) for e in edges]
|
|
413
|
+
if includeCentroid:
|
|
414
|
+
distances.append(distance_to_vertex(vertex, Topology.Centroid(topology)))
|
|
415
|
+
return round(min(distances), mantissa)
|
|
416
|
+
elif isinstance(topology, topologic.Face):
|
|
417
|
+
vertices = Topology.Vertices(topology)
|
|
418
|
+
distances = [distance_to_vertex(vertex, v) for v in vertices]
|
|
419
|
+
edges = Topology.Edges(topology)
|
|
420
|
+
distances += [distance_to_edge(vertex, e) for e in edges]
|
|
421
|
+
distances.append(distance_to_face(vertex,topology))
|
|
422
|
+
if includeCentroid:
|
|
423
|
+
distances.append(distance_to_vertex(vertex, Topology.Centroid(topology)))
|
|
424
|
+
return round(min(distances), mantissa)
|
|
425
|
+
elif isinstance(topology, topologic.Shell) or isinstance(topology, topologic.Cell) or isinstance(topology, topologic.CellComplex) or isinstance(topology, topologic.Cluster):
|
|
426
|
+
vertices = Topology.Vertices(topology)
|
|
427
|
+
distances = [distance_to_vertex(vertex, v) for v in vertices]
|
|
428
|
+
edges = Topology.Edges(topology)
|
|
429
|
+
distances += [distance_to_edge(vertex, e) for e in edges]
|
|
430
|
+
faces = Topology.Faces(topology)
|
|
431
|
+
distances += [distance_to_face(vertex, f) for f in faces]
|
|
432
|
+
edges = Topology.Edges(topology)
|
|
433
|
+
distances += [distance_to_edge(vertex, e) for e in edges]
|
|
434
|
+
if includeCentroid:
|
|
435
|
+
distances.append(distance_to_vertex(vertex, Topology.Centroid(topology)))
|
|
436
|
+
return round(min(distances), mantissa)
|
|
437
|
+
else:
|
|
438
|
+
print("Vertex.Distance - Error: Could not recognize the input topology. Returning None.")
|
|
439
|
+
return None
|
|
321
440
|
|
|
322
441
|
@staticmethod
|
|
323
442
|
def EnclosingCell(vertex: topologic.Vertex, topology: topologic.Topology, exclusive: bool = True, tolerance: float = 0.0001) -> list:
|
|
@@ -545,6 +664,7 @@ class Vertex(Topology):
|
|
|
545
664
|
|
|
546
665
|
"""
|
|
547
666
|
from topologicpy.Wire import Wire
|
|
667
|
+
from topologicpy.Face import Face
|
|
548
668
|
from topologicpy.Shell import Shell
|
|
549
669
|
from topologicpy.CellComplex import CellComplex
|
|
550
670
|
from topologicpy.Cluster import Cluster
|
|
@@ -555,7 +675,7 @@ class Vertex(Topology):
|
|
|
555
675
|
return None
|
|
556
676
|
|
|
557
677
|
if isinstance(topology, topologic.Vertex):
|
|
558
|
-
return
|
|
678
|
+
return Vertex.Distance(vertex, topology) < tolerance
|
|
559
679
|
elif isinstance(topology, topologic.Edge):
|
|
560
680
|
try:
|
|
561
681
|
parameter = topologic.EdgeUtility.ParameterAtPoint(topology, vertex)
|
|
@@ -569,7 +689,7 @@ class Vertex(Topology):
|
|
|
569
689
|
return True
|
|
570
690
|
return False
|
|
571
691
|
elif isinstance(topology, topologic.Face):
|
|
572
|
-
return
|
|
692
|
+
return Face.IsInside(topology, vertex, tolerance)
|
|
573
693
|
elif isinstance(topology, topologic.Shell):
|
|
574
694
|
faces = Shell.Faces(topology)
|
|
575
695
|
for face in faces:
|
|
@@ -813,16 +933,16 @@ class Vertex(Topology):
|
|
|
813
933
|
return None
|
|
814
934
|
if not direction:
|
|
815
935
|
direction = Vector.Reverse(Face.NormalAtParameters(face, 0.5, 0.5, "XYZ", mantissa))
|
|
816
|
-
if
|
|
936
|
+
if Face.IsInside(face, vertex, tolerance):
|
|
817
937
|
return vertex
|
|
818
|
-
d =
|
|
819
|
-
far_vertex =
|
|
820
|
-
if
|
|
938
|
+
d = Vertex.Distance(vertex, face)*10
|
|
939
|
+
far_vertex = Topology.Translate(vertex, direction[0]*d, direction[1]*d, direction[2]*d)
|
|
940
|
+
if Vertex.Distance(vertex, far_vertex) > tolerance:
|
|
821
941
|
e = topologic.Edge.ByStartVertexEndVertex(vertex, far_vertex)
|
|
822
942
|
pv = face.Intersect(e, False)
|
|
823
943
|
if not pv:
|
|
824
|
-
far_vertex =
|
|
825
|
-
if
|
|
944
|
+
far_vertex = Topology.Translate(vertex, -direction[0]*d, -direction[1]*d, -direction[2]*d)
|
|
945
|
+
if Vertex.Distance(vertex, far_vertex) > tolerance:
|
|
826
946
|
e = topologic.Edge.ByStartVertexEndVertex(vertex, far_vertex)
|
|
827
947
|
pv = face.Intersect(e, False)
|
|
828
948
|
return pv
|
topologicpy/Wire.py
CHANGED
|
@@ -504,6 +504,8 @@ class Wire(topologic.Wire):
|
|
|
504
504
|
The created circle.
|
|
505
505
|
|
|
506
506
|
"""
|
|
507
|
+
from topologicpy.Topology import Topology
|
|
508
|
+
|
|
507
509
|
if not origin:
|
|
508
510
|
origin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
509
511
|
if not isinstance(origin, topologic.Vertex):
|
|
@@ -540,13 +542,13 @@ class Wire(topologic.Wire):
|
|
|
540
542
|
baseWire = Wire.ByVertices(baseV[::-1], close) #reversing the list so that the normal points up in Blender
|
|
541
543
|
|
|
542
544
|
if placement.lower() == "lowerleft":
|
|
543
|
-
baseWire =
|
|
545
|
+
baseWire = Topology.Translate(baseWire, radius, radius, 0)
|
|
544
546
|
elif placement.lower() == "upperleft":
|
|
545
|
-
baseWire =
|
|
547
|
+
baseWire = Topology.Translate(baseWire, radius, -radius, 0)
|
|
546
548
|
elif placement.lower() == "lowerright":
|
|
547
|
-
baseWire =
|
|
549
|
+
baseWire = Topology.Translate(baseWire, -radius, radius, 0)
|
|
548
550
|
elif placement.lower() == "upperright":
|
|
549
|
-
baseWire =
|
|
551
|
+
baseWire = Topology.Translate(baseWire, -radius, -radius, 0)
|
|
550
552
|
x1 = origin.X()
|
|
551
553
|
y1 = origin.Y()
|
|
552
554
|
z1 = origin.Z()
|
|
@@ -562,8 +564,8 @@ class Wire(topologic.Wire):
|
|
|
562
564
|
theta = 0
|
|
563
565
|
else:
|
|
564
566
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Z-Axis
|
|
565
|
-
baseWire =
|
|
566
|
-
baseWire =
|
|
567
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 1, 0, theta)
|
|
568
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 0, 1, phi)
|
|
567
569
|
return baseWire
|
|
568
570
|
|
|
569
571
|
@staticmethod
|
|
@@ -1012,6 +1014,8 @@ class Wire(topologic.Wire):
|
|
|
1012
1014
|
8. "length" : The length
|
|
1013
1015
|
|
|
1014
1016
|
"""
|
|
1017
|
+
from topologicpy.Topology import Topology
|
|
1018
|
+
|
|
1015
1019
|
if not origin:
|
|
1016
1020
|
origin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
1017
1021
|
if not isinstance(origin, topologic.Vertex):
|
|
@@ -1086,7 +1090,7 @@ class Wire(topologic.Wire):
|
|
|
1086
1090
|
ellipse = Wire.ByVertices(baseV[::-1], close) #reversing the list so that the normal points up in Blender
|
|
1087
1091
|
|
|
1088
1092
|
if placement.lower() == "lowerleft":
|
|
1089
|
-
ellipse =
|
|
1093
|
+
ellipse = Topology.Translate(ellipse, a, b, 0)
|
|
1090
1094
|
x1 = origin.X()
|
|
1091
1095
|
y1 = origin.Y()
|
|
1092
1096
|
z1 = origin.Z()
|
|
@@ -1102,17 +1106,17 @@ class Wire(topologic.Wire):
|
|
|
1102
1106
|
theta = 0
|
|
1103
1107
|
else:
|
|
1104
1108
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Z-Axis
|
|
1105
|
-
ellipse =
|
|
1106
|
-
ellipse =
|
|
1109
|
+
ellipse = Topology.Rotate(ellipse, origin, 0, 1, 0, theta)
|
|
1110
|
+
ellipse = Topology.Rotate(ellipse, origin, 0, 0, 1, phi)
|
|
1107
1111
|
|
|
1108
1112
|
# Create a Cluster of the two foci
|
|
1109
1113
|
v1 = topologic.Vertex.ByCoordinates(c+origin.X(), 0+origin.Y(),0)
|
|
1110
1114
|
v2 = topologic.Vertex.ByCoordinates(-c+origin.X(), 0+origin.Y(),0)
|
|
1111
1115
|
foci = topologic.Cluster.ByTopologies([v1, v2])
|
|
1112
1116
|
if placement.lower() == "lowerleft":
|
|
1113
|
-
foci =
|
|
1114
|
-
foci =
|
|
1115
|
-
foci =
|
|
1117
|
+
foci = Topology.Translate(foci, a, b, 0)
|
|
1118
|
+
foci = Topology.Rotate(foci, origin, 0, 1, 0, theta)
|
|
1119
|
+
foci = Topology.Rotate(foci, origin, 0, 0, 1, phi)
|
|
1116
1120
|
d = {}
|
|
1117
1121
|
d['ellipse'] = ellipse
|
|
1118
1122
|
d['foci'] = foci
|
|
@@ -1417,7 +1421,8 @@ class Wire(topologic.Wire):
|
|
|
1417
1421
|
A list of faces representing the isovist projection from the input viewpoint.
|
|
1418
1422
|
|
|
1419
1423
|
"""
|
|
1420
|
-
|
|
1424
|
+
from topologicpy.Topology import Topology
|
|
1425
|
+
|
|
1421
1426
|
def vertexPartofFace(vertex, face, tolerance):
|
|
1422
1427
|
vertices = []
|
|
1423
1428
|
_ = face.Vertices(None, vertices)
|
|
@@ -1450,7 +1455,7 @@ class Wire(topologic.Wire):
|
|
|
1450
1455
|
d = topologic.VertexUtility.Distance(viewPoint, aVertex)
|
|
1451
1456
|
if d > tolerance:
|
|
1452
1457
|
scaleFactor = maxDistance/d
|
|
1453
|
-
newV =
|
|
1458
|
+
newV = Topology.Scale(aVertex, viewPoint, scaleFactor, scaleFactor, scaleFactor)
|
|
1454
1459
|
try:
|
|
1455
1460
|
ray = topologic.Edge.ByStartVertexEndVertex(viewPoint, newV)
|
|
1456
1461
|
topologyC = ray.Intersect(wire, False)
|
|
@@ -2122,7 +2127,9 @@ class Wire(topologic.Wire):
|
|
|
2122
2127
|
|
|
2123
2128
|
"""
|
|
2124
2129
|
from topologicpy.Vertex import Vertex
|
|
2130
|
+
from topologicpy.Topology import Topology
|
|
2125
2131
|
import math
|
|
2132
|
+
|
|
2126
2133
|
if not origin:
|
|
2127
2134
|
origin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
2128
2135
|
if not isinstance(origin, topologic.Vertex):
|
|
@@ -2192,15 +2199,15 @@ class Wire(topologic.Wire):
|
|
|
2192
2199
|
radius = radiusA + radiusB*turns*0.5
|
|
2193
2200
|
baseWire = Wire.ByVertices(vertices, close=False)
|
|
2194
2201
|
if placement.lower() == "center":
|
|
2195
|
-
baseWire =
|
|
2202
|
+
baseWire = Topology.Translate(baseWire, 0, 0, -height*0.5)
|
|
2196
2203
|
if placement.lower() == "lowerleft":
|
|
2197
|
-
baseWire =
|
|
2204
|
+
baseWire = Topology.Translate(baseWire, -minX, -minY, 0)
|
|
2198
2205
|
elif placement.lower() == "upperleft":
|
|
2199
|
-
baseWire =
|
|
2206
|
+
baseWire = Topology.Translate(baseWire, -minX, -maxY, 0)
|
|
2200
2207
|
elif placement.lower() == "lowerright":
|
|
2201
|
-
baseWire =
|
|
2208
|
+
baseWire = Topology.Translate(baseWire, -maxX, -minY, 0)
|
|
2202
2209
|
elif placement.lower() == "upperright":
|
|
2203
|
-
baseWire =
|
|
2210
|
+
baseWire = Topology.Translate(baseWire, -maxX, -maxY, 0)
|
|
2204
2211
|
x1 = origin.X()
|
|
2205
2212
|
y1 = origin.Y()
|
|
2206
2213
|
z1 = origin.Z()
|
|
@@ -2216,8 +2223,8 @@ class Wire(topologic.Wire):
|
|
|
2216
2223
|
theta = 0
|
|
2217
2224
|
else:
|
|
2218
2225
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Z-Axis
|
|
2219
|
-
baseWire =
|
|
2220
|
-
baseWire =
|
|
2226
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 1, 0, theta)
|
|
2227
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 0, 1, phi)
|
|
2221
2228
|
return baseWire
|
|
2222
2229
|
|
|
2223
2230
|
@staticmethod
|
|
@@ -2352,6 +2359,7 @@ class Wire(topologic.Wire):
|
|
|
2352
2359
|
The created star.
|
|
2353
2360
|
|
|
2354
2361
|
"""
|
|
2362
|
+
from topologicpy.Topology import Topology
|
|
2355
2363
|
|
|
2356
2364
|
if not origin:
|
|
2357
2365
|
origin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
@@ -2428,8 +2436,8 @@ class Wire(topologic.Wire):
|
|
|
2428
2436
|
theta = 0
|
|
2429
2437
|
else:
|
|
2430
2438
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Y-Axis
|
|
2431
|
-
baseWire =
|
|
2432
|
-
baseWire =
|
|
2439
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 1, 0, theta)
|
|
2440
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 0, 1, phi)
|
|
2433
2441
|
return baseWire
|
|
2434
2442
|
|
|
2435
2443
|
@staticmethod
|
|
@@ -2464,6 +2472,8 @@ class Wire(topologic.Wire):
|
|
|
2464
2472
|
The created trapezoid.
|
|
2465
2473
|
|
|
2466
2474
|
"""
|
|
2475
|
+
from topologicpy.Topology import Topology
|
|
2476
|
+
|
|
2467
2477
|
if not origin:
|
|
2468
2478
|
origin = topologic.Vertex.ByCoordinates(0,0,0)
|
|
2469
2479
|
if not isinstance(origin, topologic.Vertex):
|
|
@@ -2514,8 +2524,8 @@ class Wire(topologic.Wire):
|
|
|
2514
2524
|
theta = 0
|
|
2515
2525
|
else:
|
|
2516
2526
|
theta = math.degrees(math.acos(dz/dist)) # Rotation around Z-Axis
|
|
2517
|
-
baseWire =
|
|
2518
|
-
baseWire =
|
|
2527
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 1, 0, theta)
|
|
2528
|
+
baseWire = Topology.Rotate(baseWire, origin, 0, 0, 1, phi)
|
|
2519
2529
|
return baseWire
|
|
2520
2530
|
|
|
2521
2531
|
@staticmethod
|
topologicpy/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: topologicpy
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.40
|
|
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
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
topologicpy/Aperture.py,sha256=kuplpOvicYMPDDghEREs3hZa8XvcWi5m4eJf9rVfI-o,1343
|
|
2
|
-
topologicpy/Cell.py,sha256=
|
|
3
|
-
topologicpy/CellComplex.py,sha256=
|
|
2
|
+
topologicpy/Cell.py,sha256=n9p06eJKgKNEPIv_-0xk6tHNSb-Ak50TR7no3ae6WZA,72911
|
|
3
|
+
topologicpy/CellComplex.py,sha256=TMZUNEbRM9KDdcN39iJZgG4Gw1mmeJJpeQI5EyXIZ6Q,29213
|
|
4
4
|
topologicpy/Cluster.py,sha256=qkLwIHPJbTa4rFmRI-d6K9dq7HzcTZoL7ypHxwdKVzc,32569
|
|
5
5
|
topologicpy/Color.py,sha256=7ObLb4hxOOH6SyTCE-NRM5aBXd8KLBEJcM8fxDX3M88,9174
|
|
6
6
|
topologicpy/Context.py,sha256=cPxfxUScXcJVafSTnCTCNpRzBGSbu90D5i6uu26S5us,1643
|
|
7
7
|
topologicpy/DGL.py,sha256=F2pB1B3sjZwHU1nxJXCmu-xr3elk_inSCMfK6AE8mkE,131278
|
|
8
8
|
topologicpy/Dictionary.py,sha256=WKzY0laNMvUDQAWjkUeU6_jWYdYdK79cPWLHZK64SR8,18620
|
|
9
|
-
topologicpy/Edge.py,sha256=
|
|
10
|
-
topologicpy/EnergyModel.py,sha256=
|
|
11
|
-
topologicpy/Face.py,sha256=
|
|
12
|
-
topologicpy/Graph.py,sha256=
|
|
9
|
+
topologicpy/Edge.py,sha256=HMKhXKDgfJRGPvp1tdz5YAp7du_S5b3Y0eYT3goS57g,35633
|
|
10
|
+
topologicpy/EnergyModel.py,sha256=UM51L6VlxYI0-68JqKNo90ap9NnEVZ8w-CAHuTmF1Y8,50498
|
|
11
|
+
topologicpy/Face.py,sha256=aX5q5Q7wDe572xBaTnmLC-mMQXgGGSc70HS6mxxwGCE,75238
|
|
12
|
+
topologicpy/Graph.py,sha256=IGbgrhIKGCqhbO7ocMncm0v1cCD9LRXljVsroXZbHqk,251299
|
|
13
13
|
topologicpy/Grid.py,sha256=rArW8J3vkhWt8dx9NDzCSyu4oMowUpsly7rEhsLPFII,16449
|
|
14
14
|
topologicpy/Helper.py,sha256=wpq9S2Bi11fcfY8SLHFi6TV4LXmO3pKeiIIKK460pj0,9465
|
|
15
15
|
topologicpy/Honeybee.py,sha256=Vy8e0Chv2EkzqyNcaK3y4QeSj89yY5pdbE8GZgVQyGw,19153
|
|
16
16
|
topologicpy/Matrix.py,sha256=GHd_o714eEWbTOhRM5X-fXcgsV5yYJJSj6xFdnkwC14,7625
|
|
17
17
|
topologicpy/Neo4j.py,sha256=EpfkjAQgoxYJjk7UvadBJxasTJbGjI8IEY8LthHMotI,18297
|
|
18
|
-
topologicpy/Plotly.py,sha256=
|
|
18
|
+
topologicpy/Plotly.py,sha256=SsmZwM8mxQ3dvCR7mJmj708xUmMtla5oQgaMW6kDoFM,91489
|
|
19
19
|
topologicpy/Polyskel.py,sha256=jz5k5H6p4QRWe3bbMnyYbP9Iji6EQ1wdk3qQvcnbg08,15156
|
|
20
|
-
topologicpy/Shell.py,sha256=
|
|
20
|
+
topologicpy/Shell.py,sha256=Zz9zB6GUEHyem4VA7c1NyHL05k5T_OU4IxnKFaG-CJ0,68008
|
|
21
21
|
topologicpy/Speckle.py,sha256=JBS2SW-KpV11XQON_aNwoBuyHdMNQlhcsaOEWqKUcp4,13959
|
|
22
|
-
topologicpy/Topology.py,sha256=
|
|
22
|
+
topologicpy/Topology.py,sha256=1cR9F2TIUYta0_dXkfvDusbpMvzw6kLuEcqRUzH5XPA,252144
|
|
23
23
|
topologicpy/Vector.py,sha256=TE0Rt7SZ4NQD0YR3ty3crhb7BYbRws_UJ-lj2ihxPXU,17988
|
|
24
|
-
topologicpy/Vertex.py,sha256=
|
|
25
|
-
topologicpy/Wire.py,sha256=
|
|
26
|
-
topologicpy/__init__.py,sha256=
|
|
24
|
+
topologicpy/Vertex.py,sha256=YhcJYTOXP0Dl_F4UWoukMhtRsA5IUZKj1pXVvNAeavM,40443
|
|
25
|
+
topologicpy/Wire.py,sha256=maiw46JZ4UI1o0rnR6bEbnfLilC2zFNLbPSfsR4Maz8,108913
|
|
26
|
+
topologicpy/__init__.py,sha256=VT8Rj1L4FNWisLzXnhDrSm0-VT8FkB4wJ7WajN6WxLY,662
|
|
27
27
|
topologicpy/bin/linux/topologic/__init__.py,sha256=qdj8gyp_GtYre27ZdFiVdLzLViOgX62woBZLTy9K91c,58
|
|
28
28
|
topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so,sha256=uvar01STZ8qu1c8fRmtYdVnK8evxBv305QScASXY9go,1852112
|
|
29
29
|
topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so,sha256=42yjVWetFu_qn6-eZcDxgd_A8SQN_wHqkdw91txKt9U,1852112
|
|
@@ -66,8 +66,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
|
|
|
66
66
|
topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
|
|
67
67
|
topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
|
|
68
68
|
topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
|
|
69
|
-
topologicpy-0.4.
|
|
70
|
-
topologicpy-0.4.
|
|
71
|
-
topologicpy-0.4.
|
|
72
|
-
topologicpy-0.4.
|
|
73
|
-
topologicpy-0.4.
|
|
69
|
+
topologicpy-0.4.40.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
|
|
70
|
+
topologicpy-0.4.40.dist-info/METADATA,sha256=bwHK7BMZfemlUFyVXuTySkI2vLidI5bYLdKgRz_B_kY,6973
|
|
71
|
+
topologicpy-0.4.40.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
72
|
+
topologicpy-0.4.40.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
|
73
|
+
topologicpy-0.4.40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|