Tests adding points and using them
(self)
| 262 | wp.nonExistentInWorkplane() |
| 263 | |
| 264 | def testPointList(self): |
| 265 | """ |
| 266 | Tests adding points and using them |
| 267 | """ |
| 268 | c = CQ(makeUnitCube()) |
| 269 | |
| 270 | s = c.faces(">Z").workplane().pushPoints([(-0.3, 0.3), (0.3, 0.3), (0, 0)]) |
| 271 | self.assertEqual(3, s.size()) |
| 272 | # TODO: is the ability to iterate over points with circle really worth it? |
| 273 | # maybe we should just require using all() and a loop for this. the semantics and |
| 274 | # possible combinations got too hard ( ie, .circle().circle() ) was really odd |
| 275 | body = s.circle(0.05).cutThruAll() |
| 276 | self.saveModel(body) |
| 277 | self.assertEqual(9, body.faces().size()) |
| 278 | |
| 279 | # Test the case when using eachpoint with only a blank workplane |
| 280 | def callback_fn(loc): |
| 281 | self.assertEqual( |
| 282 | Vector(0, 0, 0), Vector(loc.wrapped.Transformation().TranslationPart()) |
| 283 | ) |
| 284 | |
| 285 | r = Workplane("XY") |
| 286 | r.objects = [] |
| 287 | r.eachpoint(callback_fn) |
| 288 | |
| 289 | def testWorkplaneFromFace(self): |
| 290 | # make a workplane on the top face |
nothing calls this directly
no test coverage detected