File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -530,6 +530,9 @@ def generate_iges(self,
530530 from OCC .BRepOffsetAPI import BRepOffsetAPI_ThruSections
531531 from OCC .BRepExtrema import BRepExtrema_DistShapeShape
532532
533+ if maxDeg <= 0 :
534+ raise ValueError ('maxDeg argument must be a positive integer.' )
535+
533536 if upper_face :
534537 self ._check_string (filename = upper_face )
535538 # Initializes ThruSections algorithm for building a shell passing
@@ -610,7 +613,6 @@ def generate_iges(self,
610613 self ._check_string (filename = tip )
611614 generator = BRepOffsetAPI_ThruSections (False , False , 1e-10 )
612615 generator .SetMaxDegree (maxDeg )
613-
614616 # npoints_up == npoints_down
615617 npoints = len (self .blade_coordinates_down [- 1 ][0 ])
616618 vertices_1 = TColgp_HArray1OfPnt (1 , npoints )
Original file line number Diff line number Diff line change @@ -499,6 +499,18 @@ def test_iges_blade_tip_generate(self):
499499 self .assertTrue (os .path .isfile ('tests/test_datasets/tip.iges' ))
500500 self .addCleanup (os .remove , 'tests/test_datasets/tip.iges' )
501501
502+ def test_iges_blade_maxDeg_exception (self ):
503+ blade = create_sample_blade_NACA ()
504+ blade .apply_transformations ()
505+ with self .assertRaises (ValueError ):
506+ blade .generate_iges (
507+ upper_face = None ,
508+ lower_face = None ,
509+ tip = None ,
510+ maxDeg = - 1 ,
511+ display = False ,
512+ errors = None )
513+
502514 def test_iges_errors_exception (self ):
503515 blade = create_sample_blade_NACA ()
504516 blade .apply_transformations ()
You can’t perform that action at this time.
0 commit comments