OpenCascade.js
API ReferenceModelingDataTKGeomBase

IntAna2d

OCCT package IntAna2d: IntAna2d_AnaIntersection, IntAna2d_Conic, IntAna2d_IntPoint, MyDirectPolynomialRoots.

IntAna2d_AnaIntersection

Implementation of the analytical intersection between:

  • two Lin2d,
  • two Circ2d,
  • a Lin2d and a Circ2d,
  • an element of gp (Lin2d, Circ2d, Elips2d, Parab2d, Hypr2d) and another conic. No tolerance is given for all the intersections: the tolerance will be the "precision machine".

Constructors(9)

Instance methods(14)

  • Perform(L1: gp_Lin2d, L2: gp_Lin2d): void

    Intersection between two lines.

    Parameters (2)
    • L1
    • L2
  • Perform(C1: gp_Circ2d, C2: gp_Circ2d): void

    Intersection between two circles.

    Parameters (2)
    • C1
    • C2
  • Perform(L: gp_Lin2d, C: gp_Circ2d): void

    Intersection between a line and a circle.

    Parameters (2)
    • L
    • C
  • Intersection between a line and a conic.

    Parameters (2)
    • L
    • C
  • Intersection between a circle and another conic.

    Parameters (2)
    • C
    • Co
  • Intersection between an ellipse and another conic.

    Parameters (2)
    • E
    • C
  • Intersection between a parabola and another conic.

    Parameters (2)
    • P
    • C
  • Intersection between an hyperbola and another conic.

    Parameters (2)
    • H
    • C
  • IsDone(): boolean

    Returns TRUE if the computation was successful.

  • IsEmpty(): boolean

    Returns TRUE when there is no intersection, i-e.

    • no intersection point
    • the elements are not identical. The element may be parallel in this case.
  • For the intersection between an element of gp and a conic known by an implicit equation, the result will be TRUE if the element of gp verifies the implicit equation. For the intersection between two Lin2d or two Circ2d, the result will be TRUE if the elements are identical. The function returns FALSE in all the other cases.

  • ParallelElements(): boolean

    For the intersection between two Lin2d or two Circ2d, the function returns TRUE if the elements are parallel. The function returns FALSE in all the other cases.

  • NbPoints(): number

    returns the number of IntPoint between the 2 curves.

  • returns the intersection point of range N; If (N<=0) or (N>NbPoints), an exception is raised.

    Parameters (1)
    • N

IntAna2d_Conic

Definition of a conic by its implicit quadaratic equation: A.X2 + B.Y2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0.

Constructors(5)

Instance methods(5)

  • Value(X: number, Y: number): number

    value of the function F at the point X,Y.

    Parameters (2)
    • X
    • Y
  • Grad(X: number, Y: number): gp_XY

    returns the value of the gradient of F at the point X,Y.

    Parameters (2)
    • X
    • Y
  • ValAndGrad(X: number, Y: number, Val: number, Grd: gp_XY): { Val: number }

    Returns the value of the function and its gradient at the point X,Y.

    Parameters (4)
    • X
    • Y
    • Val
    • Grd
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • Val: updated value from the call.
  • Coefficients(A: number, B: number, C: number, D: number, E: number, F: number): { A: number; B: number; C: number; D: number; E: number; F: number }

    returns the coefficients of the polynomial equation which defines the conic: A.X2 + B.Y2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0.

    Parameters (6)
    • A
    • B
    • C
    • D
    • E
    • F
    Returns

    A result object with fields:

    • A: updated value from the call.
    • B: updated value from the call.
    • C: updated value from the call.
    • D: updated value from the call.
    • E: updated value from the call.
    • F: updated value from the call.
  • NewCoefficients(A: number, B: number, C: number, D: number, E: number, F: number, Axis: gp_Ax2d): { A: number; B: number; C: number; D: number; E: number; F: number }

    Returns the coefficients of the polynomial equation ( written in the natural coordinates system ) A x x + B y y + 2 C x y + 2 D x + 2 E y + F in the local coordinates system defined by Axis.

    Parameters (7)
    • A
    • B
    • C
    • D
    • E
    • F
    • Axis
    Returns

    A result object with fields:

    • A: updated value from the call.
    • B: updated value from the call.
    • C: updated value from the call.
    • D: updated value from the call.
    • E: updated value from the call.
    • F: updated value from the call.

IntAna2d_IntPoint

Geometrical intersection between two 2d elements.

Constructors(3)

  • constructor(X: number, Y: number, U1: number): IntAna2d_IntPoint

    Create an intersection point between a parametric 2d line, and a line given by an implicit equation (ImplicitCurve). X,Y are the coordinate of the point. U1 is the parameter on the parametric element. Empty constructor. It's necessary to use one of the SetValue method after this one.

    Parameters (3)
    • X
    • Y
    • U1
  • constructor(X: number, Y: number, U1: number, U2: number): IntAna2d_IntPoint

    Create an intersection point between 2 parametric 2d lines. X,Y are the coordinate of the point. U1 is the parameter on the first element, U2 the parameter on the second one.

    Parameters (4)
    • X
    • Y
    • U1
    • U2

Instance methods(6)

  • SetValue(X: number, Y: number, U1: number, U2: number): void

    Set the values for a "non-implicit" point.

    Parameters (4)
    • X
    • Y
    • U1
    • U2
  • SetValue(X: number, Y: number, U1: number): void

    Set the values for an "implicit" point.

    Parameters (3)
    • X
    • Y
    • U1
  • Returns the geometric point.

  • SecondIsImplicit(): boolean

    Returns True if the second curve is implicit.

  • ParamOnFirst(): number

    Returns the parameter on the first element.

  • ParamOnSecond(): number

    Returns the parameter on the second element. If the second element is an implicit curve, an exception is raised.