mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Fixed flipped width/height Issue #565
This commit is contained in:
parent
7fc8199aa4
commit
d1877e0deb
4 changed files with 5 additions and 5 deletions
|
|
@ -223,7 +223,7 @@ class Rectangle(BaseSketchObject):
|
|||
self.rectangle_height = height
|
||||
self.align = tuplify(align, 2)
|
||||
|
||||
face = Face.make_rect(height, width)
|
||||
face = Face.make_rect(width, height)
|
||||
super().__init__(face, rotation, self.align, mode)
|
||||
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ class RectangleRounded(BaseSketchObject):
|
|||
self.radius = radius
|
||||
self.align = tuplify(align, 2)
|
||||
|
||||
face = Face.make_rect(height, width)
|
||||
face = Face.make_rect(width, height)
|
||||
face = face.fillet_2d(radius, face.vertices())
|
||||
super().__init__(face, rotation, align, mode)
|
||||
|
||||
|
|
|
|||
|
|
@ -5431,7 +5431,7 @@ class Face(Shape):
|
|||
Face: The centered rectangle
|
||||
"""
|
||||
pln_shape = BRepBuilderAPI_MakeFace(
|
||||
plane.wrapped, -height * 0.5, height * 0.5, -width * 0.5, width * 0.5
|
||||
plane.wrapped, -width * 0.5, width * 0.5, -height * 0.5, height * 0.5
|
||||
).Face()
|
||||
|
||||
return cls(pln_shape)
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class ObjectTests(unittest.TestCase):
|
|||
# Face
|
||||
|
||||
def test_rect(self):
|
||||
r = Face.make_rect(1, 2)
|
||||
r = Face.make_rect(2, 1)
|
||||
|
||||
self.assertTrue(isinstance(r, Shape))
|
||||
|
||||
|
|
|
|||
|
|
@ -1097,7 +1097,7 @@ class TestFace(DirectApiTestCase):
|
|||
self.assertVectorAlmostEquals(test_face.normal_at(), (0, 0, 1), 5)
|
||||
|
||||
def test_length_width(self):
|
||||
test_face = Face.make_rect(10, 8, Plane.XZ)
|
||||
test_face = Face.make_rect(8, 10, Plane.XZ)
|
||||
self.assertAlmostEqual(test_face.length, 8, 5)
|
||||
self.assertAlmostEqual(test_face.width, 10, 5)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue