topologicpy 0.7.30__py3-none-any.whl → 0.7.36__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 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 a smaller face to the inside of the input face.
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
- print("Face.ByOffset - Warning: The input face parameter is not a valid face. Returning None.")
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(wire=eb, offset=offset, bisectors=False, tolerance=tolerance)
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
- offset_internal_boundaries.append(Wire.ByOffset(wire=internal_boundary, offset=offset, bisectors=False, tolerance=tolerance))
310
- face = Face.ByWires(offset_external_boundary, offset_internal_boundaries, tolerance=tolerance)
311
- if not Topology.IsInstance(face, "Face"):
312
- print("Face.ByOffset - Warning: Could not create face from wires. Returning None.")
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 face
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
- silent : bool , optional
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/Graph.py CHANGED
@@ -1142,8 +1142,6 @@ class Graph:
1142
1142
  The desired key name to use for geometry. The default is "brep".
1143
1143
  typeKey : str , optional
1144
1144
  The dictionary key to use to look up the type of the node. The default is "type".
1145
- geometryKey : str , optional
1146
- The dictionary key to use to look up the geometry of the node. The default is "brep".
1147
1145
  spaceType : str , optional
1148
1146
  The dictionary string value to use to look up vertices of type "space". The default is "space".
1149
1147
  wallType : str , optional
@@ -1778,7 +1776,7 @@ class Graph:
1778
1776
  edges_ds = [] # A list to hold the vertices data structures until we can build the actual graphs
1779
1777
  # Access specific columns within the grouped DataFrame
1780
1778
  for graph_id, group_edge_df in grouped_edges:
1781
- #vertices = vertices_ds[graph_id]
1779
+ vertices = vertices_ds[graph_id]
1782
1780
  edges = []
1783
1781
  es = [] # a list to check for duplicate edges
1784
1782
  duplicate_edges = 0
@@ -1807,7 +1805,11 @@ class Graph:
1807
1805
  values = [label, mask]+featureList
1808
1806
  if not (src_id == dst_id) and not [src_id, dst_id] in es and not [dst_id, src_id] in es:
1809
1807
  es.append([src_id, dst_id])
1810
- edge = Edge.ByVertices([vertices[src_id], vertices[dst_id]], tolerance=tolerance)
1808
+ try:
1809
+ edge = Edge.ByVertices([vertices[src_id], vertices[dst_id]], tolerance=tolerance)
1810
+ except:
1811
+ print("Graph.ByCSVPath - Warning: Failed to create and add a edge to the list of edges.")
1812
+ edge = None
1811
1813
  if Topology.IsInstance(edge, "Edge"):
1812
1814
  d = Dictionary.ByKeysValues(edge_keys, values)
1813
1815
  if Topology.IsInstance(d, "Dictionary"):
@@ -4886,14 +4888,14 @@ class Graph:
4886
4888
  edgeSRCHeader="src_id", edgeDSTHeader="dst_id",
4887
4889
  edgeLabelHeader="label", edgeFeaturesHeader="feat",
4888
4890
  edgeTrainMaskHeader="train_mask", edgeValidateMaskHeader="val_mask", edgeTestMaskHeader="test_mask",
4889
- edgeMaskKey=None,
4891
+ edgeMaskKey="mask",
4890
4892
  edgeTrainRatio=0.8, edgeValidateRatio=0.1, edgeTestRatio=0.1,
4891
4893
  bidirectional=True,
4892
4894
 
4893
4895
  nodeLabelKey="label", defaultNodeLabel=0, nodeFeaturesKeys=[],
4894
4896
  nodeIDHeader="node_id", nodeLabelHeader="label", nodeFeaturesHeader="feat",
4895
4897
  nodeTrainMaskHeader="train_mask", nodeValidateMaskHeader="val_mask", nodeTestMaskHeader="test_mask",
4896
- nodeMaskKey=None,
4898
+ nodeMaskKey="mask",
4897
4899
  nodeTrainRatio=0.8, nodeValidateRatio=0.1, nodeTestRatio=0.1,
4898
4900
  mantissa=6, tolerance=0.0001, overwrite=False):
4899
4901
  """
@@ -4920,6 +4922,8 @@ class Graph:
4920
4922
  The edge label dictionary key saved in each graph edge. The default is "label".
4921
4923
  defaultEdgeLabel : int , optional
4922
4924
  The default edge label to use if no edge label is found. The default is 0.
4925
+ edgeLabelHeader : str , optional
4926
+ The desired edge label column header. The default is "label".
4923
4927
  edgeSRCHeader : str , optional
4924
4928
  The desired edge source column header. The default is "src_id".
4925
4929
  edgeDSTHeader : str , optional
@@ -4967,6 +4971,9 @@ class Graph:
4967
4971
  The desired node validate mask column header. The default is "val_mask".
4968
4972
  nodeTestMaskHeader : str , optional
4969
4973
  The desired node test mask column header. The default is "test_mask".
4974
+ nodeMaskKey : str , optional
4975
+ The dictionary key where the node train, validate, test category is to be found. The value should be 0 for train
4976
+ 1 for validate, and 2 for test. If no key is found, the ratio of train/validate/test will be used. The default is "mask".
4970
4977
  nodeTrainRatio : float , optional
4971
4978
  The desired ratio of the node data to use for training. The number must be between 0 and 1. The default is 0.8 which means 80% of the data will be used for training.
4972
4979
  This value is ignored if an nodeMaskKey is foud.
topologicpy/Plotly.py CHANGED
@@ -2032,6 +2032,10 @@ class Plotly:
2032
2032
  return None
2033
2033
  if not camera == None and not center == None and not up == None:
2034
2034
  figure = Plotly.SetCamera(figure, camera=camera, center=center, up=up, projection=projection)
2035
+ figure.update_layout(
2036
+ autosize=True,
2037
+ margin=dict(l=40, r=40, t=40, b=40)
2038
+ )
2035
2039
  if renderer.lower() == "offline":
2036
2040
  ofl.plot(figure)
2037
2041
  else:
topologicpy/Shell.py CHANGED
@@ -1189,12 +1189,12 @@ class Shell():
1189
1189
  ----------
1190
1190
  shell : topologic_core.Shell
1191
1191
  The input shell.
1192
- tolerance : float, optional
1193
- The desired tolerance. The default is 0.0001.
1194
1192
  origin : topologic_core.Vertex , optional
1195
1193
  The desired origin of the plane unto which the planar shell will be projected. If set to None, the centroid of the input shell will be chosen. The default is None.
1196
1194
  mantissa : int , optional
1197
1195
  The desired length of the mantissa. The default is 6.
1196
+ tolerance : float, optional
1197
+ The desired tolerance. The default is 0.0001.
1198
1198
 
1199
1199
  Returns
1200
1200
  -------
topologicpy/Topology.py CHANGED
@@ -1955,11 +1955,13 @@ class Topology():
1955
1955
  converted_entity = Wire.Circle(origin, radius)
1956
1956
 
1957
1957
  elif entity_type in ['POLYLINE', 'LWPOLYLINE']:
1958
- vertices = [Vertex.ByCoordinates(p[0], p[1], p[2]) for p in entity.points()]
1958
+ with entity.points('xyz') as points:
1959
+ vertices = [Vertex.ByCoordinates(*_) for _ in points]
1959
1960
  converted_entity = Wire.ByVertices(vertices)
1960
1961
 
1961
1962
  elif entity_type == 'ARC':
1962
- vertices = [Vertex.ByCoordinates(p.x, p.y, p.z) for p in entity.vertices()]
1963
+ with entity.points('xyz') as points:
1964
+ vertices = [Vertex.ByCoordinates(*_) for _ in points]
1963
1965
  converted_entity = Wire.ByVertices(vertices)
1964
1966
 
1965
1967
  elif entity_type == 'MESH':
@@ -7393,6 +7395,12 @@ class Topology():
7393
7395
  The list of vertices.
7394
7396
 
7395
7397
  """
7398
+ from topologicpy.Graph import Graph
7399
+
7400
+ if Topology.IsInstance(topology, "Vertex"):
7401
+ return []
7402
+ if Topology.IsInstance(topology, "Graph"):
7403
+ return Graph.Vertices(topology)
7396
7404
  return Topology.SubTopologies(topology=topology, subTopologyType="vertex")
7397
7405
 
7398
7406
  @staticmethod
@@ -7411,8 +7419,11 @@ class Topology():
7411
7419
  The list of edges.
7412
7420
 
7413
7421
  """
7422
+ from topologicpy.Graph import Graph
7414
7423
  if Topology.IsInstance(topology, "Edge") or Topology.IsInstance(topology, "Vertex"):
7415
7424
  return []
7425
+ if Topology.IsInstance(topology, "Graph"):
7426
+ return Graph.Edges(topology)
7416
7427
  return Topology.SubTopologies(topology=topology, subTopologyType="edge")
7417
7428
 
7418
7429
  @staticmethod
topologicpy/Vertex.py CHANGED
@@ -511,7 +511,7 @@ class Vertex():
511
511
  # Calculate the Euclidean distance
512
512
  distance = np.linalg.norm(point1 - point2)
513
513
 
514
- return distance
514
+ return float(distance)
515
515
 
516
516
  def distance_point_to_line(point, line_start, line_end):
517
517
  # Convert input points to NumPy arrays for vector operations
@@ -1493,8 +1493,8 @@ class Vertex():
1493
1493
 
1494
1494
  # Calculate the distance between the closest point and the given point
1495
1495
  distance = np.linalg.norm(point - closest_point)
1496
-
1497
- return distance
1496
+ return float(distance)
1497
+
1498
1498
  if not Topology.IsInstance(vertex, "Vertex"):
1499
1499
  print("Vertex.PerpendicularDistance - Error: The input vertex is not a valid topologic vertex. Returning None.")
1500
1500
  return None
topologicpy/Wire.py CHANGED
@@ -21,7 +21,7 @@ from topologicpy.Topology import Topology
21
21
  import math
22
22
  import itertools
23
23
 
24
- class Wire(Topology):
24
+ class Wire():
25
25
  @staticmethod
26
26
  def Arc(startVertex, middleVertex, endVertex, sides: int = 16, close: bool = True, tolerance: float = 0.0001):
27
27
  """
@@ -310,7 +310,7 @@ class Wire(Topology):
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, 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,8 +330,12 @@ class Wire(Topology):
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.
337
+ transferDictionaries : bool , optional
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.
335
339
  tolerance : float , optional
336
340
  The desired tolerance. The default is 0.0001.
337
341
  silent : bool , optional
@@ -357,6 +361,10 @@ class Wire(Topology):
357
361
  print("Wire.ByOffset - Error: The input wire parameter is not a valid wire. Returning None.")
358
362
  return None
359
363
 
364
+ if reverse == True:
365
+ fac = -1
366
+ else:
367
+ fac = 1
360
368
  origin = Vertex.Origin()
361
369
  temp_vertices = [Topology.Vertices(wire)[0], Topology.Vertices(wire)[1], Topology.Centroid(wire)]
362
370
  temp_face = Face.ByWire(Wire.ByVertices(temp_vertices, close=True))
@@ -369,33 +377,74 @@ class Wire(Topology):
369
377
  offset_edges = []
370
378
  final_vertices = []
371
379
  bisectors_list = []
380
+ edge_dictionaries = []
372
381
  for edge in edges:
373
382
  d = Topology.Dictionary(edge)
374
383
  d_offset = Dictionary.ValueAtKey(d, offsetKey)
375
384
  if d_offset == None:
376
385
  d_offset = offset
386
+ d_offset = d_offset*fac
377
387
  offsets.append(d_offset)
378
388
  offset_edge = Edge.ByOffset2D(edge, d_offset)
379
389
  offset_edges.append(offset_edge)
380
- o_edges = []
381
390
  for i in range(len(edges)):
382
- edge_a = edges[i]
383
391
  o_edge_a = offset_edges[i]
384
392
  v_a = Edge.StartVertex(edges[i])
385
393
  if i == 0:
386
394
  if Wire.IsClosed(wire) == False:
387
395
  v1 = Edge.StartVertex(offset_edges[0])
396
+ if transferDictionaries == True:
397
+ v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a), silent=True)
398
+ edge_dictionaries.append(Topology.Dictionary(edges[i]))
388
399
  final_vertices.append(v1)
389
400
  if bisectors == True:
390
401
  bisectors_list.append(Edge.ByVertices(v_a, v1))
391
402
  else:
392
403
  prev_edge = offset_edges[-1]
404
+ v1 = Edge.Intersect2D(prev_edge, o_edge_a, silent=True)
405
+ if Topology.IsInstance(v1, "Vertex"):
406
+ if bisectors == True:
407
+ bisectors_list.append(Edge.ByVertices(v_a, v1))
408
+ if transferDictionaries == True:
409
+ v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a))
410
+ edge_dictionaries.append(Topology.Dictionary(edges[i]))
411
+ final_vertices.append(v1)
412
+ else:
413
+ connection = Edge.Connection(prev_edge, o_edge_a)
414
+ if Topology.IsInstance(connection, "Edge"):
415
+ d = Topology.Dictionary(v_a)
416
+ d_stepOffsetA = Dictionary.ValueAtKey(d, stepOffsetKeyA)
417
+ if d_stepOffsetA == None:
418
+ d_stepOffsetA = stepOffsetA
419
+ d_stepOffsetB = Dictionary.ValueAtKey(d, stepOffsetKeyB)
420
+ if d_stepOffsetB == None:
421
+ d_stepOffsetB = stepOffsetB
422
+ v1_1 = Topology.TranslateByDirectionDistance(Edge.EndVertex(prev_edge),
423
+ direction = Vector.Reverse(Edge.Direction(prev_edge)),
424
+ distance = d_stepOffsetA)
425
+
426
+ v1_2 = Topology.TranslateByDirectionDistance(Edge.StartVertex(o_edge_a),
427
+ direction = Edge.Direction(o_edge_a),
428
+ distance = d_stepOffsetB)
429
+ bisectors_list.append(Edge.ByVertices(v_a, v1_1))
430
+ bisectors_list.append(Edge.ByVertices(v_a, v1_2))
431
+ final_vertices.append(v1_1)
432
+ final_vertices.append(v1_2)
433
+ if transferDictionaries == True:
434
+ v1_1 = Topology.SetDictionary(v1_1, Topology.Dictionary(v_a), silent=True)
435
+ v1_2 = Topology.SetDictionary(v1_2, Topology.Dictionary(v_a), silent=True)
436
+ edge_dictionaries.append(Topology.Dictionary(v_a))
437
+ edge_dictionaries.append(Topology.Dictionary(edges[i]))
393
438
  else:
394
439
  prev_edge = offset_edges[i-1]
395
440
  v1 = Edge.Intersect2D(prev_edge, o_edge_a, silent=True)
396
441
  if Topology.IsInstance(v1, "Vertex"):
397
442
  if bisectors == True:
398
443
  bisectors_list.append(Edge.ByVertices(v_a, v1))
444
+ if transferDictionaries == True:
445
+ d_temp = Topology.Dictionary(v_a)
446
+ v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a), silent=True)
447
+ edge_dictionaries.append(Topology.Dictionary(edges[i]))
399
448
  final_vertices.append(v1)
400
449
  else:
401
450
  connection = Edge.Connection(prev_edge, o_edge_a)
@@ -418,31 +467,26 @@ class Wire(Topology):
418
467
  bisectors_list.append(Edge.ByVertices(v_a, v1_2))
419
468
  final_vertices.append(v1_1)
420
469
  final_vertices.append(v1_2)
470
+ if transferDictionaries == True:
471
+ v1_1 = Topology.SetDictionary(v1_1, Topology.Dictionary(v_a))
472
+ v1_2 = Topology.SetDictionary(v1_2, Topology.Dictionary(v_a))
473
+ edge_dictionaries.append(Topology.Dictionary(v_a))
474
+ edge_dictionaries.append(Topology.Dictionary(edges[i]))
475
+ v_a = Edge.EndVertex(edges[-1])
421
476
  if Wire.IsClosed(wire) == False:
422
- v_a = Edge.EndVertex(edges[-1])
423
477
  v1 = Edge.EndVertex(offset_edges[-1])
424
478
  final_vertices.append(v1)
479
+ if transferDictionaries == True:
480
+ v1 = Topology.SetDictionary(v1, Topology.Dictionary(v_a), silent=True)
425
481
  if bisectors == True:
426
482
  bisectors_list.append(Edge.ByVertices(v_a, v1))
427
- else:
428
- v1 = Edge.Intersect2D(o_edge_a, offset_edges[0], silent=True)
429
- if Topology.IsInstance(v1, "Vertex"):
430
- if bisectors == True:
431
- bisectors_list.append(Edge.ByVertices(Edge.StartVertex(edges[0]), v1))
432
- final_vertices.append(v1)
433
- else:
434
- connection = Edge.Connection(offset_edges[0], o_edge_a)
435
- if Topology.IsInstance(connection, "Edge"):
436
- v1_1 = Edge.StartVertex(connection)
437
- v1_2 = Edge.EndVertex(connection)
438
- bisectors_list.append(Edge.ByVertices(v_a, v1_1))
439
- bisectors_list.append(Edge.ByVertices(v_a, v1_2))
440
- final_vertices.append(v1_1)
441
- final_vertices.append(v1_2)
442
483
 
484
+
443
485
  return_wire = Wire.ByVertices(final_vertices, close=Wire.IsClosed(wire))
444
- if bisectors == True:
445
- return_wire = Topology.SelfMerge(Cluster.ByTopologies(bisectors_list+Topology.Edges(return_wire)))
486
+ wire_edges = Topology.Edges(return_wire)
487
+ if transferDictionaries == True:
488
+ for i, wire_edge in enumerate(wire_edges):
489
+ wire_edge = Topology.SetDictionary(wire_edge, edge_dictionaries[i], silent=True)
446
490
  if not Topology.IsInstance(return_wire, "Wire"):
447
491
  if not silent:
448
492
  print("Wire.ByOffset - Warning: The resulting wire is not well-formed, please check your offsets.")
@@ -450,7 +494,24 @@ class Wire(Topology):
450
494
  if not Wire.IsManifold(return_wire) and bisectors == False:
451
495
  if not silent:
452
496
  print("Wire.ByOffset - Warning: The resulting wire is non-manifold, please check your offsets.")
497
+ if bisectors == True:
498
+ temp_return_wire = Topology.SelfMerge(Cluster.ByTopologies(Topology.Edges(return_wire)+bisectors_list))
499
+ if transferDictionaries == True:
500
+ sel_vertices = Topology.Vertices(return_wire)
501
+ sel_vertices += Topology.Vertices(flat_wire)
502
+ edges = Topology.Edges(return_wire)
503
+ sel_edges = []
504
+ for edge in edges:
505
+ d = Topology.Dictionary(edge)
506
+ c = Topology.Centroid(edge)
507
+ c = Topology.SetDictionary(c, d)
508
+ sel_edges.append(c)
509
+ temp_return_wire = Topology.TransferDictionariesBySelectors(temp_return_wire, sel_vertices, tranVertices=True)
510
+ temp_return_wire = Topology.TransferDictionariesBySelectors(temp_return_wire, sel_edges, tranEdges=True)
511
+ return_wire = temp_return_wire
453
512
  return_wire = Topology.Unflatten(return_wire, direction=normal, origin=origin)
513
+ if transferDictionaries == True:
514
+ return_wire = Topology.SetDictionary(return_wire, Topology.Dictionary(wire), silent=True)
454
515
  return return_wire
455
516
 
456
517
  @staticmethod
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.30'
1
+ __version__ = '0.7.36'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.30
3
+ Version: 0.7.36
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,26 +9,26 @@ 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=u-DPS5guhzfwxZUuUNYqtPJG6OdeHpY1XQHRSKn6rqk,110148
13
- topologicpy/Graph.py,sha256=ZU4etwhj6-_JUci3-CK5AoMUoFaTMtVvRWdSHW52SR0,391660
12
+ topologicpy/Face.py,sha256=SrP7LbOK9wjArYTO2fDVrtxItGXNkCMqmMRNz4-46gA,115473
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
16
16
  topologicpy/Honeybee.py,sha256=vcBECJlgWVjNNdD9ZmjNik_pA1Y_ZNoOorsQb2CiyGA,21965
17
17
  topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
18
18
  topologicpy/Neo4j.py,sha256=Gy2PS4Ky8BNhohKreoV4zgzW9OXCjhSwiZF_Aq21_wU,19589
19
- topologicpy/Plotly.py,sha256=iJ7zCoe2V1PqGH7GzTTvSfCXY5aRCG0fdYf4Sh6igZ8,98844
19
+ topologicpy/Plotly.py,sha256=qMhBMAYoNMsc-cKdNpqM2p9rqAVXWvBNTzmTKw7iU_0,98963
20
20
  topologicpy/Polyskel.py,sha256=4R5_DEdfrmi-4gR6axHNoHTCSAE2TCekOyN8jvb7bHQ,19722
21
- topologicpy/Shell.py,sha256=n91gViexVMcH3Iors6xeC_Wnn38E40KLqKq5MXQiDU4,79912
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=Z-zddTGL_wkQmhrkXlredpQxx7Myd4Xp-yNw2d95iks,361647
24
+ topologicpy/Topology.py,sha256=iL2kCRHtFTMBqFbvdJy_-E0NtLChsD7606x_F1UrKFE,362074
25
25
  topologicpy/Vector.py,sha256=WQQUbwrg7VKImtxuBUi2i-FRiPT77WlrzLP05gdXKM8,33079
26
- topologicpy/Vertex.py,sha256=xnCoPG7BTKBG-JU3C0e11KcpDJbDt9t1Ahj4f5Ul13I,71151
27
- topologicpy/Wire.py,sha256=cCdaQzjiDQWSZ7it0V1i114-6Swjh4rv8hTHgRiEf7Y,149195
26
+ topologicpy/Vertex.py,sha256=EQdVYHmW85_pZdHZB3N8pEi0GiadCCkF3z_oqohA7B0,71161
27
+ topologicpy/Wire.py,sha256=Ls2ItdNQ_qbC1RUc8bAtGbM5B5A-uShjHdiOFVVwx-8,153711
28
28
  topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
29
- topologicpy/version.py,sha256=CbJ3GQqlDb-M7QMe4MLNpbEUMiZs9eF7jGbgZtwVIIc,23
30
- topologicpy-0.7.30.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
31
- topologicpy-0.7.30.dist-info/METADATA,sha256=0JnIk0hsi9_YxehWfEHHrP_vXgPLtSkOHSRxzfL2Oac,10916
32
- topologicpy-0.7.30.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
33
- topologicpy-0.7.30.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
34
- topologicpy-0.7.30.dist-info/RECORD,,
29
+ topologicpy/version.py,sha256=h99CjXFyBnlX7m8jRVJPMpJ90azTXpjOurMUUqAElKY,23
30
+ topologicpy-0.7.36.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
31
+ topologicpy-0.7.36.dist-info/METADATA,sha256=3wd8EHITpe7rztfsjLyGZTUDqeahTQrEAzXcf_ndvWo,10916
32
+ topologicpy-0.7.36.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
33
+ topologicpy-0.7.36.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
34
+ topologicpy-0.7.36.dist-info/RECORD,,