def test_Standard_Type(self) -> None: """ test that Standard_Type returns the correct type name """ edge = BRepBuilderAPI_MakeEdge(gp_Pnt(0, 0, 0), gp_Pnt(1, 0, 0)).Edge() curve, _, _ = BRep_Tool_Curve(edge) line = Geom_Line.DownCast(curve) self.assertEqual(line.DynamicType().Name(), "Geom_Line")
def test_downcast_curve(self) -> None: """Test if a GeomCurve can be DownCasted to a GeomLine""" edge = BRepBuilderAPI_MakeEdge(gp_Pnt(0, 0, 0), gp_Pnt(1, 0, 0)).Edge() curve, _, _ = BRep_Tool_Curve(edge) self.assertTrue(isinstance(curve, Geom_Curve)) # The edge is internally a line, so we should be able to downcast it line = Geom_Line.DownCast(curve) self.assertTrue(isinstance(line, Geom_Curve)) # Hence, it should not be possible to downcast it as a B-Spline curve bspline = Geom_BSplineCurve.DownCast(curve) self.assertTrue(bspline is None)