code: def test_regular_polygon_draw2():
      """Test drawing transformed regular polygons using RegularPolygonVisual"""  # noqa
      with TestingCanvas() as c:
          rpolygon = visuals.RegularPolygon(
              center=(0.0, 0.0),
              radius=0.4,
              sides=8,
              color=(0, 0, 1, 1),
              parent=c.scene,
          )
  
          rpolygon.transform = transforms.STTransform(
              scale=(75, 100), translate=(50, 50)
          )
          assert_image_approved(
              c.render(), "visuals/regular_polygon4.png"
          )
  
          rpolygon.parent = None
          rpolygon = visuals.RegularPolygon(
              center=(0.0, 0.0),
              radius=0.4,
              sides=8,
              color=(0, 0, 1, 1),
              border_color=(1, 0, 0, 1),
              parent=c.scene,
          )
  
          rpolygon.transform = transforms.STTransform(
              scale=(75, 100), translate=(50, 50)
          )
          assert_image_approved(
              c.render(), "visuals/regular_polygon5.png"
          )
          rpolygon.parent = None
          rpolygon = visuals.RegularPolygon(
              center=(0.0, 0.0),
              radius=0.4,
              sides=8,
              border_color=(1, 0, 0, 1),
              parent=c.scene,
          )
  
          rpolygon.transform = transforms.STTransform(
              scale=(75, 100), translate=(50, 50)
          )
          assert_image_approved(
              c.render(), "visuals/regular_polygon6.png", min_corr=0.6
          )
  
imports: from vispy.scene import visuals, transforms
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main
  from vispy.testing.image_tester import assert_image_approved
label_desc: Use image node_id 2 for calling a global function with example usage: test_regular_polygon_draw2() without return types