####################################################################################################
#
# Invoking X3D model self-test:
#
#   $ python TulipPurple.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='TulipPurple.x3d',name='title'),
    meta(content='Purple Tulip for garden',name='description'),
    meta(content='Kok Keng Ng',name='translator'),
    meta(content='10 September 2002',name='created'),
    meta(content='20 October 2019',name='modified'),
    meta(content='https://www.web3d.org/x3d/content/examples/Savage/Buildings/PlayGround/TulipPurple.x3d',name='identifier'),
    meta(content='Garden flowers',name='subject'),
    meta(content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit',name='generator'),
    meta(content='../../license.html',name='license')]),
  Scene=Scene(
    children=[
    WorldInfo(title='TulipPurple.x3d'),
    Transform(scale=(0.00214,0.00214,0.00214),translation=(1.05,0.33,-0.1),
      children=[
      Transform(rotation=(0.0,1.0,0.0,-0.7679),scale=(0.8403,0.8403,0.8403),scaleOrientation=(0.0,1.0,0.0,-0.3118),translation=(-485.3,28.8,36.41),
        children=[
        Transform(rotation=(-1.0,-0.002499,5.11E-4,-2.436),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.9756,0.2079,0.07045,-0.7222),translation=(-19.9,186.1,53.03),
          children=[
          Shape(
            geometry=IndexedFaceSet(DEF='Circle49-FACES',coordIndex=[6,7,8,-1,5,6,8,-1,5,8,9,-1,5,9,10,-1,4,5,10,-1,3,4,10,-1,3,10,11,-1,3,11,12,-1,3,12,13,-1,3,13,14,-1,3,14,15,-1,3,15,16,-1,3,16,17,-1,3,17,18,-1,3,18,19,-1,3,19,20,-1,3,20,21,-1,3,21,22,-1,3,22,23,-1,3,23,24,-1,3,24,25,-1,3,25,26,-1,3,26,27,-1,3,27,0,-1,3,0,1,-1,3,1,2,-1],creaseAngle=3.14,solid=False,texCoordIndex=[6,7,8,-1,5,6,8,-1,5,8,9,-1,5,9,10,-1,4,5,10,-1,3,4,10,-1,3,10,11,-1,3,11,12,-1,3,12,13,-1,3,13,14,-1,3,14,15,-1,3,15,16,-1,3,16,17,-1,3,17,18,-1,3,18,19,-1,3,19,20,-1,3,20,21,-1,3,21,22,-1,3,22,23,-1,3,23,24,-1,3,24,25,-1,3,25,26,-1,3,26,27,-1,3,27,0,-1,3,0,1,-1,3,1,2,-1],
              coord=Coordinate(point=[(20.75,-15.96,2.389),(20.82,-22.53,-1.764),(21.41,-25.54,-10.9),(19.61,-29.02,-17.89),(17.38,-30.63,-24.48),(12.55,-31.71,-32.29),(6.484,-32.41,-36.19),(1.337,-33.46,-38.57),(-3.823,-32.54,-37.32),(-8.464,-32.4,-34.77),(-13.21,-32.7,-28.84),(-17.07,-30.13,-22.36),(-19.94,-27.2,-16.3),(-21.32,-19.93,-8.973),(-21.67,-17.06,1.43),(-20.89,-13.27,9.862),(-18.98,-5.183,17.4),(-16.68,-0.1183,24.59),(-12.3,7.52,34.81),(-8.478,11.0,45.28),(-4.268,11.94,57.04),(0.2789,12.61,58.97),(4.81,12.31,57.98),(8.836,11.7,47.08),(12.83,7.044,36.93),(15.86,-0.2902,27.46),(18.23,-6.583,20.3),(20.2,-13.35,10.99)]),
              texCoord=TextureCoordinate(point=[(0.9941,0.4735),(0.9995,0.5972),(0.9621,0.7067),(0.9008,0.8011),(0.8183,0.8911),(0.714,0.9578),(0.6124,0.9872),(0.5,0.9995),(0.3876,0.9872),(0.286,0.9578),(0.1817,0.8911),(0.09924,0.8011),(0.03794,0.7067),(4.995E-4,0.5972),(0.005896,0.4735),(0.03456,0.3499),(0.09022,0.2363),(0.1495,0.159),(0.2262,0.09345),(0.3112,0.04457),(0.401,0.01185),(0.5,4.995E-4),(0.599,0.01185),(0.6888,0.04457),(0.7738,0.09345),(0.8505,0.159),(0.9098,0.2363),(0.9654,0.3499)])),
            appearance=Appearance(DEF='chsl_1',
              material=Material(ambientIntensity=0.267858,diffuseColor=(0.244615,0.113264,0.302703),shininess=0.07027,specularColor=(0.253352,0.11731,0.313514))))]),
        Transform(rotation=(-0.865,-0.1752,0.4702,-2.527),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.7579,-0.6106,-0.2296,-0.9031),translation=(20.02,186.1,30.88),
          children=[
          Shape(DEF='chsl_2',
            geometry=IndexedFaceSet(USE='Circle49-FACES'),
            appearance=Appearance(USE='chsl_1'))]),
        Transform(rotation=(0.4844,-0.3013,0.8213,-3.498),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.8407,-0.5065,-0.1918,-0.8247),translation=(-59.24,186.1,-18.04),
          children=[
          Shape(USE='chsl_2')]),
        Transform(rotation=(-0.0118,-0.3456,0.9383,-3.137),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.765,-0.6027,-0.2268,-0.8958),translation=(-18.12,186.1,-40.57),
          children=[
          Shape(USE='chsl_2')]),
        Transform(rotation=(-0.8546,0.1777,-0.4879,-2.53),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.9968,-0.07304,-0.03316,-0.7077),translation=(-59.7,186.1,29.42),
          children=[
          Shape(USE='chsl_2')]),
        Transform(rotation=(0.0,-1.0,0.0,-0.5498),translation=(-19.53,159.8,5.288),
          children=[
          Shape(
            geometry=IndexedFaceSet(DEF='petal_base08-FACES',coordIndex=[10,11,0,-1,6,7,8,-1,4,5,6,-1,2,3,4,-1,0,1,2,-1,8,9,10,-1,8,10,0,-1,6,8,0,-1,4,6,0,-1,4,0,2,-1],creaseAngle=3.14,solid=False,
              coord=Coordinate(point=[(11.19,0.0,0.0),(28.78,16.45,-13.75),(5.593,0.0,-9.688),(0.01805,15.13,-33.29),(-5.593,0.0,-9.688),(-26.59,16.45,-15.39),(-11.19,0.0,0.0),(-25.52,15.18,14.73),(-5.593,0.0,9.688),(-1.177,15.18,32.58),(5.593,0.0,9.688),(26.13,16.41,17.51)])),
            appearance=Appearance(DEF='chsl_3',
              material=Material(ambientIntensity=0.06972,diffuseColor=(0.0,0.4353,0.1922),shininess=0.2875,specularColor=(0.3788,0.4871,0.3788))))]),
        Transform(rotation=(0.0,0.0,-1.0,-0.4451),translation=(65.54,-219.4,5.303),
          children=[
          Shape(
            geometry=IndexedFaceSet(DEF='stem_09-FACES',coordIndex=[0,1,11,-1,0,11,10,-1,1,2,12,-1,1,12,11,-1,2,3,13,-1,2,13,12,-1,3,4,14,-1,3,14,13,-1,4,5,15,-1,4,15,14,-1,5,6,16,-1,5,16,15,-1,6,7,17,-1,6,17,16,-1,7,8,18,-1,7,18,17,-1,8,9,19,-1,8,19,18,-1,9,0,10,-1,9,10,19,-1,10,11,21,-1,10,21,20,-1,11,12,22,-1,11,22,21,-1,12,13,23,-1,12,23,22,-1,13,14,24,-1,13,24,23,-1,14,15,25,-1,14,25,24,-1,15,16,26,-1,15,26,25,-1,16,17,27,-1,16,27,26,-1,17,18,28,-1,17,28,27,-1,18,19,29,-1,18,29,28,-1,19,10,20,-1,19,20,29,-1,20,21,31,-1,20,31,30,-1,21,22,32,-1,21,32,31,-1,22,23,33,-1,22,33,32,-1,23,24,34,-1,23,34,33,-1,24,25,35,-1,24,35,34,-1,25,26,36,-1,25,36,35,-1,26,27,37,-1,26,37,36,-1,27,28,38,-1,27,38,37,-1,28,29,39,-1,28,39,38,-1,29,20,30,-1,29,30,39,-1,30,31,41,-1,30,41,40,-1,31,32,42,-1,31,42,41,-1,32,33,43,-1,32,43,42,-1,33,34,44,-1,33,44,43,-1,34,35,45,-1,34,45,44,-1,35,36,46,-1,35,46,45,-1,36,37,47,-1,36,47,46,-1,37,38,48,-1,37,48,47,-1,38,39,49,-1,38,49,48,-1,39,30,40,-1,39,40,49,-1,40,41,51,-1,40,51,50,-1,41,42,52,-1,41,52,51,-1,42,43,53,-1,42,53,52,-1,43,44,54,-1,43,54,53,-1,44,45,55,-1,44,55,54,-1,45,46,56,-1,45,56,55,-1,46,47,57,-1,46,57,56,-1,47,48,58,-1,47,58,57,-1,48,49,59,-1,48,59,58,-1,49,40,50,-1,49,50,59,-1,50,51,61,-1,50,61,60,-1,51,52,62,-1,51,62,61,-1,52,53,63,-1,52,63,62,-1,53,54,64,-1,53,64,63,-1,54,55,65,-1,54,65,64,-1,55,56,66,-1,55,66,65,-1,56,57,67,-1,56,67,66,-1,57,58,68,-1,57,68,67,-1,58,59,69,-1,58,69,68,-1,59,50,60,-1,59,60,69,-1,60,61,71,-1,60,71,70,-1,61,62,72,-1,61,72,71,-1,62,63,73,-1,62,73,72,-1,63,64,74,-1,63,74,73,-1,64,65,75,-1,64,75,74,-1,65,66,76,-1,65,76,75,-1,66,67,77,-1,66,77,76,-1,67,68,78,-1,67,78,77,-1,68,69,79,-1,68,79,78,-1,69,60,70,-1,69,70,79,-1,70,71,81,-1,70,81,80,-1,71,72,82,-1,71,82,81,-1,72,73,83,-1,72,83,82,-1,73,74,84,-1,73,84,83,-1,74,75,85,-1,74,85,84,-1,75,76,86,-1,75,86,85,-1,76,77,87,-1,76,87,86,-1,77,78,88,-1,77,88,87,-1,78,79,89,-1,78,89,88,-1,79,70,80,-1,79,80,89,-1,80,81,91,-1,80,91,90,-1,81,82,92,-1,81,92,91,-1,82,83,93,-1,82,93,92,-1,83,84,94,-1,83,94,93,-1,84,85,95,-1,84,95,94,-1,85,86,96,-1,85,96,95,-1,86,87,97,-1,86,97,96,-1,87,88,98,-1,87,98,97,-1,88,89,99,-1,88,99,98,-1,89,80,90,-1,89,90,99,-1,90,91,101,-1,90,101,100,-1,91,92,102,-1,91,102,101,-1,92,93,103,-1,92,103,102,-1,93,94,104,-1,93,104,103,-1,94,95,105,-1,94,105,104,-1,95,96,106,-1,95,106,105,-1,96,97,107,-1,96,107,106,-1,97,98,108,-1,97,108,107,-1,98,99,109,-1,98,109,108,-1,99,90,100,-1,99,100,109,-1,5,7,6,-1,4,7,5,-1,3,7,4,-1,2,7,3,-1,1,7,2,-1,0,7,1,-1,9,7,0,-1,8,7,9,-1,105,106,107,-1,104,105,107,-1,103,104,107,-1,102,103,107,-1,101,102,107,-1,100,101,107,-1,109,100,107,-1,108,109,107,-1],creaseAngle=3.14,solid=False,
              coord=Coordinate(point=[(-58.75,36.65,0.0),(-59.29,36.85,-1.777),(-60.71,37.37,-2.875),(-62.47,38.01,-2.875),(-63.89,38.53,-1.777),(-64.43,38.73,0.0),(-63.89,38.53,1.777),(-62.47,38.01,2.875),(-60.71,37.37,2.875),(-59.29,36.85,1.777),(-41.63,81.46,0.0),(-42.21,81.52,-1.777),(-43.71,81.69,-2.875),(-45.57,81.9,-2.875),(-47.07,82.07,-1.777),(-47.64,82.14,0.0),(-47.07,82.07,1.777),(-45.57,81.9,2.875),(-43.71,81.69,2.875),(-42.21,81.52,1.777),(-22.94,125.7,0.0),(-23.5,125.8,-1.777),(-24.99,126.0,-2.875),(-26.84,126.4,-2.875),(-28.32,126.6,-1.777),(-28.89,126.7,0.0),(-28.32,126.6,1.777),(-26.84,126.4,2.875),(-24.99,126.0,2.875),(-23.5,125.8,1.777),(-4.38,169.3,0.0),(-4.942,169.4,-1.777),(-6.415,169.7,-2.875),(-8.235,170.1,-2.875),(-9.708,170.5,-1.777),(-10.27,170.6,0.0),(-9.708,170.5,1.777),(-8.235,170.1,2.875),(-6.415,169.7,2.875),(-4.942,169.4,1.777),(14.46,213.5,0.0),(13.91,213.6,-1.777),(12.45,214.1,-2.875),(10.66,214.6,-2.875),(9.209,215.0,-1.777),(8.655,215.2,0.0),(9.21,215.0,1.777),(10.66,214.6,2.875),(12.45,214.1,2.875),(13.91,213.6,1.777),(33.38,258.3,0.0),(32.83,258.5,-1.777),(31.41,259.0,-2.875),(29.65,259.6,-2.875),(28.22,260.1,-1.777),(27.68,260.3,0.0),(28.22,260.1,1.777),(29.65,259.6,2.875),(31.41,259.0,2.875),(32.83,258.5,1.777),(53.58,302.9,0.0),(53.05,303.1,-1.777),(51.66,303.7,-2.875),(49.93,304.4,-2.875),(48.54,305.0,-1.777),(48.01,305.2,0.0),(48.54,305.0,1.777),(49.93,304.4,2.875),(51.66,303.7,2.875),(53.05,303.1,1.777),(90.44,380.7,0.0),(89.97,380.9,-1.615),(88.72,381.5,-2.614),(87.19,382.2,-2.614),(85.94,382.8,-1.615),(85.47,383.1,0.0),(85.94,382.8,1.615),(87.19,382.2,2.614),(88.72,381.5,2.614),(89.97,380.9,1.615),(97.2,391.8,0.0),(96.51,392.1,-2.381),(94.68,393.0,-3.853),(92.43,394.1,-3.853),(90.61,395.0,-2.381),(89.91,395.3,0.0),(90.61,395.0,2.381),(92.43,394.1,3.853),(94.68,393.0,3.853),(96.51,392.1,2.381),(102.0,402.2,0.0),(101.3,402.5,-2.221),(99.64,403.3,-3.594),(97.55,404.4,-3.594),(95.85,405.2,-2.221),(95.21,405.5,0.0),(95.85,405.2,2.221),(97.55,404.4,3.594),(99.64,403.3,3.594),(101.3,402.5,2.221),(105.7,415.7,0.0),(105.5,415.8,-0.8265),(104.8,416.1,-1.337),(104.1,416.5,-1.337),(103.4,416.8,-0.8265),(103.2,416.9,0.0),(103.4,416.8,0.8265),(104.1,416.5,1.337),(104.8,416.1,1.337),(105.5,415.8,0.8265)])),
            appearance=Appearance(USE='chsl_3'))]),
        Transform(rotation=(-0.4731,-0.3618,0.8032,-2.722),scale=(0.6579,0.6579,0.6579),scaleOrientation=(0.9794,0.0,0.2021,-0.7838),translation=(-16.47,204.7,3.791),
          children=[
          Shape(
            geometry=IndexedFaceSet(DEF='tops_25-FACES',coordIndex=[7,8,9,-1,7,9,0,-1,7,0,1,-1,7,1,2,-1,7,2,3,-1,7,3,4,-1,7,4,5,-1,6,7,5,-1],creaseAngle=3.14,solid=False,
              coord=Coordinate(point=[(1.444,-1.542,0.0),(1.403,-1.093,-4.489),(0.7009,-0.1811,-7.264),(-0.7009,-0.1811,-7.264),(-1.403,-1.093,-4.489),(-1.444,-1.542,0.0),(-1.403,-1.093,4.489),(-0.7009,-0.1811,7.264),(0.7009,-0.1811,7.264),(1.403,-1.093,4.489)])),
            appearance=Appearance(DEF='chsl_4',
              material=Material(ambientIntensity=0.1264,diffuseColor=(1.0,1.0,1.0),shininess=0.2875,specularColor=(0.045,0.045,0.045))))]),
        Transform(rotation=(-1.0,0.0,0.0,-2.295),scale=(0.6579,0.6579,0.6579),scaleOrientation=(0.0,0.7161,0.698,-0.1598),translation=(-19.38,204.7,8.727),
          children=[
          Shape(DEF='chsl_5',
            geometry=IndexedFaceSet(USE='tops_25-FACES'),
            appearance=Appearance(USE='chsl_4'))]),
        Transform(rotation=(0.4474,-0.3673,0.8154,-3.539),scale=(0.6579,0.6579,0.6579),scaleOrientation=(-0.7702,-0.5834,-0.258,-0.973),translation=(-22.18,204.7,3.617),
          children=[
          Shape(USE='chsl_5')]),
        Transform(rotation=(-0.4979,-0.3007,0.8134,-2.783),scale=(1.0,0.5155,1.0),scaleOrientation=(-0.9837,-0.1668,-0.0676,-0.7162),translation=(23.91,186.1,-14.81),
          children=[
          Shape(USE='chsl_2')]),
        Transform(rotation=(0.0,-1.0,0.0,-4.154),translation=(-26.19,178.5,16.33),
          children=[
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),scaleOrientation=(0.2254,-0.9743,0.0,-0.05605),translation=(2.911,11.1,0.0),
            children=[
            Shape(
              geometry=IndexedFaceSet(DEF='staman_top_49-FACES',coordIndex=[0,1,7,-1,0,7,6,-1,1,2,8,-1,1,8,7,-1,2,3,9,-1,2,9,8,-1,3,4,10,-1,3,10,9,-1,4,5,11,-1,4,11,10,-1,5,0,6,-1,5,6,11,-1,6,7,13,-1,6,13,12,-1,7,8,14,-1,7,14,13,-1,8,9,15,-1,8,15,14,-1,9,10,16,-1,9,16,15,-1,10,11,17,-1,10,17,16,-1,11,6,12,-1,11,12,17,-1,12,13,19,-1,12,19,18,-1,13,14,20,-1,13,20,19,-1,14,15,21,-1,14,21,20,-1,15,16,22,-1,15,22,21,-1,16,17,23,-1,16,23,22,-1,17,12,18,-1,17,18,23,-1,18,19,25,-1,18,25,24,-1,19,20,26,-1,19,26,25,-1,20,21,27,-1,20,27,26,-1,21,22,28,-1,21,28,27,-1,22,23,29,-1,22,29,28,-1,23,18,24,-1,23,24,29,-1,24,25,31,-1,24,31,30,-1,25,26,32,-1,25,32,31,-1,26,27,33,-1,26,33,32,-1,27,28,34,-1,27,34,33,-1,28,29,35,-1,28,35,34,-1,29,24,30,-1,29,30,35,-1,3,5,4,-1,2,5,3,-1,1,5,2,-1,0,5,1,-1,33,34,35,-1,32,33,35,-1,31,32,35,-1,30,31,35,-1],creaseAngle=3.14,
                coord=Coordinate(point=[(0.8636,0.0,0.0),(0.4318,0.0,-0.7479),(-0.4318,0.0,-0.7479),(-0.8636,0.0,0.0),(-0.4318,0.0,0.7479),(0.4318,0.0,0.7479),(1.388,1.3,0.0),(0.694,1.3,-1.202),(-0.694,1.3,-1.202),(-1.388,1.3,0.0),(-0.694,1.3,1.202),(0.694,1.3,1.202),(1.568,2.6,0.0),(0.7842,2.6,-1.358),(-0.7842,2.6,-1.358),(-1.568,2.6,0.0),(-0.7842,2.6,1.358),(0.7842,2.6,1.358),(1.568,3.9,0.0),(0.7842,3.9,-1.358),(-0.7842,3.9,-1.358),(-1.568,3.9,0.0),(-0.7842,3.9,1.358),(0.7842,3.9,1.358),(1.296,5.2,0.0),(0.6481,5.2,-1.123),(-0.6481,5.2,-1.123),(-1.296,5.2,0.0),(-0.6481,5.2,1.123),(0.6481,5.2,1.123),(0.8072,6.5,0.0),(0.4036,6.5,-0.699),(-0.4036,6.5,-0.699),(-0.8072,6.5,0.0),(-0.4036,6.5,0.699),(0.4036,6.5,0.699)])),
              appearance=Appearance(DEF='chsl_6',
                material=Material(diffuseColor=(1.0,0.0,0.0))))]),
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009151),
            children=[
            Shape(
              geometry=IndexedFaceSet(DEF='stamen_stem_49-FACES',coordIndex=[0,1,7,-1,0,7,6,-1,1,2,8,-1,1,8,7,-1,2,3,9,-1,2,9,8,-1,3,4,10,-1,3,10,9,-1,4,5,11,-1,4,11,10,-1,5,0,6,-1,5,6,11,-1,6,7,13,-1,6,13,12,-1,7,8,14,-1,7,14,13,-1,8,9,15,-1,8,15,14,-1,9,10,16,-1,9,16,15,-1,10,11,17,-1,10,17,16,-1,11,6,12,-1,11,12,17,-1,12,13,19,-1,12,19,18,-1,13,14,20,-1,13,20,19,-1,14,15,21,-1,14,21,20,-1,15,16,22,-1,15,22,21,-1,16,17,23,-1,16,23,22,-1,17,12,18,-1,17,18,23,-1,18,19,25,-1,18,25,24,-1,19,20,26,-1,19,26,25,-1,20,21,27,-1,20,27,26,-1,21,22,28,-1,21,28,27,-1,22,23,29,-1,22,29,28,-1,23,18,24,-1,23,24,29,-1,0,2,1,-1,0,3,2,-1,0,4,3,-1,0,5,4,-1,24,25,26,-1,24,26,27,-1,24,27,28,-1,24,28,29,-1],creaseAngle=3.14,
                coord=Coordinate(point=[(0.4782,0.0,0.0),(0.2391,0.0,-0.4142),(-0.2391,0.0,-0.4142),(-0.4782,0.0,0.0),(-0.2391,0.0,0.4142),(0.2391,0.0,0.4142),(1.333,7.578,0.0),(1.1,7.632,-0.4142),(0.634,7.738,-0.4142),(0.4009,7.791,0.0),(0.634,7.738,0.4142),(1.1,7.632,0.4142),(3.856,14.78,0.0),(3.64,14.88,-0.4142),(3.209,15.09,-0.4142),(2.994,15.19,0.0),(3.209,15.09,0.4142),(3.64,14.88,0.4142),(7.918,21.23,0.0),(7.731,21.38,-0.4142),(7.358,21.68,-0.4142),(7.171,21.83,0.0),(7.358,21.68,0.4142),(7.731,21.38,0.4142),(13.32,26.62,0.0),(13.17,26.8,-0.4142),(12.87,27.18,-0.4142),(12.72,27.37,0.0),(12.87,27.18,0.4142),(13.17,26.8,0.4142)])),
              appearance=Appearance(DEF='chsl_7',
                material=Material(ambientIntensity=0.298,diffuseColor=(0.9882,0.8588,0.0),shininess=0.2875,specularColor=(0.3588,0.349,0.08235))))])]),
        Transform(rotation=(0.0,-1.0,0.0,-2.094),translation=(-25.81,178.5,-5.375),
          children=[
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),scaleOrientation=(-0.7509,0.6605,0.0,-0.0572),translation=(2.911,11.1,-4.422E-5),
            children=[
            Shape(DEF='chsl_8',
              geometry=IndexedFaceSet(USE='staman_top_49-FACES'),
              appearance=Appearance(USE='chsl_6'))]),
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009151),
            children=[
            Shape(DEF='chsl_9',
              geometry=IndexedFaceSet(USE='stamen_stem_49-FACES'),
              appearance=Appearance(USE='chsl_7'))])]),
        Transform(translation=(-6.819,178.5,5.589),
          children=[
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009173),
            children=[
            Shape(USE='chsl_9')]),
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),scaleOrientation=(0.08564,-0.4127,-0.9068,-0.8548),translation=(2.911,11.1,-2.661E-5),
            children=[
            Shape(USE='chsl_8')])]),
        Transform(rotation=(0.0,1.0,0.0,-1.012),translation=(-12.77,178.5,16.33),
          children=[
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009118),
            children=[
            Shape(USE='chsl_9')]),
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),translation=(2.911,11.1,0.0),
            children=[
            Shape(USE='chsl_8')])]),
        Transform(rotation=(0.0,-1.0,0.0,-0.9512),translation=(-12.13,178.5,-4.718),
          children=[
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009144),
            children=[
            Shape(USE='chsl_9')]),
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),scaleOrientation=(-0.3844,0.3533,-0.8529,-0.1726),translation=(2.911,11.1,0.0),
            children=[
            Shape(USE='chsl_8')])]),
        Transform(rotation=(0.0,-1.0,0.0,-3.142),translation=(-32.14,178.5,5.589),
          children=[
          Transform(rotation=(0.0,0.0,-1.0,-0.07854),translation=(-7.91,-16.84,-0.009152),
            children=[
            Shape(USE='chsl_9')]),
          Transform(rotation=(0.0,0.0,1.0,-0.7505),scale=(1.09,1.09,1.09),scaleOrientation=(0.6484,-0.7613,0.0,-0.1624),translation=(2.911,11.1,0.0),
            children=[
            Shape(USE='chsl_8')])]),
        Transform(translation=(-1.543E-5,-14.89,0.0),
          children=[
          Transform(rotation=(-0.9929,0.01547,-0.1183,-1.149),scale=(0.6957,0.6957,0.6957),scaleOrientation=(-0.2308,-0.04201,0.9721,-0.8001),translation=(-16.32,-39.42,-32.55),
            children=[
            Shape(
              geometry=IndexedFaceSet(DEF='Line42-FACES',coordIndex=[6,7,8,-1,14,0,1,-1,13,14,1,-1,6,8,9,-1,5,6,9,-1,4,5,9,-1,4,9,10,-1,3,4,10,-1,3,10,11,-1,3,11,12,-1,2,3,12,-1,2,12,13,-1,1,2,13,-1],creaseAngle=3.14,solid=False,
                coord=Coordinate(point=[(6.974,-2.127,134.8),(10.51,-0.4029,105.9),(18.41,3.449,64.51),(25.17,6.75,25.6),(27.43,7.85,-14.56),(27.63,2.152,-74.81),(19.26,-4.781,-133.8),(0.0,-18.42,-214.1),(-21.76,-3.381,-135.1),(-31.06,4.546,-74.81),(-30.87,10.3,-14.56),(-28.67,9.107,25.6),(-20.95,4.915,64.51),(-12.12,0.1233,105.9),(-7.827,-2.209,134.8)])),
              appearance=Appearance(USE='chsl_3'))]),
          Transform(rotation=(-0.481,0.7416,-0.4676,-1.801),scale=(0.8,0.8,0.8),scaleOrientation=(-0.9932,-0.1161,0.0,-0.2886),translation=(39.13,-76.79,1.276),
            children=[
            Shape(DEF='chsl_10',
              geometry=IndexedFaceSet(USE='Line42-FACES'),
              appearance=Appearance(USE='chsl_3'))]),
          Transform(rotation=(-0.3967,-0.7379,0.546,-2.157),scale=(0.6061,0.6061,0.6061),scaleOrientation=(-0.3682,0.1829,-0.9116,-0.5404),translation=(-38.02,53.29,12.64),
            children=[
            Shape(USE='chsl_10')]),
          Transform(rotation=(-0.006089,-0.8767,0.481,-3.129),scale=(0.5,0.5,0.5),scaleOrientation=(-0.2571,0.0,0.9664,-0.7999),translation=(-20.12,86.61,41.13),
            children=[
            Shape(USE='chsl_10')]),
          Transform(rotation=(-0.3172,-0.8094,0.4943,-2.218),scale=(0.8,0.8,0.8),scaleOrientation=(0.9947,-0.1028,-0.004207,-0.7892),translation=(-49.19,-76.79,27.85),
            children=[
            Shape(USE='chsl_10')])])])])])
)

### X3D model conversion complete ###

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

print('Self-test diagnostics for TulipPurple.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 TulipPurple.py load and self-test diagnostics complete.")
