|
28 | 28 | from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox |
29 | 29 | from OCC.Core.BRepBuilderAPI import (BRepBuilderAPI_MakeVertex, |
30 | 30 | BRepBuilderAPI_MakeEdge) |
31 | | -from OCC.Core.gp import (gp_Pnt, gp_Vec, gp_Pnt2d, gp_Lin, gp_Dir, |
| 31 | +from OCC.Core.gp import (gp_Pnt, gp_Vec, gp_Pnt2d, gp_Lin, gp_Dir, gp_Ax2, |
32 | 32 | gp_Quaternion, gp_QuaternionSLerp, gp_XYZ, gp_Mat) |
33 | 33 | from OCC.Core.GC import GC_MakeSegment |
34 | 34 | from OCC.Core.STEPControl import STEPControl_Writer |
|
52 | 52 | BRepCheck_EmptyWire) |
53 | 53 | from OCC.Core.Geom import Geom_Curve, Geom_Line, Geom_BSplineCurve |
54 | 54 | from OCC.Core.BRep import BRep_Tool_Curve |
| 55 | +from OCC.Core.HLRBRep import HLRBRep_Algo, HLRBRep_HLRToShape |
| 56 | +from OCC.Core.HLRAlgo import HLRAlgo_Projector |
55 | 57 |
|
56 | 58 | @contextmanager |
57 | 59 | def assert_warns_deprecated(): |
@@ -658,6 +660,20 @@ def test_in_place_operators(self): |
658 | 660 | self.assertEqual(d.Y(), 7.) |
659 | 661 | self.assertEqual(d.Z(), 9.) |
660 | 662 |
|
| 663 | + def test_shape_conversion_as_py_none(self): |
| 664 | + # see issue #600 and PR #614 |
| 665 | + # a null topods_shape should be returned as Py_None by the TopoDS transformer |
| 666 | + # the following test case returns a null topods_shape |
| 667 | + box = BRepPrimAPI_MakeBox(1., 1., 1.).Shape() |
| 668 | + hlr = HLRBRep_Algo() |
| 669 | + hlr.Add(box) |
| 670 | + projector = HLRAlgo_Projector(gp_Ax2(gp_Pnt(), gp_Dir(-1.75, 1.1, 5))) |
| 671 | + hlr.Projector(projector) |
| 672 | + hlr.Update() |
| 673 | + hlr.Hide() |
| 674 | + hlr_shapes = HLRBRep_HLRToShape(hlr) |
| 675 | + visible_smooth_edges = hlr_shapes.Rg1LineVCompound() |
| 676 | + self.assertTrue(visible_smooth_edges is None) |
661 | 677 |
|
662 | 678 | def suite(): |
663 | 679 | test_suite = unittest.TestSuite() |
|
0 commit comments