#################################################################################################### # # Invoking X3D model self-test: # # $ python EhimeMaru.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=[ # The bow thrusters are taken from a fan and grate example from Chapter 18 of the VRML2.0 Sourcebook by Ames, Nadeau and MoreLand. # All other textures are the creation of the Author or are in the public domain. meta(content='EhimeMaru.x3d',name='title'), meta(content='Model of Japanese trawler sunk by the USS Greeneville.',name='description'), meta(content='Andrew Wiest',name='creator'), meta(content='X3d-Edit',name='translator'), meta(content='9 May 2001',name='created'), meta(content='20 October 2019',name='modified'), meta(content='https://savage.nps.edu/Savage/ShipsCivilian/Trawlers/EhimeMaru.x3d',name='identifier'), meta(content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit',name='generator'), meta(content='http://lib1.nippon-foundation.or.jp/1997/0834/contents/137.htm',name='reference'), meta(content='EhimeMaru137-1.jpg',name='photo'), meta(content='EhimeMaru137-2.gif',name='photo'), meta(content='http://www.nytimes.com/images/2001/03/08/national/010308_nat_subHAWAIIch.gif',name='reference'), meta(content='http://www.cpf.navy.mil/pages/legal/foia/Exhibit_52.pdf',name='reference'), meta(content='http://www.cpf.navy.mil/pages/legal/foia/Exhibit_54_pages_1_7.pdf',name='reference'), meta(content='http://www.cpf.navy.mil/pages/legal/foia/Exhibit_54_pages_8_14.pdf',name='reference'), meta(content='http://www.uscg.mil/d14/news_release/2001/Feb2001.htm#32-01',name='reference'), meta(content='http://www.cnn.com/video/us/2001/02/18/vo.sunk.ship.navy.html',name='reference'), meta(content='http://www.usanavy.com/misc/news/ehime_maru.htm',name='reference'), meta(content='http://www.ntsb.gov/Pressrel/2001/010302.htm',name='reference'), meta(content='http://www.uscg.mil/d14/news_release/2001/Mar2001.htm#43-01',name='reference'), meta(content='http://www.uscg.mil/d14/news_release/2001/Mar2001.htm#42-01',name='reference'), meta(content='http://www.uscg.mil/d14/news_release/2001/Feb2001.htm#41-01',name='reference'), meta(content='http://www.uscg.mil/d14/news_release/2001/Feb2001.htm#20-01',name='reference'), meta(content='http://www.cpf.navy.mil',name='reference'), meta(content='http://www.cpf.navy.mil/greeneville.html',name='reference'), meta(content='http://www.csp.navy.mil/css1/772/home.html',name='reference'), meta(content='http://www.cpf.navy.mil/greenevilleimages.html',name='reference'), meta(content='http://www.chinfo.navy.mil/navpalib/factfile/ShipsCivilian/ship-ssn.html',name='reference'), meta(content='http://www.pbs.org/wgbh/nova/subsecrets/inside.html',name='reference'), meta(content='http://www.nytimes.com/2001/03/09/national/09HAWA.html',name='reference'), meta(content='http://www.cnn.com/2001/US/03/08/japan.sub.03/index.html',name='reference'), meta(content='http://www.cnn.com/SPECIALS/2001/sub.collision/session1.html',name='reference'), meta(content='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18-TextureMapping/Figure18.27RotatingFanAnimatedTextureTransform.wrl',name='reference'), meta(content='../../license.html',name='license')]), Scene=Scene( children=[ NavigationInfo(speed=10), Background(skyAngle=[1.57],skyColor=[(0.6,0.8,0.6),(0.6,0.6,0.6)]), Viewpoint(description='Ehime Maru starboard quarter',orientation=(-0.140128,0.988431,0.058043,0.79366),position=(40,12,40)), Viewpoint(description='Ehime Maru from behind',orientation=(0,1,0,-1.57),position=(-50,6,0)), Transform(translation=(0,5,0), children=[ Shape(DEF='TransparentBoxForExaminationStability', geometry=Box(size=(60,20,12)), appearance=Appearance( material=Material(transparency=1)))]), Transform(DEF='EhimeMaruTopTransform', children=[ Transform(DEF='RollTransform', children=[ Transform(DEF='PitchTransform', children=[ Transform(DEF='YawTransform', children=[ Transform(DEF='ScaleTransform',scale=(1.41213592233,1.41213592233,1.41213592233), children=[ Transform(DEF='EhimeMaruParentTransform', children=[ Transform(DEF='LowerHull', children=[ Shape( geometry=IndexedFaceSet(coordIndex=[1,2,3,54,4,5,-1,1,6,2,-1,7,2,6,-1,7,8,3,2,-1,8,9,3,-1,1,5,6,-1,12,6,5,-1,5,4,11,12,-1,4,10,11,-1,6,14,15,7,-1,6,13,14,-1,6,12,20,21,-1,6,21,13,-1,15,16,8,7,-1,16,17,9,8,-1,11,10,18,19,-1,19,20,12,11,-1,54,3,56,-1,56,4,54,-1,56,3,55,-1,57,4,56,-1,10,4,57,-1,3,9,55,-1,18,58,17,-1,58,56,55,-1,58,57,56,-1,57,58,18,-1,10,57,18,-1,17,58,55,-1,17,55,9,-1],creaseAngle=2, coord=Coordinate(DEF='HullCoordinates',point=[(0,0,0),(-15,-3,0),(-5,-2.8,-1),(17.5,-2.4,-1),(17.5,-2.4,1),(-5,-2.8,1),(-15,-1,0),(-5,-1,-3),(12.8,-1,-3),(17.5,-1,-1),(17.5,-1,1),(12.8,-1,3),(-5,-1,3),(-19.3,0,0),(-18,0,-2),(-15,0,-3.2),(12.8,0,-3.2),(17.5,0,-1),(17.5,0,1),(12.8,0,3.2),(-15,0,3.2),(-18,0,2),(-20,1,0),(-20,1,-3.3),(12.8,1,-3.3),(15,1,-2.5),(17,1,-1.5),(18.5,1,0),(17,1,1.5),(15,1,2.5),(12.8,1,3.3),(-20,1,3.3),(-20.6,2,0),(-20.6,2,-3),(-20,2,-3.5),(12.8,2,-3.5),(16,2,-2.8),(19.5,2,0),(16,2,2.8),(12.8,2,3.5),(-20,2,3.5),(-20.6,2,3),(-20.6,3.2,0),(-20.6,3.2,-3),(-20,3.2,-3.5),(12.8,2.7,-3.5),(16,2.9,-2.8),(19,3,-1.6),(20.6,3.1,0),(19,3,1.6),(16,2.9,2.8),(12.8,2.7,3.5),(-20,3.2,3.5),(-20.6,3.2,3),(18,-2.2,0),(18.2,-1,-0.5),(18.5,-1.2,0),(18.2,-1,0.5),(18.2,-0.7,0),(5.3,3,3.5),(6,2,3.5),(6.7,1,3.3),(5.5,3,-3.5),(7,1,-3.3),(6,2,-3.5)])), appearance=Appearance( material=Material(DEF='HullRed',diffuseColor=(.8,.1,.1))))]), Transform(DEF='UpperHull', children=[ Shape( geometry=IndexedFaceSet(coordIndex=[31,21,20,-1,13,21,31,-1,13,31,22,-1,13,22,23,-1,23,14,13,-1,23,15,14,-1,23,24,16,15,-1,16,24,25,-1,16,25,26,-1,26,17,16,-1,17,26,27,-1,19,29,30,-1,19,28,29,-1,19,18,28,-1,18,27,28,-1,18,17,27,-1,30,31,20,19,-1,32,33,23,22,-1,22,31,41,32,-1,33,34,23,-1,40,41,31,-1,34,35,24,23,-1,35,36,25,24,-1,36,26,25,-1,36,37,27,26,-1,37,38,28,27,-1,29,28,38,-1,30,29,38,39,-1,60,40,31,61,-1,42,43,33,32,-1,32,41,53,42,-1,43,44,34,33,-1,41,40,52,53,-1,44,45,35,34,-1,45,46,36,35,-1,46,47,36,-1,47,48,37,36,-1,48,49,38,37,-1,49,50,38,-1,50,51,39,38,-1,59,52,40,60,-1],creaseAngle=2,solid=False, coord=Coordinate(USE='HullCoordinates')), appearance=Appearance( material=Material(DEF='EhimeMaruWhite',diffuseColor=(1,1,1))))]), Transform(DEF='MainDeck',scale=(.99,.99,.99),translation=(0,-.05,0), children=[ Shape( geometry=IndexedFaceSet(coordIndex=[22,23,24,25,26,27,28,29,30,31,22,-1],solid=False, coord=Coordinate(USE='HullCoordinates')), appearance=Appearance( material=Material(DEF='EhimeMaruDeckColor',diffuseColor=(.6,.5,.4)), texture=ImageTexture(DEF='EhimeMaruDeckSkin',url=["EhimeMaruLargeDeckSkin.gif","https://savage.nps.edu/Savage/ShipsCivilian/Trawlers/EhimeMaruLargeDeckSkin.gif"])))]), Transform(DEF='ForwardDeck',center=(16,0,0),scale=(.99,.99,.99), children=[ Shape( geometry=IndexedFaceSet(coordIndex=[35,36,37,38,39,35,-1,24,30,39,35,24,-1],solid=False, coord=Coordinate(USE='HullCoordinates')), appearance=Appearance( material=Material(diffuseColor=(.4,.3,.2)), texture=ImageTexture(USE='EhimeMaruDeckSkin')))]), Transform(DEF='AftDeck',scale=(.99,.99,.99), children=[ Shape( geometry=IndexedFaceSet(coordIndex=[60,64,63,61,60,-1,60,64,34,33,32,41,40,60,-1],creaseAngle=1,solid=False, coord=Coordinate(USE='HullCoordinates')), appearance=Appearance( material=Material(USE='EhimeMaruDeckColor'), texture=ImageTexture(USE='EhimeMaruDeckSkin')))]), Transform(DEF='SuperStructure1',translation=(-7.9,3,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Box(size=(24,2,5.4)))]), Transform(DEF='MainRoof',translation=(-8.2,4.0,0), children=[ Shape( appearance=Appearance( material=Material(DEF='EhimeMaruRoofColor',diffuseColor=(.7,.6,.5)), texture=ImageTexture(USE='EhimeMaruDeckSkin')), geometry=Box(size=(24.7,.1,7)))]), Transform(DEF='Bridge1',translation=(0.5,4.5,0), children=[ Shape( geometry=Box(size=(5.99,1.99,3)), appearance=Appearance( material=Material(diffuseColor=(.9,.9,.9)))), Transform(DEF='AftBridgeWindows',translation=(-1,0,0), children=[ Transform(rotation=(0,1,0,-1.570796),translation=(0.3,0.35,-1.5), children=[ Shape(DEF='BridgeWindowShape', appearance=Appearance( material=Material(diffuseColor=(0.1,0.1,0.4),transparency=.4)), geometry=Box(size=(0.1,0.3,0.5)))]), Transform(rotation=(0,1,0,-1.570796),translation=(0.3,0.35,1.5), children=[ Shape(USE='BridgeWindowShape')]), Transform(rotation=(0,1,0,-1.570796),translation=(-0.5,0.35,-1.5), children=[ Shape(USE='BridgeWindowShape')]), Transform(rotation=(0,1,0,-1.570796),translation=(-0.5,0.35,1.5), children=[ Shape(USE='BridgeWindowShape')])])]), Transform(DEF='Bridge2',translation=(2.25,4.5,0), children=[ Shape( geometry=Box(size=(2.5,1.99,4)), appearance=Appearance( material=Material(USE='EhimeMaruWhite'))), Transform(DEF='BridgeWindows', children=[ Transform(DEF='FrontBridgeWindows',rotation=(0,0,1,-0.07),translation=(1.22,0.35,0), children=[ Transform( children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,-0.57), children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,-1.14), children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,-1.71), children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,0.57), children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,1.14), children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,1.71), children=[ Shape(USE='BridgeWindowShape')])]), Transform(DEF='PortBridgeWindows',rotation=(0,1,0,-1.570796),translation=(0,0.35,2), children=[ Transform(translation=(0,0,-0.57), children=[ Shape(USE='BridgeWindowShape')]), Transform( children=[ Shape(USE='BridgeWindowShape')]), Transform(translation=(0,0,0.57), children=[ Shape(USE='BridgeWindowShape')])]), Transform(DEF='StbdBridgeWindows',translation=(0,0,-4), children=[ Transform(USE='PortBridgeWindows')])])]), Transform(DEF='BridgeRoof',translation=(0,-0.5,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruRoofColor'), texture=ImageTexture(USE='EhimeMaruDeckSkin')), geometry=IndexedFaceSet(coordIndex=[0,1,2,3,4,5,6,7],solid=False, coord=Coordinate(point=[(-2.6,6,-1.6),(0.9,6,-1.6),(0.9,6,-2.1),(3.6,6,-2.1),(3.6,6,2.1),(0.9,6,2.1),(0.9,6,1.6),(-2.6,6,1.6)])))]), Transform(DEF='SmokeStack',translation=(0,-1.0,0), children=[ Transform(DEF='SmokeStackBottom', children=[ Shape(DEF='SSLeftSide', appearance=Appearance( material=Material(USE='EhimeMaruWhite'), texture=ImageTexture(DEF='EhimeMaruSmokeStackStar',url=["EhimeMaruSmokeStackStar.jpg","https://savage.nps.edu/Savage/ShipsCivilian/Trawlers/EhimeMaruSmokeStackStar.jpg"])), geometry=IndexedFaceSet(coordIndex=[5,6,7,8,-1], coord=Coordinate(DEF='SmokeStackBottomPoints',point=[(0,0,0),(-12.5,4,1),(-11.5,7,1),(-9,7,1),(-9,4,1),(-12.5,4,-1),(-11.5,7,-1),(-9,7,-1),(-9,4,-1)]))), Shape(DEF='SSRightSide', appearance=Appearance( material=Material(USE='EhimeMaruWhite'), texture=ImageTexture(USE='EhimeMaruSmokeStackStar')), geometry=IndexedFaceSet(coordIndex=[1,4,3,2,-1], coord=Coordinate(USE='SmokeStackBottomPoints'))), Shape(DEF='SSRestofSides', appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=IndexedFaceSet(coordIndex=[8,7,3,4,-1,1,2,6,5,-1,2,3,7,6,-1], coord=Coordinate(USE='SmokeStackBottomPoints')))]), Transform(DEF='SmokeStackTopPart1',rotation=(0,0,1,0.4),translation=(-10.3,6.79,0), children=[ Shape( geometry=Box(size=(2.52,.62,1.99)), appearance=Appearance( material=Material(diffuseColor=(0,0,0))))]), Transform(DEF='SmokeStackTopPart2',rotation=(0,0,1,0.13),translation=(-10.45,7.1,0), children=[ Shape( geometry=Box(size=(2.45,0.6,1.99)), appearance=Appearance( material=Material(diffuseColor=(0,0,0))))])]), Transform(DEF='SideSwirlHolders', children=[ Transform(DEF='RightSideSwirl', children=[ Shape( geometry=IndexedFaceSet(coordIndex=[4,3,2,1,-1],solid=False, coord=Coordinate(point=[(0,0,0),(2.5,1,3.4),(2.5,2.5,3.55),(4,2.5,3.55),(4,1,3.4)])), appearance=Appearance( material=Material(USE='EhimeMaruWhite'), texture=ImageTexture(DEF='EhimeMaruSideSwirlSymbol',url=["EhimeMaruSideSwirlSymbol.jpg","https://savage.nps.edu/Savage/ShipsCivilian/Trawlers/EhimeMaruSideSwirlSymbol.jpg"])))]), Transform(DEF='LeftSideSwirl', children=[ Shape( geometry=IndexedFaceSet(coordIndex=[1,2,3,4,-1],solid=False, coord=Coordinate(point=[(0,0,0),(2.5,1,-3.4),(2.5,2.5,-3.55),(4,2.5,-3.55),(4,1,-3.4)])), appearance=Appearance( material=Material(USE='EhimeMaruWhite'), texture=ImageTexture(USE='EhimeMaruSideSwirlSymbol')))])]), Transform(DEF='RunningPosts', children=[ Transform(DEF='StbdSidePosts',translation=(0,-0.53,0), children=[ Transform(translation=(-19.78,3.9,3.4), children=[ Transform(DEF='CookieCutterPost', children=[ Transform(rotation=(0,0,1,-0.3),translation=(0,.05,0), children=[ Shape( geometry=Box(size=(0.2,1.2,0.1)), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))])])]), Transform(translation=(-17.5,3.9,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(translation=(-15.5,3.9,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(translation=(-13,3.9,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-10.5,3.78,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-8.3,3.78,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-6,3.78,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-3.9,3.78,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-1.5,3.78,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.3,1),translation=(0.9,3.72,3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.3,1),translation=(3.2,3.72,3.4), children=[ Transform(USE='CookieCutterPost')])]), Transform(DEF='PortSidePosts',translation=(0,-0.53,0), children=[ Transform(translation=(-19.78,3.9,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(translation=(-17.5,3.9,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.1,1),translation=(-15.5,3.8,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.1,1),translation=(-13,3.85,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-10.5,3.78,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-8.3,3.78,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.2,1),translation=(-6,3.78,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.3,1),translation=(-3.9,3.7,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.4,1),translation=(-1.5,3.65,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.4,1),translation=(0.9,3.65,-3.4), children=[ Transform(USE='CookieCutterPost')]), Transform(scale=(1,1.4,1),translation=(3.2,3.65,-3.4), children=[ Transform(USE='CookieCutterPost')])])]), Transform(DEF='Masts', children=[ Transform(DEF='ForwardMast',rotation=(0,0,1,0.174),translation=(12.5,5.8,0), children=[ Transform(DEF='VerticalForwardMast1', children=[ Shape( geometry=Cone(bottom=False,bottomRadius=.25,height=7.8), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform(DEF='CrossbarForwardMast',rotation=(1,0,0,1.57079),translation=(0,3.5,0), children=[ Shape( geometry=Cylinder(radius=.02), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform(DEF='VerticalForwardMast2', children=[ Shape( geometry=Cylinder(bottom=False,height=7.8,radius=.05), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))])]), Transform(DEF='Wires', children=[ Shape( geometry=IndexedLineSet(coordIndex=[0,1,-1,0,2,-1,0,3,-1,0,4,-1,0,5,-1,6,7,-1,9,11,-1,8,10,-1,10,12,-1,11,13,-1], coord=Coordinate(point=[(12.6,5.8,0),(16,2,-2.8),(19.5,2,0),(16,2,2.8),(3.5,5.5,2),(3.5,5.5,-2),(12.2,7.3,0),(0,7.3,0),(11.9,9.25,0.95),(11.9,9.25,-0.95),(-0.76,9.67,0.95),(-0.76,9.67,-0.95),(-18,9.33,0.99),(-18,9.33,-0.99)])), appearance=Appearance( material=Material(emissiveColor=(.5,.5,.5))))]), Transform(DEF='Midmast',rotation=(0,0,1,0.15),translation=(-0.5,8,0), children=[ Transform(DEF='VerticalMidMast1', children=[ Shape( geometry=Cone(bottom=False,bottomRadius=0.23,height=5.5), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform(DEF='VerticalMidMast2', children=[ Shape( geometry=Cylinder(bottom=False,height=5.5,radius=.05), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform(DEF='VerticalMidMast3',rotation=(0,0,1,-0.174),translation=(0,-2,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cone(bottom=False,bottomRadius=.3,height=1.2))]), Transform(DEF='HorizontalMidMast1',translation=(0,-1.8,0), children=[ Transform(USE='CrossbarForwardMast')]), Transform(DEF='HorizontalMidMast2',translation=(0,-1.3,0), children=[ Transform(USE='HorizontalMidMast1')]), Transform(DEF='RadarMast1',rotation=(0,0,1,-0.15), children=[ Transform(DEF='RadarMastSupport',translation=(0.5,-0.7,0), children=[ Shape( geometry=Box(size=(1,0.02,0.2)), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))])]), Transform(DEF='RadarMast2',rotation=(0,0,1,-0.15),translation=(0,1,0), children=[ Transform(USE='RadarMastSupport')]), Transform(DEF='RadarsupportTop',rotation=(0,0,1,-0.15),translation=(0.75,0.24,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.1,radius=.03,top=False))]), Transform(DEF='RadarsupportLower',rotation=(0,0,1,-0.15),translation=(0.75,-0.76,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.1,radius=.03,top=False))])]), Transform(DEF='AftMast',translation=(0,-1.2,0), children=[ Transform(DEF='PortSupport',rotation=(1,0,0,0.11),translation=(-18.1,6.5,-.5), children=[ Shape(DEF='AftMastColumn', appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=9,radius=.05))]), Transform(DEF='StbdSupport',rotation=(1,0,0,-0.11),translation=(-18.1,6.5,.5), children=[ Shape(USE='AftMastColumn')]), Transform(DEF='FwdSupport',rotation=(0,0,1,0.19),scale=(1.5,1,1.5),translation=(-17.35,7.1,0), children=[ Shape(USE='AftMastColumn')]), Transform(DEF='AftMastCrossbar',scale=(1.3,1.3,1.0),translation=(-18,6,0), children=[ Transform(USE='CrossbarForwardMast')]), Transform(DEF='AftMassHorizontalBars',translation=(-18,7,0), children=[ Transform(DEF='Bar1',rotation=(0,1,0,0.5),translation=(0.11,2,0.11), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.5,radius=.04,top=False))])]), Transform(DEF='Bar2',rotation=(0,1,0,-0.5),translation=(0.11,2,-0.11), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.5,radius=.04,top=False))])]), Transform(DEF='Bar3',rotation=(0,1,0,0.5),translation=(0.20,0.8,0.2), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.7,radius=.04,top=False))])]), Transform(DEF='Bar4',rotation=(0,1,0,-0.5),translation=(0.2,0.8,-0.2), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=.7,radius=.04,top=False))])]), Transform(DEF='Bar5',rotation=(0,1,0,0.5),translation=(0.36,-0.4,0.24), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=0.95,radius=.04,top=False))])]), Transform(DEF='Bar6',rotation=(0,1,0,-0.5),translation=(0.36,-0.4,-0.24), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=0.95,radius=.04,top=False))])]), Transform(DEF='Bar7',rotation=(0,1,0,0.5),translation=(0.42,-1.5,0.31), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.2,radius=.04,top=False))])]), Transform(DEF='Bar8',rotation=(0,1,0,-0.5),translation=(0.42,-1.5,-0.31), children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.2,radius=.04,top=False))])])]), Transform(DEF='AftMastAngledBars',translation=(-18,7,0), children=[ Transform(DEF='ABar1',rotation=(0,1,0,0.75),translation=(0.10,1.4,0.2), children=[ Transform(rotation=(0,0,1,-0.35), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.3,radius=.02,top=False))])]), Transform(DEF='ABar2',rotation=(0,1,0,-0.75),translation=(0.1,1.4,-0.2), children=[ Transform(rotation=(0,0,1,-0.35), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.3,radius=.02,top=False))])]), Transform(DEF='ABar3',rotation=(0,1,0,0.4),translation=(0.32,0.2,0.2), children=[ Transform(rotation=(0,0,1,0.6), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.4,radius=.02,top=False))])]), Transform(DEF='ABar4',rotation=(0,1,0,-0.4),translation=(0.32,0.2,-0.2), children=[ Transform(rotation=(0,0,1,0.6), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.4,radius=.02,top=False))])]), Transform(DEF='ABar5',rotation=(0,1,0,0.6),translation=(0.35,-0.9,0.3), children=[ Transform(rotation=(0,0,1,-0.75), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.5,radius=.02,top=False))])]), Transform(DEF='ABar6',rotation=(0,1,0,-0.6),translation=(0.35,-0.9,-0.3), children=[ Transform(rotation=(0,0,1,-0.75), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=1.5,radius=.02,top=False))])])])]), Transform(DEF='DomeRadar',scale=(.35,.4,.35),translation=(2.1,5,-1.5), children=[ Transform(DEF='radarPost', children=[ Shape( geometry=Cylinder(bottom=False,height=5,radius=.2,top=False), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform(DEF='RadarHousing',translation=(0,3,0), children=[ Transform(translation=(0,.5,0), children=[ Shape( geometry=Sphere(), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))]), Transform( children=[ Shape( geometry=Cylinder(height=1.2,top=False), appearance=Appearance( material=Material(USE='EhimeMaruWhite')))])])]), OrientationInterpolator(DEF='TopRadarInterpolator',key=[0,.25,.5,.75,1],keyValue=[(0,1,0,0),(0,1,0,1.570796),(0,1,0,3.14159),(0,1,0,4.7124),(0,1,0,6.283185)]), TimeSensor(DEF='TopRadarTImeSource',cycleInterval=7,loop=True), TimeSensor(DEF='LowerRadarTimeSource',cycleInterval=5,loop=True), OrientationInterpolator(DEF='LowerRadarInterpolator',key=[0,.25,.5,.75,1],keyValue=[(0,1,0,0),(0,1,0,1.570796),(0,1,0,3.14159),(0,1,0,4.7124),(0,1,0,6.283185)]), Transform(DEF='RotatingTopRadar',translation=(0.22,8.43,0), children=[ Transform(DEF='RadarAntennaTop', children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(height=1,radius=0.05))]), Transform(translation=(0,0,.05), children=[ Shape( geometry=Box(size=(1,0.1,0.1)), appearance=Appearance( material=Material(USE='EhimeMaruWhite'))), Transform(translation=(0,0,.02), children=[ Shape( appearance=Appearance( material=Material(DEF='RadarXmitterBlue',diffuseColor=(.1,.1,.5),transparency=0.3)), geometry=Box(size=(.99,.09,.09)))])])])]), Transform(DEF='RotatingLowerRadar',translation=(.35,7.45,0), children=[ Transform(DEF='RadarAntennaLower', children=[ Transform(rotation=(0,0,1,-1.570796), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(height=1,radius=0.05))]), Transform(translation=(0,0,.05), children=[ Shape( geometry=Box(size=(1,0.1,0.1)), appearance=Appearance( material=Material(USE='EhimeMaruWhite'))), Transform(translation=(0,0,.02), children=[ Shape( appearance=Appearance( material=Material(USE='RadarXmitterBlue')), geometry=Box(size=(.99,.09,.09)))])])])])]), Transform(DEF='RescueBoatParentNode', children=[ Transform(DEF='RescueBoat',scale=(.4,.4,.4),translation=(-4.2,5,-2.5), children=[ Inline(url=["../../ShipsMilitary/DestroyerSovremennyRussia/CaptainsBarge.x3d","https://savage.nps.edu/Savage/ShipsMilitary/DestroyerSovremennyRussia/CaptainsBarge.x3d","../../ShipsMilitary/DestroyerSovremennyRussia/CaptainsBarge.wrl","https://savage.nps.edu/Savage/ShipsMilitary/DestroyerSovremennyRussia/CaptainsBarge.wrl"])]), Transform(DEF='ForwardBoatSupport',translation=(-3.5,4,-2), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=4,radius=.02))]), Transform(DEF='AftBoatSupport',translation=(-6.2,4,-2), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(bottom=False,height=4,radius=.02))])]), Transform(DEF='StructuresOnDeck', children=[ Transform(DEF='Box1',translation=(-7.5,4.5,0), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Box(size=(1.2,1,1.4)))]), Transform(DEF='Box2',translation=(-11.3,4.6,2.6), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Box(size=(1.,1.25,.9)))]), Transform(DEF='Box3',translation=(-15,4.5,2.3), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Box(size=(2,1,2)))]), Transform(DEF='Cylinder1',rotation=(0,0,1,-1.570796),translation=(-6.5,4.3,3), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(DEF='TopsideCylinder',height=4.3,radius=.3))]), Transform(DEF='Cylinder2',rotation=(0,0,1,-1.570796),translation=(-12,4.3,-3), children=[ Shape( appearance=Appearance( material=Material(USE='EhimeMaruWhite')), geometry=Cylinder(USE='TopsideCylinder'))]), Transform(DEF='FwdBox1',translation=(9,1.3,-0.9), children=[ Shape( appearance=Appearance( material=Material(diffuseColor=(.5,.4,.4)), texture=ImageTexture(USE='EhimeMaruDeckSkin')), geometry=Box(size=(2,1,2)))]), Transform(DEF='FwdCylinder1',translation=(15,2,-1), children=[ Shape( appearance=Appearance( material=Material(diffuseColor=(.4,.4,.4))), geometry=Cylinder(height=.7,radius=.3))]), Transform(DEF='FwdCylinder2',translation=(15,2,1), children=[ Shape( appearance=Appearance( material=Material(diffuseColor=(.4,.4,.4))), geometry=Cylinder(height=.7,radius=.3))]), Transform(DEF='FwdCylinder3',scale=(1.2,1.2,1.2),translation=(17.5,2,0), children=[ Shape( appearance=Appearance( material=Material(diffuseColor=(.4,.4,.4))), geometry=Cylinder(height=.7,radius=.3))])]), Transform(DEF='RudderAssembly',translation=(-17,-2,0), children=[ Transform(DEF='HorizontalRudderSupport',translation=(2.8,-0.9,0), children=[ Shape( geometry=Box(size=(6,.02,.4)), appearance=Appearance( material=Material(USE='HullRed')))]), Transform(DEF='VerticalRudderSupport',translation=(0,0.6,0), children=[ Shape( geometry=Cylinder(height=3,radius=.04,top=False), appearance=Appearance( material=Material(USE='HullRed')))]), Transform(DEF='Rudder',translation=(0,0.2,0), children=[ Shape( geometry=Box(size=(1.5,2,.04)), appearance=Appearance( material=Material(USE='HullRed')))])]), Transform(DEF='PropAssembly',center=(-15,-2,0), children=[ Transform(DEF='Propeller',rotation=(0,1,0,-3.142),scale=(.8,.8,.8),translation=(-15.3,-2,0), children=[ Transform( children=[ Shape(DEF='blade', geometry=Extrusion(creaseAngle=.785,crossSection=[(0,-.25),(-.2,0),(-.2,.25),(0,.25),(0,-.25)],orientation=[(0,1,0,0),(0,1,0,.1),(0,1,0,.2),(0,1,0,.3),(0,1,0,.4),(0,1,0,.5),(0,1,0,.6),(0,1,0,.7),(0,1,0,.8),(0,1,0,.9)],scale=[(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6),(0.1,0.6)],spine=[(0,0,0),(0,.1,0),(0,.2,0),(0,.3,0),(0,.4,0),(0,.5,0),(0,.6,0),(0,.7,0),(0,.8,0),(0,.9,0)]), appearance=Appearance(DEF='screw_color', material=Material(ambientIntensity=.3,diffuseColor=(.1,.1,.1),emissiveColor=(.1,.1,.1),shininess=.5,specularColor=(.1,.1,.1)), texture=ImageTexture(url=["screw_texture.jpg","https://savage.nps.edu/Savage/ShipsCivilian/Trawlers/screw_texture.jpg"])))]), Transform(rotation=(1,0,0,1.5707), children=[ Shape(USE='blade')]), Transform(rotation=(1,0,0,3.14159), children=[ Shape(USE='blade')]), Transform(rotation=(1,0,0,4.7124), children=[ Shape(USE='blade')]), Transform(DEF='endcap',rotation=(0,0,1,-1.571),scale=(.5,.3,.5),translation=(0.2,0,0), children=[ Shape( geometry=Cone(bottomRadius=.26,height=1.3), appearance=Appearance(USE='screw_color'))])]), Transform(DEF='DriveShaft',rotation=(0,0,1,-1.571),translation=(-13.85,-2,0), children=[ Shape( geometry=Cylinder(bottom=False,height=3,radius=.07,top=False), appearance=Appearance( material=Material(USE='HullRed')))])]), TimeSensor(DEF='PropTimerSource',cycleInterval=5,loop=True), OrientationInterpolator(DEF='PropRotationInterpolator',key=[0,0.25,0.5,0.75,1],keyValue=[(1,0,0,0),(1,0,0,1.570796),(1,0,0,3.14159),(1,0,0,4.7124),(1,0,0,6.283185)]), Transform(DEF='BowThrusters', children=[ Transform(DEF='StbdThruster',rotation=(0,1,0,0.4),translation=(14,-0.95,2.53), children=[ Transform(rotation=(1,0,0,0.1), children=[ Transform(rotation=(1,0,0,1.570796), children=[ Shape( appearance=Appearance( material=Material(ambientIntensity=.3,diffuseColor=(.1,.1,.1),emissiveColor=(.1,.1,.1),shininess=.5,specularColor=(.1,.1,.1))), geometry=Cylinder(height=.05,radius=.4))]), Transform(scale=(.26,.26,.26),translation=(0,0,0.07), children=[ LOD(DEF='BowThrusterImage',range=[400], children=[ Inline(url=["../../../Vrml2Sourcebook/Chapter18-TextureMapping/Figure18.27RotatingFanAnimatedTextureTransform.x3d","https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18-TextureMapping/Figure18.27RotatingFanAnimatedTextureTransform.x3d","../../../Vrml2Sourcebook/Chapter18-TextureMapping/Figure18.27RotatingFanAnimatedTextureTransform.wrl","https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter18-TextureMapping/Figure18.27RotatingFanAnimatedTextureTransform.wrl"]), WorldInfo(info=["null node"])])])])]), Transform(DEF='PortThruster',rotation=(0,1,0,-0.4),translation=(14,-0.95,-2.53), children=[ Transform(rotation=(1,0,0,-0.1), children=[ Transform(rotation=(1,0,0,1.570796), children=[ Shape( appearance=Appearance( material=Material(ambientIntensity=.3,diffuseColor=(.1,.1,.1),emissiveColor=(.1,.1,.1),shininess=.5,specularColor=(.1,.1,.1))), geometry=Cylinder(height=.05,radius=.4))]), Transform(rotation=(0,1,0,-3.14159),scale=(.26,.26,.26),translation=(0,0,-0.07), children=[ LOD(USE='BowThrusterImage')])])])]), Transform(DEF='ShipName',translation=(15,2,0), children=[ Transform(DEF='PortShipName',rotation=(0,1,0,0.4),translation=(-0.6,-0.8,3), children=[ Shape(DEF='ShipNameText', geometry=Text(string=["-- EHIME MARU --"], fontStyle=FontStyle(justify=["BEGIN","MIDDLE"],size=0.5,style_='BOLD')), appearance=Appearance( material=Material(diffuseColor=(.1,.1,.4))))]), Transform(DEF='StbdShipName',rotation=(0,1,0,-3.54159),translation=(0.8,-0.8,-2.5), children=[ Shape(USE='ShipNameText')]), Transform(DEF='AftShipName',rotation=(0,1,0,-1.570796),translation=(-35.8,0.7,-1.8), children=[ Shape(USE='ShipNameText')])])])])])])])]), ROUTE(fromField='fraction_changed',fromNode='TopRadarTImeSource',toField='set_fraction',toNode='TopRadarInterpolator'), ROUTE(fromField='value_changed',fromNode='TopRadarInterpolator',toField='set_rotation',toNode='RadarAntennaTop'), ROUTE(fromField='fraction_changed',fromNode='LowerRadarTimeSource',toField='set_fraction',toNode='LowerRadarInterpolator'), ROUTE(fromField='value_changed',fromNode='LowerRadarInterpolator',toField='set_rotation',toNode='RadarAntennaLower'), ROUTE(fromField='fraction_changed',fromNode='PropTimerSource',toField='set_fraction',toNode='PropRotationInterpolator'), ROUTE(fromField='value_changed',fromNode='PropRotationInterpolator',toField='set_rotation',toNode='PropAssembly')]) ) # X3D model complete #################################################################################################### # Self-test diagnostics #################################################################################################### print('Self-test diagnostics for EhimeMaru.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 EhimeMaru.py load and self-test diagnostics complete.")