Added Workplane.tangentArcToPoint, occ_impl.shapes.Edge.makeTangentArc

This commit is contained in:
Marcus Boyd
2020-02-22 20:00:45 +10:30
parent cd66589e4e
commit b89bc44f86
5 changed files with 178 additions and 4 deletions

View File

@ -82,6 +82,24 @@ class TestCadObjects(BaseTest):
(-10.0, 0.0, 0.0), halfCircleEdge.endPoint().toTuple(), 3
)
def testEdgeWrapperMakeTangentArc(self):
tangent_arc = Edge.makeTangentArc(
Vector(1, 1), # starts at 1, 1
Vector(0, 1), # tangent at start of arc is in the +y direction
Vector(2, 1), # arc curves 180 degrees and ends at 2, 1
)
self.assertTupleAlmostEquals((1, 1, 0), tangent_arc.startPoint().toTuple(), 3)
self.assertTupleAlmostEquals((2, 1, 0), tangent_arc.endPoint().toTuple(), 3)
self.assertTupleAlmostEquals(
(0, 1, 0), tangent_arc.tangentAt(locationParam=0).toTuple(), 3
)
self.assertTupleAlmostEquals(
(1, 0, 0), tangent_arc.tangentAt(locationParam=0.5).toTuple(), 3
)
self.assertTupleAlmostEquals(
(0, -1, 0), tangent_arc.tangentAt(locationParam=1).toTuple(), 3
)
def testFaceWrapperMakePlane(self):
mplane = Face.makePlane(10, 10)