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

Method test_compound_faces_center

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

Source from the content-addressed store, hash-verified

5896 assert w2.solids().size() == 1
5897
5898 def test_compound_faces_center(self):
5899 sk = Sketch().rect(50, 50).faces()
5900 face1 = sk.val()
5901 face2 = face1.copy().translate(Vector(100, 0, 0))
5902 compound = Compound.makeCompound([face1, face2])
5903 expected_center = Shape.CombinedCenter([face1, face2])
5904
5905 assert (
5906 compound.Center() == expected_center
5907 ), "Incorrect center of mass of the compound, expected {}, got {}".format(
5908 expected_center, compound.Center()
5909 )
5910
5911 def test_line_from_vertex(self):
5912

Callers

nothing calls this directly

Calls 10

SketchClass · 0.85
VectorClass · 0.85
makeCompoundMethod · 0.80
CombinedCenterMethod · 0.80
facesMethod · 0.45
rectMethod · 0.45
valMethod · 0.45
translateMethod · 0.45
copyMethod · 0.45
CenterMethod · 0.45

Tested by

no test coverage detected