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

Method testNoClean

tests/test_cadquery.py:2991–3060  ·  view source on GitHub ↗

Test the case when clean is disabled.

(self)

Source from the content-addressed store, hash-verified

2989 assert len(s.edges().vals()) == 14
2990
2991 def testNoClean(self):
2992 """
2993 Test the case when clean is disabled.
2994 """
2995 # test disabling autoSimplify
2996 s = (
2997 Workplane("XY")
2998 .moveTo(0, 0)
2999 .line(5, 0)
3000 .line(5, 0)
3001 .line(0, 10)
3002 .line(-10, 0)
3003 .close()
3004 .extrude(10, clean=False)
3005 )
3006 self.assertEqual(7, s.faces().size())
3007
3008 s = (
3009 Workplane("XY")
3010 .box(10, 10, 10)
3011 .union(Workplane("XY").box(20, 10, 10), clean=False)
3012 )
3013 self.assertEqual(14, s.faces().size())
3014
3015 s = (
3016 Workplane("XY")
3017 .box(10, 10, 10)
3018 .faces(">Y")
3019 .workplane()
3020 .rect(5, 10, True)
3021 .extrude(20, clean=False)
3022 )
3023
3024 self.assertEqual(12, s.faces().size())
3025
3026 s = Workplane().sphere(1).box(0.5, 4, 4, clean=False)
3027 assert len(s.edges().vals()) == 16
3028
3029 s = (
3030 Workplane()
3031 .box(1, 1, 1)
3032 .faces("<Z")
3033 .workplane()
3034 .cylinder(
3035 2,
3036 0.2,
3037 centered=(True, True, False),
3038 direct=Vector(0, 0, -1),
3039 clean=False,
3040 )
3041 )
3042 assert len(s.edges().vals()) == 16
3043
3044 s = (
3045 Workplane()
3046 .pushPoints([(-0.5, -0.2), (0.5, 0.2)])
3047 .rect(2, 2)
3048 .extrude(0.2, clean=False)

Callers

nothing calls this directly

Calls 15

WorkplaneClass · 0.85
VectorClass · 0.85
extrudeMethod · 0.80
lineMethod · 0.80
moveToMethod · 0.80
unionMethod · 0.80
boxMethod · 0.80
workplaneMethod · 0.80
sphereMethod · 0.80
cylinderMethod · 0.80
interpPlateMethod · 0.80
pushPointsMethod · 0.80

Tested by

no test coverage detected