topologicpy 0.5.3__py3-none-any.whl → 0.5.4__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 +112 -112
- topologicpy/CellComplex.py +15 -15
- topologicpy/Cluster.py +3 -3
- topologicpy/Color.py +10 -10
- topologicpy/Edge.py +12 -9
- topologicpy/Face.py +32 -30
- topologicpy/Graph.py +29 -29
- topologicpy/Grid.py +9 -9
- topologicpy/Plotly.py +29 -29
- topologicpy/Shell.py +42 -43
- topologicpy/Speckle.py +1 -1
- topologicpy/Topology.py +58 -62
- topologicpy/Vector.py +36 -36
- topologicpy/Vertex.py +12 -12
- topologicpy/Wire.py +80 -76
- topologicpy/__init__.py +1 -1
- {topologicpy-0.5.3.dist-info → topologicpy-0.5.4.dist-info}/METADATA +1 -1
- {topologicpy-0.5.3.dist-info → topologicpy-0.5.4.dist-info}/RECORD +21 -21
- {topologicpy-0.5.3.dist-info → topologicpy-0.5.4.dist-info}/LICENSE +0 -0
- {topologicpy-0.5.3.dist-info → topologicpy-0.5.4.dist-info}/WHEEL +0 -0
- {topologicpy-0.5.3.dist-info → topologicpy-0.5.4.dist-info}/top_level.txt +0 -0
topologicpy/CellComplex.py
CHANGED
@@ -53,14 +53,14 @@ class CellComplex(Topology):
|
|
53
53
|
def Box(origin: topologic.Vertex = None,
|
54
54
|
width: float = 1.0, length: float = 1.0, height: float = 1.0,
|
55
55
|
uSides: int = 2, vSides: int = 2, wSides: int = 2,
|
56
|
-
direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
56
|
+
direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
57
57
|
"""
|
58
58
|
Creates a box with internal cells.
|
59
59
|
|
60
60
|
Parameters
|
61
61
|
----------
|
62
62
|
origin : topologic.Vertex , optional
|
63
|
-
The origin location of the box. The default is None which results in the box being placed at (0,0,0).
|
63
|
+
The origin location of the box. The default is None which results in the box being placed at (0, 0, 0).
|
64
64
|
width : float , optional
|
65
65
|
The width of the box. The default is 1.
|
66
66
|
length : float , optional
|
@@ -74,7 +74,7 @@ class CellComplex(Topology):
|
|
74
74
|
wSides : int , optional
|
75
75
|
The number of sides along the height. The default is 1.
|
76
76
|
direction : list , optional
|
77
|
-
The vector representing the up direction of the box. The default is [0,0,1].
|
77
|
+
The vector representing the up direction of the box. The default is [0, 0, 1].
|
78
78
|
placement : str , optional
|
79
79
|
The description of the placement of the origin of the box. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
|
80
80
|
tolerance : float , optional
|
@@ -511,7 +511,7 @@ class CellComplex(Topology):
|
|
511
511
|
zList.append(f.Centroid().Z())
|
512
512
|
zMin = min(zList)
|
513
513
|
zMax = max(zList)
|
514
|
-
up = [0,0,1]
|
514
|
+
up = [0, 0, 1]
|
515
515
|
for aFace in faces:
|
516
516
|
aCode = angleCode(aFace, up, tiltAngle)
|
517
517
|
cells = []
|
@@ -575,7 +575,7 @@ class CellComplex(Topology):
|
|
575
575
|
return d
|
576
576
|
|
577
577
|
@staticmethod
|
578
|
-
def Delaunay(vertices: list=None, tolerance: float = 0.0001) -> topologic.CellComplex:
|
578
|
+
def Delaunay(vertices: list = None, tolerance: float = 0.0001) -> topologic.CellComplex:
|
579
579
|
"""
|
580
580
|
Triangulates the input vertices based on the Delaunay method. See https://en.wikipedia.org/wiki/Delaunay_triangulation.
|
581
581
|
|
@@ -761,7 +761,7 @@ class CellComplex(Topology):
|
|
761
761
|
|
762
762
|
@staticmethod
|
763
763
|
def Octahedron(origin: topologic.Vertex = None, radius: float = 0.5,
|
764
|
-
direction: list = [0,0,1], placement: str ="center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
764
|
+
direction: list = [0, 0, 1], placement: str ="center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
765
765
|
"""
|
766
766
|
Description
|
767
767
|
----------
|
@@ -770,11 +770,11 @@ class CellComplex(Topology):
|
|
770
770
|
Parameters
|
771
771
|
----------
|
772
772
|
origin : topologic.Vertex , optional
|
773
|
-
The origin location of the octahedron. The default is None which results in the octahedron being placed at (0,0,0).
|
773
|
+
The origin location of the octahedron. The default is None which results in the octahedron being placed at (0, 0, 0).
|
774
774
|
radius : float , optional
|
775
775
|
The radius of the octahedron's circumscribed sphere. The default is 0.5.
|
776
776
|
direction : list , optional
|
777
|
-
The vector representing the up direction of the octahedron. The default is [0,0,1].
|
777
|
+
The vector representing the up direction of the octahedron. The default is [0, 0, 1].
|
778
778
|
placement : str , optional
|
779
779
|
The description of the placement of the origin of the octahedron. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
|
780
780
|
tolerance : float , optional
|
@@ -792,7 +792,7 @@ class CellComplex(Topology):
|
|
792
792
|
from topologicpy.Topology import Topology
|
793
793
|
|
794
794
|
if not origin:
|
795
|
-
origin = Vertex.ByCoordinates(0,0,0)
|
795
|
+
origin = Vertex.ByCoordinates(0, 0, 0)
|
796
796
|
if not isinstance(origin, topologic.Vertex):
|
797
797
|
print("CellComplex.Octahedron - Error: The input origin parameter is not a valid topologic vertex. Returning None.")
|
798
798
|
return None
|
@@ -819,7 +819,7 @@ class CellComplex(Topology):
|
|
819
819
|
octahedron = Topology.Translate(octahedron, 0, 0, radius)
|
820
820
|
elif placement == "lowerleft":
|
821
821
|
octahedron = Topology.Translate(octahedron, radius, radius, radius)
|
822
|
-
octahedron = Topology.Orient(octahedron, origin=Vertex.Origin(), dirA=[0,0,1], dirB=direction)
|
822
|
+
octahedron = Topology.Orient(octahedron, origin=Vertex.Origin(), dirA=[0, 0, 1], dirB=direction)
|
823
823
|
octahedron = Topology.Place(octahedron, originA=Vertex.Origin(), originB=origin)
|
824
824
|
return octahedron
|
825
825
|
|
@@ -827,14 +827,14 @@ class CellComplex(Topology):
|
|
827
827
|
def Prism(origin: topologic.Vertex = None,
|
828
828
|
width: float = 1.0, length: float = 1.0, height: float = 1.0,
|
829
829
|
uSides: int = 2, vSides: int = 2, wSides: int = 2,
|
830
|
-
direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
830
|
+
direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.CellComplex:
|
831
831
|
"""
|
832
832
|
Creates a prismatic cellComplex with internal cells.
|
833
833
|
|
834
834
|
Parameters
|
835
835
|
----------
|
836
836
|
origin : topologic.Vertex , optional
|
837
|
-
The origin location of the prism. The default is None which results in the prism being placed at (0,0,0).
|
837
|
+
The origin location of the prism. The default is None which results in the prism being placed at (0, 0, 0).
|
838
838
|
width : float , optional
|
839
839
|
The width of the prism. The default is 1.
|
840
840
|
length : float , optional
|
@@ -848,7 +848,7 @@ class CellComplex(Topology):
|
|
848
848
|
wSides : int , optional
|
849
849
|
The number of sides along the height. The default is 1.
|
850
850
|
direction : list , optional
|
851
|
-
The vector representing the up direction of the prism. The default is [0,0,1].
|
851
|
+
The vector representing the up direction of the prism. The default is [0, 0, 1].
|
852
852
|
placement : str , optional
|
853
853
|
The description of the placement of the origin of the prism. This can be "bottom", "center", or "lowerleft". It is case insensitive. The default is "center".
|
854
854
|
tolerance : float , optional
|
@@ -912,12 +912,12 @@ class CellComplex(Topology):
|
|
912
912
|
else:
|
913
913
|
return topologic.CellComplex.ByCells([topology])
|
914
914
|
if not isinstance(origin, topologic.Vertex):
|
915
|
-
origin = Vertex.ByCoordinates(0,0,0)
|
915
|
+
origin = Vertex.ByCoordinates(0, 0, 0)
|
916
916
|
|
917
917
|
c = Cell.Prism(origin=origin, width=width, length=length, height=height, uSides=1, vSides=1, wSides=1, placement=placement, tolerance=tolerance)
|
918
918
|
prism = slice(c, uSides=uSides, vSides=vSides, wSides=wSides)
|
919
919
|
if prism:
|
920
|
-
prism = Topology.Orient(prism, origin=origin, dirA=[0,0,1], dirB=direction)
|
920
|
+
prism = Topology.Orient(prism, origin=origin, dirA=[0, 0, 1], dirB=direction)
|
921
921
|
return prism
|
922
922
|
else:
|
923
923
|
print("CellComplex.Prism - Error: Could not create a prism. Returning None.")
|
topologicpy/Cluster.py
CHANGED
@@ -1081,7 +1081,7 @@ class Cluster(Topology):
|
|
1081
1081
|
return Cluster.ByTopologies(cellComplexes+cells)
|
1082
1082
|
|
1083
1083
|
@staticmethod
|
1084
|
-
def MysticRose(wire: topologic.Wire = None, origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, perimeter: bool = True, direction: list = [0,0,1], placement:str = "center", tolerance: float = 0.0001) -> topologic.Cluster:
|
1084
|
+
def MysticRose(wire: topologic.Wire = None, origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, perimeter: bool = True, direction: list = [0, 0, 1], placement:str = "center", tolerance: float = 0.0001) -> topologic.Cluster:
|
1085
1085
|
"""
|
1086
1086
|
Creates a mystic rose.
|
1087
1087
|
|
@@ -1090,7 +1090,7 @@ class Cluster(Topology):
|
|
1090
1090
|
wire : topologic.Wire , optional
|
1091
1091
|
The input Wire. if set to None, a circle with the input parameters is created. Otherwise, the input parameters are ignored.
|
1092
1092
|
origin : topologic.Vertex , optional
|
1093
|
-
The location of the origin of the circle. The default is None which results in the circle being placed at (0,0,0).
|
1093
|
+
The location of the origin of the circle. The default is None which results in the circle being placed at (0, 0, 0).
|
1094
1094
|
radius : float , optional
|
1095
1095
|
The radius of the mystic rose. The default is 1.
|
1096
1096
|
sides : int , optional
|
@@ -1098,7 +1098,7 @@ class Cluster(Topology):
|
|
1098
1098
|
perimeter : bool , optional
|
1099
1099
|
If True, the perimeter edges are included in the output. The default is True.
|
1100
1100
|
direction : list , optional
|
1101
|
-
The vector representing the up direction of the mystic rose. The default is [0,0,1].
|
1101
|
+
The vector representing the up direction of the mystic rose. The default is [0, 0, 1].
|
1102
1102
|
placement : str , optional
|
1103
1103
|
The description of the placement of the origin of the mystic rose. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
|
1104
1104
|
tolerance : float , optional
|
topologicpy/Color.py
CHANGED
@@ -33,7 +33,7 @@ class Color:
|
|
33
33
|
Returns
|
34
34
|
-------
|
35
35
|
list
|
36
|
-
The color expressed as an [r,g,b] or an [r,g,b,a] list.
|
36
|
+
The color expressed as an [r, g, b] or an [r, g, b, a] list.
|
37
37
|
"""
|
38
38
|
import webcolors
|
39
39
|
if not alpha == None:
|
@@ -66,7 +66,7 @@ class Color:
|
|
66
66
|
Returns
|
67
67
|
-------
|
68
68
|
list
|
69
|
-
The color expressed as an [r,g,b] or an [r,g,b,a] list.
|
69
|
+
The color expressed as an [r, g, b] or an [r, g, b, a] list.
|
70
70
|
|
71
71
|
"""
|
72
72
|
if not isinstance(hex, str):
|
@@ -83,7 +83,7 @@ class Color:
|
|
83
83
|
r = int(hex[0:2], 16)
|
84
84
|
g = int(hex[2:4], 16)
|
85
85
|
b = int(hex[4:6], 16)
|
86
|
-
rgbList = [r,g,b]
|
86
|
+
rgbList = [r, g, b]
|
87
87
|
if not alpha == None:
|
88
88
|
rgbList.append(alpha)
|
89
89
|
return rgbList
|
@@ -111,7 +111,7 @@ class Color:
|
|
111
111
|
Returns
|
112
112
|
-------
|
113
113
|
list
|
114
|
-
The color expressed as an [r,g,b] or an [r,g,b,a] list.
|
114
|
+
The color expressed as an [r, g, b] or an [r, g, b, a] list.
|
115
115
|
|
116
116
|
"""
|
117
117
|
if not alpha == None:
|
@@ -250,12 +250,12 @@ class Color:
|
|
250
250
|
def CSSNamedColor(color):
|
251
251
|
"""
|
252
252
|
Returns the CSS Named color that most closely matches the input color. The input color is assumed to be
|
253
|
-
in the format [r,g,b]. See https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
|
253
|
+
in the format [r, g, b]. See https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
|
254
254
|
|
255
255
|
Parameters
|
256
256
|
----------
|
257
257
|
color : list
|
258
|
-
The input color. This is assumed to be in the format [r,g,b]
|
258
|
+
The input color. This is assumed to be in the format [r, g, b]
|
259
259
|
|
260
260
|
Returns
|
261
261
|
-------
|
@@ -271,12 +271,12 @@ class Color:
|
|
271
271
|
return None
|
272
272
|
color = [int(x) for x in color if isinstance(x, numbers.Real)]
|
273
273
|
if len(color) < 3:
|
274
|
-
print("Color.CSSNamedColor - Error: The input color parameter does not contain valid r,g,b values. Returning None.")
|
274
|
+
print("Color.CSSNamedColor - Error: The input color parameter does not contain valid r, g, b values. Returning None.")
|
275
275
|
return None
|
276
276
|
color = color[0:3]
|
277
277
|
for x in color:
|
278
278
|
if not (0 <= x <= 255):
|
279
|
-
print("Color.CSSNamedColor - Error: The input color parameter does not contain valid r,g,b values. Returning None.")
|
279
|
+
print("Color.CSSNamedColor - Error: The input color parameter does not contain valid r, g, b values. Returning None.")
|
280
280
|
return None
|
281
281
|
|
282
282
|
def est_color(requested_color):
|
@@ -336,12 +336,12 @@ class Color:
|
|
336
336
|
@staticmethod
|
337
337
|
def PlotlyColor(color, alpha=1.0, useAlpha=False):
|
338
338
|
"""
|
339
|
-
Returns a plotly color string based on the input list of [r,g,b] or [r,g,b,a]. If your list is [r,g,b], you can optionally specify an alpha value
|
339
|
+
Returns a plotly color string based on the input list of [r, g, b] or [r, g, b, a]. If your list is [r, g, b], you can optionally specify an alpha value
|
340
340
|
|
341
341
|
Parameters
|
342
342
|
----------
|
343
343
|
color : list
|
344
|
-
The input color list. This is assumed to be in the format [r,g,b] or [r,g,b,a]
|
344
|
+
The input color list. This is assumed to be in the format [r, g, b] or [r, g, b, a]
|
345
345
|
alpha : float , optional
|
346
346
|
The transparency value. 0.0 means the color is fully transparent, 1.0 means the color is fully opaque. The default is 1.0.
|
347
347
|
useAlpha : bool , optional
|
topologicpy/Edge.py
CHANGED
@@ -696,7 +696,7 @@ class Edge(Topology):
|
|
696
696
|
Parameters
|
697
697
|
----------
|
698
698
|
origin : topologic.Vertex , optional
|
699
|
-
The origin location of the box. The default is None which results in the edge being placed at (0,0,0).
|
699
|
+
The origin location of the box. The default is None which results in the edge being placed at (0, 0, 0).
|
700
700
|
length : float , optional
|
701
701
|
The desired length of the edge. The default is 1.0.
|
702
702
|
direction : list , optional
|
@@ -751,7 +751,7 @@ class Edge(Topology):
|
|
751
751
|
return None
|
752
752
|
|
753
753
|
@staticmethod
|
754
|
-
def Normal(edge: topologic.Edge,
|
754
|
+
def Normal(edge: topologic.Edge, angle: float = 0.0):
|
755
755
|
"""
|
756
756
|
Returns the normal (perpendicular) vector to the input edge.
|
757
757
|
|
@@ -759,6 +759,9 @@ class Edge(Topology):
|
|
759
759
|
----------
|
760
760
|
edge : topologic.Edge
|
761
761
|
The input edge.
|
762
|
+
angle : float , optional
|
763
|
+
The desired rotational offset angle in degrees for the normal edge. This rotates the normal edge
|
764
|
+
by the angle value around the axis defined by the input edge. The default is 0.0.
|
762
765
|
|
763
766
|
Returns
|
764
767
|
-------
|
@@ -769,11 +772,11 @@ class Edge(Topology):
|
|
769
772
|
if not isinstance(edge, topologic.Edge):
|
770
773
|
print("Edge.Normal - Error: The input edge parameter is not a valid edge. Returning None.")
|
771
774
|
return None
|
772
|
-
normal_edge = Edge.NormalAsEdge(edge, length=1.0, u=0.5,
|
775
|
+
normal_edge = Edge.NormalAsEdge(edge, length=1.0, u=0.5, angle=angle)
|
773
776
|
return Edge.Direction(normal_edge)
|
774
777
|
|
775
778
|
@staticmethod
|
776
|
-
def NormalAsEdge(edge: topologic.Edge, length: float=1.0, u: float=0.5,
|
779
|
+
def NormalAsEdge(edge: topologic.Edge, length: float = 1.0, u: float = 0.5, angle: float = 0.0):
|
777
780
|
"""
|
778
781
|
Returns the normal (perpendicular) vector to the input edge as an edge.
|
779
782
|
|
@@ -788,14 +791,14 @@ class Edge(Topology):
|
|
788
791
|
at the start vertex of the input edge, a value of 0.5 places the normal edge
|
789
792
|
at the midpoint of the input edge, and a value of 1.0 places the normal edge
|
790
793
|
at the end vertex of the input edge. The default is 0.5
|
791
|
-
|
792
|
-
The desired rotational offset in degrees for the normal edge. This rotates the normal edge
|
793
|
-
by the
|
794
|
+
angle : float , optional
|
795
|
+
The desired rotational offset angle in degrees for the normal edge. This rotates the normal edge
|
796
|
+
by the angle value around the axis defined by the input edge. The default is 0.0.
|
794
797
|
|
795
798
|
Returns
|
796
799
|
-------
|
797
800
|
topologic.Edge
|
798
|
-
The normal (perpendicular
|
801
|
+
The normal (perpendicular) vector to the input edge as an edge.
|
799
802
|
|
800
803
|
"""
|
801
804
|
import numpy as np
|
@@ -844,7 +847,7 @@ class Edge(Topology):
|
|
844
847
|
ev = Vertex.ByCoordinates(list(normal_line_end))
|
845
848
|
normal_edge = Edge.ByVertices([sv, ev])
|
846
849
|
normal_edge = Edge.SetLength(normal_edge, length, bothSides=False)
|
847
|
-
normal_edge = Topology.Rotate(normal_edge, Edge.StartVertex(normal_edge),
|
850
|
+
normal_edge = Topology.Rotate(normal_edge, origin=Edge.StartVertex(normal_edge), axis=[x,y,z], angle=angle)
|
848
851
|
dist = Edge.Length(edge)*u
|
849
852
|
normal_edge = Topology.TranslateByDirectionDistance(normal_edge, edge_direction, dist)
|
850
853
|
return normal_edge
|
topologicpy/Face.py
CHANGED
@@ -230,7 +230,7 @@ class Face(Topology):
|
|
230
230
|
for z in range(za,zb,zc):
|
231
231
|
if flag:
|
232
232
|
break
|
233
|
-
t = Topology.Rotate(topology, origin=origin,
|
233
|
+
t = Topology.Rotate(topology, origin=origin, axis=[0, 0, 1], angle=z)
|
234
234
|
minX, minY, maxX, maxY = bb(t)
|
235
235
|
w = abs(maxX - minX)
|
236
236
|
l = abs(maxY - minY)
|
@@ -257,7 +257,7 @@ class Face(Topology):
|
|
257
257
|
|
258
258
|
baseWire = Wire.ByVertices([vb1, vb2, vb3, vb4], close=True)
|
259
259
|
baseFace = Face.ByWire(baseWire, tolerance=tolerance)
|
260
|
-
baseFace = Topology.Rotate(baseFace, origin=origin,
|
260
|
+
baseFace = Topology.Rotate(baseFace, origin=origin, axis=[0, 0, 1], angle=-best_z)
|
261
261
|
dictionary = Dictionary.ByKeysValues(["zrot"], [best_z])
|
262
262
|
baseFace = Topology.SetDictionary(baseFace, dictionary)
|
263
263
|
return baseFace
|
@@ -705,7 +705,7 @@ class Face(Topology):
|
|
705
705
|
return Face.ByWires(externalBoundary, internalBoundaries, tolerance=tolerance, silent=silent)
|
706
706
|
|
707
707
|
@staticmethod
|
708
|
-
def NorthArrow(origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, direction: list = [0,0,1], northAngle: float = 0.0,
|
708
|
+
def NorthArrow(origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, direction: list = [0, 0, 1], northAngle: float = 0.0,
|
709
709
|
placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
710
710
|
"""
|
711
711
|
Creates a north arrow.
|
@@ -713,13 +713,13 @@ class Face(Topology):
|
|
713
713
|
Parameters
|
714
714
|
----------
|
715
715
|
origin : topologic.Vertex, optional
|
716
|
-
The location of the origin of the circle. The default is None which results in the circle being placed at (0,0,0).
|
716
|
+
The location of the origin of the circle. The default is None which results in the circle being placed at (0, 0, 0).
|
717
717
|
radius : float , optional
|
718
718
|
The radius of the circle. The default is 1.
|
719
719
|
sides : int , optional
|
720
720
|
The number of sides of the circle. The default is 16.
|
721
721
|
direction : list , optional
|
722
|
-
The vector representing the up direction of the circle. The default is [0,0,1].
|
722
|
+
The vector representing the up direction of the circle. The default is [0, 0, 1].
|
723
723
|
northAngle : float , optional
|
724
724
|
The angular offset in degrees from the positive Y axis direction. The angle is measured in a counter-clockwise fashion where 0 is positive Y, 90 is negative X, 180 is negative Y, and 270 is positive X.
|
725
725
|
placement : str , optional
|
@@ -738,11 +738,11 @@ class Face(Topology):
|
|
738
738
|
if not origin:
|
739
739
|
origin = Vertex.Origin()
|
740
740
|
|
741
|
-
c = Face.Circle(origin=origin, radius=radius, sides=sides, direction=[0,0,1], placement="center", tolerance=tolerance)
|
741
|
+
c = Face.Circle(origin=origin, radius=radius, sides=sides, direction=[0, 0, 1], placement="center", tolerance=tolerance)
|
742
742
|
r = Face.Rectangle(origin=origin, width=radius*0.01,length=radius*1.2, placement="lowerleft")
|
743
743
|
r = Topology.Translate(r, -0.005*radius,0,0)
|
744
744
|
arrow = Topology.Difference(c, r, tolerance=tolerance)
|
745
|
-
arrow = Topology.Rotate(arrow, Vertex.Origin(), 0,0,1,northAngle)
|
745
|
+
arrow = Topology.Rotate(arrow, origin=Vertex.Origin(), axis=[0, 0, 1], angle=northAngle)
|
746
746
|
if placement.lower() == "lowerleft":
|
747
747
|
arrow = Topology.Translate(arrow, radius, radius, 0)
|
748
748
|
elif placement.lower() == "upperleft":
|
@@ -756,7 +756,7 @@ class Face(Topology):
|
|
756
756
|
return arrow
|
757
757
|
|
758
758
|
@staticmethod
|
759
|
-
def Circle(origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, fromAngle: float = 0.0, toAngle: float = 360.0, direction: list = [0,0,1],
|
759
|
+
def Circle(origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, fromAngle: float = 0.0, toAngle: float = 360.0, direction: list = [0, 0, 1],
|
760
760
|
placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
761
761
|
"""
|
762
762
|
Creates a circle.
|
@@ -764,7 +764,7 @@ class Face(Topology):
|
|
764
764
|
Parameters
|
765
765
|
----------
|
766
766
|
origin : topologic.Vertex, optional
|
767
|
-
The location of the origin of the circle. The default is None which results in the circle being placed at (0,0,0).
|
767
|
+
The location of the origin of the circle. The default is None which results in the circle being placed at (0, 0, 0).
|
768
768
|
radius : float , optional
|
769
769
|
The radius of the circle. The default is 1.
|
770
770
|
sides : int , optional
|
@@ -774,7 +774,7 @@ class Face(Topology):
|
|
774
774
|
toAngle : float , optional
|
775
775
|
The angle in degrees at which to end creating the arc of the circle. The default is 360.
|
776
776
|
direction : list , optional
|
777
|
-
The vector representing the up direction of the circle. The default is [0,0,1].
|
777
|
+
The vector representing the up direction of the circle. The default is [0, 0, 1].
|
778
778
|
placement : str , optional
|
779
779
|
The description of the placement of the origin of the circle. This can be "center", "lowerleft", "upperleft", "lowerright", or "upperright". It is case insensitive. The default is "center".
|
780
780
|
tolerance : float , optional
|
@@ -880,19 +880,19 @@ class Face(Topology):
|
|
880
880
|
return edges
|
881
881
|
|
882
882
|
@staticmethod
|
883
|
-
def Einstein(origin: topologic.Vertex = None, radius: float = 0.5, direction: list = [0,0,1],
|
884
|
-
placement: str = "center", tolerance: float=0.0001) -> topologic.Face:
|
883
|
+
def Einstein(origin: topologic.Vertex = None, radius: float = 0.5, direction: list = [0, 0, 1],
|
884
|
+
placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
885
885
|
"""
|
886
886
|
Creates an aperiodic monotile, also called an 'einstein' tile (meaning one tile in German, not the name of the famous physist). See https://arxiv.org/abs/2303.10798
|
887
887
|
|
888
888
|
Parameters
|
889
889
|
----------
|
890
890
|
origin : topologic.Vertex , optional
|
891
|
-
The location of the origin of the tile. The default is None which results in the tiles first vertex being placed at (0,0,0).
|
891
|
+
The location of the origin of the tile. The default is None which results in the tiles first vertex being placed at (0, 0, 0).
|
892
892
|
radius : float , optional
|
893
893
|
The radius of the hexagon determining the size of the tile. The default is 0.5.
|
894
894
|
direction : list , optional
|
895
|
-
The vector representing the up direction of the ellipse. The default is [0,0,1].
|
895
|
+
The vector representing the up direction of the ellipse. The default is [0, 0, 1].
|
896
896
|
placement : str , optional
|
897
897
|
The description of the placement of the origin of the hexagon determining the location of the tile. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
|
898
898
|
tolerance : float , optional
|
@@ -927,7 +927,8 @@ class Face(Topology):
|
|
927
927
|
internal boundaries (holes). For example: [[270,270,270,270], [[270,270,270,270],[300,300,300]]]. If not, the returned list will be
|
928
928
|
a simple list of interior angles of the external boundary. For example: [270,270,270,270]. Please note that that the interior angles of the
|
929
929
|
internal boundaries are considered to be those interior to the original face. Thus, they are exterior to the internal boundary.
|
930
|
-
|
930
|
+
mantissa : int , optional
|
931
|
+
The desired length of the mantissa. The default is 6.
|
931
932
|
Returns
|
932
933
|
-------
|
933
934
|
list
|
@@ -1054,7 +1055,7 @@ class Face(Topology):
|
|
1054
1055
|
return harmonizedFace
|
1055
1056
|
|
1056
1057
|
@staticmethod
|
1057
|
-
def InteriorAngles(face: topologic.Face, includeInternalBoundaries=False, mantissa: int = 6) -> list:
|
1058
|
+
def InteriorAngles(face: topologic.Face, includeInternalBoundaries: bool = False, mantissa: int = 6) -> list:
|
1058
1059
|
"""
|
1059
1060
|
Returns the interior angles of the input face in degrees. The face must be planar.
|
1060
1061
|
|
@@ -1068,7 +1069,8 @@ class Face(Topology):
|
|
1068
1069
|
internal boundaries (holes). For example: [[90,90,90,90], [[90,90,90,90],[60,60,60]]]. If not, the returned list will be
|
1069
1070
|
a simple list of interior angles of the external boundary. For example: [90,90,90,90]. Please note that that the interior angles of the
|
1070
1071
|
internal boundaries are considered to be those interior to the original face. Thus, they are exterior to the internal boundary.
|
1071
|
-
|
1072
|
+
mantissa : int , optional
|
1073
|
+
The desired length of the mantissa. The default is 6.
|
1072
1074
|
Returns
|
1073
1075
|
-------
|
1074
1076
|
list
|
@@ -1269,7 +1271,7 @@ class Face(Topology):
|
|
1269
1271
|
normal = Face.Normal(face)
|
1270
1272
|
flatFace = Topology.Flatten(face, origin=origin, direction=normal)
|
1271
1273
|
|
1272
|
-
# Create a Vertex at the world's origin (0,0,0)
|
1274
|
+
# Create a Vertex at the world's origin (0, 0, 0)
|
1273
1275
|
world_origin = Vertex.Origin()
|
1274
1276
|
|
1275
1277
|
faceEdges = Face.Edges(flatFace)
|
@@ -1592,20 +1594,20 @@ class Face(Topology):
|
|
1592
1594
|
return Face.Rectangle(origin=origin, width=width, length=length, direction = direction, placement=placement, tolerance=tolerance)
|
1593
1595
|
|
1594
1596
|
@staticmethod
|
1595
|
-
def Rectangle(origin: topologic.Vertex = None, width: float = 1.0, length: float = 1.0, direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1597
|
+
def Rectangle(origin: topologic.Vertex = None, width: float = 1.0, length: float = 1.0, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1596
1598
|
"""
|
1597
1599
|
Creates a rectangle.
|
1598
1600
|
|
1599
1601
|
Parameters
|
1600
1602
|
----------
|
1601
1603
|
origin : topologic.Vertex, optional
|
1602
|
-
The location of the origin of the rectangle. The default is None which results in the rectangle being placed at (0,0,0).
|
1604
|
+
The location of the origin of the rectangle. The default is None which results in the rectangle being placed at (0, 0, 0).
|
1603
1605
|
width : float , optional
|
1604
1606
|
The width of the rectangle. The default is 1.0.
|
1605
1607
|
length : float , optional
|
1606
1608
|
The length of the rectangle. The default is 1.0.
|
1607
1609
|
direction : list , optional
|
1608
|
-
The vector representing the up direction of the rectangle. The default is [0,0,1].
|
1610
|
+
The vector representing the up direction of the rectangle. The default is [0, 0, 1].
|
1609
1611
|
placement : str , optional
|
1610
1612
|
The description of the placement of the origin of the rectangle. This can be "center", "lowerleft", "upperleft", "lowerright", "upperright". It is case insensitive. The default is "center".
|
1611
1613
|
tolerance : float , optional
|
@@ -1680,18 +1682,18 @@ class Face(Topology):
|
|
1680
1682
|
return Wire.Skeleton(face, tolerance=tolerance)
|
1681
1683
|
|
1682
1684
|
@staticmethod
|
1683
|
-
def Square(origin: topologic.Vertex = None, size: float = 1.0, direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1685
|
+
def Square(origin: topologic.Vertex = None, size: float = 1.0, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1684
1686
|
"""
|
1685
1687
|
Creates a square.
|
1686
1688
|
|
1687
1689
|
Parameters
|
1688
1690
|
----------
|
1689
1691
|
origin : topologic.Vertex , optional
|
1690
|
-
The location of the origin of the square. The default is None which results in the square being placed at (0,0,0).
|
1692
|
+
The location of the origin of the square. The default is None which results in the square being placed at (0, 0, 0).
|
1691
1693
|
size : float , optional
|
1692
1694
|
The size of the square. The default is 1.0.
|
1693
1695
|
direction : list , optional
|
1694
|
-
The vector representing the up direction of the square. The default is [0,0,1].
|
1696
|
+
The vector representing the up direction of the square. The default is [0, 0, 1].
|
1695
1697
|
placement : str , optional
|
1696
1698
|
The description of the placement of the origin of the square. This can be "center", "lowerleft", "upperleft", "lowerright", or "upperright". It is case insensitive. The default is "center".
|
1697
1699
|
tolerance : float , optional
|
@@ -1706,14 +1708,14 @@ class Face(Topology):
|
|
1706
1708
|
return Face.Rectangle(origin=origin, width=size, length=size, direction=direction, placement=placement, tolerance=tolerance)
|
1707
1709
|
|
1708
1710
|
@staticmethod
|
1709
|
-
def Star(origin: topologic.Vertex = None, radiusA: float = 1.0, radiusB: float = 0.4, rays: int = 5, direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1711
|
+
def Star(origin: topologic.Vertex = None, radiusA: float = 1.0, radiusB: float = 0.4, rays: int = 5, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1710
1712
|
"""
|
1711
1713
|
Creates a star.
|
1712
1714
|
|
1713
1715
|
Parameters
|
1714
1716
|
----------
|
1715
1717
|
origin : topologic.Vertex, optional
|
1716
|
-
The location of the origin of the star. The default is None which results in the star being placed at (0,0,0).
|
1718
|
+
The location of the origin of the star. The default is None which results in the star being placed at (0, 0, 0).
|
1717
1719
|
radiusA : float , optional
|
1718
1720
|
The outer radius of the star. The default is 1.0.
|
1719
1721
|
radiusB : float , optional
|
@@ -1721,7 +1723,7 @@ class Face(Topology):
|
|
1721
1723
|
rays : int , optional
|
1722
1724
|
The number of star rays. The default is 5.
|
1723
1725
|
direction : list , optional
|
1724
|
-
The vector representing the up direction of the star. The default is [0,0,1].
|
1726
|
+
The vector representing the up direction of the star. The default is [0, 0, 1].
|
1725
1727
|
placement : str , optional
|
1726
1728
|
The description of the placement of the origin of the star. This can be "center", "lowerleft", "upperleft", "lowerright", or "upperright". It is case insensitive. The default is "center".
|
1727
1729
|
tolerance : float , optional
|
@@ -1741,14 +1743,14 @@ class Face(Topology):
|
|
1741
1743
|
return Face.ByWire(wire, tolerance=tolerance)
|
1742
1744
|
|
1743
1745
|
@staticmethod
|
1744
|
-
def Trapezoid(origin: topologic.Vertex = None, widthA: float = 1.0, widthB: float = 0.75, offsetA: float = 0.0, offsetB: float = 0.0, length: float = 1.0, direction: list = [0,0,1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1746
|
+
def Trapezoid(origin: topologic.Vertex = None, widthA: float = 1.0, widthB: float = 0.75, offsetA: float = 0.0, offsetB: float = 0.0, length: float = 1.0, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001) -> topologic.Face:
|
1745
1747
|
"""
|
1746
1748
|
Creates a trapezoid.
|
1747
1749
|
|
1748
1750
|
Parameters
|
1749
1751
|
----------
|
1750
1752
|
origin : topologic.Vertex, optional
|
1751
|
-
The location of the origin of the trapezoid. The default is None which results in the trapezoid being placed at (0,0,0).
|
1753
|
+
The location of the origin of the trapezoid. The default is None which results in the trapezoid being placed at (0, 0, 0).
|
1752
1754
|
widthA : float , optional
|
1753
1755
|
The width of the bottom edge of the trapezoid. The default is 1.0.
|
1754
1756
|
widthB : float , optional
|
@@ -1760,7 +1762,7 @@ class Face(Topology):
|
|
1760
1762
|
length : float , optional
|
1761
1763
|
The length of the trapezoid. The default is 1.0.
|
1762
1764
|
direction : list , optional
|
1763
|
-
The vector representing the up direction of the trapezoid. The default is [0,0,1].
|
1765
|
+
The vector representing the up direction of the trapezoid. The default is [0, 0, 1].
|
1764
1766
|
placement : str , optional
|
1765
1767
|
The description of the placement of the origin of the trapezoid. This can be "center", or "lowerleft". It is case insensitive. The default is "center".
|
1766
1768
|
tolerance : float , optional
|