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

Method testFaceToPln

tests/test_cadquery.py:5326–5347  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5324 self.assertAlmostEqual(si.Volume(), 1)
5325
5326 def testFaceToPln(self):
5327
5328 origin = (1, 2, 3)
5329 normal = (1, 1, 1)
5330 f0 = Face.makePlane(length=None, width=None, basePnt=origin, dir=normal)
5331 p0 = f0.toPln()
5332
5333 self.assertTrue(Vector(p0.Location()) == Vector(origin))
5334 self.assertTrue(Vector(p0.Axis().Direction()) == Vector(normal).normalized())
5335
5336 origin1 = (0, 0, -3)
5337 normal1 = (-1, 1, -1)
5338 f1 = Face.makePlane(length=0.1, width=100, basePnt=origin1, dir=normal1)
5339 p1 = f1.toPln()
5340
5341 self.assertTrue(Vector(p1.Location()) == Vector(origin1))
5342 self.assertTrue(Vector(p1.Axis().Direction()) == Vector(normal1).normalized())
5343
5344 f2 = Workplane().box(1, 1, 10, centered=False).faces(">Z").val()
5345 p2 = f2.toPln()
5346 self.assertTrue(p2.Contains(f2.Center().toPnt(), 0.1))
5347 self.assertTrue(Vector(p2.Axis().Direction()) == f2.normalAt())
5348
5349 def testEachpoint(self):
5350

Callers

nothing calls this directly

Calls 11

VectorClass · 0.85
WorkplaneClass · 0.85
makePlaneMethod · 0.80
normalizedMethod · 0.80
boxMethod · 0.80
toPntMethod · 0.80
toPlnMethod · 0.45
valMethod · 0.45
facesMethod · 0.45
CenterMethod · 0.45
normalAtMethod · 0.45

Tested by

no test coverage detected