diff --git a/src/topologicpy/Face.py b/src/topologicpy/Face.py index b4299d1..2c5b7a1 100644 --- a/src/topologicpy/Face.py +++ b/src/topologicpy/Face.py @@ -323,7 +323,10 @@ def ByOffset(face, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: print("Face.ByOffset - Warning: The input face parameter is not a valid face. Returning None.") return None + if abs(Face.Normal(face)[2] + 1) < tolerance: + reverse = not(reverse) eb = Face.Wire(face) + internal_boundaries = Face.InternalBoundaries(face) offset_external_boundary = Wire.ByOffset(eb, offset=offset, diff --git a/src/topologicpy/Wire.py b/src/topologicpy/Wire.py index d030720..3c4779a 100644 --- a/src/topologicpy/Wire.py +++ b/src/topologicpy/Wire.py @@ -365,7 +365,7 @@ def ByOffset(wire, offset: float = 1.0, offsetKey: str = "offset", stepOffsetA: fac = -1 else: fac = 1 - origin = Vertex.Origin() + origin = Topology.Centroid(wire) temp_vertices = [Topology.Vertices(wire)[0], Topology.Vertices(wire)[1], Topology.Centroid(wire)] temp_face = Face.ByWire(Wire.ByVertices(temp_vertices, close=True)) temp_normal = Face.Normal(temp_face) diff --git a/src/topologicpy/version.py b/src/topologicpy/version.py index ad66bea..735712f 100644 --- a/src/topologicpy/version.py +++ b/src/topologicpy/version.py @@ -1 +1 @@ -__version__ = '0.7.41' +__version__ = '0.7.42'