####################################################################################################
#
# Invoking X3D model self-test:
#
#   $ python RangeLightPrototype.py
#
# Python package x3d.py package is available on PyPI for import.
#   This approach simplifies Python X3D deployment and use.
#   https://pypi.org/project/x3d
#
# Installation:
#       pip install x3d
# or
#       python -m pip install x3d
#
# Developer options for loading x3d package in other Python programs:
#
#    from x3d import *  # preferred approach, terser source that avoids x3d.* class prefixes
#
# or
#    import x3d         # traditional way to subclass x3d package, all classes require x3d.* prefix,
#                       # but python source is very verbose, for example x3d.Material x3d.Shape etc.
#                       # X3dToPython.xslt stylesheet insertPackagePrefix=true supports this option.
#
# Project home page:    # X3D Python Scene Access Interface Library (X3DPSAIL)
#                       # https://www.web3d.org/x3d/stylesheets/python/python.html
# Conversion generator: # https://www.web3d.org/x3d/stylesheets/X3dToPython.xslt
#
####################################################################################################

from x3d import *

newModel=X3D(profile='Immersive',version='3.0',
  head=head(
    children=[
    meta(content='RangeLightPrototype.x3d',name='title'),
    meta(content='Range Light Prototype, with options for Light On/Off and Light Glow Scale. NOTE: Beacon light points due North (-Z) and is only visible from that side. Rotate into correct orientation.',name='description'),
    meta(content='Planet 9 Studios, Inc., San Francisco, CA',name='creator'),
    meta(content='Christian Greuel, Director of Art and Production',name='producer'),
    meta(content='Danny Lee, Christian Greuel',name='modelers'),
    meta(content='http://www.planet9.com',name='reference'),
    meta(content='Xj3D Format Converter',name='translator'),
    meta(content='17 August 2006',name='created'),
    meta(content='18 August 2006',name='translated'),
    meta(content='20 October 2019',name='modified'),
    meta(content='RangeLightPrototype.png',name='Image'),
    meta(content='https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/RangeLightPrototype.x3d',name='identifier'),
    meta(content='../../license.html',name='license')]),
  Scene=Scene(
    children=[
    WorldInfo(title='RangeLightPrototype.x3d'),
    ProtoDeclare(name='RangeLight',
      ProtoInterface=ProtoInterface(
        field=[
        field(accessType='inputOutput',name='LightType',type='SFInt32',value=1),
        Comment('0=LightOff, 1=LightOn, 2=LightFlashing(NotImplemented)'),
        field(accessType='inputOutput',name='LightGlow',type='SFVec3f',value=(1.0,1.0,1.0)),
        Comment('XYZ Scale of Light Glow Effect (suggest Z=1.0)'),],),
      ProtoBody=ProtoBody(
        children=[
        Group(DEF='RangeLightGeometry',
          children=[
          Group(DEF='LatticeBase',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon01.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon01.jpg"])),
              geometry=IndexedFaceSet(coordIndex=[8,10,11,-1,11,9,8,-1,12,13,15,-1,15,14,12,-1],normalIndex=[0,0,0,-1,0,0,0,-1,1,1,1,-1,1,1,1,-1],texCoordIndex=[8,9,10,-1,10,11,8,-1,8,11,10,-1,10,9,8,-1],
                coord=Coordinate(DEF='LatticeBase-COORD',point=[(0.70215,0.0,-0.70215),(-0.70215,0.0,-0.70215),(0.70215,0.0,0.70215),(-0.70215,0.0,0.70215),(0.70215,0.439774,-0.70215),(-0.70215,0.439774,-0.70215),(0.70215,0.439774,0.70215),(-0.70215,0.439774,0.70215),(0.823077,11.618,-0.423813),(-0.823077,11.618,-0.423813),(0.823077,14.5044,-0.584243),(-0.823077,14.5044,-0.584242),(0.823077,11.606,-0.639052),(-0.823077,11.606,-0.639051),(0.823077,14.4925,-0.799481),(-0.823077,14.4925,-0.799481),(-0.256949,12.2108,-0.267117),(-0.217921,12.235,-0.266274),(-0.217921,12.1853,-0.268004),(-0.454128,12.0735,-0.44912),(-0.4151,12.096,-0.45037),(-0.4151,12.0467,-0.44763),(0.246926,12.2108,-0.267117),(0.207898,12.235,-0.266275),(0.207898,12.1853,-0.268004),(0.444105,12.0735,-0.44912),(0.405077,12.096,-0.45037),(0.405077,12.0467,-0.44763),(-0.202399,13.7433,-0.196316),(-0.163371,13.7582,-0.177237),(-0.163371,13.7276,-0.216393),(-0.399578,14.1792,-0.623146),(-0.36055,14.1946,-0.606721),(-0.36055,14.1608,-0.642723),(0.201468,13.7433,-0.196316),(0.162441,13.7582,-0.177237),(0.162441,13.7276,-0.216393),(0.398647,14.1792,-0.623147),(0.35962,14.1946,-0.606721),(0.35962,14.1608,-0.642723),(0.585125,10.7977,-0.585125),(-0.585125,10.7977,-0.585125),(0.585125,10.7977,0.585125),(-0.585125,10.7977,0.585125),(0.585125,10.9485,-0.585125),(-0.585125,10.9485,-0.585125),(0.585125,10.9485,0.585125),(-0.585125,10.9485,0.585125),(0.23405,14.1675,-0.23405),(-0.23405,14.1675,-0.23405),(0.23405,14.1675,0.23405),(-0.23405,14.1675,0.23405),(0.23405,14.3183,-0.23405),(-0.23405,14.3183,-0.23405),(0.23405,14.3183,0.23405),(-0.23405,14.3183,0.23405),(-0.011229,1.40056,0.0),(0.005614,1.40056,0.009724),(0.005614,1.40056,-0.009724),(-0.011229,14.5967,0.0),(0.005614,14.5967,0.009724),(0.005614,14.5967,-0.009724),(0.022173,14.6302,0.020549),(-0.041212,14.5936,0.020549),(-0.020083,14.6302,0.020549),(0.043301,14.5936,0.020549),(0.022173,14.557,0.020549),(-0.020083,14.557,0.020549),(-0.041212,14.5936,-0.018249),(-0.020083,14.6302,-0.018249),(0.022173,14.6302,-0.018249),(0.043301,14.5936,-0.018249),(0.022173,14.557,-0.018249),(-0.020083,14.557,-0.018249),(-0.031706,14.5936,-0.012896),(-0.01533,14.6219,-0.012896),(0.01742,14.6219,-0.012896),(0.033795,14.5936,-0.012896),(0.01742,14.5652,-0.012896),(-0.01533,14.5652,-0.012896),(0.23405,0.441133,-0.23405),(-0.23405,0.441133,-0.23405),(0.23405,0.441133,0.23405),(-0.23405,0.441133,0.23405),(0.23405,1.40043,-0.23405),(-0.23405,1.40043,-0.23405),(0.23405,1.40043,0.23405),(-0.23405,1.40043,0.23405)]),
                normal=Normal(vector=[(0.0,0.0554,0.9984),(0.0,-0.0554,-0.9984)]),
                texCoord=TextureCoordinate(DEF='LatticeBase-TEXCOORD',point=[(1.0,0.343419),(0.0,0.343419),(1.0,0.656581),(0.0,0.656581),(0.0,0.0),(1.0,0.0),(1.0,1.0),(0.0,1.0),(4.99E-4,4.99E-4),(4.99E-4,0.9995),(0.9995,0.9995),(0.9995,4.99E-4),(-0.002949,4.99E-4),(-0.002949,0.999501),(5.19629,4.99E-4),(5.19629,0.999501),(-0.023944,4.99E-4),(-0.023944,0.999501),(5.1974,4.99E-4),(5.1974,0.999501),(-0.016151,4.99E-4),(5.2131,4.99E-4),(5.2131,0.999501),(-0.016151,0.999501),(5.21362,4.99E-4),(5.21362,0.999501),(-0.024802,4.99E-4),(-0.024802,0.999501),(0.75,0.0),(0.083333,0.0),(0.416667,0.0),(0.75,1.0),(0.083333,1.0),(0.416667,1.0),(-0.25,0.0),(-0.25,1.0),(0.916667,0.446284),(0.083333,0.446284),(0.916667,0.553716),(0.083333,0.553716),(0.916667,0.083333),(0.916667,0.916667),(0.083333,0.916667),(0.083333,0.083333),(0.666667,0.446284),(0.333333,0.446284),(0.666667,0.553716),(0.333333,0.553716),(0.666667,0.333333),(0.666667,0.666667),(0.333333,0.666667),(0.333333,0.333333),(0.517992,-13.5954),(0.479225,-13.5954),(0.482008,-13.5954),(0.517992,14.5954),(0.479225,14.5954),(0.482008,14.5954),(0.520775,14.5954),(0.520775,-13.5954),(0.5,0.458557),(0.545136,0.578179),(0.590273,0.5),(0.454864,0.458557),(0.454864,0.578179),(0.421821,0.458557),(0.409727,0.5),(0.454864,0.421821),(0.545136,0.421821),(0.534983,0.560592),(0.569965,0.5),(0.465017,0.560592),(0.430035,0.5),(0.465017,0.439408),(0.534983,0.439408),(0.578179,0.541443),(0.5,0.541443),(0.578179,0.458557),(0.545136,0.541443),(0.454864,0.541443),(0.545136,0.458557),(0.421821,0.541443),(0.999501,0.9995),(4.99E-4,0.999501)]))),
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon05.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon05.jpg"])),
              geometry=IndexedFaceSet(coordIndex=[4,5,7,-1,7,6,4,-1,0,1,5,-1,5,4,0,-1,1,3,7,-1,7,5,1,-1,3,2,6,-1,6,7,3,-1,2,0,4,-1,4,6,2,-1,16,20,19,-1,16,17,20,-1,17,21,20,-1,17,18,21,-1,18,19,21,-1,18,16,19,-1,22,26,25,-1,22,23,26,-1,23,27,26,-1,23,24,27,-1,24,25,27,-1,24,22,25,-1,28,32,31,-1,28,29,32,-1,29,33,32,-1,29,30,33,-1,30,31,33,-1,30,28,31,-1,34,37,38,-1,34,38,35,-1,35,38,39,-1,35,39,36,-1,36,39,37,-1,36,37,34,-1,40,42,43,-1,43,41,40,-1,44,45,47,-1,47,46,44,-1,40,41,45,-1,45,44,40,-1,41,43,47,-1,47,45,41,-1,43,42,46,-1,46,47,43,-1,42,40,44,-1,44,46,42,-1,48,50,51,-1,51,49,48,-1,52,53,55,-1,55,54,52,-1,48,49,53,-1,53,52,48,-1,49,51,55,-1,55,53,49,-1,51,50,54,-1,54,55,51,-1,50,48,52,-1,52,54,50,-1,56,60,59,-1,56,57,60,-1,57,61,60,-1,57,58,61,-1,58,59,61,-1,58,56,59,-1,63,69,68,-1,63,64,69,-1,64,70,69,-1,64,62,70,-1,62,71,70,-1,62,65,71,-1,65,72,71,-1,65,66,72,-1,66,73,72,-1,66,67,73,-1,67,68,73,-1,67,63,68,-1,68,69,75,-1,75,74,68,-1,69,70,76,-1,76,75,69,-1,70,71,77,-1,77,76,70,-1,71,72,78,-1,78,77,71,-1,72,73,79,-1,79,78,72,-1,73,68,74,-1,74,79,73,-1],normalIndex=[18,18,18,-1,18,18,18,-1,38,38,38,-1,38,38,38,-1,16,16,16,-1,16,16,16,-1,25,25,25,-1,25,25,25,-1,5,5,5,-1,5,5,5,-1,32,10,39,-1,32,33,10,-1,33,34,10,-1,33,8,34,-1,8,39,34,-1,8,32,39,-1,17,13,37,-1,17,35,13,-1,35,30,13,-1,35,24,30,-1,24,37,30,-1,24,17,37,-1,6,19,23,-1,6,3,19,-1,3,36,19,-1,3,41,36,-1,41,23,36,-1,41,6,23,-1,40,15,26,-1,40,26,11,-1,11,26,4,-1,11,4,7,-1,7,4,15,-1,7,15,40,-1,27,27,27,-1,27,27,27,-1,18,18,18,-1,18,18,18,-1,38,38,38,-1,38,38,38,-1,16,16,16,-1,16,16,16,-1,25,25,25,-1,25,25,25,-1,5,5,5,-1,5,5,5,-1,27,27,27,-1,27,27,27,-1,18,18,18,-1,18,18,18,-1,38,38,38,-1,38,38,38,-1,16,16,16,-1,16,16,16,-1,25,25,25,-1,25,25,25,-1,5,5,5,-1,5,5,5,-1,16,1,16,-1,16,1,1,-1,1,12,1,-1,1,12,12,-1,12,16,12,-1,12,16,16,-1,16,9,16,-1,16,9,9,-1,9,0,9,-1,9,0,0,-1,0,5,0,-1,0,5,5,-1,5,14,5,-1,5,14,14,-1,14,22,14,-1,14,22,22,-1,22,16,22,-1,22,16,16,-1,21,31,31,-1,31,21,21,-1,31,2,2,-1,2,31,31,-1,2,29,29,-1,29,2,2,-1,29,28,28,-1,28,29,29,-1,28,20,20,-1,20,28,28,-1,20,21,21,-1,21,20,20,-1],texCoordIndex=[4,5,6,-1,6,7,4,-1,1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1,34,32,35,-1,34,29,32,-1,29,33,32,-1,29,30,33,-1,30,31,33,-1,30,28,31,-1,34,32,35,-1,34,29,32,-1,29,33,32,-1,29,30,33,-1,30,31,33,-1,30,28,31,-1,34,32,35,-1,34,29,32,-1,29,33,32,-1,29,30,33,-1,30,31,33,-1,30,28,31,-1,34,35,32,-1,34,32,29,-1,29,32,33,-1,29,33,30,-1,30,33,31,-1,30,31,28,-1,40,41,42,-1,42,43,40,-1,43,40,41,-1,41,42,43,-1,37,36,38,-1,38,39,37,-1,37,36,38,-1,38,39,37,-1,37,36,38,-1,38,39,37,-1,37,36,38,-1,38,39,37,-1,48,49,50,-1,50,51,48,-1,51,48,49,-1,49,50,51,-1,45,44,46,-1,46,47,45,-1,45,44,46,-1,46,47,45,-1,45,44,46,-1,46,47,45,-1,45,44,46,-1,46,47,45,-1,54,55,57,-1,54,52,55,-1,53,58,56,-1,53,59,58,-1,54,55,57,-1,54,52,55,-1,60,75,76,-1,60,77,75,-1,63,78,79,-1,63,80,78,-1,65,76,81,-1,65,60,76,-1,60,75,76,-1,60,77,75,-1,63,78,79,-1,63,80,78,-1,65,76,81,-1,65,60,76,-1,62,61,69,-1,69,70,62,-1,61,64,71,-1,71,69,61,-1,64,66,72,-1,72,71,64,-1,66,67,73,-1,73,72,66,-1,67,68,74,-1,74,73,67,-1,68,62,70,-1,70,74,68,-1],
                coord=Coordinate(USE='LatticeBase-COORD'),
                normal=Normal(vector=[(0.4999,0.866,0.0),(0.4999,0.0,0.866),(-0.2453,-0.4249,-0.8713),(0.5497,0.7001,0.4556),(-0.3025,-0.5967,-0.7432),(1.0,0.0,0.0),(-0.9509,-0.1812,0.2507),(-0.6149,-0.3906,-0.6849),(0.7438,-0.5001,-0.4434),(-0.4999,0.866,0.0),(0.0643,0.7652,-0.6405),(-0.5497,0.7001,0.4556),(0.5,0.0,-0.866),(0.0643,-0.7652,0.6405),(0.4999,-0.866,0.0),(0.9507,-0.2092,0.2288),(-1.0,0.0,0.0),(-0.7576,-0.4388,-0.4831),(0.0,1.0,0.0),(0.3499,0.7308,0.5859),(0.2453,0.4249,-0.8713),(0.4906,0.0,-0.8713),(-0.4999,-0.866,0.0),(-0.9507,-0.2092,0.2288),(0.7438,0.5,0.4434),(0.0,0.0,1.0),(-0.3499,0.7308,0.5859),(0.0,-1.0,0.0),(-0.2453,0.4249,-0.8713),(-0.4906,0.0,-0.8713),(0.0771,0.8217,-0.5645),(0.2453,-0.4249,-0.8713),(-0.7576,0.4388,0.4831),(0.3524,0.5146,-0.7816),(0.0771,-0.8217,0.5645),(0.3524,-0.5146,0.7816),(0.3025,-0.5967,-0.7432),(-0.6566,0.0384,-0.7532),(0.0,0.0,-1.0),(-0.6566,-0.0384,0.7532),(0.9509,-0.1812,0.2507),(0.6149,-0.3906,-0.6849)]),
                texCoord=TextureCoordinate(USE='LatticeBase-TEXCOORD'))),
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon06.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon06.jpg"])),
              geometry=IndexedFaceSet(coordIndex=[8,9,13,-1,13,12,8,-1,9,11,15,-1,15,13,9,-1,11,10,14,-1,14,15,11,-1,10,8,12,-1,12,14,10,-1],normalIndex=[3,3,3,-1,3,3,3,-1,1,1,1,-1,1,1,1,-1,2,2,2,-1,2,2,2,-1,0,0,0,-1,0,0,0,-1],texCoordIndex=[20,21,22,-1,22,23,20,-1,16,18,19,-1,19,17,16,-1,12,14,15,-1,15,13,12,-1,26,24,25,-1,25,27,26,-1],
                coord=Coordinate(USE='LatticeBase-COORD'),
                normal=Normal(vector=[(1.0,0.0,0.0),(-1.0,0.0,0.0),(0.0,0.9984,-0.0554),(0.0,-0.9984,0.0554)]),
                texCoord=TextureCoordinate(USE='LatticeBase-TEXCOORD'))),
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon08.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon08.jpg"])),
              geometry=IndexedFaceSet(coordIndex=[80,81,85,-1,85,84,80,-1,81,83,87,-1,87,85,81,-1,83,82,86,-1,86,87,83,-1,82,80,84,-1,84,86,82,-1],normalIndex=[3,3,3,-1,3,3,3,-1,1,1,1,-1,1,1,1,-1,2,2,2,-1,2,2,2,-1,0,0,0,-1,0,0,0,-1],texCoordIndex=[8,11,10,-1,10,9,8,-1,8,11,10,-1,10,9,8,-1,8,11,10,-1,10,9,8,-1,8,11,10,-1,10,9,8,-1],
                coord=Coordinate(USE='LatticeBase-COORD'),
                normal=Normal(vector=[(1.0,0.0,0.0),(-1.0,0.0,0.0),(0.0,0.0,1.0),(0.0,0.0,-1.0)]),
                texCoord=TextureCoordinate(USE='LatticeBase-TEXCOORD'))),
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon09.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon09.jpg"])),
              geometry=IndexedFaceSet(coordIndex=[84,85,87,-1,87,86,84,-1],normalIndex=[0,0,0,-1,0,0,0,-1],texCoordIndex=[8,11,82,-1,82,83,8,-1],
                coord=Coordinate(USE='LatticeBase-COORD'),
                normal=Normal(vector=[(0.0,1.0,0.0)]),
                texCoord=TextureCoordinate(USE='LatticeBase-TEXCOORD'))),
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=1.0,diffuseColor=(0.588,0.588,0.588),shininess=0.145)),
              geometry=IndexedFaceSet(coordIndex=[62,64,63,-1,62,66,65,-1,62,67,66,-1,62,63,67,-1],normalIndex=[0,0,0,-1,0,0,0,-1,0,0,0,-1,0,0,0,-1],
                coord=Coordinate(USE='LatticeBase-COORD'),
                normal=Normal(vector=[(0.0,0.0,1.0)])))]),
          Group(DEF='LatticeInside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon02.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon02.png"])),
              geometry=IndexedFaceSet(coordIndex=[0,1,5,-1,5,4,0,-1,1,3,7,-1,7,5,1,-1,3,2,6,-1,6,7,3,-1,2,0,4,-1,4,6,2,-1],normalIndex=[2,2,2,-1,2,2,2,-1,0,0,0,-1,0,0,0,-1,1,1,1,-1,1,1,1,-1,3,3,3,-1,3,3,3,-1],texCoordIndex=[1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1,1,0,2,-1,2,3,1,-1],
                coord=Coordinate(point=[(0.66634,0.439546,-0.666369),(-0.66634,0.439546,-0.666369),(0.66634,0.439546,0.666369),(-0.66634,0.439546,0.666369),(0.186575,14.2325,-0.186583),(-0.186575,14.2325,-0.186583),(0.186575,14.2325,0.186583),(-0.186575,14.2325,0.186583)]),
                normal=Normal(vector=[(-0.9993,0.0347,0.0),(0.0,0.0347,0.9993),(0.0,0.0347,-0.9993),(0.9993,0.0347,0.0)]),
                texCoord=TextureCoordinate(point=[(0.982478,4.99E-4),(0.015089,4.99E-4),(0.634219,0.9995),(0.36335,0.9995)])))]),
          Group(DEF='LatticeOutside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon02.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon02.png"])),
              geometry=IndexedFaceSet(coordIndex=[1,0,5,-1,4,5,0,-1,3,1,7,-1,5,7,1,-1,2,3,6,-1,7,6,3,-1,0,2,4,-1,6,4,2,-1],normalIndex=[2,2,2,-1,2,2,2,-1,0,0,0,-1,0,0,0,-1,3,3,3,-1,3,3,3,-1,1,1,1,-1,1,1,1,-1],texCoordIndex=[0,1,2,-1,3,2,1,-1,0,1,2,-1,3,2,1,-1,0,1,2,-1,3,2,1,-1,0,1,2,-1,3,2,1,-1],
                coord=Coordinate(point=[(0.66634,0.439546,-0.666369),(-0.66634,0.439546,-0.666369),(0.66634,0.439546,0.666369),(-0.66634,0.439546,0.666369),(0.186575,14.2325,-0.186583),(-0.186575,14.2325,-0.186583),(0.186575,14.2325,0.186583),(-0.186575,14.2325,0.186583)]),
                normal=Normal(vector=[(0.9993,-0.0347,0.0),(-0.9993,-0.0347,0.0),(0.0,-0.0347,0.9993),(0.0,-0.0347,-0.9993)]),
                texCoord=TextureCoordinate(point=[(0.982478,4.99E-4),(0.015089,4.99E-4),(0.634219,0.9995),(0.36335,0.9995)])))]),
          Group(DEF='FenceInside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon03.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon03.png"])),
              geometry=IndexedFaceSet(coordIndex=[4,5,3,-1,3,1,4,-1,5,6,2,-1,2,3,5,-1,6,7,0,-1,0,2,6,-1,7,4,1,-1,1,0,7,-1],normalIndex=[0,0,0,-1,0,0,0,-1,3,3,3,-1,3,3,3,-1,1,1,1,-1,1,1,1,-1,2,2,2,-1,2,2,2,-1],solid=False,texCoordIndex=[0,1,3,-1,3,2,0,-1,0,1,3,-1,3,2,0,-1,0,1,3,-1,3,2,0,-1,0,1,3,-1,3,2,0,-1],
                coord=Coordinate(point=[(0.585125,10.9485,-0.585125),(-0.585125,10.9485,-0.585125),(0.585125,10.9485,0.585125),(-0.585125,10.9485,0.585125),(-0.585125,11.5453,-0.585125),(-0.585125,11.5453,0.585125),(0.585125,11.5453,0.585125),(0.585125,11.5453,-0.585125)]),
                normal=Normal(vector=[(1.0,0.0,0.0),(-1.0,0.0,0.0),(0.0,0.0,1.0),(0.0,0.0,-1.0)]),
                texCoord=TextureCoordinate(point=[(4.99E-4,0.999501),(0.9995,0.999501),(4.99E-4,4.99E-4),(0.9995,4.99E-4)])))]),
          Group(DEF='FenceOutside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon03.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon03.png"])),
              geometry=IndexedFaceSet(coordIndex=[5,4,3,-1,1,3,4,-1,6,5,2,-1,3,2,5,-1,7,6,0,-1,2,0,6,-1,4,7,1,-1,0,1,7,-1],normalIndex=[1,1,1,-1,1,1,1,-1,2,2,2,-1,2,2,2,-1,0,0,0,-1,0,0,0,-1,3,3,3,-1,3,3,3,-1],solid=False,texCoordIndex=[1,0,3,-1,2,3,0,-1,1,0,3,-1,2,3,0,-1,1,0,3,-1,2,3,0,-1,1,0,3,-1,2,3,0,-1],
                coord=Coordinate(point=[(0.585125,10.9485,-0.585125),(-0.585125,10.9485,-0.585125),(0.585125,10.9485,0.585125),(-0.585125,10.9485,0.585125),(-0.585125,11.5453,-0.585125),(-0.585125,11.5453,0.585125),(0.585125,11.5453,0.585125),(0.585125,11.5453,-0.585125)]),
                normal=Normal(vector=[(1.0,0.0,0.0),(-1.0,0.0,0.0),(0.0,0.0,1.0),(0.0,0.0,-1.0)]),
                texCoord=TextureCoordinate(point=[(4.99E-4,0.999501),(0.9995,0.999501),(4.99E-4,4.99E-4),(0.9995,4.99E-4)])))]),
          Group(DEF='CrownInside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon04.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon04.png"])),
              geometry=IndexedFaceSet(coordIndex=[4,5,3,-1,3,1,4,-1,5,6,2,-1,2,3,5,-1,7,4,0,-1,1,0,4,-1,6,7,2,-1,0,2,7,-1],normalIndex=[0,0,0,-1,0,0,0,-1,1,1,1,-1,1,1,1,-1,2,2,2,-1,2,2,2,-1,3,3,3,-1,3,3,3,-1],solid=False,texCoordIndex=[8,7,9,-1,9,10,8,-1,0,11,6,-1,6,2,0,-1,12,1,10,-1,3,10,1,-1,0,5,4,-1,6,4,5,-1],
                coord=Coordinate(point=[(0.23405,14.3183,-0.23405),(-0.23405,14.3183,-0.23405),(0.23405,14.3183,0.23405),(-0.23405,14.3183,0.23405),(-0.234262,14.498,-0.233862),(-0.234262,14.498,0.234238),(0.233838,14.498,0.234238),(0.233838,14.498,-0.233862)]),
                normal=Normal(vector=[(0.9999,0.0011,0.0),(0.0,0.0010,-0.9999),(0.0,-0.0010,0.9999),(-0.9999,-0.0011,0.0)]),
                texCoord=TextureCoordinate(point=[(4.99E-4,0.9995),(0.9995,0.999501),(9.52E-4,4.99E-4),(0.999048,4.99E-4),(9.0E-4,4.99E-4),(0.999099,0.999501),(0.9995,4.99E-4),(0.9995,0.9995),(9.0E-4,0.999501),(0.999099,4.99E-4),(4.99E-4,4.99E-4),(0.999048,0.9995),(9.52E-4,0.999501)])))]),
          Group(DEF='CrownOutside',
            children=[
            Shape(
              appearance=Appearance(
                material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                texture=ImageTexture(url=["Textures/LatticeBeacon04.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon04.png"])),
              geometry=IndexedFaceSet(coordIndex=[5,4,3,-1,1,3,4,-1,6,5,2,-1,3,2,5,-1,4,7,0,-1,0,1,4,-1,7,6,2,-1,2,0,7,-1],normalIndex=[3,3,3,-1,3,3,3,-1,2,2,2,-1,2,2,2,-1,1,1,1,-1,1,1,1,-1,0,0,0,-1,0,0,0,-1],solid=False,texCoordIndex=[7,8,9,-1,10,9,8,-1,11,0,6,-1,2,6,0,-1,1,12,10,-1,10,3,1,-1,5,0,4,-1,4,6,5,-1],
                coord=Coordinate(point=[(0.23405,14.3183,-0.23405),(-0.23405,14.3183,-0.23405),(0.23405,14.3183,0.23405),(-0.23405,14.3183,0.23405),(-0.234262,14.498,-0.233862),(-0.234262,14.498,0.234238),(0.233838,14.498,0.234238),(0.233838,14.498,-0.233862)]),
                normal=Normal(vector=[(0.9999,0.0011,0.0),(0.0,0.0010,-0.9999),(0.0,-0.0010,0.9999),(-0.9999,-0.0011,0.0)]),
                texCoord=TextureCoordinate(point=[(4.99E-4,0.9995),(0.9995,0.999501),(9.52E-4,4.99E-4),(0.999048,4.99E-4),(9.0E-4,4.99E-4),(0.999099,0.999501),(0.9995,4.99E-4),(0.9995,0.9995),(9.0E-4,0.999501),(0.999099,4.99E-4),(4.99E-4,4.99E-4),(0.999048,0.9995),(9.52E-4,0.999501)])))]),
          Switch(DEF='LightSwitch',whichChoice=-1,
            IS=IS(
              connect=[
              connect(nodeField='whichChoice',protoField='LightType')]),
            children=[
            Group(DEF='LightOff',
              children=[
              Shape(
                appearance=Appearance(
                  material=Material(ambientIntensity=0.0,diffuseColor=(0.588235,0.588235,0.588235),shininess=0.145),
                  texture=ImageTexture(url=["Textures/LatticeBeacon07.jpg","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LatticeBeacon07.jpg"])),
                geometry=IndexedFaceSet(coordIndex=[0,8,9,-1,0,9,10,-1,0,10,11,-1,0,11,7,-1,1,2,0,-1,0,7,1,-1,2,3,8,-1,8,0,2,-1,3,4,9,-1,9,8,3,-1,4,5,10,-1,10,9,4,-1,5,6,11,-1,11,10,5,-1,6,1,7,-1,7,11,6,-1],normalIndex=[9,6,8,-1,9,8,10,-1,9,10,0,-1,9,0,11,-1,3,4,9,-1,9,11,3,-1,4,2,6,-1,6,9,4,-1,2,1,8,-1,8,6,2,-1,1,5,10,-1,10,8,1,-1,5,7,0,-1,0,10,5,-1,7,3,11,-1,11,0,7,-1],texCoordIndex=[0,1,2,-1,0,2,3,-1,0,3,4,-1,0,4,5,-1,6,7,0,-1,0,5,6,-1,7,8,1,-1,1,0,7,-1,8,9,2,-1,2,1,8,-1,9,10,3,-1,3,2,9,-1,10,11,4,-1,4,3,10,-1,11,6,5,-1,5,4,11,-1],
                  coord=Coordinate(point=[(-0.009991,14.6127,-0.017862),(-0.031706,14.5936,-0.012896),(-0.01533,14.6219,-0.012896),(0.01742,14.6219,-0.012896),(0.033795,14.5936,-0.012896),(0.01742,14.5652,-0.012896),(-0.01533,14.5652,-0.012896),(-0.021028,14.5936,-0.017862),(0.012081,14.6127,-0.017862),(0.023117,14.5936,-0.017862),(0.012081,14.5745,-0.017862),(-0.009991,14.5745,-0.017862)]),
                  normal=Normal(vector=[(-0.1409,-0.2441,-0.9594),(0.4216,0.0,-0.9067),(0.2108,0.3651,-0.9067),(-0.4216,0.0,-0.9067),(-0.2108,0.3651,-0.9067),(0.2108,-0.3651,-0.9067),(0.1409,0.2441,-0.9594),(-0.2108,-0.3651,-0.9067),(0.2819,0.0,-0.9594),(-0.1409,0.2441,-0.9594),(0.1409,-0.2441,-0.9594),(-0.2819,0.0,-0.9594)]),
                  texCoord=TextureCoordinate(point=[(0.645526,0.783806),(0.327726,0.783806),(0.168826,0.498784),(0.327726,0.213762),(0.645525,0.213762),(0.804425,0.498784),(0.958161,0.498784),(0.722393,0.921685),(0.250858,0.921685),(0.015089,0.498784),(0.250858,0.075883),(0.722393,0.075883)])))]),
            Group(DEF='LightOn',
              children=[
              Group(DEF='LightOnBulb',
                children=[
                Shape(
                  appearance=Appearance(
                    material=Material(ambientIntensity=0.0,diffuseColor=(0.662745,0.12549,0.133333),emissiveColor=(0.662745,0.12549,0.133333),shininess=0.145)),
                  geometry=IndexedFaceSet(coordIndex=[0,8,9,-1,0,9,10,-1,0,10,11,-1,0,11,7,-1,1,2,0,-1,0,7,1,-1,2,3,8,-1,8,0,2,-1,3,4,9,-1,9,8,3,-1,4,5,10,-1,10,9,4,-1,5,6,11,-1,11,10,5,-1,6,1,7,-1,7,11,6,-1],normalIndex=[9,6,8,-1,9,8,10,-1,9,10,0,-1,9,0,11,-1,3,4,9,-1,9,11,3,-1,4,2,6,-1,6,9,4,-1,2,1,8,-1,8,6,2,-1,1,5,10,-1,10,8,1,-1,5,7,0,-1,0,10,5,-1,7,3,11,-1,11,0,7,-1],
                    coord=Coordinate(point=[(-0.009991,14.6127,-0.017862),(-0.031706,14.5936,-0.012896),(-0.01533,14.6219,-0.012896),(0.01742,14.6219,-0.012896),(0.033795,14.5936,-0.012896),(0.01742,14.5652,-0.012896),(-0.01533,14.5652,-0.012896),(-0.021028,14.5936,-0.017862),(0.012081,14.6127,-0.017862),(0.023117,14.5936,-0.017862),(0.012081,14.5745,-0.017862),(-0.009991,14.5745,-0.017862)]),
                    normal=Normal(vector=[(-0.1409,-0.2441,-0.9594),(0.4216,0.0,-0.9067),(0.2108,0.3651,-0.9067),(-0.4216,0.0,-0.9067),(-0.2108,0.3651,-0.9067),(0.2108,-0.3651,-0.9067),(0.1409,0.2441,-0.9594),(-0.2108,-0.3651,-0.9067),(0.2819,0.0,-0.9594),(-0.1409,0.2441,-0.9594),(0.1409,-0.2441,-0.9594),(-0.2819,0.0,-0.9594)])))]),
              Transform(DEF='LightOnGlow',translation=(0.0,14.5936,0.010164),
                IS=IS(
                  connect=[
                  connect(nodeField='scale',protoField='LightGlow')]),
                children=[
                Collision(enabled=False,
                  children=[
                  Shape(
                    appearance=Appearance(
                      material=Material(diffuseColor=(0.662745,0.12549,0.133333),emissiveColor=(0.662745,0.12549,0.133333),transparency=0.1),
                      texture=ImageTexture(url=["Textures/LightOnRedGlow.png","https://www.web3d.org/x3d/content/examples/Savage/HarborEquipment/NavigationAids/Textures/LightOnRedGlow.png"])),
                    geometry=IndexedFaceSet(coordIndex=[2,0,1,-1,0,3,1,-1,3,4,1,-1,4,5,1,-1,5,6,1,-1,6,2,1,-1],normalIndex=[0,2,4,-1,2,1,4,-1,1,3,4,-1,3,5,4,-1,5,6,4,-1,6,0,4,-1],texCoordIndex=[2,0,1,-1,0,3,1,-1,3,4,1,-1,4,5,1,-1,5,6,1,-1,6,2,1,-1],
                      coord=Coordinate(point=[(-0.373511,0.648737,-0.555472),(0.0,0.0,0.0),(-0.748065,0.0,-0.555471),(0.3756,0.648737,-0.555472),(0.750155,0.0,-0.555472),(0.3756,-0.648737,-0.555472),(-0.373511,-0.648737,-0.555472)]),
                      normal=Normal(vector=[(0.5961,0.0,-0.8028),(-0.2977,-0.5155,-0.8034),(0.2978,-0.5161,-0.803),(-0.595,0.0,-0.8036),(7.0E-4,0.0,-0.9999),(-0.2977,0.5155,-0.8034),(0.2978,0.5161,-0.803)]),
                      texCoord=TextureCoordinate(point=[(0.74975,0.999501),(0.5,0.499999),(0.999501,0.499998),(0.25025,0.999501),(4.99E-4,0.499998),(0.25025,4.99E-4),(0.74975,4.99E-4)])))])])])])])])),
    ProtoInstance(name='RangeLight')])
)

### X3D model conversion complete ###

####################################################################################################
# Self-test diagnostics
####################################################################################################

print('Self-test diagnostics for RangeLightPrototype.py:')
if        metaDiagnostics(newModel): # built-in utility method in X3D class
    print(metaDiagnostics(newModel)) # display meta info, hint, warning, error, TODO values in this model
# print('check newModel.XML() serialization...')
newModelXML= newModel.XML() # test export method XML() for exceptions during export
newModel.XMLvalidate()
# print(newModelXML) # diagnostic

try:
#   print('check newModel.VRML() serialization...')
    newModelVRML=newModel.VRML() # test export method VRML() for exceptions during export
    # print(prependLineNumbers(newModelVRML)) # debug
    print("Python-to-VRML export of VRML output successful", flush=True)
except Exception as err: # usually BaseException
    # https://stackoverflow.com/questions/18176602/how-to-get-the-name-of-an-exception-that-was-caught-in-python
    print("*** Python-to-VRML export of VRML output failed:", type(err).__name__, err)
    if newModelVRML: # may have failed to generate
        print(prependLineNumbers(newModelVRML, err.lineno))

try:
#   print('check newModel.JSON() serialization...')
    newModelJSON=newModel.JSON() # test export method JSON() for exceptions during export
#   print(prependLineNumbers(newModelJSON)) # debug
    print("Python-to-JSON export of JSON output successful (under development)")
except Exception as err: # usually SyntaxError
    print("*** Python-to-JSON export of JSON output failed:", type(err).__name__, err)
    if newModelJSON: # may have failed to generate
        print(prependLineNumbers(newModelJSON,err.lineno))

print("python RangeLightPrototype.py load and self-test diagnostics complete.")
