OpenCascade.js
API ReferenceModelingAlgorithmsTKGeomAlgo

IntRes2d

OCCT package IntRes2d: IntRes2d_Domain, IntRes2d_Intersection, IntRes2d_IntersectionPoint, IntRes2d_IntersectionSegment, and 4 more bound classes.

IntRes2d_Domain

Definition of the domain of parameter on a 2d-curve. Most of the time, a domain is defined by two extremities. An extremity is made of :

  • a point in 2d-space (Pnt2d from gp),
  • a parameter on the curve,
  • a tolerance in the 2d-space. Sometimes, it can be made of 0 or 1 point ( for an infinite or semi-infinite line for example).
    For Intersection algorithms, Ellipses and Circles Domains must be closed. So, SetEquivalentParameters(.,.) method must be called after initializing the first and the last bounds.

Constructors(3)

  • Creates an infinite Domain (HasFirstPoint = False and HasLastPoint = False).

  • constructor(Pnt: gp_Pnt2d, Par: number, Tol: number, First: boolean): IntRes2d_Domain

    Creates a semi-infinite Domain. If First is set to True, the given point is the first point of the domain, otherwise it is the last point.

    Parameters (4)
    • Pnt
    • Par
    • Tol
    • First
  • constructor(Pnt1: gp_Pnt2d, Par1: number, Tol1: number, Pnt2: gp_Pnt2d, Par2: number, Tol2: number): IntRes2d_Domain

    Creates a bounded Domain.

    Parameters (6)
    • Pnt1
    • Par1
    • Tol1
    • Pnt2
    • Par2
    • Tol2

Instance methods(14)

  • SetValues(Pnt1: gp_Pnt2d, Par1: number, Tol1: number, Pnt2: gp_Pnt2d, Par2: number, Tol2: number): void

    Sets the values for a bounded domain.

    Parameters (6)
    • Pnt1
    • Par1
    • Tol1
    • Pnt2
    • Par2
    • Tol2
  • SetValues(): void

    Sets the values for an infinite domain.

  • SetValues(Pnt: gp_Pnt2d, Par: number, Tol: number, First: boolean): void

    Sets the values for a semi-infinite domain.

    Parameters (4)
    • Pnt
    • Par
    • Tol
    • First
  • SetEquivalentParameters(zero: number, period: number): void

    Defines a closed domain.

    Parameters (2)
    • zero
    • period
  • HasFirstPoint(): boolean

    Returns True if the domain has a first point, i-e a point defining the lowest admitted parameter on the curve.

  • FirstParameter(): number

    Returns the parameter of the first point of the domain The exception DomainError is raised if HasFirstPoint returns False.

  • Returns the first point of the domain. The exception DomainError is raised if HasFirstPoint returns False.

  • FirstTolerance(): number

    Returns the tolerance of the first (left) bound. The exception DomainError is raised if HasFirstPoint returns False.

  • HasLastPoint(): boolean

    Returns True if the domain has a last point, i-e a point defining the highest admitted parameter on the curve.

  • LastParameter(): number

    Returns the parameter of the last point of the domain. The exception DomainError is raised if HasLastPoint returns False.

  • Returns the last point of the domain. The exception DomainError is raised if HasLastPoint returns False.

  • LastTolerance(): number

    Returns the tolerance of the last (right) bound. The exception DomainError is raised if HasLastPoint returns False.

  • IsClosed(): boolean

    Returns True if the domain is closed.

  • EquivalentParameters(zero: number, zeroplusperiod: number): { zero: number; zeroplusperiod: number }

    Returns Equivalent parameters if the domain is closed. Otherwise, the exception DomainError is raised.

    Parameters (2)
    • zero
    • zeroplusperiod
    Returns

    A result object with fields:

    • zero: updated value from the call.
    • zeroplusperiod: updated value from the call.

IntRes2d_Intersection

Defines the root class of all the Intersections between two 2D-Curves, and provides all the methods about the results of the Intersections Algorithms.

Instance methods(7)

  • IsDone(): boolean

    returns TRUE when the computation was successful.

  • IsEmpty(): boolean

    Returns TRUE if there is no intersection between the given arguments. The exception NotDone is raised if IsDone returns FALSE.

  • NbPoints(): number

    This function returns the number of intersection points between the 2 curves. The exception NotDone is raised if IsDone returns FALSE.

  • This function returns the intersection point of range N; The exception NotDone is raised if IsDone returns FALSE. The exception OutOfRange is raised if (N <= 0) or (N > NbPoints).

    Parameters (1)
    • N
  • NbSegments(): number

    This function returns the number of intersection segments between the two curves. The exception NotDone is raised if IsDone returns FALSE.

  • This function returns the intersection segment of range N; The exception NotDone is raised if IsDone returns FALSE. The exception OutOfRange is raised if (N <= 0) or (N > NbPoints).

    Parameters (1)
    • N
  • SetReversedParameters(Reverseflag: boolean): void
    Parameters (1)
    • Reverseflag

IntRes2d_IntersectionPoint

Definition of an intersection point between two 2D curves.

Constructors(2)

Instance methods(6)

IntRes2d_IntersectionSegment

Definition of an intersection curve between two 2D curves.

Constructors(4)

Instance methods(5)

  • IsOpposite(): boolean

    Returns FALSE if the intersection segment has got the same orientation on both curves.

  • HasFirstPoint(): boolean

    Returns True if the segment is limited by a first point. This point defines the lowest parameter admitted on the first curve for the segment. If IsOpposite returns False, it defines the lowest parameter on the second curve, otherwise, it is the highest parameter on the second curve.

  • Returns the first point of the segment as an IntersectionPoint (with a transition). The exception DomainError is raised if HasFirstPoint returns False.

  • HasLastPoint(): boolean

    Returns True if the segment is limited by a last point. This point defines the highest parameter admitted on the first curve for the segment. If IsOpposite returns False, it defines the highest parameter on the second curve, otherwise, it is the lowest parameter on the second curve.

  • Returns the last point of the segment as an IntersectionPoint (with a transition). The exception DomainError is raised if HasLastExtremity returns False.

IntRes2d_Transition

Definition of the type of transition near an intersection point between two curves. The transition is either a "true transition", which means that one of the curves goes inside or outside the area defined by the other curve near the intersection, or a "touch transition" which means that the first curve does not cross the other one, or an "undecided" transition, which means that the curves are superposed.

Constructors(4)

Instance methods(9)

  • SetValue(Tangent: boolean, Pos: IntRes2d_Position, Type: IntRes2d_TypeTrans): void

    Sets the values of an IN or OUT transition.

    Parameters (3)
    • Tangent
    • Pos
    • Type
  • SetValue(Tangent: boolean, Pos: IntRes2d_Position, Situ: IntRes2d_Situation, Oppos: boolean): void

    Sets the values of a TOUCH transition.

    Parameters (4)
    • Tangent
    • Pos
    • Situ
    • Oppos
  • Sets the values of an UNDECIDED transition.

    Parameters (1)
    • Pos
  • Sets the value of the position.

    Parameters (1)
    • Pos
  • Indicates if the intersection is at the beginning (IntRes2d_Head), at the end (IntRes2d_End), or in the middle (IntRes2d_Middle) of the curve.

  • Returns the type of transition at the intersection. It may be IN or OUT or TOUCH, or UNDECIDED if the two first derivatives are not enough to give the tangent to one of the two curves.

  • IsTangent(): boolean

    Returns TRUE when the 2 curves are tangent at the intersection point. Theexception DomainError is raised if the type of transition is UNDECIDED.

  • returns a significant value if TransitionType returns TOUCH. In this case, the function returns : INSIDE when the curve remains inside the other one, OUTSIDE when it remains outside the other one, UNKNOWN when the calculus, based on the second derivatives cannot give the result. If TransitionType returns IN or OUT or UNDECIDED, the exception DomainError is raised.

  • IsOpposite(): boolean

    returns a significant value if TransitionType returns TOUCH. In this case, the function returns true when the 2 curves locally define two different parts of the space. If TransitionType returns IN or OUT or UNDECIDED, the exception DomainError is raised.