notice = """
             Cone Demo
 -----------------------------------
| Copyright 2022 by Joel C. Alcarez |
| [joelalcarez1975@gmail.com]       |
|-----------------------------------|
|    We make absolutely no warranty |
| of any kind, expressed or implied |
|-----------------------------------|
|   This graphics library outputs   |
|   to a bitmap file.               |
 -----------------------------------
"""
from Python_BMP.BITMAPlib import(
        newBMP,
        centercoord,
        plot3Dsolid,
        getRGBfactors,
        rotvec3D,
        conevertandsurface,
        saveBMP
        )

import subprocess as proc
from os import path

def main():
        print(notice)
        imgedt = 'mspaint'  # replace with another editor if Unix
        rootdir = path.dirname(__file__) # get path of this script
        mx = my = 250 # x=y square bmp
        file = 'HelloCone.bmp' # some random file name as string
        bmp = newBMP(mx, my, 24) # RGB bmp
        cenpt = centercoord(bmp) # helper method to get center of a bitmap
        cf = getRGBfactors() # color info with presets
        d, translationvector = 400, [0, 0, 200] # be careful with these variables or object goes offscreen
        isSolid = True # toggle solid or outline
        showoutline = False # can show outline even if solid
        cf = getRGBfactors() # color list
        color = cf['brightyellow'] # color of solid
        outlinecolor = 0 # outline color
        rotation = rotvec3D(25,240,70) # rotation vector (x,y,z) in degrees
        vcen = (1,0,0) # x y z coords
        r = 40 # radius of cone
        zlen = 40 # height of cone
        deganglestep = 5 # how finely we tile flat surfaces around the cone
        obj3D = conevertandsurface(vcen, r, zlen, deganglestep)# A solid is defined by vertices and surfaces
        plot3Dsolid(bmp, obj3D, isSolid, color,
                showoutline, outlinecolor,
                rotation, translationvector, d, cenpt)
        saveBMP(file, bmp) # save file
        print('Saved to %s in %s\nAll done close %s to finish' % \
                (file, rootdir, imgedt))
        ret = proc.call([imgedt, file])

if __name__=="__main__":
        main()

[((30, 18, 30, 40), 'os.path.dirname', 'path.dirname', ({(30, 31, 30, 39): '__file__'}, {}), '(__file__)', False, 'from os import path\n'), ((33, 14, 33, 32), 'Python_BMP.BITMAPlib.newBMP', 'newBMP', ({(33, 21, 33, 23): 'mx', (33, 25, 33, 27): 'my', (33, 29, 33, 31): '24'}, {}), '(mx, my, 24)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((34, 16, 34, 32), 'Python_BMP.BITMAPlib.centercoord', 'centercoord', ({(34, 28, 34, 31): 'bmp'}, {}), '(bmp)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((35, 13, 35, 28), 'Python_BMP.BITMAPlib.getRGBfactors', 'getRGBfactors', ({}, {}), '()', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((39, 13, 39, 28), 'Python_BMP.BITMAPlib.getRGBfactors', 'getRGBfactors', ({}, {}), '()', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((42, 19, 42, 38), 'Python_BMP.BITMAPlib.rotvec3D', 'rotvec3D', ({(42, 28, 42, 30): '25', (42, 31, 42, 34): '240', (42, 35, 42, 37): '70'}, {}), '(25, 240, 70)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((47, 16, 47, 63), 'Python_BMP.BITMAPlib.conevertandsurface', 'conevertandsurface', ({(47, 35, 47, 39): 'vcen', (47, 41, 47, 42): 'r', (47, 44, 47, 48): 'zlen', (47, 50, 47, 62): 'deganglestep'}, {}), '(vcen, r, zlen, deganglestep)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((48, 8, 50, 54), 'Python_BMP.BITMAPlib.plot3Dsolid', 'plot3Dsolid', ({(48, 20, 48, 23): 'bmp', (48, 25, 48, 30): 'obj3D', (48, 32, 48, 39): 'isSolid', (48, 41, 48, 46): 'color', (49, 16, 49, 27): 'showoutline', (49, 29, 49, 41): 'outlinecolor', (50, 16, 50, 24): 'rotation', (50, 26, 50, 43): 'translationvector', (50, 45, 50, 46): 'd', (50, 48, 50, 53): 'cenpt'}, {}), '(bmp, obj3D, isSolid, color, showoutline, outlinecolor, rotation,\n    translationvector, d, cenpt)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((51, 8, 51, 26), 'Python_BMP.BITMAPlib.saveBMP', 'saveBMP', ({(51, 16, 51, 20): 'file', (51, 22, 51, 25): 'bmp'}, {}), '(file, bmp)', False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, getRGBfactors, rotvec3D, conevertandsurface, saveBMP\n'), ((54, 14, 54, 39), 'subprocess.call', 'proc.call', ({(54, 24, 54, 38): '[imgedt, file]'}, {}), '([imgedt, file])', True, 'import subprocess as proc\n')]