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

Method testEdgeWrapperMakeEllipse1

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

Source from the content-addressed store, hash-verified

156 )
157
158 def testEdgeWrapperMakeEllipse1(self):
159 # Check x_radius > y_radius
160 x_radius, y_radius = 20, 10
161 angle1, angle2 = -75.0, 90.0
162 arcEllipseEdge = Edge.makeEllipse(
163 x_radius=x_radius,
164 y_radius=y_radius,
165 pnt=(0, 0, 0),
166 dir=(0, 0, 1),
167 angle1=angle1,
168 angle2=angle2,
169 )
170
171 start = (
172 x_radius * math.cos(angle1 * DEG2RAD),
173 y_radius * math.sin(angle1 * DEG2RAD),
174 0.0,
175 )
176 end = (
177 x_radius * math.cos(angle2 * DEG2RAD),
178 y_radius * math.sin(angle2 * DEG2RAD),
179 0.0,
180 )
181 self.assertTupleAlmostEquals(start, arcEllipseEdge.startPoint().toTuple(), 3)
182 self.assertTupleAlmostEquals(end, arcEllipseEdge.endPoint().toTuple(), 3)
183
184 def testEdgeWrapperMakeEllipse2(self):
185 # 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