topologicpy 0.7.34__py3-none-any.whl → 0.7.37__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/Face.py +85 -12
- topologicpy/Topology.py +128 -30
- topologicpy/Wire.py +9 -4
- topologicpy/version.py +1 -1
- {topologicpy-0.7.34.dist-info → topologicpy-0.7.37.dist-info}/METADATA +1 -1
- {topologicpy-0.7.34.dist-info → topologicpy-0.7.37.dist-info}/RECORD +9 -9
- {topologicpy-0.7.34.dist-info → topologicpy-0.7.37.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.34.dist-info → topologicpy-0.7.37.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.34.dist-info → topologicpy-0.7.37.dist-info}/top_level.txt +0 -0
topologicpy/Face.py
CHANGED
@@ -276,9 +276,9 @@ class Face():
|
|
276
276
|
return face
|
277
277
|
|
278
278
|
@staticmethod
|
279
|
-
def ByOffset(face, offset: float = 1.0, tolerance: float = 0.0001):
|
279
|
+
def ByOffset(face, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = "stepOffsetA", stepOffsetKeyB: str = "stepOffsetB", reverse: bool = False, bisectors: bool = False, transferDictionaries: bool = False, tolerance: float = 0.0001, silent: bool = False):
|
280
280
|
"""
|
281
|
-
Creates an offset face from the input face. A positive offset value results in
|
281
|
+
Creates an offset face from the input face. A positive offset value results in an offset to the interior of an anti-clockwise face.
|
282
282
|
|
283
283
|
Parameters
|
284
284
|
----------
|
@@ -286,32 +286,105 @@ class Face():
|
|
286
286
|
The input face.
|
287
287
|
offset : float , optional
|
288
288
|
The desired offset distance. The default is 1.0.
|
289
|
+
offsetKey : str , optional
|
290
|
+
The edge dictionary key under which to find the offset value. If a value cannot be found, the offset input parameter value is used instead. The default is "offset".
|
291
|
+
stepOffsetA : float , optional
|
292
|
+
The amount to offset along the previous edge when transitioning between parallel edges with different offsets. The default is 0.
|
293
|
+
stepOffsetB : float , optional
|
294
|
+
The amount to offset along the next edge when transitioning between parallel edges with different offsets. The default is 0.
|
295
|
+
stepOffsetKeyA : str , optional
|
296
|
+
The vertex dictionary key under which to find the step offset A value. If a value cannot be found, the stepOffsetA input parameter value is used instead. The default is "stepOffsetA".
|
297
|
+
stepOffsetKeyB : str , optional
|
298
|
+
The vertex dictionary key under which to find the step offset B value. If a value cannot be found, the stepOffsetB input parameter value is used instead. The default is "stepOffsetB".
|
299
|
+
bisectors : bool , optional
|
300
|
+
If set to True, The bisectors (seams) edges will be included in the returned wire. This will result in the returned shape to be a shell rather than a face. The default is False.
|
301
|
+
reverse : bool , optional
|
302
|
+
If set to True, the direction of offsets is reversed. Otherwise, it is not. The default is False.
|
303
|
+
transferDictionaries : bool , optional
|
304
|
+
If set to True, the dictionaries of the original wire, its edges, and its vertices are transfered to the new wire. Otherwise, they are not. The default is False.
|
289
305
|
tolerance : float , optional
|
290
306
|
The desired tolerance. The default is 0.0001.
|
307
|
+
silent : bool , optional
|
308
|
+
If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
|
291
309
|
|
292
310
|
Returns
|
293
311
|
-------
|
294
|
-
topologic_core.Face
|
295
|
-
The created face.
|
312
|
+
topologic_core.Face or topologic_core.Shell
|
313
|
+
The created face or shell.
|
296
314
|
|
297
315
|
"""
|
298
316
|
from topologicpy.Wire import Wire
|
317
|
+
from topologicpy.Cluster import Cluster
|
299
318
|
from topologicpy.Topology import Topology
|
319
|
+
from topologicpy.Helper import Helper
|
300
320
|
|
301
321
|
if not Topology.IsInstance(face, "Face"):
|
302
|
-
|
322
|
+
if not silent:
|
323
|
+
print("Face.ByOffset - Warning: The input face parameter is not a valid face. Returning None.")
|
303
324
|
return None
|
325
|
+
|
304
326
|
eb = Face.Wire(face)
|
305
327
|
internal_boundaries = Face.InternalBoundaries(face)
|
306
|
-
offset_external_boundary = Wire.ByOffset(
|
328
|
+
offset_external_boundary = Wire.ByOffset(eb,
|
329
|
+
offset=offset,
|
330
|
+
offsetKey=offsetKey,
|
331
|
+
stepOffsetA=stepOffsetA,
|
332
|
+
stepOffsetB=stepOffsetB,
|
333
|
+
stepOffsetKeyA=stepOffsetKeyA,
|
334
|
+
stepOffsetKeyB=stepOffsetKeyB,
|
335
|
+
reverse=reverse,
|
336
|
+
bisectors=bisectors,
|
337
|
+
transferDictionaries=transferDictionaries,
|
338
|
+
tolerance=tolerance,
|
339
|
+
silent=silent)
|
307
340
|
offset_internal_boundaries = []
|
308
341
|
for internal_boundary in internal_boundaries:
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
342
|
+
offset_internal_boundary = Wire.ByOffset(internal_boundary,
|
343
|
+
offset=offset,
|
344
|
+
offsetKey=offsetKey,
|
345
|
+
stepOffsetA=stepOffsetA,
|
346
|
+
stepOffsetB=stepOffsetB,
|
347
|
+
stepOffsetKeyA=stepOffsetKeyA,
|
348
|
+
stepOffsetKeyB=stepOffsetKeyB,
|
349
|
+
reverse=reverse,
|
350
|
+
bisectors=bisectors,
|
351
|
+
transferDictionaries=transferDictionaries,
|
352
|
+
tolerance=tolerance,
|
353
|
+
silent=silent)
|
354
|
+
offset_internal_boundaries.append(offset_internal_boundary)
|
355
|
+
|
356
|
+
if bisectors == True:
|
357
|
+
return_face = Face.ByOffset(face,
|
358
|
+
offset=offset,
|
359
|
+
offsetKey=offsetKey,
|
360
|
+
stepOffsetA=stepOffsetA,
|
361
|
+
stepOffsetB=stepOffsetB,
|
362
|
+
stepOffsetKeyA=stepOffsetKeyA,
|
363
|
+
stepOffsetKeyB=stepOffsetKeyB,
|
364
|
+
reverse=reverse,
|
365
|
+
bisectors=False,
|
366
|
+
transferDictionaries=transferDictionaries,
|
367
|
+
tolerance=tolerance,
|
368
|
+
silent=silent)
|
369
|
+
all_edges = Topology.Edges(offset_external_boundary)+[Topology.Edges(ib) for ib in offset_internal_boundaries]
|
370
|
+
all_edges += Topology.Edges(face)
|
371
|
+
all_edges = Helper.Flatten(all_edges)
|
372
|
+
all_edges_cluster = Cluster.ByTopologies(all_edges)
|
373
|
+
if reverse == True:
|
374
|
+
return_face = Topology.Slice(return_face, all_edges_cluster)
|
375
|
+
else:
|
376
|
+
return_face = Topology.Slice(face, all_edges_cluster)
|
377
|
+
if not Topology.IsInstance(return_face, "Shell"):
|
378
|
+
if not silent:
|
379
|
+
print("Face.ByOffset - Warning: Could not create shell by slicing. Returning None.")
|
380
|
+
return None
|
381
|
+
return return_face
|
382
|
+
return_face = Face.ByWires(offset_external_boundary, offset_internal_boundaries, tolerance=tolerance)
|
383
|
+
if not Topology.IsInstance(return_face, "Face"):
|
384
|
+
if not silent:
|
385
|
+
print("Face.ByOffset - Warning: Could not create face from wires. Returning None.")
|
313
386
|
return None
|
314
|
-
return
|
387
|
+
return return_face
|
315
388
|
|
316
389
|
@staticmethod
|
317
390
|
def ByShell(shell, origin= None, angTolerance: float = 0.1, tolerance: float = 0.0001, silent=False):
|
@@ -563,7 +636,7 @@ class Face():
|
|
563
636
|
The input wire.
|
564
637
|
tolerance : float , optional
|
565
638
|
The desired tolerance. The default is 0.0001.
|
566
|
-
|
639
|
+
silent : bool , optional
|
567
640
|
If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
|
568
641
|
|
569
642
|
Returns
|
topologicpy/Topology.py
CHANGED
@@ -1893,7 +1893,7 @@ class Topology():
|
|
1893
1893
|
return Topology.ByBREPFile(file)
|
1894
1894
|
|
1895
1895
|
@staticmethod
|
1896
|
-
def ByDXFFile(file):
|
1896
|
+
def ByDXFFile(file, sides: int = 16):
|
1897
1897
|
"""
|
1898
1898
|
Imports a list of topologies from a DXF file.
|
1899
1899
|
This is an experimental method with limited capabilities.
|
@@ -1902,6 +1902,8 @@ class Topology():
|
|
1902
1902
|
----------
|
1903
1903
|
file : a DXF file object
|
1904
1904
|
The DXF file object.
|
1905
|
+
sides : int , optional
|
1906
|
+
The desired number of sides of splines. The default is 16.
|
1905
1907
|
|
1906
1908
|
Returns
|
1907
1909
|
-------
|
@@ -1916,6 +1918,8 @@ class Topology():
|
|
1916
1918
|
from topologicpy.Cell import Cell
|
1917
1919
|
from topologicpy.CellComplex import CellComplex
|
1918
1920
|
from topologicpy.Topology import Topology
|
1921
|
+
from topologicpy.Dictionary import Dictionary
|
1922
|
+
|
1919
1923
|
|
1920
1924
|
try:
|
1921
1925
|
import ezdxf
|
@@ -1936,34 +1940,123 @@ class Topology():
|
|
1936
1940
|
print("Topology.ByDXFFile - Error: the input file parameter is not a valid file. Returning None.")
|
1937
1941
|
return None
|
1938
1942
|
|
1939
|
-
|
1940
|
-
entity_type = entity.dxftype()
|
1941
|
-
converted_entity = None
|
1943
|
+
import ezdxf
|
1942
1944
|
|
1943
|
-
if entity_type == 'POINT':
|
1944
|
-
x, y, z = entity.dxf.location.x, entity.dxf.location.y, entity.dxf.location.z
|
1945
|
-
converted_entity = Vertex.ByCoordinates(x, y, z)
|
1946
1945
|
|
1947
|
-
elif entity_type == 'LINE':
|
1948
|
-
start = Vertex.ByCoordinates(entity.dxf.start.x, entity.dxf.start.y, entity.dxf.start.z)
|
1949
|
-
end = Vertex.ByCoordinates(entity.dxf.end.x, entity.dxf.end.y, entity.dxf.end.z)
|
1950
|
-
converted_entity = Edge.ByVertices(start, end)
|
1951
1946
|
|
1947
|
+
def get_layer_color(layers, layer_name):
|
1948
|
+
# iteration
|
1949
|
+
for layer in layers:
|
1950
|
+
if layer_name == layer.dxf.name:
|
1951
|
+
r,g,b = layer.rgb
|
1952
|
+
return [r,g,b]
|
1953
|
+
return
|
1954
|
+
|
1955
|
+
def convert_entity(entity, file, sides=36):
|
1956
|
+
entity_type = entity.dxftype()
|
1957
|
+
python_dict = entity.dxf.all_existing_dxf_attribs()
|
1958
|
+
keys = python_dict.keys()
|
1959
|
+
for key in keys:
|
1960
|
+
if python_dict[key].__class__ == ezdxf.acc.vector.Vec3:
|
1961
|
+
python_dict[key] = list(python_dict[key])
|
1962
|
+
try:
|
1963
|
+
r,g,b = entity.rgb
|
1964
|
+
except:
|
1965
|
+
rgb_list = get_layer_color(file.layers, entity.dxf.layer)
|
1966
|
+
if rgb_list == None:
|
1967
|
+
rgb_list = [0,0,0]
|
1968
|
+
python_dict['color'] = rgb_list
|
1969
|
+
python_dict['type'] = entity_type
|
1970
|
+
d = Dictionary.ByPythonDictionary(python_dict)
|
1971
|
+
|
1972
|
+
if entity_type == 'POINT':
|
1973
|
+
point = entity.dxf.location.xyz
|
1974
|
+
e = Vertex.ByCoordinates(point[0], point[1], point[2])
|
1975
|
+
e = Topology.SetDictionary(e, d)
|
1976
|
+
|
1977
|
+
elif entity_type == 'LINE':
|
1978
|
+
sp = entity.dxf.start.xyz
|
1979
|
+
ep = entity.dxf.end.xyz
|
1980
|
+
sv = Vertex.ByCoordinates(sp[0], sp[1], sp[2])
|
1981
|
+
ev = Vertex.ByCoordinates(ep[0], ep[1], ep[2])
|
1982
|
+
e = Edge.ByVertices(sv,ev)
|
1983
|
+
e = Topology.SetDictionary(e, d)
|
1984
|
+
|
1985
|
+
elif entity_type == 'POLYLINE':
|
1986
|
+
if entity.dxf.flags == 1:
|
1987
|
+
closed = True
|
1988
|
+
else:
|
1989
|
+
closed = False
|
1990
|
+
vertices = []
|
1991
|
+
for vertex in entity.vertices:
|
1992
|
+
point = vertex.dxf.location.xyz
|
1993
|
+
vertices.append(Vertex.ByCoordinates(point[0], point[1], point[2]))
|
1994
|
+
if entity.dxf.hasattr("closed"):
|
1995
|
+
closed = entity.closed
|
1996
|
+
e = Wire.ByVertices(vertices, close=closed)
|
1997
|
+
e = Topology.SetDictionary(e, d)
|
1998
|
+
|
1999
|
+
elif entity_type == 'LWPOLYLINE':
|
2000
|
+
vertices = []
|
2001
|
+
for point in entity.get_points():
|
2002
|
+
vertices.append(Vertex.ByCoordinates(point[0], point[1], 0))
|
2003
|
+
if entity.dxf.hasattr("closed"):
|
2004
|
+
close = entity.closed
|
2005
|
+
else:
|
2006
|
+
close = False
|
2007
|
+
e = Wire.ByVertices(vertices, close=close)
|
2008
|
+
e = Topology.SetDictionary(e, d)
|
2009
|
+
|
1952
2010
|
elif entity_type == 'CIRCLE':
|
1953
|
-
|
2011
|
+
center = entity.dxf.center.xyz
|
1954
2012
|
radius = entity.dxf.radius
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
2013
|
+
num_points = 36 # Approximate the circle with 36 points
|
2014
|
+
vertices = []
|
2015
|
+
for i in range(sides):
|
2016
|
+
angle = 2 * np.pi * i / num_points
|
2017
|
+
x = center[0] + radius * np.cos(angle)
|
2018
|
+
y = center[1] + radius * np.sin(angle)
|
2019
|
+
z = center[2]
|
2020
|
+
vertices.append(Vertex.ByCoordinates(x,y,z))
|
2021
|
+
e = Wire.ByVertices(vertices, close=True)
|
2022
|
+
e = Topology.SetDictionary(e, d)
|
2023
|
+
|
1962
2024
|
elif entity_type == 'ARC':
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
2025
|
+
center = entity.dxf.center.xyz
|
2026
|
+
radius = entity.dxf.radius
|
2027
|
+
start_angle = np.deg2rad(entity.dxf.start_angle)
|
2028
|
+
end_angle = np.deg2rad(entity.dxf.end_angle)
|
2029
|
+
vertices = []
|
2030
|
+
for i in range(sides+1):
|
2031
|
+
angle = start_angle + (end_angle - start_angle) * i / (num_points - 1)
|
2032
|
+
x = center[0] + radius * np.cos(angle)
|
2033
|
+
y = center[1] + radius * np.sin(angle)
|
2034
|
+
z = center[2]
|
2035
|
+
vertices.append(Vertex.ByCoordinates(x,y,z))
|
2036
|
+
e = Wire.ByVertices(vertices, close=False)
|
2037
|
+
e = Topology.SetDictionary(e, d)
|
2038
|
+
|
2039
|
+
elif entity_type == 'SPLINE':
|
2040
|
+
# draw the curve tangents as red lines:
|
2041
|
+
ct = entity.construction_tool()
|
2042
|
+
vertices = []
|
2043
|
+
for t in np.linspace(0, ct.max_t, 64):
|
2044
|
+
point, derivative = ct.derivative(t, 1)
|
2045
|
+
vertices.append(Vertex.ByCoordinates(list(point)))
|
2046
|
+
converted_entity = Wire.ByVertices(vertices, close=entity.closed)
|
2047
|
+
vertices = []
|
2048
|
+
for i in range(sides+1):
|
2049
|
+
if i == 0:
|
2050
|
+
u = 0
|
2051
|
+
elif i == sides:
|
2052
|
+
u = 1
|
2053
|
+
else:
|
2054
|
+
u = float(i)/float(sides)
|
2055
|
+
vertices.append(Wire.VertexByParameter(converted_entity, u))
|
1966
2056
|
|
2057
|
+
e = Wire.ByVertices(vertices, close=entity.closed)
|
2058
|
+
e = Topology.SetDictionary(e, d)
|
2059
|
+
|
1967
2060
|
elif entity_type == 'MESH':
|
1968
2061
|
vertices = [list(v) for v in entity.vertices]
|
1969
2062
|
faces = [list(face) for face in entity.faces]
|
@@ -1976,16 +2069,17 @@ class Topology():
|
|
1976
2069
|
temp = Shell.ByFaces(Topology.Faces(converted_entity))
|
1977
2070
|
if not Topology.IsInstance(temp, "Shell"):
|
1978
2071
|
temp = converted_entity
|
1979
|
-
|
1980
|
-
|
2072
|
+
e = temp
|
2073
|
+
e = Topology.SetDictionary(e, d)
|
2074
|
+
return e
|
1981
2075
|
|
1982
|
-
def convert_insert(entity, file):
|
2076
|
+
def convert_insert(entity, file, sides=16):
|
1983
2077
|
block_name = entity.dxf.name
|
1984
2078
|
block = file.blocks.get(block_name)
|
1985
2079
|
converted_entities = []
|
1986
2080
|
|
1987
2081
|
for block_entity in block:
|
1988
|
-
converted_entity = convert_entity(block_entity)
|
2082
|
+
converted_entity = convert_entity(block_entity, sides=sides)
|
1989
2083
|
if converted_entity is not None:
|
1990
2084
|
converted_entities.append(converted_entity)
|
1991
2085
|
|
@@ -2006,9 +2100,9 @@ class Topology():
|
|
2006
2100
|
continue # Ignore TEXT and MTEXT
|
2007
2101
|
|
2008
2102
|
if entity_type == 'INSERT':
|
2009
|
-
converted_entities.extend(convert_insert(entity, file))
|
2103
|
+
converted_entities.extend(convert_insert(entity, file, sides=sides))
|
2010
2104
|
else:
|
2011
|
-
converted_entity = convert_entity(entity)
|
2105
|
+
converted_entity = convert_entity(entity, file, sides=sides)
|
2012
2106
|
if converted_entity is not None:
|
2013
2107
|
converted_entities.append(converted_entity)
|
2014
2108
|
|
@@ -2017,7 +2111,7 @@ class Topology():
|
|
2017
2111
|
return converted_entities
|
2018
2112
|
|
2019
2113
|
@staticmethod
|
2020
|
-
def ByDXFPath(path):
|
2114
|
+
def ByDXFPath(path, sides: int = 16):
|
2021
2115
|
"""
|
2022
2116
|
Imports a list of topologies from a DXF file path.
|
2023
2117
|
This is an experimental method with limited capabilities.
|
@@ -2026,6 +2120,8 @@ class Topology():
|
|
2026
2120
|
----------
|
2027
2121
|
path : str
|
2028
2122
|
The path to the DXF file.
|
2123
|
+
sides : int , optional
|
2124
|
+
The desired number of sides of splines. The default is 16.
|
2029
2125
|
|
2030
2126
|
Returns
|
2031
2127
|
-------
|
@@ -2057,7 +2153,7 @@ class Topology():
|
|
2057
2153
|
if not file:
|
2058
2154
|
print("Topology.ByDXFPath - Error: the input file parameter is not a valid file. Returning None.")
|
2059
2155
|
return None
|
2060
|
-
return Topology.ByDXFFile(file)
|
2156
|
+
return Topology.ByDXFFile(file, sides=sides)
|
2061
2157
|
|
2062
2158
|
@staticmethod
|
2063
2159
|
def ByIFCFile(file, transferDictionaries=False, includeTypes=[], excludeTypes=[]):
|
@@ -6989,6 +7085,8 @@ class Topology():
|
|
6989
7085
|
if isinstance(colorKey, str):
|
6990
7086
|
f_color = Dictionary.ValueAtKey(d, colorKey)
|
6991
7087
|
if f_color:
|
7088
|
+
vertexColor = Color.PlotlyColor(f_color, alpha=1.0, useAlpha=False)
|
7089
|
+
edgeColor = Color.PlotlyColor(f_color, alpha=1.0, useAlpha=False)
|
6992
7090
|
faceColor = Color.PlotlyColor(f_color, alpha=1.0, useAlpha=False)
|
6993
7091
|
faceOpacity = Dictionary.ValueAtKey(d, opacityKey) or faceOpacity
|
6994
7092
|
data += Plotly.DataByTopology(topology=topology,
|
topologicpy/Wire.py
CHANGED
@@ -310,7 +310,7 @@ class Wire():
|
|
310
310
|
return Wire.ByEdges(edges, tolerance=tolerance)
|
311
311
|
|
312
312
|
@staticmethod
|
313
|
-
def ByOffset(wire, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = "stepOffsetA", stepOffsetKeyB: str = "stepOffsetB", bisectors: bool = False, transferDictionaries: bool = False, tolerance: float = 0.0001, silent: bool = False):
|
313
|
+
def ByOffset(wire, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = "stepOffsetA", stepOffsetKeyB: str = "stepOffsetB", reverse: bool = False, bisectors: bool = False, transferDictionaries: bool = False, tolerance: float = 0.0001, silent: bool = False):
|
314
314
|
"""
|
315
315
|
Creates an offset wire from the input wire. A positive offset value results in an offset to the interior of an anti-clockwise wire.
|
316
316
|
|
@@ -330,9 +330,11 @@ class Wire():
|
|
330
330
|
The vertex dictionary key under which to find the step offset A value. If a value cannot be found, the stepOffsetA input parameter value is used instead. The default is "stepOffsetA".
|
331
331
|
stepOffsetKeyB : str , optional
|
332
332
|
The vertex dictionary key under which to find the step offset B value. If a value cannot be found, the stepOffsetB input parameter value is used instead. The default is "stepOffsetB".
|
333
|
+
reverse : bool , optional
|
334
|
+
If set to True, the direction of offsets is reversed. Otherwise, it is not. The default is False.
|
333
335
|
bisectors : bool , optional
|
334
336
|
If set to True, The bisectors (seams) edges will be included in the returned wire. The default is False.
|
335
|
-
|
337
|
+
transferDictionaries : bool , optional
|
336
338
|
If set to True, the dictionaries of the original wire, its edges, and its vertices are transfered to the new wire. Otherwise, they are not. The default is False.
|
337
339
|
tolerance : float , optional
|
338
340
|
The desired tolerance. The default is 0.0001.
|
@@ -359,6 +361,10 @@ class Wire():
|
|
359
361
|
print("Wire.ByOffset - Error: The input wire parameter is not a valid wire. Returning None.")
|
360
362
|
return None
|
361
363
|
|
364
|
+
if reverse == True:
|
365
|
+
fac = -1
|
366
|
+
else:
|
367
|
+
fac = 1
|
362
368
|
origin = Vertex.Origin()
|
363
369
|
temp_vertices = [Topology.Vertices(wire)[0], Topology.Vertices(wire)[1], Topology.Centroid(wire)]
|
364
370
|
temp_face = Face.ByWire(Wire.ByVertices(temp_vertices, close=True))
|
@@ -377,6 +383,7 @@ class Wire():
|
|
377
383
|
d_offset = Dictionary.ValueAtKey(d, offsetKey)
|
378
384
|
if d_offset == None:
|
379
385
|
d_offset = offset
|
386
|
+
d_offset = d_offset*fac
|
380
387
|
offsets.append(d_offset)
|
381
388
|
offset_edge = Edge.ByOffset2D(edge, d_offset)
|
382
389
|
offset_edges.append(offset_edge)
|
@@ -387,7 +394,6 @@ class Wire():
|
|
387
394
|
if Wire.IsClosed(wire) == False:
|
388
395
|
v1 = Edge.StartVertex(offset_edges[0])
|
389
396
|
if transferDictionaries == True:
|
390
|
-
d_temp = Topology.Dictionary(v_a)
|
391
397
|
v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a), silent=True)
|
392
398
|
edge_dictionaries.append(Topology.Dictionary(edges[i]))
|
393
399
|
final_vertices.append(v1)
|
@@ -400,7 +406,6 @@ class Wire():
|
|
400
406
|
if bisectors == True:
|
401
407
|
bisectors_list.append(Edge.ByVertices(v_a, v1))
|
402
408
|
if transferDictionaries == True:
|
403
|
-
d_temp = Topology.Dictionary(v_a)
|
404
409
|
v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a))
|
405
410
|
edge_dictionaries.append(Topology.Dictionary(edges[i]))
|
406
411
|
final_vertices.append(v1)
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.7.
|
1
|
+
__version__ = '0.7.37'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.37
|
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
|
License: MIT License
|
@@ -9,7 +9,7 @@ topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
|
|
9
9
|
topologicpy/Dictionary.py,sha256=KqJ29YyE23Y3Xc6XmKLSCZXRfBvm-OEOxlMZ4dt-rfM,27094
|
10
10
|
topologicpy/Edge.py,sha256=vhYHkobSLGSWV-oe2oJFFDobqFToDyb7s71yQ840AAA,65166
|
11
11
|
topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
|
12
|
-
topologicpy/Face.py,sha256=
|
12
|
+
topologicpy/Face.py,sha256=SrP7LbOK9wjArYTO2fDVrtxItGXNkCMqmMRNz4-46gA,115473
|
13
13
|
topologicpy/Graph.py,sha256=ICwFUYLka6tEPMo43I9QAe24ljItMUZOZYL21xpDPIg,392146
|
14
14
|
topologicpy/Grid.py,sha256=Q-2WNBkvIsJks7pbGkzzkRWVB4fTMYgWipG3lcDXbpE,18496
|
15
15
|
topologicpy/Helper.py,sha256=mLwJmhyc-d-JqW82MBf7JwM91zWHVx8RzOmndPWHm-k,17717
|
@@ -21,14 +21,14 @@ topologicpy/Polyskel.py,sha256=4R5_DEdfrmi-4gR6axHNoHTCSAE2TCekOyN8jvb7bHQ,19722
|
|
21
21
|
topologicpy/Shell.py,sha256=bJ8zu5gj-TSOADR-p3YQ9yLPHFTffnv-29uD5b6Zvuc,79912
|
22
22
|
topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
|
23
23
|
topologicpy/Sun.py,sha256=_gZfVyH0SDLQmmt775UeeAJ_BtwXO1STQnUMV1qkU0s,37161
|
24
|
-
topologicpy/Topology.py,sha256=
|
24
|
+
topologicpy/Topology.py,sha256=Sfw0C5Sd1m3ndLyM_zrCLzegfMd6ytnaK82J_ToK5lQ,366264
|
25
25
|
topologicpy/Vector.py,sha256=WQQUbwrg7VKImtxuBUi2i-FRiPT77WlrzLP05gdXKM8,33079
|
26
26
|
topologicpy/Vertex.py,sha256=EQdVYHmW85_pZdHZB3N8pEi0GiadCCkF3z_oqohA7B0,71161
|
27
|
-
topologicpy/Wire.py,sha256=
|
27
|
+
topologicpy/Wire.py,sha256=Ls2ItdNQ_qbC1RUc8bAtGbM5B5A-uShjHdiOFVVwx-8,153711
|
28
28
|
topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
|
29
|
-
topologicpy/version.py,sha256=
|
30
|
-
topologicpy-0.7.
|
31
|
-
topologicpy-0.7.
|
32
|
-
topologicpy-0.7.
|
33
|
-
topologicpy-0.7.
|
34
|
-
topologicpy-0.7.
|
29
|
+
topologicpy/version.py,sha256=ELkwc8QfDXR6OC99fHNSgYmlBjnbBmo_0j-69MXQmNA,23
|
30
|
+
topologicpy-0.7.37.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
|
31
|
+
topologicpy-0.7.37.dist-info/METADATA,sha256=ZOohbLJX-LIHwG-aIFZUdZbgYqxppOt5uroiZvyoobU,10916
|
32
|
+
topologicpy-0.7.37.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
33
|
+
topologicpy-0.7.37.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
34
|
+
topologicpy-0.7.37.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|