####################################################################################################
#
# Invoking X3D model self-test:
#
#   $ python l_tarsal_proximal_phalanx_3.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='l_tarsal_proximal_phalanx_3.x3d',name='title'),
    meta(content='bone in foot',name='description'),
    meta(content='Don Brutzman, Joe Williams, John Carlson, Damon Hernandez',name='creator'),
    meta(content='Don Brutzman',name='translator'),
    meta(content='5 December 2013',name='created'),
    meta(content='5 March 2026',name='translated'),
    meta(content='23 April 2026',name='modified'),
    meta(content='originals/lfpprox3.x3d',name='reference'),
    meta(content='https://en.wikipedia.org/wiki/Phalanx_bone',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/Bones/l_tarsal_proximal_phalanx_3.x3d',name='identifier'),
    meta(content='../license.html',name='license')]),
  Scene=Scene(
    children=[
    WorldInfo(title='l_tarsal_proximal_phalanx_3.x3d'),
    Background(skyColor=[(0.858824,1,0.94902)]),
    Comment('user hover lights bone and reveals description, user selection/deselection temporarily binds/unbinds close-up hidden viewpoint'),
    TouchSensor(DEF='UserTouchSensor',description='bone l_tarsal_proximal_phalanx_3'),
    Transform(DEF='l_tarsal_proximal_phalanx_3',translation=(0.1045,0.0111,0.0631),
      children=[
      BooleanToggle(DEF='UserTouchState'),
      ROUTE(fromField='isActive',fromNode='UserTouchSensor',toField='set_boolean',toNode='UserTouchState'),
      Viewpoint(DEF='HiddenViewpoint',nearDistance=0.001,position=(0,0,0.2),retainUserOffsets=True,
        navigationInfo=NavigationInfo(transitionType=["ANIMATE"],type=["EXAMINE"])),
      ROUTE(fromField='toggle',fromNode='UserTouchState',toField='set_bind',toNode='HiddenViewpoint'),
      DirectionalLight(DEF='HiddenLight',ambientIntensity=1,color=(0.1,0.1,1),on=False),
      ROUTE(fromField='toggle',fromNode='UserTouchState',toField='on',toNode='HiddenLight'),
      Transform(DEF='CenterOfRotationForJoint',visible=False,
        children=[
        Comment('insert computations for joint center of rotation here'),
        Inline(DEF='AxesDisplay',description='RGB display axes showing XYZ direction in local coordinate system',url=["AxesDisplay.x3d"],visible=False)]),
      ROUTE(fromField='toggle',fromNode='UserTouchState',toField='visible',toNode='CenterOfRotationForJoint'),
      Shape(
        appearance=Appearance(
          material=Material(DEF='BoneMaterial',ambientIntensity=0.965,diffuseColor=(1,0.9765,0.8667),shininess=0.05,specularColor=(0.349,0.349,0.349))),
        geometry=IndexedFaceSet(DEF='l_tarsal_proximal_phalanx_3_geometry',coordIndex=[0,1,2,-1,0,3,1,-1,4,5,6,-1,7,8,9,-1,10,11,12,-1,11,13,12,-1,14,15,16,-1,17,18,19,-1,20,21,22,-1,23,24,25,-1,26,27,28,-1,26,29,27,-1,30,31,32,-1,33,34,35,-1,36,37,38,-1,36,39,37,-1,23,40,34,-1,40,41,42,-1,43,44,19,-1,44,17,19,-1,45,46,38,-1,47,48,49,-1,49,50,47,-1,51,52,53,-1,53,54,51,-1,55,56,57,-1,58,59,60,-1,61,62,63,-1,58,64,65,-1,66,67,57,-1,68,69,70,-1,69,71,70,-1,72,73,74,-1,72,75,73,-1,76,77,78,-1,76,79,77,-1,80,81,82,-1,83,74,84,-1,85,86,83,-1,87,88,89,-1,90,91,92,-1,91,93,92,-1,54,94,95,-1,96,97,57,-1,24,98,99,-1,100,101,102,-1,103,104,105,-1,106,107,108,-1,109,110,111,-1,110,112,111,-1,113,110,114,-1,110,115,114,-1,116,110,113,-1,117,118,119,-1,120,121,22,-1,98,33,122,-1,123,124,125,-1,29,26,1,-1,1,3,29,-1,50,126,58,-1,60,127,58,-1,58,128,129,-1,57,130,131,-1,56,96,57,-1,132,131,130,-1,130,133,132,-1,134,14,135,-1,134,136,14,-1,49,137,135,-1,53,94,54,-1,52,51,138,-1,51,139,138,-1,140,92,93,-1,93,4,140,-1,141,142,92,-1,72,74,83,-1,5,143,144,-1,5,87,143,-1,145,146,147,-1,145,62,146,-1,148,48,149,-1,149,61,148,-1,84,150,151,-1,150,7,151,-1,84,151,85,-1,85,83,84,-1,57,97,66,-1,55,57,131,-1,152,128,58,-1,58,65,59,-1,127,47,58,-1,152,58,126,-1,15,153,3,-1,153,29,3,-1,79,154,77,-1,22,155,120,-1,22,21,155,-1,155,21,156,-1,21,157,156,-1,114,115,158,-1,115,89,158,-1,159,160,161,-1,162,88,160,-1,88,161,160,-1,161,88,163,-1,88,87,163,-1,143,89,115,-1,143,87,89,-1,164,165,166,-1,164,39,165,-1,28,167,26,-1,135,137,134,-1,109,115,110,-1,109,143,115,-1,129,64,58,-1,57,67,168,-1,142,90,92,-1,169,170,75,-1,61,171,148,-1,61,63,171,-1,92,170,141,-1,92,140,170,-1,63,69,68,-1,68,139,63,-1,172,173,12,-1,173,95,12,-1,174,79,175,-1,174,154,79,-1,176,86,177,-1,177,70,176,-1,178,179,180,-1,180,181,178,-1,69,145,181,-1,181,71,69,-1,182,111,166,-1,182,8,111,-1,127,48,47,-1,127,149,48,-1,86,85,67,-1,85,168,67,-1,168,85,183,-1,85,151,183,-1,58,47,50,-1,184,118,37,-1,118,117,37,-1,114,185,113,-1,25,107,23,-1,33,35,122,-1,186,31,187,-1,165,39,36,-1,107,25,108,-1,34,33,23,-1,12,188,172,-1,12,13,188,-1,132,11,10,-1,2,1,91,-1,189,91,1,-1,91,189,93,-1,144,150,190,-1,144,191,150,-1,182,132,133,-1,182,11,132,-1,172,192,136,-1,172,188,192,-1,98,156,99,-1,98,155,156,-1,124,193,125,-1,193,124,194,-1,102,82,81,-1,101,82,102,-1,31,45,117,-1,31,186,45,-1,43,195,44,-1,195,43,104,-1,196,105,197,-1,105,196,198,-1,199,35,34,-1,200,35,199,-1,81,201,102,-1,81,202,201,-1,117,32,31,-1,117,119,32,-1,203,159,121,-1,203,160,159,-1,204,114,205,-1,114,204,185,-1,205,158,206,-1,114,158,205,-1,156,123,125,-1,157,123,156,-1,100,106,108,-1,100,207,106,-1,208,209,187,-1,210,209,208,-1,154,46,202,-1,154,174,46,-1,211,208,30,-1,211,212,208,-1,105,213,103,-1,213,105,198,-1,106,41,107,-1,210,41,106,-1,25,99,193,-1,99,25,24,-1,104,211,195,-1,103,211,104,-1,18,113,185,-1,113,18,116,-1,17,184,214,-1,17,118,184,-1,132,94,131,-1,132,10,94,-1,215,96,138,-1,96,215,97,-1,67,177,86,-1,66,177,67,-1,53,131,94,-1,53,55,131,-1,135,16,126,-1,14,16,135,-1,90,129,128,-1,90,142,129,-1,147,65,178,-1,65,147,59,-1,127,146,149,-1,60,146,127,-1,64,142,179,-1,142,64,129,-1,130,9,133,-1,130,183,9,-1,166,112,164,-1,166,111,112,-1,71,176,70,-1,71,169,176,-1,188,175,79,-1,175,188,13,-1,216,95,173,-1,95,216,54,-1,51,63,139,-1,51,171,63,-1,180,170,169,-1,141,170,180,-1,69,62,145,-1,69,63,62,-1,148,216,137,-1,148,171,216,-1,172,134,173,-1,134,172,136,-1,140,6,73,-1,4,6,140,-1,73,170,140,-1,73,75,170,-1,179,141,180,-1,179,142,141,-1,158,88,162,-1,158,89,88,-1,109,144,143,-1,191,144,109,-1,26,161,163,-1,167,161,26,-1,217,187,209,-1,217,186,187,-1,42,198,218,-1,42,213,198,-1,184,39,164,-1,184,37,39,-1,20,28,21,-1,20,167,28,-1,159,167,20,-1,159,161,167,-1,196,206,219,-1,205,206,196,-1,200,121,120,-1,203,121,200,-1,21,27,157,-1,21,28,27,-1,175,36,174,-1,36,175,165,-1,80,124,123,-1,80,82,124,-1,174,38,46,-1,38,174,36,-1,152,2,128,-1,152,0,2,-1,183,57,168,-1,183,130,57,-1,8,109,111,-1,191,109,8,-1,15,76,153,-1,15,192,76,-1,87,189,163,-1,87,5,189,-1,181,147,178,-1,181,145,147,-1,68,177,215,-1,70,177,68,-1,190,73,6,-1,73,190,74,-1,62,149,146,-1,62,61,149,-1,10,95,94,-1,12,95,10,-1,13,165,175,-1,13,11,165,-1,11,166,165,-1,11,182,166,-1,0,126,16,-1,126,0,152,-1,77,202,81,-1,202,77,154,-1,153,27,29,-1,220,27,153,-1,78,153,76,-1,78,220,153,-1,19,197,43,-1,19,204,197,-1,116,112,110,-1,214,112,116,-1,197,205,196,-1,205,197,204,-1,33,24,23,-1,33,98,24,-1,212,210,208,-1,212,41,210,-1,30,195,211,-1,32,195,30,-1,207,102,201,-1,207,100,102,-1,25,194,108,-1,194,25,193,-1,138,68,215,-1,68,138,139,-1,163,1,26,-1,163,189,1,-1,74,150,84,-1,74,190,150,-1,221,219,206,-1,221,199,219,-1,176,83,86,-1,83,176,72,-1,220,80,123,-1,220,78,80,-1,78,81,80,-1,78,77,81,-1,192,79,76,-1,192,188,79,-1,137,173,134,-1,137,216,173,-1,169,181,180,-1,169,71,181,-1,169,72,176,-1,169,75,72,-1,54,171,51,-1,54,216,171,-1,44,118,17,-1,118,44,119,-1,214,164,112,-1,164,214,184,-1,146,59,147,-1,59,146,60,-1,178,64,179,-1,64,178,65,-1,50,135,126,-1,49,135,50,-1,128,91,90,-1,2,91,128,-1,66,215,177,-1,97,215,66,-1,138,56,52,-1,56,138,96,-1,7,183,151,-1,7,9,183,-1,55,52,56,-1,53,52,55,-1,137,48,148,-1,49,48,137,-1,214,18,17,-1,116,18,214,-1,40,218,34,-1,40,42,218,-1,213,41,212,-1,42,41,213,-1,107,40,23,-1,107,41,40,-1,209,201,217,-1,201,209,207,-1,103,212,211,-1,212,103,213,-1,38,117,45,-1,38,37,117,-1,203,199,221,-1,200,199,203,-1,187,30,208,-1,187,31,30,-1,207,210,106,-1,207,209,210,-1,101,108,194,-1,101,100,108,-1,220,157,27,-1,220,123,157,-1,221,160,203,-1,221,162,160,-1,18,204,19,-1,18,185,204,-1,162,206,158,-1,162,221,206,-1,20,121,159,-1,121,20,22,-1,218,199,34,-1,218,219,199,-1,186,46,45,-1,46,186,217,-1,155,122,120,-1,98,122,155,-1,198,219,218,-1,198,196,219,-1,105,43,197,-1,104,43,105,-1,195,119,44,-1,32,119,195,-1,217,202,46,-1,201,202,217,-1,82,194,124,-1,194,82,101,-1,125,99,156,-1,99,125,193,-1,120,35,200,-1,120,122,35,-1,136,15,14,-1,136,192,15,-1,133,8,182,-1,9,8,133,-1,7,191,8,-1,150,191,7,-1,144,6,5,-1,6,144,190,-1,5,93,189,-1,93,5,4,-1,3,16,15,-1,16,3,0,-1],creaseAngle=1.571,
          coord=Coordinate(DEF='l_tarsal_proximal_phalanx_3_coordinate',point=[(-0.0001,-0.0027,0.0081),(-0.0001,-0.0026,0.0054),(-0.0001,-0.0035,0.0076),(0.0001,-0.0019,0.0059),(0.0016,-0.0040,0.0069),(0.0017,-0.0032,0.0048),(0.0020,-0.0041,0.0069),(0.0047,-0.0041,0.0055),(0.0044,-0.0030,0.0038),(0.0047,-0.0038,0.0057),(0.0044,-0.0016,0.0076),(0.0040,-0.0012,0.0049),(0.0035,-0.0014,0.0078),(0.0032,-0.0007,0.0054),(0.0003,-0.0016,0.0083),(0.0004,-0.0008,0.0059),(0.0002,-0.0017,0.0083),(0.0036,0.0007,-0.0127),(0.0021,-0.0020,-0.0127),(0.0021,-0.0017,-0.0134),(-0.0068,-0.0010,-0.0097),(-0.0074,0.0010,-0.0095),(-0.0072,-0.0009,-0.0106),(-0.0047,0.0022,-0.0117),(-0.0066,0.0032,-0.0113),(-0.0053,0.0042,-0.0106),(-0.0014,-0.0016,-0.0006),(-0.0040,0.0018,-0.0055),(-0.0042,0.0002,-0.0059),(-0.0016,-0.0001,-0.0006),(0.0025,0.0032,-0.0123),(0.0032,0.0048,-0.0112),(0.0035,0.0031,-0.0132),(-0.0063,0.0009,-0.0126),(-0.0039,0.0003,-0.0132),(-0.0059,-0.0001,-0.0132),(0.0032,0.0040,-0.0060),(0.0039,0.0041,-0.0088),(0.0030,0.0056,-0.0083),(0.0041,0.0031,-0.0061),(-0.0028,0.0013,-0.0123),(-0.0018,0.0023,-0.0114),(-0.0023,0.0012,-0.0125),(0.0021,-0.0004,-0.0151),(0.0034,0.0011,-0.0146),(0.0028,0.0062,-0.0089),(0.0013,0.0070,-0.0078),(0.0003,-0.0026,0.0134),(0.0005,-0.0023,0.0135),(0.0004,-0.0023,0.0122),(0.0001,-0.0025,0.0122),(0.0054,-0.0026,0.0129),(0.0070,-0.0031,0.0121),(0.0062,-0.0023,0.0111),(0.0046,-0.0021,0.0117),(0.0064,-0.0025,0.0107),(0.0072,-0.0033,0.0117),(0.0059,-0.0041,0.0095),(-0.0000,-0.0044,0.0126),(0.0004,-0.0056,0.0146),(0.0005,-0.0045,0.0150),(0.0024,-0.0034,0.0144),(0.0025,-0.0041,0.0146),(0.0039,-0.0038,0.0139),(-0.0001,-0.0066,0.0120),(0.0001,-0.0065,0.0135),(0.0073,-0.0068,0.0115),(0.0067,-0.0068,0.0101),(0.0058,-0.0054,0.0136),(0.0038,-0.0051,0.0139),(0.0052,-0.0067,0.0125),(0.0035,-0.0058,0.0129),(0.0038,-0.0066,0.0095),(0.0026,-0.0049,0.0088),(0.0035,-0.0057,0.0082),(0.0029,-0.0057,0.0103),(-0.0000,0.0021,-0.0008),(-0.0007,0.0054,-0.0054),(-0.0023,0.0043,-0.0052),(0.0014,0.0026,-0.0008),(-0.0041,0.0063,-0.0079),(-0.0018,0.0073,-0.0077),(-0.0043,0.0072,-0.0088),(0.0052,-0.0063,0.0087),(0.0046,-0.0053,0.0074),(0.0056,-0.0060,0.0083),(0.0065,-0.0071,0.0101),(0.0009,-0.0023,-0.0013),(-0.0018,-0.0017,-0.0071),(-0.0008,-0.0018,-0.0072),(0.0002,-0.0046,0.0093),(-0.0000,-0.0036,0.0074),(0.0007,-0.0049,0.0092),(0.0005,-0.0040,0.0072),(0.0051,-0.0020,0.0102),(0.0042,-0.0019,0.0103),(0.0077,-0.0042,0.0123),(0.0079,-0.0054,0.0126),(-0.0076,0.0013,-0.0123),(-0.0074,0.0040,-0.0110),(-0.0028,0.0066,-0.0088),(-0.0042,0.0071,-0.0091),(-0.0019,0.0071,-0.0083),(0.0006,0.0001,-0.0143),(0.0017,0.0000,-0.0151),(-0.0000,-0.0008,-0.0148),(-0.0025,0.0045,-0.0097),(-0.0036,0.0030,-0.0107),(-0.0041,0.0054,-0.0097),(0.0032,-0.0024,-0.0020),(0.0020,-0.0027,-0.0076),(0.0041,-0.0015,-0.0020),(0.0033,-0.0007,-0.0071),(0.0010,-0.0029,-0.0108),(-0.0004,-0.0026,-0.0110),(0.0007,-0.0026,-0.0076),(0.0021,-0.0023,-0.0105),(0.0037,0.0046,-0.0110),(0.0040,0.0028,-0.0120),(0.0039,0.0029,-0.0131),(-0.0072,-0.0006,-0.0129),(-0.0062,-0.0020,-0.0112),(-0.0070,-0.0001,-0.0131),(-0.0060,0.0048,-0.0083),(-0.0058,0.0064,-0.0095),(-0.0069,0.0054,-0.0100),(0.0001,-0.0027,0.0107),(0.0005,-0.0036,0.0146),(-0.0000,-0.0043,0.0096),(-0.0001,-0.0060,0.0108),(0.0053,-0.0036,0.0083),(0.0055,-0.0025,0.0096),(0.0046,-0.0018,0.0073),(0.0048,-0.0028,0.0064),(0.0016,-0.0019,0.0108),(0.0005,-0.0025,0.0108),(0.0014,-0.0014,0.0083),(0.0020,-0.0020,0.0122),(0.0075,-0.0041,0.0127),(0.0057,-0.0039,0.0135),(0.0018,-0.0048,0.0092),(0.0010,-0.0062,0.0103),(0.0001,-0.0062,0.0107),(0.0023,-0.0027,-0.0018),(0.0031,-0.0039,0.0039),(0.0023,-0.0056,0.0146),(0.0008,-0.0045,0.0151),(0.0007,-0.0057,0.0147),(0.0023,-0.0022,0.0134),(0.0007,-0.0035,0.0146),(0.0041,-0.0045,0.0055),(0.0051,-0.0051,0.0073),(-0.0002,-0.0034,0.0102),(-0.0014,0.0016,-0.0005),(0.0003,0.0056,-0.0055),(-0.0079,0.0012,-0.0119),(-0.0077,0.0040,-0.0107),(-0.0068,0.0034,-0.0088),(-0.0018,-0.0021,-0.0106),(-0.0058,-0.0023,-0.0102),(-0.0048,-0.0024,-0.0106),(-0.0032,-0.0022,-0.0066),(-0.0029,-0.0021,-0.0105),(-0.0007,-0.0022,-0.0008),(0.0041,0.0012,-0.0066),(0.0040,0.0008,-0.0015),(0.0045,-0.0003,-0.0017),(-0.0038,-0.0013,-0.0063),(0.0058,-0.0056,0.0084),(0.0031,-0.0061,0.0120),(0.0022,-0.0056,0.0106),(0.0037,-0.0023,0.0132),(0.0026,-0.0011,0.0083),(0.0030,-0.0019,0.0107),(0.0018,0.0054,-0.0057),(0.0026,0.0018,-0.0011),(0.0045,-0.0073,0.0108),(0.0072,-0.0069,0.0117),(0.0004,-0.0067,0.0135),(0.0001,-0.0069,0.0118),(0.0015,-0.0071,0.0118),(0.0020,-0.0066,0.0134),(0.0045,-0.0021,0.0043),(0.0052,-0.0045,0.0076),(0.0040,0.0020,-0.0093),(0.0007,-0.0029,-0.0120),(0.0023,0.0063,-0.0093),(0.0020,0.0053,-0.0101),(0.0024,-0.0003,0.0059),(0.0004,-0.0031,0.0052),(0.0032,-0.0048,0.0060),(0.0038,-0.0038,0.0037),(0.0014,-0.0006,0.0059),(-0.0067,0.0054,-0.0105),(-0.0056,0.0064,-0.0098),(0.0031,0.0013,-0.0147),(-0.0014,-0.0007,-0.0139),(0.0001,-0.0014,-0.0147),(-0.0013,-0.0002,-0.0140),(-0.0039,-0.0002,-0.0131),(-0.0057,-0.0007,-0.0132),(-0.0003,0.0069,-0.0081),(-0.0002,0.0070,-0.0076),(-0.0051,-0.0021,-0.0114),(0.0005,-0.0025,-0.0130),(-0.0007,-0.0023,-0.0119),(-0.0021,-0.0019,-0.0115),(-0.0013,0.0059,-0.0088),(0.0009,0.0035,-0.0113),(0.0002,0.0056,-0.0092),(-0.0008,0.0039,-0.0103),(0.0014,0.0013,-0.0136),(-0.0002,0.0018,-0.0125),(-0.0009,0.0006,-0.0134),(0.0034,0.0000,-0.0100),(0.0078,-0.0055,0.0129),(0.0034,-0.0020,0.0122),(0.0011,0.0069,-0.0083),(-0.0029,0.0002,-0.0134),(-0.0029,-0.0003,-0.0134),(-0.0033,0.0034,-0.0051),(-0.0032,-0.0018,-0.0114)])))])])
)

### X3D model conversion complete ###

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

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