MCPcopy
hub / github.com/CadQuery/cadquery / testEdgeWrapperMakeTangentArc

Method testEdgeWrapperMakeTangentArc

tests/test_cad_objects.py:140–156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

138 )
139
140 def testEdgeWrapperMakeTangentArc(self):
141 tangent_arc = Edge.makeTangentArc(
142 Vector(1, 1), # starts at 1, 1
143 Vector(0, 1), # tangent at start of arc is in the +y direction
144 Vector(2, 1), # arc curves 180 degrees and ends at 2, 1
145 )
146 self.assertTupleAlmostEquals((1, 1, 0), tangent_arc.startPoint().toTuple(), 3)
147 self.assertTupleAlmostEquals((2, 1, 0), tangent_arc.endPoint().toTuple(), 3)
148 self.assertTupleAlmostEquals(
149 (0, 1, 0), tangent_arc.tangentAt(locationParam=0).toTuple(), 3
150 )
151 self.assertTupleAlmostEquals(
152 (1, 0, 0), tangent_arc.tangentAt(locationParam=0.5).toTuple(), 3
153 )
154 self.assertTupleAlmostEquals(
155 (0, -1, 0), tangent_arc.tangentAt(locationParam=1).toTuple(), 3
156 )
157
158 def testEdgeWrapperMakeEllipse1(self):
159 # Check x_radius > y_radius

Callers

nothing calls this directly

Calls 7

VectorClass · 0.85
makeTangentArcMethod · 0.80
startPointMethod · 0.80
endPointMethod · 0.80
toTupleMethod · 0.45
tangentAtMethod · 0.45

Tested by

no test coverage detected