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

Method testToSVG

tests/test_cadquery.py:123–135  ·  view source on GitHub ↗

Tests to make sure that a CadQuery object is converted correctly to SVG

(self)

Source from the content-addressed store, hash-verified

121 self.assertEqual(type(r), OCP.TopoDS.TopoDS_Solid)
122
123 def testToSVG(self):
124 """
125 Tests to make sure that a CadQuery object is converted correctly to SVG
126 """
127 r = Workplane("XY").rect(5, 5).extrude(5)
128
129 r_str = r.toSvg()
130
131 # Make sure that a couple of sections from the SVG output make sense
132 self.assertTrue(r_str.index('path d="M') > 0)
133 self.assertTrue(
134 r_str.index('line x1="30" y1="-30" x2="58" y2="-15" stroke-width="3"') > 0
135 )
136
137 def testCubePlugin(self):
138 """

Callers

nothing calls this directly

Calls 4

WorkplaneClass · 0.85
extrudeMethod · 0.80
toSvgMethod · 0.80
rectMethod · 0.45

Tested by

no test coverage detected