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

Method testEdgeWrapperMakeEllipse2

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

Source from the content-addressed store, hash-verified

182 self.assertTupleAlmostEquals(end, arcEllipseEdge.endPoint().toTuple(), 3)
183
184 def testEdgeWrapperMakeEllipse2(self):
185 # Check x_radius < y_radius
186 x_radius, y_radius = 10, 20
187 angle1, angle2 = 0.0, 45.0
188 arcEllipseEdge = Edge.makeEllipse(
189 x_radius=x_radius,
190 y_radius=y_radius,
191 pnt=(0, 0, 0),
192 dir=(0, 0, 1),
193 angle1=angle1,
194 angle2=angle2,
195 )
196
197 start = (
198 x_radius * math.cos(angle1 * DEG2RAD),
199 y_radius * math.sin(angle1 * DEG2RAD),
200 0.0,
201 )
202 end = (
203 x_radius * math.cos(angle2 * DEG2RAD),
204 y_radius * math.sin(angle2 * DEG2RAD),
205 0.0,
206 )
207 self.assertTupleAlmostEquals(start, arcEllipseEdge.startPoint().toTuple(), 3)
208 self.assertTupleAlmostEquals(end, arcEllipseEdge.endPoint().toTuple(), 3)
209
210 def testEdgeWrapperMakeCircleWithEllipse(self):
211 # Check x_radius == y_radius

Callers

nothing calls this directly

Calls 5

startPointMethod · 0.80
endPointMethod · 0.80
makeEllipseMethod · 0.45
toTupleMethod · 0.45

Tested by

no test coverage detected