#################################################################################################### # # Invoking X3D model self-test: # # $ python Toilet.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. # #################################################################################################### from x3d import * newModel=X3D(profile='Immersive',version='3.0', head=head( children=[ meta(content='Toilet.x3d',name='title'), meta(content='Toilet with movaable lid and sound effect.',name='description'), meta(content='Seksit Siripala',name='creator'), meta(content='12 September 2002',name='created'), meta(content='20 October 2019',name='modified'), meta(content='https://savage.nps.edu/Savage/Buildings/HouseSeksitSiripala/Toilet.x3d',name='identifier'), meta(content='../../license.html',name='license')]), Scene=Scene( children=[ WorldInfo(title='Toilet.x3d'), Transform( children=[ Transform(rotation=(0.0,-1.0,0.0,1.57079),scale=(0.494505,0.652912,1.0),translation=(-0.190905,-0.37962,0.435344), children=[ Shape( appearance=Appearance( material=Material(),), geometry=Box(),)]), Transform(translation=(-0.19803,-5.96046E-8,0.581482), children=[ Collision(enabled=False, children=[ Group( children=[ Group( children=[ Group( children=[ Shape( appearance=Appearance( material=Material(DEF='_DefMat')), geometry=IndexedFaceSet(ccw=False,coordIndex=[13,2,0,-1,10,6,5,-1,11,5,3,-1,13,3,2,-1,11,3,13,-1,3,5,4,-1,0,2,1,-1,7,9,8,-1,9,6,10,-1,9,7,6,-1,11,13,12,-1,10,5,11,-1,0,1,15,-1,0,15,14,-1,1,2,16,-1,1,16,15,-1,2,3,17,-1,2,17,16,-1,3,18,17,-1,3,19,18,-1,3,4,20,-1,3,20,19,-1,4,5,21,-1,4,21,20,-1,5,6,22,-1,5,22,21,-1,6,7,23,-1,6,23,22,-1,7,8,24,-1,7,24,23,-1,8,9,25,-1,8,25,24,-1,9,10,26,-1,9,26,25,-1,10,11,27,-1,10,27,26,-1,11,28,27,-1,11,29,28,-1,11,12,30,-1,11,30,29,-1,12,13,31,-1,12,31,30,-1,13,32,31,-1,13,33,32,-1,13,0,14,-1,13,14,33,-1,14,15,35,-1,14,35,34,-1,15,16,36,-1,15,36,35,-1,16,17,37,-1,16,37,36,-1,38,17,18,-1,17,38,37,-1,18,19,38,-1,39,19,20,-1,19,39,38,-1,20,21,39,-1,21,22,40,-1,21,40,39,-1,22,23,41,-1,22,41,40,-1,23,24,42,-1,23,42,41,-1,24,25,43,-1,24,43,42,-1,25,26,44,-1,25,44,43,-1,26,60,44,-1,60,26,61,-1,27,28,45,-1,46,28,29,-1,28,46,45,-1,29,30,46,-1,31,46,30,-1,31,32,47,-1,32,33,48,-1,32,48,47,-1,33,14,34,-1,33,34,48,-1,35,82,66,-1,67,36,50,-1,36,37,50,-1,37,38,52,-1,37,51,50,-1,37,52,51,-1,38,39,54,-1,38,53,52,-1,38,54,53,-1,39,40,55,-1,39,55,54,-1,40,41,56,-1,40,56,55,-1,41,42,57,-1,41,57,56,-1,42,43,58,-1,42,58,57,-1,43,44,59,-1,43,59,58,-1,61,26,27,-1,44,60,59,-1,61,27,45,-1,45,46,63,-1,45,62,61,-1,45,63,62,-1,47,46,31,-1,63,78,77,-1,79,49,65,-1,49,79,48,-1,48,34,49,-1,35,66,49,-1,49,66,65,-1,35,49,34,-1,68,50,51,-1,50,68,67,-1,51,52,68,-1,69,52,53,-1,52,69,68,-1,53,54,69,-1,54,55,70,-1,54,70,69,-1,55,56,71,-1,55,71,70,-1,56,57,72,-1,56,72,71,-1,57,58,73,-1,57,73,72,-1,58,59,74,-1,58,74,73,-1,75,59,60,-1,59,75,74,-1,60,61,75,-1,76,61,62,-1,61,76,75,-1,62,63,76,-1,46,47,64,-1,63,77,76,-1,63,64,78,-1,46,64,63,-1,48,79,47,-1,64,79,78,-1,47,79,64,-1,65,66,81,-1,65,81,80,-1,83,36,67,-1,66,82,81,-1,35,83,82,-1,36,83,35,-1,67,68,85,-1,67,84,83,-1,67,85,84,-1,68,69,87,-1,68,86,85,-1,68,87,86,-1,69,70,88,-1,69,88,87,-1,70,71,89,-1,70,89,88,-1,71,72,90,-1,71,90,89,-1,72,73,91,-1,72,91,90,-1,73,74,92,-1,73,92,91,-1,74,75,94,-1,74,93,92,-1,74,94,93,-1,75,76,96,-1,75,95,94,-1,75,96,95,-1,97,76,77,-1,76,97,96,-1,77,78,97,-1,78,79,98,-1,78,98,97,-1,79,65,80,-1,79,80,98,-1,80,81,100,-1,80,100,99,-1,81,82,101,-1,81,101,100,-1,82,83,102,-1,82,102,101,-1,83,84,103,-1,83,103,102,-1,84,85,104,-1,84,104,103,-1,85,86,105,-1,85,105,104,-1,86,87,106,-1,86,106,105,-1,87,88,107,-1,87,107,106,-1,88,89,108,-1,88,108,107,-1,89,90,109,-1,89,109,108,-1,90,91,110,-1,90,110,109,-1,91,92,111,-1,91,111,110,-1,92,93,112,-1,92,112,111,-1,93,94,113,-1,93,113,112,-1,94,95,114,-1,94,114,113,-1,95,96,115,-1,95,115,114,-1,96,97,117,-1,96,116,115,-1,96,117,116,-1,97,98,118,-1,97,118,117,-1,98,80,99,-1,98,99,118,-1,108,109,110,-1,108,110,111,-1,108,111,107,-1,127,128,143,-1,128,129,143,-1,137,138,148,-1,138,119,148,-1,119,120,149,-1,120,121,139,-1,120,139,149,-1,121,122,140,-1,121,140,139,-1,122,123,141,-1,122,141,140,-1,123,124,150,-1,123,150,141,-1,124,125,142,-1,124,142,150,-1,125,126,142,-1,126,127,151,-1,127,143,151,-1,129,130,152,-1,130,131,144,-1,130,144,152,-1,131,132,145,-1,131,145,144,-1,132,133,146,-1,132,146,145,-1,133,134,153,-1,133,153,146,-1,134,135,147,-1,134,147,153,-1,135,136,147,-1,136,137,154,-1,137,148,154,-1,119,149,155,-1,142,126,159,-1,126,151,159,-1,143,129,160,-1,129,152,160,-1,147,136,164,-1,136,154,164,-1,148,119,155,-1,149,139,156,-1,139,140,157,-1,139,157,156,-1,140,141,158,-1,140,158,157,-1,141,150,158,-1,150,142,166,-1,142,159,166,-1,151,143,167,-1,143,160,167,-1,152,144,161,-1,144,145,162,-1,144,162,161,-1,145,146,163,-1,145,163,162,-1,146,153,163,-1,153,147,169,-1,147,164,169,-1,154,148,170,-1,148,155,170,-1,156,157,173,-1,157,158,173,-1,158,150,165,-1,150,166,165,-1,159,151,175,-1,151,167,175,-1,152,161,177,-1,161,162,177,-1,163,153,168,-1,153,169,168,-1,164,154,179,-1,154,170,179,-1,155,149,171,-1,149,156,172,-1,149,172,171,-1,156,173,172,-1,173,158,181,-1,158,165,182,-1,158,182,181,-1,165,166,183,-1,165,183,182,-1,166,159,174,-1,166,174,183,-1,159,175,174,-1,160,152,176,-1,152,177,176,-1,177,162,186,-1,162,163,187,-1,162,187,186,-1,163,168,188,-1,163,188,187,-1,168,169,189,-1,168,189,188,-1,169,164,178,-1,169,178,189,-1,164,179,178,-1,155,171,180,-1,175,167,184,-1,167,160,185,-1,167,185,184,-1,160,176,185,-1,179,170,190,-1,170,155,180,-1,170,180,190,-1,180,171,192,-1,171,172,193,-1,171,193,192,-1,172,173,194,-1,172,194,193,-1,173,181,195,-1,173,195,194,-1,181,182,196,-1,181,196,195,-1,182,183,197,-1,182,197,196,-1,183,174,198,-1,183,198,197,-1,174,175,199,-1,174,199,198,-1,175,184,199,-1,185,176,202,-1,176,177,203,-1,176,203,202,-1,177,186,204,-1,177,204,203,-1,186,187,205,-1,186,205,204,-1,187,188,206,-1,187,206,205,-1,188,189,207,-1,188,207,206,-1,189,178,208,-1,189,208,207,-1,178,179,209,-1,178,209,208,-1,179,190,209,-1,180,192,191,-1,199,184,200,-1,184,185,201,-1,184,201,200,-1,185,202,201,-1,209,190,210,-1,190,180,191,-1,190,191,210,-1,191,192,120,-1,191,120,119,-1,192,193,121,-1,192,121,120,-1,193,194,122,-1,193,122,121,-1,194,195,123,-1,194,123,122,-1,195,196,124,-1,195,124,123,-1,196,197,125,-1,196,125,124,-1,197,198,126,-1,197,126,125,-1,198,199,127,-1,198,127,126,-1,199,200,128,-1,199,128,127,-1,200,201,129,-1,200,129,128,-1,201,202,130,-1,201,130,129,-1,202,203,131,-1,202,131,130,-1,203,204,132,-1,203,132,131,-1,204,205,133,-1,204,133,132,-1,205,206,134,-1,205,134,133,-1,206,207,135,-1,206,135,134,-1,207,208,136,-1,207,136,135,-1,208,209,137,-1,208,137,136,-1,209,210,138,-1,209,138,137,-1,210,191,119,-1,210,119,138,-1],creaseAngle=1.44042,solid=False, coord=Coordinate(point=[(0.00500011,-2.82827,1.65294),(-0.0752701,-2.82827,1.63705),(-0.147683,-2.82827,1.59092),(-0.242046,-2.82827,1.42858),(-0.242046,-2.82827,1.2279),(-0.20515,-2.82827,1.13738),(-0.147683,-2.83768,0.246655),(-0.0752701,-2.83768,0.200535),(0.00500011,-2.83768,0.184643),(0.0852702,-2.83768,0.200535),(0.157683,-2.83768,0.246655),(0.252046,-2.82827,1.2279),(0.252046,-2.82827,1.42858),(0.21515,-2.82827,1.51909),(0.00500011,-2.76192,1.80419),(-0.112661,-2.76192,1.78089),(-0.218804,-2.76192,1.71329),(-0.303039,-1.67947,1.57975),(-0.357122,-1.67947,1.44708),(-0.375758,-1.67947,1.3),(-0.357122,-1.67947,1.15292),(-0.303039,-1.67947,1.02025),(-0.218804,-1.67947,0.91495),(-0.112661,-2.14069,0.367305),(0.00500011,-2.14069,0.34401),(0.122661,-2.14069,0.367305),(0.228804,-1.67947,0.91495),(0.31304,-1.67947,1.02025),(0.367122,-1.67947,1.15292),(0.385758,-1.67947,1.3),(0.367122,-1.67947,1.44708),(0.31304,-1.67947,1.57975),(0.228804,-2.76192,1.71329),(0.122661,-2.76192,1.78089),(0.00500011,-1.58914,1.91421),(-0.146842,-1.58914,1.88415),(-0.28382,-1.58914,1.79691),(-0.392527,-1.58914,1.66103),(-0.48637,-1.58914,1.3),(-0.392527,-1.58914,0.938975),(-0.28382,-1.58914,0.803091),(-0.146842,-1.58914,-0.00892043),(0.00500011,-1.58914,-0.0389822),(0.156842,-1.58914,-0.00892055),(0.29382,-1.58914,0.803091),(0.472321,-1.58914,1.1102),(0.472321,-1.58914,1.4898),(0.29382,-1.58914,1.79691),(0.156842,-1.58914,1.88415),(0.00500011,-1.47728,2.03572),(-0.47117,-1.47728,1.73245),(-0.554772,-1.47728,1.52735),(-0.583579,-1.47728,1.3),(-0.554772,-1.47728,1.07265),(-0.47117,-1.47728,0.867552),(-0.340958,-1.47728,0.704787),(-0.176881,-1.47728,-0.124484),(0.0050,-1.47728,-0.160493),(0.186881,-1.47728,-0.124485),(0.350958,-1.47728,0.704787),(0.481171,-1.47728,0.867552),(0.564772,-1.47728,1.07265),(0.593579,-1.47728,1.3),(0.564772,-1.47728,1.52735),(0.350958,-1.47728,1.89521),(0.00500011,-1.34695,2.13717),(-0.201959,-1.34695,2.09619),(-0.536825,-1.34695,1.79207),(-0.664733,-1.34695,1.3),(-0.536825,-1.34695,0.807926),(-0.388659,-1.34695,0.622718),(-0.201959,-1.34695,-0.220962),(0.0050,-1.34695,-0.261936),(0.211959,-1.34695,-0.220962),(0.398659,-1.34695,0.622718),(0.641954,-1.34695,1.0413),(0.641954,-1.34695,1.5587),(0.546825,-1.34695,1.79207),(0.398659,-1.34695,1.97728),(0.211959,-1.34695,2.09619),(0.00500011,-1.2017,2.21577),(-0.221391,-1.2017,2.17095),(-0.425622,-1.2017,2.04088),(-0.587701,-1.2017,1.83828),(-0.691762,-1.2017,1.58299),(-0.727619,-1.2017,1.3),(-0.691762,-1.2017,1.01701),(-0.587701,-1.2017,0.761722),(-0.425622,-1.2017,0.559124),(-0.221392,-1.2017,-0.295722),(0.0050,-1.2017,-0.340543),(0.231392,-1.2017,-0.295722),(0.435623,-1.2017,0.559124),(0.597701,-1.2017,0.761722),(0.701762,-1.2017,1.01701),(0.737619,-1.2017,1.3),(0.701762,-1.2017,1.58299),(0.435622,-1.2017,2.04088),(0.231392,-1.2017,2.17095),(0.00500011,-1.04549,2.2694),(-0.234649,-1.04549,2.22195),(-0.450839,-1.04549,2.08426),(-0.622409,-1.04549,1.8698),(-0.732563,-1.04549,1.59956),(-0.77052,-1.04549,1.3),(-0.732563,-1.04549,1.00044),(-0.622409,-1.04549,0.730201),(-0.450839,-1.04549,0.515739),(-0.234649,-1.04549,-0.346724),(0.0050,-1.04549,-0.39417),(0.244649,-1.04549,-0.346724),(0.46084,-1.04549,0.515739),(0.632409,-1.04549,0.730201),(0.742564,-1.04549,1.00044),(0.78052,-1.04549,1.3),(0.742564,-1.04549,1.59956),(0.632409,-1.04549,1.8698),(0.460839,-1.04549,2.08426),(0.244649,-1.04549,2.22195),(0.741824,-1.01,1.71561),(0.631034,-1.01,1.96651),(0.458473,-1.01,2.16561),(0.241034,-1.01,2.29345),(7.53167E-7,-1.01,2.3375),(-0.241033,-1.01,2.29345),(-0.458472,-1.01,2.16562),(-0.631033,-1.01,1.96651),(-0.741824,-1.01,1.71562),(-0.78,-1.01,1.4375),(-0.741824,-1.01,1.15938),(-0.631033,-1.01,0.908493),(-0.458472,-1.01,0.709385),(-0.241033,-1.01,0.581549),(-3.40949E-8,-1.01,0.5375),(0.241033,-1.01,0.581549),(0.458472,-1.01,0.709385),(0.631033,-1.01,0.908493),(0.741824,-1.01,1.15938),(0.78,-1.01,1.4375),(0.44388,-0.92771,2.14244),(0.233362,-0.92771,2.26621),(7.29194E-7,-0.92771,2.30885),(-0.443879,-0.92771,2.14244),(-0.755172,-0.92771,1.4375),(-0.443879,-0.92771,0.732561),(-0.233361,-0.92771,0.608795),(-3.30096E-8,-0.92771,0.566147),(0.443879,-0.92771,0.732561),(0.755172,-0.92771,1.4375),(0.58768,-0.896738,1.93016),(-0.224473,-0.896738,2.23465),(-0.690859,-0.896738,1.69651),(-0.58768,-0.896738,0.944837),(0.224474,-0.896738,0.640355),(0.690859,-0.896738,1.17849),(0.656393,-0.876852,1.68359),(0.405674,-0.876852,2.08176),(0.213276,-0.876852,2.19488),(6.6643E-7,-0.876852,2.23385),(-0.558361,-0.876852,1.90558),(-0.656393,-0.876852,1.19141),(-0.405673,-0.876852,0.793237),(-0.213275,-0.876852,0.680124),(-3.01684E-8,-0.876852,0.641147),(0.558361,-0.876852,0.969416),(-0.200861,-0.87,2.15079),(-0.38206,-0.87,2.04426),(-0.65,-0.87,1.4375),(0.200861,-0.87,0.724208),(0.38206,-0.87,0.830737),(0.65,-0.87,1.4375),(0.493361,-0.876852,1.85109),(0.358448,-0.876852,2.00676),(0.188448,-0.876852,2.10671),(-0.493361,-0.876852,1.85109),(-0.57998,-0.876852,1.65494),(-0.493361,-0.876852,1.02391),(-0.358448,-0.876852,0.868237),(0.493361,-0.876852,1.02391),(0.579981,-0.876852,1.22006),(0.545515,-0.896738,1.64202),(5.53856E-7,-0.896738,2.09933),(-0.177248,-0.896738,2.06694),(-0.337146,-0.896738,1.97293),(-0.573588,-0.896738,1.4375),(-0.545514,-0.896738,1.23298),(-0.177248,-0.896738,0.80806),(-2.50723E-8,-0.896738,0.775668),(0.177248,-0.896738,0.80806),(0.337146,-0.896738,0.902067),(0.573588,-0.896738,1.4375),(0.500601,-0.966738,1.62518),(0.425837,-0.966738,1.79449),(0.309389,-0.966738,1.92885),(0.162656,-0.966738,2.01512),(5.08255E-7,-0.966738,2.04484),(-0.162655,-0.966738,2.01512),(-0.309388,-0.966738,1.92885),(-0.425836,-0.966738,1.79449),(-0.500601,-0.966738,1.62518),(-0.526363,-0.966738,1.4375),(-0.500601,-0.966738,1.24982),(-0.425836,-0.966738,1.08051),(-0.309388,-0.966738,0.94615),(-0.162655,-0.966738,0.859884),(-2.3008E-8,-0.966738,0.830159),(0.162655,-0.966738,0.859884),(0.309388,-0.966738,0.94615),(0.425836,-0.966738,1.08051),(0.500601,-0.966738,1.24982),(0.526363,-0.966738,1.4375)])))])])])])])]), Transform(rotation=(0.0,1.0,0.0,0.0494167),scale=(0.5564,0.873727,0.681617),translation=(-0.221256,-2.19389,1.94541), children=[ Shape( appearance=Appearance( material=Material(ambientIntensity=0.25,diffuseColor=(0.0,0.631244,0.748016),shininess=0.642424,specularColor=(0.915152,0.915152,0.915152),transparency=0.510638)), geometry=IndexedFaceSet(coordIndex=[16,15,14,-1,16,14,13,-1,16,13,12,-1,16,12,11,-1,16,11,10,-1,16,10,9,-1,16,9,8,-1,16,8,7,-1,16,7,6,-1,16,6,5,-1,16,5,4,-1,16,4,3,-1,16,3,2,-1,16,2,1,-1,16,1,0,-1,16,0,15,-1],creaseAngle=0.5,solid=False, coord=Coordinate(point=[(0.0,1.0,-1.0),(0.382683,1.0,-0.92388),(0.707107,1.0,-0.707107),(0.92388,1.0,-0.382683),(1.0,1.0,4.37114E-8),(0.92388,1.0,0.382684),(0.707107,1.0,0.707107),(0.382683,1.0,0.92388),(1.50996E-7,1.0,1.0),(-0.382683,1.0,0.92388),(-0.707107,1.0,0.707107),(-0.92388,1.0,0.382684),(-1.0,1.0,-1.19249E-8),(-0.923879,1.0,-0.382684),(-0.707107,1.0,-0.707107),(-0.382683,1.0,-0.92388),(0.0,1.0,0.0)])))]), Transform( children=[ TouchSensor(DEF='touchSensorTrigger_0',description='touch to activate'), Transform(DEF='_1',center=(0.74077,-0.315403,1.61988E-7),rotation=(1.0,-1.73877E-6,1.95672E-6,1.57079),scale=(0.191347,0.0374406,0.0531332),translation=(-1.55668,0.417836,0.970123), children=[ Group( children=[ Group(DEF='tflush', children=[ TimeSensor(DEF='Time_2',cycleInterval=0.8)]), OrientationInterpolator(DEF='UnnamedShapeRotationInterp_3',key=[0.0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.0],keyValue=[(1.0,-1.73877E-6,1.95672E-6,1.57079),(0.994735,0.0724649,0.0724687,1.57608),(0.971878,0.166512,0.166516,1.59932),(0.954202,0.211539,0.211543,1.61766),(0.961666,0.193903,0.193907,1.60988),(0.977376,0.149557,0.149561,1.59368),(0.991504,0.0919768,0.0919807,1.57933),(0.998658,0.0366171,0.036621,1.57214),(1.0,-1.83338E-6,1.93875E-6,1.57079)])]), TouchSensor(DEF='Touch_4'), Shape( appearance=Appearance( material=Material(ambientIntensity=0.256,diffuseColor=(0.155308,0.150902,0.151742),shininess=0.102041,specularColor=(0.528268,0.524391,0.524455))), geometry=IndexedFaceSet(coordIndex=[0,1,3,2,-1,4,5,7,6,-1,6,7,1,0,-1,2,3,5,4,-1,6,0,2,4,-1,1,7,5,3,-1],creaseAngle=1.53973, coord=Coordinate(point=[(-1.0,1.0,1.0),(-1.0,-1.0,1.0),(1.0,1.0,1.0),(1.0,-1.0,1.0),(1.0,1.0,-1.0),(1.0,-1.0,-1.0),(-0.0527761,0.369192,-0.528911),(-0.0527761,-1.63081,-0.528911)])))]), Sound(DEF='toilet1',location=(-0.957652,0.102433,0.970123),minBack=12.0,minFront=12.0,priority=1.0, source=AudioClip(DEF='Sound1clip_5',description='toilet flushing sound',url=["toilet.wav","https://savage.nps.edu/Savage/Buildings/HouseSeksitSiripala/toilet.wav"]))]), ROUTE(fromField='touchTime',fromNode='Touch_4',toField='set_startTime',toNode='Time_2'), ROUTE(fromField='fraction_changed',fromNode='Time_2',toField='set_fraction',toNode='UnnamedShapeRotationInterp_3'), ROUTE(fromField='value_changed',fromNode='UnnamedShapeRotationInterp_3',toField='set_rotation',toNode='_1'), ROUTE(fromField='touchTime',fromNode='touchSensorTrigger_0',toField='set_startTime',toNode='Sound1clip_5'), ROUTE(fromField='touchTime',fromNode='Touch_4',toField='set_startTime',toNode='Sound1clip_5')]) ) # X3D model complete #################################################################################################### # Self-test diagnostics #################################################################################################### print('Self-test diagnostics for Toilet.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 Toilet.py load and self-test diagnostics complete.")