Podeu controlar una construcció de Kig a través d' un script en python "pykig", que pot executar- se amb l' ordre pykig. py. Seguidament en teniu un petit exemple (hexagons. kpy) que podeu provar: kigdocument. hideobjects () def hexagons (c, v, n): hexagon = PolygonBCV (c, v, 6) if n & lt; = 0: hexagon. show () for i in range( 6): PolygonSide (hexagon, i, True) return cnew = MidPoints (c, v) hexagons (cnew, v, n- 1) for k in [2, 4]: v1 = PolygonVertex (hexagon, k) cnew = MidPoints (c, v1) hexagons (cnew, v1, n- 1) hexagons (Point( 0, 0), Point( 1, 0), 5)
You can control a kig construction by means of a "pykig" python script, that can be executed with the command pykig. py. Here is a nice example (hexagons. kpy) you can try: kigdocument. hideobjects() def hexagons (c, v, n): hexagon = PolygonBCV (c, v, 6) if n & lt; = 0: hexagon. show() for i in range(6): PolygonSide (hexagon, i, True) return cnew = MidPoints (c, v) hexagons (cnew, v, n-1) for k in [2,4]: v1 = PolygonVertex (hexagon, k) cnew = MidPoints (c, v1) hexagons (cnew, v1, n-1) hexagons (Point(0,0), Point(1,0), 5)