@@ -5944,6 +5944,33 @@ def test38_space_height_width(self):
59445944 self .assertEqual (o .level (), DBG )
59455945 translator = openstudio .osversion .VersionTranslator ()
59465946
5947+ # Basic test: 'deep' space (vs X-axis).
5948+ vtx = openstudio .Point3dVector ()
5949+ vtx .append (openstudio .Point3d (2 ,9 ,1 ))
5950+ vtx .append (openstudio .Point3d (2 ,1 ,1 ))
5951+ vtx .append (openstudio .Point3d (1 ,1 ,1 ))
5952+ vtx .append (openstudio .Point3d (1 ,9 ,1 ))
5953+
5954+ model = openstudio .model .Model ()
5955+ space = openstudio .model .Space (model )
5956+ floor = openstudio .model .Surface (vtx , model )
5957+ floor .setSpace (space )
5958+ self .assertAlmostEqual (osut .spaceWidth (space ),1 ,3 )
5959+
5960+ # Basic test: 'narrow' space (vs X-axis).
5961+ vtx = openstudio .Point3dVector ()
5962+ vtx .append (openstudio .Point3d (9 ,2 ,1 ))
5963+ vtx .append (openstudio .Point3d (9 ,1 ,1 ))
5964+ vtx .append (openstudio .Point3d (1 ,1 ,1 ))
5965+ vtx .append (openstudio .Point3d (1 ,2 ,1 ))
5966+
5967+ model = openstudio .model .Model ()
5968+ space = openstudio .model .Space (model )
5969+ floor = openstudio .model .Surface (vtx , model )
5970+ floor .setSpace (space )
5971+ self .assertAlmostEqual (osut .spaceWidth (space ),1 ,3 )
5972+
5973+ # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- #
59475974 path = openstudio .path ("./tests/files/osms/in/warehouse.osm" )
59485975 model = translator .loadModel (path )
59495976 self .assertTrue (model )
0 commit comments