libcascade
API ReferenceModelingDataTKGeomBase

ProjLib

OCCT package ProjLib: ProjLib, ProjLib_CompProjectedCurve, ProjLib_ComputeApprox, ProjLib_ComputeApproxOnPolarSurface, and 11 more bound classes.

ProjLib

The ProjLib package first provides projection of curves on a plane along a given Direction. The result will be a 3D curve.
The ProjLib package provides projection of curves on surfaces to compute the curve in the parametric space. It is assumed that the curve is on the surface.
It provides:

  • Package methods to handle the easiest cases:Line, Circle, Ellipse, Parabola, Hyperbola on plane.Line, Circle on cylinder.Line, Circle on cone.
  • Classes to handle the general cases:Plane.Cylinder.Cone.Sphere.Torus.
  • A generic class to handle a Adaptor3d_Curve on a Adaptor3d_Surface.

Constructors(1)

Static methods(18)

ProjLib_CompProjectedCurve

Constructors(4)

Static methods(2)

Instance methods(44)

  • Shallow copy of adaptor.

  • Init(): void

    computes a set of projected point and determine the continuous parts of the projected curves. The points corresponding to a projection on the bounds of the surface are included in this set of points.

  • Perform(): void

    Performs projecting for given curve. If projecting uses approximation, approximation parameters can be set before by corresponding methods SetTol3d(...), SeContinuity(...), SetMaxDegree(...), SetMaxSeg(...)

  • SetTol3d(theTol3d: number): void

    Set the parameter, which defines 3d tolerance of approximation.

    Parameters (1)
    • theTol3d
  • SetContinuity(theContinuity: GeomAbs_Shape): void

    Set the parameter, which defines curve continuity. Default value is GeomAbs_C2;.

    Parameters (1)
    • theContinuity
  • SetMaxDegree(theMaxDegree: number): void

    Set max possible degree of result BSpline curve2d, which is got by approximation. If MaxDegree < 0, algorithm uses values that are chosen depending of types curve 3d and surface.

    Parameters (1)
    • theMaxDegree
  • SetMaxSeg(theMaxSeg: number): void

    Set the parameter, which defines maximal value of parametric intervals the projected curve can be cut for approximation. If MaxSeg < 0, algorithm uses default value = 16.

    Parameters (1)
    • theMaxSeg
  • SetProj2d(theProj2d: boolean): void

    Set the parameter, which defines necessity of 2d results.

    Parameters (1)
    • theProj2d
  • SetProj3d(theProj3d: boolean): void

    Set the parameter, which defines necessity of 3d results.

    Parameters (1)
    • theProj3d
  • Changes the surface.

    Parameters (1)
    • S
  • Changes the curve.

    Parameters (1)
    • C
  • GetTolerance(TolU?: number, TolV?: number): { TolU: number; TolV: number }
    Parameters (2)
    • TolU
    • TolV
  • NbCurves(): number

    returns the number of continuous part of the projected curve

  • Bounds(Index: number, Udeb?: number, Ufin?: number): { Udeb: number; Ufin: number }

    returns the bounds of the continuous part corresponding to Index

    Parameters (3)
    • Index
    • Udeb
    • Ufin
    Returns

    A result object with fields:

    • Udeb: updated value from the call.
    • Ufin: updated value from the call.
  • IsSinglePnt(Index: number, P: gp_Pnt2d): boolean

    returns True if part of projection with number Index is a single point and writes its coordinates in P

    Parameters (2)
    • Index
    • P
      Mutated in place; read the updated value from this argument after the call.
  • IsUIso(Index: number, U?: number): { returnValue: boolean; U: number }

    returns True if part of projection with number Index is an u-isoparametric curve of input surface

    Parameters (2)
    • Index
    • U
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • U: updated value from the call.
  • IsVIso(Index: number, V?: number): { returnValue: boolean; V: number }

    returns True if part of projection with number Index is an v-isoparametric curve of input surface

    Parameters (2)
    • Index
    • V
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • V: updated value from the call.
  • Value(U: number): gp_Pnt2d

    Computes the point of parameter U on the curve.

    Parameters (1)
    • U
  • D0(U: number, P: gp_Pnt2d): void

    Computes the point of parameter U on the curve.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • D1(U: number, P: gp_Pnt2d, V: gp_Vec2d): void

    Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (3)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V
      Mutated in place; read the updated value from this argument after the call.
  • D2(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): void

    Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

    Parameters (4)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
  • DN(U: number, N: number): gp_Vec2d

    The returned vector gives the value of the derivative for the order of derivation N. Raised if N < 1. Raised if N > 2.

    Parameters (2)
    • U
    • N
  • FirstParameter(): number

    Returns the first parameter of the curve C which has a projection on S.

  • LastParameter(): number

    Returns the last parameter of the curve C which has a projection on S.

  • Returns the Continuity used in the approximation.

  • Returns the number of intervals which define an S continuous part of the projected curve.

    Parameters (1)
    • S
  • Trim(FirstParam: number, LastParam: number, Tol: number): Adaptor2d_Curve2d

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 2d points confusion. If <First> >= <Last>

    Parameters (3)
    • FirstParam
    • LastParam
    • Tol
  • Returns the parameters corresponding to S discontinuities.
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • MaxDistance(Index: number): number

    returns the maximum distance between curve to project and surface

    Parameters (1)
    • Index
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • ResultIsPoint(theIndex: number): boolean

    Returns true if result of projecting of the curve interval with number Index is point.

    Parameters (1)
    • theIndex
  • GetResult2dUApproxError(theIndex: number): number

    Returns the error of approximation of U parameter 2d-curve as a result projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult2dVApproxError(theIndex: number): number

    Returns the error of approximation of V parameter 2d-curve as a result projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult3dApproxError(theIndex: number): number

    Returns the error of approximation of 3d-curve as a result projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult2dC(theIndex: number): Geom2d_Curve

    Returns the resulting 2d-curve of projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult3dC(theIndex: number): Geom_Curve

    Returns the resulting 3d-curve of projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult2dP(theIndex: number): gp_Pnt2d

    Returns the resulting 2d-point of projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetResult3dP(theIndex: number): gp_Pnt

    Returns the resulting 3d-point of projecting of the curve interval with number Index.

    Parameters (1)
    • theIndex
  • GetProj2d(): boolean

    Returns the parameter, which defines necessity of only 2d results.

  • GetProj3d(): boolean

    Returns the parameter, which defines necessity of only 3d results.

ProjLib_ComputeApprox

Approximate the projection of a 3d curve on an analytic surface and stores the result in Approx. The result is a 2d curve. For approximation some parameters are used, including required tolerance of approximation. Tolerance is maximal possible value of 3d deviation of 3d projection of projected curve from "exact" 3d projection.
Since algorithm searches 2d curve on surface, required 2d tolerance is computed from 3d tolerance with help of U,V resolutions of surface. 3d and 2d tolerances have sense only for curves on surface, it defines precision of projecting and approximation and have nothing to do with distance between the projected curve and the surface.

Constructors(2)

Instance methods(8)

  • Performs projecting. In case of approximation current values of parameters are used: default values or set by corresponding methods Set...

    Parameters (2)
    • C
    • S
  • SetTolerance(theTolerance: number): void

    Set tolerance of approximation. Default value is Precision::Confusion().

    Parameters (1)
    • theTolerance
  • SetDegree(theDegMin: number, theDegMax: number): void

    Set min and max possible degree of result BSpline curve2d, which is got by approximation. If theDegMin/Max < 0, algorithm uses values that are chosen depending of types curve 3d and surface.

    Parameters (2)
    • theDegMin
    • theDegMax
  • SetMaxSegments(theMaxSegments: number): void

    Set the parameter, which defines maximal value of parametric intervals the projected curve can be cut for approximation. If theMaxSegments < 0, algorithm uses default value = 1000.

    Parameters (1)
    • theMaxSegments
  • Set the parameter, which defines type of boundary condition between segments during approximation. It can be AppParCurves_PassPoint or AppParCurves_TangencyPoint. Default value is AppParCurves_TangencyPoint;.

    Parameters (1)
    • theBndPnt
  • Tolerance(): number

    returns the reached Tolerance.

ProjLib_ComputeApproxOnPolarSurface

Approximate the projection of a 3d curve on an polar surface and stores the result in Approx. The result is a 2d curve. The evaluation of the current point of the 2d curve is done with the evaluation of the extrema P3d - Surface. For approximation some parameters are used, including required tolerance of approximation. Tolerance is maximal possible value of 3d deviation of 3d projection of projected curve from "exact" 3d projection.
Since algorithm searches 2d curve on surface, required 2d tolerance is computed from 3d tolerance with help of U,V resolutions of surface. 3d and 2d tolerances have sense only for curves on surface, it defines precision of projecting and approximation and have nothing to do with distance between the projected curve and the surface.

Constructors(4)

Instance methods(13)

  • SetDegree(theDegMin: number, theDegMax: number): void

    Set min and max possible degree of result BSpline curve2d, which is got by approximation. If theDegMin/Max < 0, algorithm uses values min = 2, max = 8.

    Parameters (2)
    • theDegMin
    • theDegMax
  • SetMaxSegments(theMaxSegments: number): void

    Set the parameter, which defines maximal value of parametric intervals the projected curve can be cut for approximation. If theMaxSegments < 0, algorithm uses default value = 1000.

    Parameters (1)
    • theMaxSegments
  • Set the parameter, which defines type of boundary condition between segments during approximation. It can be AppParCurves_PassPoint or AppParCurves_TangencyPoint. Default value is AppParCurves_TangencyPoint.

    Parameters (1)
    • theBndPnt
  • SetMaxDist(theMaxDist: number): void

    Set the parameter, which defines maximal possible distance between projected curve and surface. It is used only for projecting on not analytical surfaces. If theMaxDist < 0, algorithm uses default value 100.*Tolerance. If real distance between curve and surface more then theMaxDist, algorithm stops working.

    Parameters (1)
    • theMaxDist
  • SetTolerance(theTolerance: number): void

    Set the tolerance used to project the curve on the surface. Default value is Precision::Approximation().

    Parameters (1)
    • theTolerance
  • Method, which performs projecting, using default values of parameters or they must be set by corresponding methods before using.

    Parameters (2)
    • C
    • S
  • Method, which performs projecting, using default values of parameters or they must be set by corresponding methods before using. Parameter InitCurve2d is any rough estimation of 2d result curve.

    Parameters (3)
    • InitCurve2d
    • C
    • S
  • Builds initial 2d curve as BSpline with degree = 1 using Extrema algorithm. Method is used in method Perform(...).

    Parameters (2)
    • Curve
    • S
  • Method, which performs projecting. Method is used in method Perform(...).

    Parameters (3)
    • Curve
    • S
    • InitCurve2d
  • Returns result curve 2d.

  • Returns second 2d curve.

  • IsDone(): boolean
  • Tolerance(): number

    returns the reached Tolerance.

ProjLib_Cone

Projects elementary curves on a cone.

Constructors(4)

Instance methods(6)

ProjLib_Cylinder

Projects elementary curves on a cylinder.

Constructors(5)

Instance methods(6)

ProjLib_Plane

Projects elementary curves on a plane.

Constructors(7)

Instance methods(6)

ProjLib_PrjFunc

Constructors(1)

Instance methods(6)

ProjLib_PrjResolve

Constructors(1)

Instance methods(3)

  • Perform(t: number, U: number, V: number, Tol: gp_Pnt2d, Inf: gp_Pnt2d, Sup: gp_Pnt2d, FTol?: number, StrictInside?: boolean): void

    Calculates the ort from C(t) to S with a close point. The close point is defined by the parameter values U0 and V0. The function F(u,v)=distance(S(u,v),C(t)) has an extremum when gradient(F)=0. The algorithm searches a zero near the close point.

    Parameters (8)
    • t
    • U
    • V
    • Tol
    • Inf
    • Sup
    • FTol
    • StrictInside
  • IsDone(): boolean

    Returns True if the distance is found.

  • Returns the point of the extremum distance.

ProjLib_ProjectOnPlane

Class used to project a 3d curve on a plane. The result will be a 3d curve.
You can ask the projected curve to have the same parametrization as the original curve.
The projection can be done along every direction not parallel to the plane.

Constructors(3)

Instance methods(33)

  • Shallow copy of adaptor.

  • Load(C: Adaptor3d_Curve, Tolerance: number, KeepParametrization?: boolean): void

    Sets the Curve and perform the projection. if <KeepParametrization> is true, the parametrization of the Projected Curve <PC> will be the same as the parametrization of the initial curve . It means: proj(C(u)) = PC(u) for each u. Otherwise, the parametrization may change.

    Parameters (3)
    • C
    • Tolerance
    • KeepParametrization
  • FirstParameter(): number
  • LastParameter(): number
  • If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity .
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Trim(First: number, Last: number, Tol: number): Adaptor3d_Curve

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>

    Parameters (3)
    • First
    • Last
    • Tol
  • IsClosed(): boolean
  • IsPeriodic(): boolean
  • Period(): number
  • EvalD0(theU: number): gp_Pnt

    Computes the point of parameter theU on the curve.

    Parameters (1)
    • theU
  • EvalD1(theU: number): Geom_Curve_ResD1

    Computes the point of parameter theU on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (1)
    • theU
  • EvalD2(theU: number): Geom_Curve_ResD2

    Returns the point and the first and second derivatives at parameter theU. Raised if the continuity of the current interval is not C2.

    Parameters (1)
    • theU
  • EvalD3(theU: number): Geom_Curve_ResD3

    Returns the point and the first, second and third derivatives at parameter theU. Raised if the continuity of the current interval is not C3.

    Parameters (1)
    • theU
  • EvalDN(theU: number, theN: number): gp_Vec

    Returns the derivative of order theN at parameter theU. Raised if the continuity of the current interval is not CN. Raised if theN < 1.

    Parameters (2)
    • theU
    • theN
  • Resolution(R3d: number): number

    Returns the parametric resolution corresponding to the real space resolution <R3d>.

    Parameters (1)
    • R3d
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • Degree(): number
  • IsRational(): boolean
  • NbPoles(): number
  • NbKnots(): number
  • Warning ! this will NOT make a copy of the Bezier Curve : If you want to modify the Curve please make a copy yourself Also it will NOT trim the surface to myFirst/Last.

  • Warning ! this will NOT make a copy of the BSpline Curve : If you want to modify the Curve please make a copy yourself Also it will NOT trim the surface to myFirst/Last.

ProjLib_ProjectOnSurface

Project a curve on a surface. The result (a 3D Curve) will be an approximation.

Constructors(2)

Instance methods(4)

ProjLib_ProjectedCurve

Compute the 2d-curve. Try to solve the particular case if possible. Otherwise, an approximation is done. For approximation some parameters are used, including required tolerance of approximation. Tolerance is maximal possible value of 3d deviation of 3d projection of projected curve from "exact" 3d projection.
Since algorithm searches 2d curve on surface, required 2d tolerance is computed from 3d tolerance with help of U,V resolutions of surface. 3d and 2d tolerances have sense only for curves on surface, it defines precision of projecting and approximation and have nothing to do with distance between the projected curve and the surface.

Constructors(4)

Static methods(2)

Instance methods(40)

  • Shallow copy of adaptor.

  • Load(Tolerance: number): void

    Changes the tolerance used to project the curve on the surface.

    Parameters (1)
    • Tolerance
  • Changes the Surface.

    Parameters (1)
    • S
  • Performs projecting for given curve. If projecting uses approximation, approximation parameters can be set before by corresponding methods SetDegree(...), SetMaxSegmets(...), SetBndPnt(...), SetMaxDist(...)

    Parameters (1)
    • C
  • SetDegree(theDegMin: number, theDegMax: number): void

    Set min and max possible degree of result BSpline curve2d, which is got by approximation. If theDegMin/Max < 0, algorithm uses values that are chosen depending of types curve 3d and surface.

    Parameters (2)
    • theDegMin
    • theDegMax
  • SetMaxSegments(theMaxSegments: number): void

    Set the parameter, which defines maximal value of parametric intervals the projected curve can be cut for approximation. If theMaxSegments < 0, algorithm uses default value = 1000.

    Parameters (1)
    • theMaxSegments
  • Set the parameter, which defines type of boundary condition between segments during approximation. It can be AppParCurves_PassPoint or AppParCurves_TangencyPoint. Default value is AppParCurves_TangencyPoint;.

    Parameters (1)
    • theBndPnt
  • SetMaxDist(theMaxDist: number): void

    Set the parameter, which degines maximal possible distance between projected curve and surface. It uses only for projecting on not analytical surfaces. If theMaxDist < 0, algorithm uses default value 100.*Tolerance. If real distance between curve and surface more then theMaxDist, algorithm stops working.

    Parameters (1)
    • theMaxDist
  • GetTolerance(): number

    returns the tolerance reached if an approximation is Done.

  • FirstParameter(): number
  • LastParameter(): number
  • If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity .
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Trim(First: number, Last: number, Tol: number): Adaptor2d_Curve2d

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>

    Parameters (3)
    • First
    • Last
    • Tol
  • IsClosed(): boolean
  • IsPeriodic(): boolean
  • Period(): number
  • Value(U: number): gp_Pnt2d

    Computes the point of parameter U on the curve.

    Parameters (1)
    • U
  • D0(U: number, P: gp_Pnt2d): void

    Computes the point of parameter U on the curve.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • D1(U: number, P: gp_Pnt2d, V: gp_Vec2d): void

    Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (3)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V
      Mutated in place; read the updated value from this argument after the call.
  • D2(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): void

    Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

    Parameters (4)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
  • D3(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): void

    Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.

    Parameters (5)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
    • V3
      Mutated in place; read the updated value from this argument after the call.
  • DN(U: number, N: number): gp_Vec2d

    The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.

    Parameters (2)
    • U
    • N
  • Resolution(R3d: number): number

    Returns the parametric resolution corresponding to the real space resolution <R3d>.

    Parameters (1)
    • R3d
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • Degree(): number
  • IsRational(): boolean
  • NbPoles(): number
  • NbKnots(): number
  • Warning! This will NOT make a copy of the Bezier Curve If you want to modify the Curve please make a copy yourself. Also it will NOT trim the surface to myFirst/Last.

  • Warning! This will NOT make a copy of the BSpline Curve If you want to modify the Curve please make a copy yourself. Also it will NOT trim the surface to myFirst/Last.

ProjLib_Projector

Root class for projection algorithms, stores the result.

Constructors(1)

Instance methods(22)

ProjLib_Sphere

Projects elementary curves on a sphere.

Constructors(3)

Instance methods(7)

ProjLib_Torus

Projects elementary curves on a torus.

Constructors(3)

Instance methods(6)