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)PntParTolFirst
- constructor(Pnt1: gp_Pnt2d, Par1: number, Tol1: number, Pnt2: gp_Pnt2d, Par2: number, Tol2: number): IntRes2d_Domain
Creates a bounded Domain.
Parameters (6)Pnt1Par1Tol1Pnt2Par2Tol2
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)Pnt1Par1Tol1Pnt2Par2Tol2
- SetValues(): void
Sets the values for an infinite domain.
Sets the values for a semi-infinite domain.
Parameters (4)PntParTolFirst
- SetEquivalentParameters(zero: number, period: number): void
Defines a closed domain.
Parameters (2)zeroperiod
- 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)zerozeroplusperiod
ReturnsA 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.
- Point(N: number): IntRes2d_IntersectionPoint
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.
- Segment(N: number): IntRes2d_IntersectionSegment
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): voidParameters (1)
Reverseflag
IntRes2d_IntersectionPoint
Definition of an intersection point between two 2D curves.
Constructors(2)
Empty constructor.
- constructor(P: gp_Pnt2d, Uc1: number, Uc2: number, Trans1: IntRes2d_Transition, Trans2: IntRes2d_Transition, ReversedFlag: boolean): IntRes2d_IntersectionPoint
Creates an IntersectionPoint. if ReversedFlag is False, the parameter Uc1(resp. Uc2) and the Transition Trans1 (resp. Trans2) refer to the first curve (resp. second curve) otherwise Uc1 and Trans1 (resp. Uc2 and Trans2) refer to the second curve (resp. the first curve).
Parameters (6)PUc1Uc2Trans1Trans2ReversedFlag
Instance methods(6)
- SetValues(P: gp_Pnt2d, Uc1: number, Uc2: number, Trans1: IntRes2d_Transition, Trans2: IntRes2d_Transition, ReversedFlag: boolean): void
Sets the values for an existing intersection point. The meaning of the parameters are the same as for the Create.
Parameters (6)PUc1Uc2Trans1Trans2ReversedFlag
Returns the value of the coordinates of the intersection point in the 2D space.
- ParamOnFirst(): number
Returns the parameter on the first curve.
- ParamOnSecond(): number
Returns the parameter on the second curve.
Returns the transition of the 1st curve compared to the 2nd one.
returns the transition of the 2nd curve compared to the 1st one.
IntRes2d_IntersectionSegment
Definition of an intersection curve between two 2D curves.
Constructors(4)
Empty constructor.
- constructor(Oppos: boolean): IntRes2d_IntersectionSegment
Creates an infinite segment of intersection.
Parameters (1)Oppos
- constructor(P1: IntRes2d_IntersectionPoint, P2: IntRes2d_IntersectionPoint, Oppos: boolean, ReverseFlag: boolean): IntRes2d_IntersectionSegmentParameters (4)
P1P2OpposReverseFlag
- constructor(P: IntRes2d_IntersectionPoint, First: boolean, Oppos: boolean, ReverseFlag: boolean): IntRes2d_IntersectionSegmentParameters (4)
PFirstOpposReverseFlag
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_Position
Properties(3)
IntRes2d_Situation
Properties(3)
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)
Empty constructor.
Creates an UNDECIDED transition.
Parameters (1)Pos
- constructor(Tangent: boolean, Pos: IntRes2d_Position, Type: IntRes2d_TypeTrans): IntRes2d_Transition
Creates an IN or OUT transition.
Parameters (3)TangentPosType
- constructor(Tangent: boolean, Pos: IntRes2d_Position, Situ: IntRes2d_Situation, Oppos: boolean): IntRes2d_Transition
Creates a TOUCH transition.
Parameters (4)TangentPosSituOppos
Instance methods(9)
- SetValue(Tangent: boolean, Pos: IntRes2d_Position, Type: IntRes2d_TypeTrans): void
Sets the values of an IN or OUT transition.
Parameters (3)TangentPosType
- SetValue(Tangent: boolean, Pos: IntRes2d_Position, Situ: IntRes2d_Situation, Oppos: boolean): void
Sets the values of a TOUCH transition.
Parameters (4)TangentPosSituOppos
- SetValue(Pos: IntRes2d_Position): void
Sets the values of an UNDECIDED transition.
Parameters (1)Pos
- SetPosition(Pos: IntRes2d_Position): void
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.