diff --git a/src/topologicpy/Face.py b/src/topologicpy/Face.py index cd2f262..e0f2186 100644 --- a/src/topologicpy/Face.py +++ b/src/topologicpy/Face.py @@ -1909,7 +1909,7 @@ def Squircle(origin = None, radius: float = 0.5, sides: int = 121, a: float = 2. return Face.ByWire(wire) @staticmethod - def Star(origin= None, radiusA: float = 1.0, radiusB: float = 0.4, rays: int = 5, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001): + def Star(origin= None, radiusA: float = 0.5, radiusB: float = 0.2, rays: int = 8, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001): """ Creates a star. diff --git a/src/topologicpy/Topology.py b/src/topologicpy/Topology.py index 74af626..99aca4e 100644 --- a/src/topologicpy/Topology.py +++ b/src/topologicpy/Topology.py @@ -871,6 +871,7 @@ def Intersect(topologyA, topologyB, tranDict=False, tolerance=0.0001): See Topology.Boolean(). """ + from topologicpy.Cluster import Cluster if topologyA == None: return None @@ -884,27 +885,24 @@ def Intersect(topologyA, topologyB, tranDict=False, tolerance=0.0001): topologyA = topologyB topologyB = temp - if Topology.IsInstance(topologyB, "CellComplex") or Topology.IsInstance(topologyB, "Cluster"): - merge = Topology.Merge(topologyA, topologyB) - symdif = Topology.SymDif(topologyA, topologyB) - return Topology.Difference(merge, symdif) + results = [] + if Topology.IsInstance(topologyA, "CellComplex"): + cellsA = Topology.Cells(topologyA) else: - # Vertex: - if Topology.IsInstance(topologyA, "Vertex"): - # Vertex: - if Topology.IsInstance(topologyB, "Vertex"): - if Vertex.Distance(topologyA, topologyB) < tolerance: - return topologyA - else: - return None - # Edge/Wire/Face/Shell/Cell: - else: - if Vertex.IsInternal(topologyA, topologyB): - return topologyA - else: - return None + cellsA = [topologyA] + for cellA in cellsA: + if Topology.IsInstance(topologyB, "CellComplex"): + cellsB = Topology.Cells(topologyB) else: - return topologyA.Intersect(topologyB) + cellsB = [topologyB] + for cellB in cellsB: + cellC = cellA.Intersect(cellB) + results.append(cellC) + results = [x for x in results if results is not None] + if len(results) == 1: + return results[0] + else: + return Topology.SelfMerge(Topology.SelfMerge(Cluster.ByTopologies(results))) @staticmethod def SymmetricDifference(topologyA, topologyB, tranDict=False, tolerance=0.0001): diff --git a/src/topologicpy/version.py b/src/topologicpy/version.py index c9880e6..7dfe66c 100644 --- a/src/topologicpy/version.py +++ b/src/topologicpy/version.py @@ -1 +1 @@ -__version__ = '0.7.4' +__version__ = '0.7.5'