コード例 #1
0
 def test_parabola(self):
     '''Test: parabola'''
     # P is the vertex point
     # P and D give the axis of symmetry
     # 6 is the focal length of the parabola
     P = gp_Pnt2d(2., 3.)
     D = gp_Dir2d(4., 5.)
     A = gp_Ax22d(P, D, True)
     Para = gp_Parab2d(A, 6)
     aParabola = GCE2d_MakeParabola(Para)
     gParabola = aParabola.Value()
     aTrimmedCurve = Geom2d_TrimmedCurve(gParabola, -100, 100, True)
コード例 #2
0
 def test_parabola(self):
     """Test: parabola"""
     # P is the vertex point
     # P and D give the axis of symmetry
     # 6 is the focal length of the parabola
     P = gp_Pnt2d(2.0, 3.0)
     D = gp_Dir2d(4.0, 5.0)
     A = gp_Ax22d(P, D, True)
     Para = gp_Parab2d(A, 6)
     aParabola = GCE2d_MakeParabola(Para)
     gParabola = aParabola.Value()
     self.assertIsInstance(gParabola, Geom2d_Parabola)
     aTrimmedCurve = Geom2d_TrimmedCurve(gParabola, -100, 100, True)
     self.assertIsNotNone(aTrimmedCurve)
     self.assertFalse(aTrimmedCurve is None)
コード例 #3
0
 def test_parabola(self):
     '''Test: parabola'''
     # P is the vertex point
     # P and D give the axis of symmetry
     # 6 is the focal length of the parabola
     P = gp_Pnt2d(2., 3.)
     D = gp_Dir2d(4., 5.)
     A = gp_Ax22d(P, D, True)
     Para = gp_Parab2d(A, 6)
     aParabola = GCE2d_MakeParabola(Para)
     gParabola = aParabola.Value()
     self.assertIsInstance(gParabola, Geom2d_Parabola)
     aTrimmedCurve = Geom2d_TrimmedCurve(gParabola, -100, 100, True)
     self.assertIsNotNone(aTrimmedCurve)
     self.assertFalse(aTrimmedCurve.IsNull())
コード例 #4
0
def parabola(event=None):
    # P is the vertex point
    # P and D give the axis of symmetry
    # 6 is the focal length of the parabola
    a_pnt = gp_Pnt2d(2, 3)
    a_dir = gp_Dir2d(4, 5)
    an_ax = gp_Ax22d(a_pnt, a_dir, True)
    para = gp_Parab2d(an_ax, 6)
    display.DisplayShape(a_pnt)
    display.DisplayMessage(a_pnt, "P")

    aParabola = GCE2d_MakeParabola(para)
    gParabola = aParabola.Value()

    aTrimmedCurve = Geom2d_TrimmedCurve(gParabola, -100, 100, True)

    display.DisplayShape(aTrimmedCurve, update=True)