####################################################################################################
#
# Invoking X3D model self-test:
#
#   $ python lprem1lr.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='Interactive',version='4.0',
  head=head(
    children=[
    meta(content='lprem1lr.x3d',name='title'),
    meta(content='fix naming',name='warning'),
    meta(content='tooth (TODO fix name)',name='description'),
    meta(content='Joe Williams, John Carlson, Damon Hernandez, Don Brutzman',name='creator'),
    meta(content='Don Brutzman',name='translator'),
    meta(content='5 December 2013',name='created'),
    meta(content='5 March 2026',name='translated'),
    meta(content='14 March 2026',name='modified'),
    meta(content='originals/lprem1lr.x3d',name='reference'),
    meta(content='https://en.wikipedia.org/wiki/List_of_bones_of_the_human_skeleton',name='reference'),
    meta(content='usage examples https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Medical',name='reference'),
    meta(content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit',name='generator'),
    meta(content='X3D Tidy, https://www.web3d.org/x3d/stylesheets/X3dTidy.html',name='generator'),
    meta(content='https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/lprem1lr.x3d',name='identifier'),
    meta(content='../license.html',name='license')]),
  Scene=Scene(
    children=[
    WorldInfo(title='*TODO_add_title*'),
    Comment(' user hover lights bone and reveals description, user selection/deselection temporarily binds/unbinds close-up hidden viewpoint '),
    TouchSensor(DEF='UserTouchSensor',description='tooth lprem1lr'),
    Transform(DEF='lprem1lr',translation=(0.0170,1.5793,0.0796),
      children=[
      Viewpoint(DEF='HiddenViewpoint',nearDistance=0.001,position=(0,0,0.3),
        navigationInfo=NavigationInfo(transitionType=["ANIMATE"],type=["EXAMINE"])),
      DirectionalLight(DEF='HiddenLight',ambientIntensity=1,color=(0.1,0.1,1),on=False),
      ROUTE(fromField='isOver',fromNode='UserTouchSensor',toField='on',toNode='HiddenLight'),
      Shape(
        appearance=Appearance(
          material=Material(DEF='ToothMaterial',ambientIntensity=0.4,diffuseColor=(1,0.9843,0.9843),shininess=0.05)),
        geometry=IndexedFaceSet(DEF='lprem1lr_geometry',coordIndex=[0,1,2,-1,3,4,5,-1,6,7,8,-1,9,4,3,-1,10,11,12,-1,13,14,15,-1,14,16,17,-1,14,13,16,-1,18,19,20,-1,18,20,4,-1,13,15,21,-1,10,22,11,-1,9,18,4,-1,8,23,6,-1,3,5,24,-1,0,2,25,-1,26,27,28,-1,26,29,27,-1,30,31,32,-1,30,33,31,-1,34,35,36,-1,35,34,37,-1,38,39,40,-1,38,41,39,-1,42,43,44,-1,42,45,43,-1,46,47,48,-1,47,46,49,-1,50,51,52,-1,50,28,51,-1,32,53,54,-1,53,32,55,-1,56,57,58,-1,56,35,57,-1,59,60,61,-1,59,58,60,-1,48,62,63,-1,62,48,47,-1,64,52,65,-1,64,50,52,-1,54,66,67,-1,66,54,53,-1,68,58,59,-1,68,56,58,-1,69,61,70,-1,69,59,61,-1,1,71,72,-1,71,1,0,-1,73,74,75,-1,74,73,76,-1,67,77,78,-1,77,67,66,-1,77,12,11,-1,12,77,79,-1,80,70,81,-1,80,69,70,-1,82,83,84,-1,83,82,85,-1,86,20,19,-1,86,87,20,-1,88,89,90,-1,88,9,89,-1,91,81,92,-1,91,80,81,-1,93,94,95,-1,93,96,94,-1,97,98,99,-1,98,97,100,-1,98,101,102,-1,101,98,103,-1,104,90,105,-1,104,88,90,-1,106,107,108,-1,106,109,107,-1,110,111,112,-1,111,110,113,-1,114,115,116,-1,115,114,117,-1,115,118,119,-1,118,115,120,-1,121,122,123,-1,121,124,122,-1,125,126,127,-1,125,128,126,-1,129,130,131,-1,129,132,130,-1,133,134,135,-1,133,136,134,-1,137,138,139,-1,137,140,138,-1,119,141,142,-1,141,119,118,-1,143,123,144,-1,143,121,123,-1,145,127,146,-1,145,125,127,-1,147,148,149,-1,150,148,147,-1,151,152,153,-1,151,154,152,-1,155,156,157,-1,155,158,156,-1,159,160,161,-1,162,160,159,-1,160,163,164,-1,160,144,163,-1,165,44,43,-1,165,158,44,-1,151,17,137,-1,151,14,17,-1,166,158,155,-1,158,166,44,-1,141,167,168,-1,167,141,169,-1,133,170,171,-1,170,133,135,-1,143,172,173,-1,162,172,143,-1,150,146,148,-1,150,145,146,-1,33,174,31,-1,39,175,176,-1,177,174,33,-1,177,178,174,-1,179,178,177,-1,179,34,178,-1,27,34,179,-1,27,37,34,-1,29,37,27,-1,29,180,37,-1,181,180,29,-1,181,182,180,-1,183,182,181,-1,183,41,182,-1,184,41,183,-1,184,39,41,-1,184,175,39,-1,158,185,156,-1,158,165,185,-1,167,186,187,-1,167,172,186,-1,188,13,21,-1,13,188,170,-1,150,189,190,-1,147,189,150,-1,146,136,133,-1,146,127,136,-1,144,191,163,-1,144,123,191,-1,118,169,141,-1,169,118,192,-1,138,166,139,-1,166,138,193,-1,135,129,16,-1,135,134,129,-1,131,112,140,-1,131,130,112,-1,127,106,136,-1,127,126,106,-1,123,104,191,-1,123,122,104,-1,120,192,118,-1,192,120,102,-1,194,42,193,-1,42,194,195,-1,113,194,111,-1,194,113,96,-1,108,91,132,-1,108,107,91,-1,105,22,128,-1,105,90,22,-1,101,196,124,-1,101,103,196,-1,98,86,103,-1,98,100,86,-1,95,114,93,-1,114,95,84,-1,92,7,110,-1,92,81,7,-1,10,197,109,-1,10,12,197,-1,198,9,88,-1,198,18,9,-1,100,87,86,-1,100,74,87,-1,71,84,95,-1,84,71,82,-1,81,8,7,-1,81,70,8,-1,79,197,12,-1,197,79,199,-1,66,79,77,-1,79,66,200,-1,20,5,4,-1,20,65,5,-1,62,75,85,-1,75,62,73,-1,201,72,23,-1,72,201,1,-1,202,59,69,-1,202,68,59,-1,203,56,68,-1,203,204,56,-1,24,54,67,-1,24,205,54,-1,76,50,64,-1,76,206,50,-1,25,63,0,-1,63,25,48,-1,61,207,208,-1,61,60,207,-1,58,209,60,-1,58,57,209,-1,55,210,53,-1,210,55,211,-1,52,212,213,-1,52,51,212,-1,49,214,47,-1,214,49,215,-1,216,217,2,-1,216,40,217,-1,175,46,218,-1,46,175,184,-1,209,41,38,-1,209,182,41,-1,178,36,211,-1,36,178,34,-1,212,33,30,-1,212,177,33,-1,181,26,215,-1,26,181,29,-1,184,49,46,-1,49,184,183,-1,28,179,51,-1,28,27,179,-1,31,55,32,-1,55,31,174,-1,35,180,57,-1,35,37,180,-1,40,176,217,-1,40,39,176,-1,168,187,219,-1,187,168,167,-1,218,48,25,-1,48,218,46,-1,26,50,206,-1,50,26,28,-1,205,32,54,-1,205,30,32,-1,204,35,56,-1,204,36,35,-1,207,40,216,-1,207,38,40,-1,201,2,1,-1,201,216,2,-1,47,73,62,-1,73,47,214,-1,65,213,5,-1,65,52,213,-1,53,200,66,-1,200,53,210,-1,200,199,79,-1,199,200,203,-1,70,208,8,-1,70,61,208,-1,0,82,71,-1,82,0,63,-1,74,64,87,-1,74,76,64,-1,3,67,78,-1,3,24,67,-1,11,78,77,-1,11,89,78,-1,220,69,80,-1,220,202,69,-1,23,94,6,-1,94,23,72,-1,85,97,83,-1,97,85,75,-1,103,19,196,-1,103,86,19,-1,90,11,22,-1,90,89,11,-1,107,80,91,-1,107,220,80,-1,6,96,113,-1,96,6,94,-1,83,99,117,-1,99,83,97,-1,99,102,120,-1,102,99,98,-1,122,88,104,-1,122,198,88,-1,126,109,106,-1,126,10,109,-1,130,110,112,-1,130,92,110,-1,93,116,195,-1,116,93,114,-1,116,119,45,-1,119,116,115,-1,221,124,121,-1,221,101,124,-1,222,128,125,-1,222,105,128,-1,134,132,129,-1,134,108,132,-1,111,193,138,-1,193,111,194,-1,17,140,137,-1,17,131,140,-1,45,142,43,-1,142,45,119,-1,173,121,143,-1,173,221,121,-1,223,125,145,-1,223,222,125,-1,161,164,224,-1,160,164,161,-1,171,149,148,-1,171,225,149,-1,153,14,151,-1,14,153,15,-1,154,157,152,-1,154,155,157,-1,219,226,168,-1,226,219,227,-1,170,16,13,-1,170,135,16,-1,171,146,133,-1,171,148,146,-1,164,223,190,-1,164,163,223,-1,167,173,172,-1,167,169,173,-1,43,226,165,-1,43,142,226,-1,137,154,151,-1,154,137,139,-1,139,155,154,-1,155,139,166,-1,168,142,141,-1,168,226,142,-1,145,190,223,-1,150,190,145,-1,162,144,160,-1,162,143,144,-1,227,165,226,-1,165,227,185,-1,186,162,159,-1,162,186,172,-1,171,188,225,-1,171,170,188,-1,224,190,189,-1,164,190,224,-1,163,222,223,-1,163,191,222,-1,169,221,173,-1,169,192,221,-1,193,44,166,-1,42,44,193,-1,16,131,17,-1,16,129,131,-1,112,138,140,-1,138,112,111,-1,136,108,134,-1,136,106,108,-1,191,105,222,-1,191,104,105,-1,102,221,192,-1,221,102,101,-1,195,45,42,-1,45,195,116,-1,96,195,194,-1,195,96,93,-1,132,92,130,-1,132,91,92,-1,128,10,126,-1,128,22,10,-1,124,198,122,-1,124,196,198,-1,117,120,115,-1,120,117,99,-1,84,117,114,-1,117,84,83,-1,7,113,110,-1,113,7,6,-1,109,220,107,-1,109,197,220,-1,196,18,198,-1,196,19,18,-1,75,100,97,-1,100,75,74,-1,72,95,94,-1,95,72,71,-1,199,220,197,-1,220,199,202,-1,78,9,3,-1,89,9,78,-1,87,65,20,-1,87,64,65,-1,63,85,82,-1,85,63,62,-1,8,201,23,-1,8,208,201,-1,203,202,199,-1,202,203,68,-1,210,203,200,-1,203,210,204,-1,5,205,24,-1,5,213,205,-1,214,76,73,-1,76,214,206,-1,208,216,201,-1,208,207,216,-1,60,38,207,-1,60,209,38,-1,211,204,210,-1,204,211,36,-1,213,30,205,-1,213,212,30,-1,215,206,214,-1,206,215,26,-1,217,25,2,-1,25,217,218,-1,176,218,217,-1,218,176,175,-1,57,182,209,-1,57,180,182,-1,174,211,55,-1,211,174,178,-1,51,177,212,-1,51,179,177,-1,183,215,49,-1,215,183,181,-1],creaseAngle=1.571,
          coord=Coordinate(DEF='lprem1lr_coordinate',point=[(-0.0022,-0.0062,-0.0016),(-0.0023,-0.0062,-0.0020),(-0.0018,-0.0074,-0.0022),(0.0014,-0.0051,-0.0001),(0.0010,-0.0051,0.0002),(0.0007,-0.0064,-0.0002),(-0.0030,-0.0029,-0.0029),(-0.0025,-0.0028,-0.0035),(-0.0022,-0.0047,-0.0030),(0.0019,-0.0033,0.0004),(0.0015,-0.0012,-0.0017),(0.0018,-0.0032,-0.0012),(0.0014,-0.0031,-0.0019),(-0.0009,0.0070,-0.0030),(-0.0016,0.0071,-0.0031),(-0.0015,0.0084,-0.0030),(-0.0009,0.0056,-0.0031),(-0.0016,0.0056,-0.0033),(0.0015,-0.0034,0.0009),(0.0010,-0.0034,0.0012),(0.0006,-0.0051,0.0006),(-0.0008,0.0083,-0.0030),(0.0022,-0.0013,-0.0010),(-0.0027,-0.0047,-0.0026),(0.0009,-0.0064,-0.0005),(-0.0018,-0.0075,-0.0018),(-0.0005,-0.0084,-0.0014),(-0.0004,-0.0085,-0.0016),(-0.0003,-0.0084,-0.0014),(-0.0005,-0.0085,-0.0017),(0.0001,-0.0084,-0.0016),(-0.0001,-0.0085,-0.0019),(0.0002,-0.0084,-0.0018),(-0.0001,-0.0085,-0.0018),(-0.0004,-0.0085,-0.0023),(-0.0005,-0.0083,-0.0026),(-0.0003,-0.0083,-0.0024),(-0.0005,-0.0085,-0.0024),(-0.0011,-0.0083,-0.0027),(-0.0010,-0.0085,-0.0024),(-0.0012,-0.0083,-0.0025),(-0.0009,-0.0084,-0.0025),(-0.0034,0.0035,-0.0006),(-0.0030,0.0053,0.0005),(-0.0035,0.0054,-0.0004),(-0.0029,0.0035,0.0002),(-0.0011,-0.0083,-0.0019),(-0.0013,-0.0075,-0.0012),(-0.0016,-0.0075,-0.0015),(-0.0010,-0.0084,-0.0017),(-0.0003,-0.0076,-0.0006),(-0.0001,-0.0084,-0.0014),(0.0001,-0.0076,-0.0006),(0.0004,-0.0075,-0.0017),(0.0006,-0.0076,-0.0013),(0.0001,-0.0084,-0.0021),(-0.0005,-0.0074,-0.0025),(-0.0007,-0.0083,-0.0027),(-0.0008,-0.0074,-0.0027),(-0.0009,-0.0062,-0.0028),(-0.0011,-0.0074,-0.0028),(-0.0013,-0.0061,-0.0029),(-0.0016,-0.0063,-0.0007),(-0.0020,-0.0063,-0.0012),(-0.0001,-0.0064,0.0001),(0.0004,-0.0064,0.0001),(0.0008,-0.0063,-0.0014),(0.0010,-0.0064,-0.0008),(-0.0005,-0.0062,-0.0025),(-0.0010,-0.0047,-0.0030),(-0.0015,-0.0047,-0.0032),(-0.0027,-0.0048,-0.0015),(-0.0028,-0.0048,-0.0021),(-0.0010,-0.0064,-0.0003),(-0.0005,-0.0051,0.0004),(-0.0010,-0.0050,0.0002),(-0.0005,-0.0064,0.0000),(0.0013,-0.0050,-0.0013),(0.0015,-0.0050,-0.0005),(0.0009,-0.0049,-0.0017),(-0.0010,-0.0029,-0.0036),(-0.0016,-0.0029,-0.0038),(-0.0023,-0.0049,-0.0010),(-0.0020,-0.0032,0.0001),(-0.0027,-0.0031,-0.0007),(-0.0018,-0.0050,-0.0004),(0.0002,-0.0033,0.0012),(0.0000,-0.0051,0.0005),(0.0023,-0.0015,0.0009),(0.0021,-0.0033,-0.0003),(0.0025,-0.0014,0.0001),(-0.0010,-0.0010,-0.0035),(-0.0016,-0.0010,-0.0036),(-0.0032,-0.0011,-0.0012),(-0.0032,-0.0029,-0.0022),(-0.0031,-0.0030,-0.0015),(-0.0033,-0.0010,-0.0020),(-0.0011,-0.0033,0.0007),(-0.0002,-0.0015,0.0016),(-0.0011,-0.0014,0.0011),(-0.0004,-0.0033,0.0011),(0.0006,0.0009,0.0023),(-0.0001,0.0010,0.0021),(0.0005,-0.0015,0.0017),(0.0026,0.0009,0.0013),(0.0028,0.0010,0.0005),(0.0009,0.0013,-0.0022),(-0.0001,-0.0011,-0.0030),(0.0000,0.0014,-0.0028),(0.0007,-0.0012,-0.0024),(-0.0025,-0.0010,-0.0034),(-0.0033,0.0015,-0.0026),(-0.0026,0.0015,-0.0033),(-0.0032,-0.0010,-0.0027),(-0.0028,-0.0012,-0.0005),(-0.0021,0.0011,0.0008),(-0.0029,0.0012,-0.0001),(-0.0021,-0.0013,0.0004),(-0.0010,0.0032,0.0020),(-0.0021,0.0033,0.0012),(-0.0010,0.0010,0.0016),(0.0017,0.0031,0.0027),(0.0021,0.0009,0.0019),(0.0023,0.0031,0.0023),(0.0015,0.0009,0.0023),(0.0027,0.0033,-0.0004),(0.0017,0.0012,-0.0015),(0.0019,0.0034,-0.0012),(0.0025,0.0011,-0.0007),(-0.0009,0.0037,-0.0032),(-0.0016,0.0015,-0.0035),(-0.0016,0.0037,-0.0034),(-0.0009,0.0015,-0.0034),(0.0012,0.0054,-0.0018),(0.0001,0.0036,-0.0026),(0.0002,0.0055,-0.0025),(0.0010,0.0035,-0.0020),(-0.0027,0.0056,-0.0030),(-0.0034,0.0037,-0.0024),(-0.0035,0.0056,-0.0022),(-0.0027,0.0037,-0.0031),(-0.0010,0.0051,0.0024),(-0.0022,0.0052,0.0015),(0.0019,0.0049,0.0032),(0.0025,0.0049,0.0027),(0.0029,0.0052,-0.0002),(0.0021,0.0053,-0.0010),(0.0034,0.0076,0.0001),(0.0023,0.0067,-0.0010),(0.0024,0.0079,-0.0009),(0.0032,0.0065,0.0000),(-0.0026,0.0071,-0.0028),(-0.0033,0.0082,-0.0020),(-0.0024,0.0085,-0.0027),(-0.0034,0.0070,-0.0020),(-0.0036,0.0068,-0.0011),(-0.0033,0.0074,0.0001),(-0.0035,0.0077,-0.0010),(-0.0034,0.0066,-0.0001),(0.0022,0.0066,0.0037),(0.0028,0.0061,0.0031),(0.0029,0.0070,0.0033),(0.0020,0.0059,0.0035),(0.0031,0.0050,0.0021),(0.0033,0.0062,0.0024),(-0.0029,0.0066,0.0008),(-0.0037,0.0055,-0.0014),(0.0001,0.0061,0.0033),(-0.0010,0.0062,0.0026),(0.0000,0.0050,0.0030),(0.0003,0.0069,-0.0025),(0.0014,0.0068,-0.0018),(0.0011,0.0059,0.0034),(0.0009,0.0050,0.0032),(-0.0001,-0.0085,-0.0021),(-0.0010,-0.0085,-0.0021),(-0.0010,-0.0085,-0.0022),(-0.0002,-0.0085,-0.0017),(-0.0002,-0.0085,-0.0022),(-0.0003,-0.0085,-0.0016),(-0.0006,-0.0085,-0.0025),(-0.0007,-0.0085,-0.0017),(-0.0008,-0.0084,-0.0025),(-0.0008,-0.0085,-0.0019),(-0.0009,-0.0085,-0.0020),(-0.0028,0.0072,0.0010),(0.0012,0.0066,0.0036),(0.0001,0.0070,0.0035),(0.0004,0.0081,-0.0024),(0.0037,0.0076,0.0015),(0.0036,0.0064,0.0014),(0.0028,0.0031,0.0017),(0.0000,0.0031,0.0026),(-0.0036,0.0036,-0.0016),(-0.0035,0.0014,-0.0018),(-0.0033,0.0013,-0.0009),(0.0013,-0.0015,0.0017),(0.0006,-0.0030,-0.0026),(0.0018,-0.0015,0.0014),(0.0003,-0.0049,-0.0023),(0.0005,-0.0063,-0.0017),(-0.0023,-0.0062,-0.0024),(-0.0004,-0.0048,-0.0027),(0.0000,-0.0062,-0.0022),(-0.0002,-0.0075,-0.0023),(0.0005,-0.0076,-0.0010),(-0.0006,-0.0076,-0.0007),(-0.0014,-0.0074,-0.0027),(-0.0019,-0.0061,-0.0028),(-0.0008,-0.0083,-0.0027),(0.0001,-0.0075,-0.0020),(-0.0001,-0.0083,-0.0022),(0.0000,-0.0084,-0.0015),(0.0003,-0.0076,-0.0008),(-0.0009,-0.0076,-0.0009),(-0.0007,-0.0084,-0.0016),(-0.0018,-0.0074,-0.0025),(-0.0013,-0.0083,-0.0023),(-0.0012,-0.0083,-0.0021),(-0.0010,0.0071,0.0028),(-0.0002,-0.0030,-0.0031),(0.0007,0.0031,0.0027),(0.0031,0.0032,0.0008),(0.0033,0.0051,0.0012),(0.0035,0.0073,0.0025),(0.0017,0.0081,-0.0017),(-0.0020,0.0064,0.0018),(-0.0020,0.0070,0.0020)])))])])
)

### X3D model conversion complete ###

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

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