Open tanuva opened 9 years ago
please provide the whole code (in particular the implementation of imagemap)
I'm sorry, should've added that right away. The whole implementation is this (actual code wasn't changed):
class ImageMap(POVRayElement):
""" ImageMap('image', 'my_image.png') """
povray_name= 'image_map'
url = wikiref+'Image_Map'
The code using it is this (excerpt):
sphere1 = Sphere([-4, 2, 2], 2.0,
ImageMap(image = "map.png"))
(Not sure if that would even result in correct pov syntax, but I'd expect vapory to write at least a pov file I can check manually.)
I actually only changed the class comment but don't really understand how it is parsed. Reading vapory's readme again (RTFM, future self!), I understand that those comments are not parsed by some magic but simple usage instructions. I see now how POVRayElement
works, but I don't get how ImageMap breaks here as the default implementation of POVRayElement works the same way f.e. for Camera
.
tl;dr: How does the syntax used in the class documentation comments that specify a POVRayElement's content work?
I'm trying to make heightfields available in vapory. From the existing POVRayElements, I deduce the syntax should be something like
""" 'parameter_name', default_value_implying_type, 'parameter2_name', another_default """
.How does that work for something like ImageMap which doesn't have a named parameter? If I extend ImageMap like this:
""" ImageMap('image', 'my_image.png') """
(before adding additional image_map parameters), Python throws the following at me:This is vapory 0.1.1 from pip on Python 2.7.