OpenCascade.js
API ReferenceModelingAlgorithmsTKGeomAlgo

GeomAPI

OCCT package GeomAPI: GeomAPI, GeomAPI_ExtremaCurveCurve, GeomAPI_ExtremaCurveSurface, GeomAPI_ExtremaSurfaceSurface, and 7 more bound classes.

GeomAPI

The GeomAPI package provides an Application Programming Interface for the Geometry.
The API is a set of classes and methods aiming to provide :

  • High level and simple calls for the most common operations.
  • Keeping an access on the low-level implementation of high-level calls.
    The API provides classes to call the algorithms of the Geometry
  • The constructors of the classes provides the different constructions methods.
  • The class keeps as fields the different tools used by the algorithms
  • The class provides a casting method to get automatically the result with a function-like call.
    For example to evaluate the distance <D> between a point
    and a curve , one can writes :
    D = GeomAPI_ProjectPointOnCurve(P,C);
    or
    GeomAPI_ProjectPointOnCurve PonC(P,C); D = PonC.LowerDistance();

Constructors(1)

Static methods(2)

  • This function builds (in the parametric space of the plane P) a 2D curve equivalent to the 3D curve C. The 3D curve C is considered to be located in the plane P. Warning The 3D curve C must be of one of the following types:

    • a line
    • a circle
    • an ellipse
    • a hyperbola
    • a parabola
    • a Bezier curve
    • a BSpline curve Exceptions Standard_NoSuchObject if C is not a defined type curve.
    Parameters (2)
    • C
    • P
  • Builds a 3D curve equivalent to the 2D curve C described in the parametric space defined by the local coordinate system of plane P. The resulting 3D curve is of the same nature as that of the curve C.

    Parameters (2)
    • C
    • P

GeomAPI_ExtremaCurveCurve

Describes functions for computing all the extrema between two 3D curves. An ExtremaCurveCurve algorithm minimizes or maximizes the distance between a point on the first curve and a point on the second curve. Thus, it computes start and end points of perpendiculars common to the two curves (an intersection point is not an extremum unless the two curves are tangential at this point). Solutions consist of pairs of points, and an extremum is considered to be a segment joining the two points of a solution. An ExtremaCurveCurve object provides a framework for:

  • defining the construction of the extrema,
  • implementing the construction algorithm, and
  • consulting the results. Warning In some cases, the nearest points between two curves do not correspond to one of the computed extrema. Instead, they may be given by:
  • a limit point of one curve and one of the following:
  • its orthogonal projection on the other curve,
  • a limit point of the other curve; or
  • an intersection point between the two curves.

Constructors(3)

  • Constructs an empty algorithm for computing extrema between two curves. Use an Init function to define the curves on which it is going to work.

  • Computes the extrema between the curves C1 and C2.

    Parameters (2)
    • C1
    • C2
  • constructor(C1: Geom_Curve, C2: Geom_Curve, U1min: number, U1max: number, U2min: number, U2max: number): GeomAPI_ExtremaCurveCurve

    Computes the portion of the curve C1 limited by the two points of parameter (U1min,U1max), and.

    • the portion of the curve C2 limited by the two points of parameter (U2min,U2max). Warning Use the function NbExtrema to obtain the number of solutions. If this algorithm fails, NbExtrema returns 0.
    Parameters (6)
    • C1
    • C2
    • U1min
    • U1max
    • U2min
    • U2max

Instance methods(13)

  • Init(C1: Geom_Curve, C2: Geom_Curve): void

    Initializes this algorithm with the given arguments and computes the extrema between the curves C1 and C2.

    Parameters (2)
    • C1
    • C2
  • Init(C1: Geom_Curve, C2: Geom_Curve, U1min: number, U1max: number, U2min: number, U2max: number): void

    Initializes this algorithm with the given arguments and computes the extrema between :

    • the portion of the curve C1 limited by the two points of parameter (U1min,U1max), and
    • the portion of the curve C2 limited by the two points of parameter (U2min,U2max). Warning Use the function NbExtrema to obtain the number of solutions. If this algorithm fails, NbExtrema returns 0.
    Parameters (6)
    • C1
    • C2
    • U1min
    • U1max
    • U2min
    • U2max
  • NbExtrema(): number

    Returns the number of extrema computed by this algorithm. Note: if this algorithm fails, NbExtrema returns 0.

  • Points(Index: number, P1: gp_Pnt, P2: gp_Pnt): void

    Returns the points P1 on the first curve and P2 on the second curve, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (3)
    • Index
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • Parameters(Index: number, U1: number, U2: number): { U1: number; U2: number }

    Returns the parameters U1 of the point on the first curve and U2 of the point on the second curve, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (3)
    • Index
    • U1
    • U2
    Returns

    A result object with fields:

    • U1: updated value from the call.
    • U2: updated value from the call.
  • Distance(Index: number): number

    Computes the distance between the end points of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (1)
    • Index
  • IsParallel(): boolean

    Returns True if the two curves are parallel.

  • NearestPoints(P1: gp_Pnt, P2: gp_Pnt): void

    Returns the points P1 on the first curve and P2 on the second curve, which are the ends of the shortest extremum computed by this algorithm. Exceptions StdFail_NotDone if this algorithm fails.

    Parameters (2)
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • LowerDistanceParameters(U1: number, U2: number): { U1: number; U2: number }

    Returns the parameters U1 of the point on the first curve and U2 of the point on the second curve, which are the ends of the shortest extremum computed by this algorithm. Exceptions StdFail_NotDone if this algorithm fails.

    Parameters (2)
    • U1
    • U2
    Returns

    A result object with fields:

    • U1: updated value from the call.
    • U2: updated value from the call.
  • LowerDistance(): number

    Computes the distance between the end points of the shortest extremum computed by this algorithm. Exceptions StdFail_NotDone if this algorithm fails.

  • TotalNearestPoints(P1: gp_Pnt, P2: gp_Pnt): boolean

    set in <P1> and <P2> the couple solution points such a the distance [P1,P2] is the minimum. taking in account extremity points of curves.

    Parameters (2)
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • TotalLowerDistanceParameters(U1: number, U2: number): { returnValue: boolean; U1: number; U2: number }

    set in <U1> and <U2> the parameters of the couple solution points which represents the total nearest solution.

    Parameters (2)
    • U1
    • U2
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • U1: updated value from the call.
    • U2: updated value from the call.
  • return the distance of the total nearest couple solution point. if <myExtCC> is not done

GeomAPI_ExtremaCurveSurface

Describes functions for computing all the extrema between a curve and a surface. An ExtremaCurveSurface algorithm minimizes or maximizes the distance between a point on the curve and a point on the surface. Thus, it computes start and end points of perpendiculars common to the curve and the surface (an intersection point is not an extremum except where the curve and the surface are tangential at this point). Solutions consist of pairs of points, and an extremum is considered to be a segment joining the two points of a solution. An ExtremaCurveSurface object provides a framework for:

  • defining the construction of the extrema,
  • implementing the construction algorithm, and
  • consulting the results. Warning In some cases, the nearest points between a curve and a surface do not correspond to one of the computed extrema. Instead, they may be given by:
  • a point of a bounding curve of the surface and one of the following:
  • its orthogonal projection on the curve,
  • a limit point of the curve; or
  • a limit point of the curve and its projection on the surface; or
  • an intersection point between the curve and the surface.

Constructors(3)

  • Constructs an empty algorithm for computing extrema between a curve and a surface. Use an Init function to define the curve and the surface on which it is going to work.

  • Computes the extrema distances between the curve and the surface .

    Parameters (2)
    • Curve
    • Surface
  • constructor(Curve: Geom_Curve, Surface: Geom_Surface, Wmin: number, Wmax: number, Umin: number, Umax: number, Vmin: number, Vmax: number): GeomAPI_ExtremaCurveSurface

    Computes the extrema distances between the curve and the surface . The solution point are computed in the domain [Wmin,Wmax] of the curve and in the domain [Umin,Umax] [Vmin,Vmax] of the surface. Warning Use the function NbExtrema to obtain the number of solutions. If this algorithm fails, NbExtrema returns 0.

    Parameters (8)
    • Curve
    • Surface
    • Wmin
    • Wmax
    • Umin
    • Umax
    • Vmin
    • Vmax

Instance methods(10)

  • Init(Curve: Geom_Curve, Surface: Geom_Surface): void

    Computes the extrema distances between the curve and the surface .

    Parameters (2)
    • Curve
    • Surface
  • Init(Curve: Geom_Curve, Surface: Geom_Surface, Wmin: number, Wmax: number, Umin: number, Umax: number, Vmin: number, Vmax: number): void

    Computes the extrema distances between the curve and the surface . The solution point are computed in the domain [Wmin,Wmax] of the curve and in the domain [Umin,Umax] [Vmin,Vmax] of the surface. Warning Use the function NbExtrema to obtain the number of solutions. If this algorithm fails, NbExtrema returns 0.

    Parameters (8)
    • Curve
    • Surface
    • Wmin
    • Wmax
    • Umin
    • Umax
    • Vmin
    • Vmax
  • NbExtrema(): number

    Returns the number of extrema computed by this algorithm. Note: if this algorithm fails, NbExtrema returns 0.

  • Points(Index: number, P1: gp_Pnt, P2: gp_Pnt): void

    Returns the points P1 on the curve and P2 on the surface, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (3)
    • Index
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • Parameters(Index: number, W: number, U: number, V: number): { W: number; U: number; V: number }

    Returns the parameters W of the point on the curve, and (U,V) of the point on the surface, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (4)
    • Index
    • W
    • U
    • V
    Returns

    A result object with fields:

    • W: updated value from the call.
    • U: updated value from the call.
    • V: updated value from the call.
  • Distance(Index: number): number

    Computes the distance between the end points of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (1)
    • Index
  • IsParallel(): boolean

    Returns True if the curve is on a parallel surface.

  • NearestPoints(PC: gp_Pnt, PS: gp_Pnt): void

    Returns the points PC on the curve and PS on the surface, which are the ends of the shortest extremum computed by this algorithm. Exceptions - StdFail_NotDone if this algorithm fails.

    Parameters (2)
    • PC
      Mutated in place; read the updated value from this argument after the call.
    • PS
      Mutated in place; read the updated value from this argument after the call.
  • LowerDistanceParameters(W: number, U: number, V: number): { W: number; U: number; V: number }

    Returns the parameters W of the point on the curve and (U,V) of the point on the surface, which are the ends of the shortest extremum computed by this algorithm. Exceptions - StdFail_NotDone if this algorithm fails.

    Parameters (3)
    • W
    • U
    • V
    Returns

    A result object with fields:

    • W: updated value from the call.
    • U: updated value from the call.
    • V: updated value from the call.
  • LowerDistance(): number

    Computes the distance between the end points of the shortest extremum computed by this algorithm. Exceptions - StdFail_NotDone if this algorithm fails.

GeomAPI_ExtremaSurfaceSurface

Describes functions for computing all the extrema between two surfaces. An ExtremaSurfaceSurface algorithm minimizes or maximizes the distance between a point on the first surface and a point on the second surface. Results are start and end points of perpendiculars common to the two surfaces. Solutions consist of pairs of points, and an extremum is considered to be a segment joining the two points of a solution. An ExtremaSurfaceSurface object provides a framework for:

  • defining the construction of the extrema,
  • implementing the construction algorithm, and
  • consulting the results. Warning In some cases, the nearest points between the two surfaces do not correspond to one of the computed extrema. Instead, they may be given by:
  • a point of a bounding curve of one surface and one of the following:
  • its orthogonal projection on the other surface,
  • a point of a bounding curve of the other surface; or
  • any point on intersection curves between the two surfaces.

Constructors(3)

  • Constructs an empty algorithm for computing extrema between two surfaces. Use an Init function to define the surfaces on which it is going to work.

  • Computes the extrema distances between the surfaces <S1> and <S2>.

    Parameters (2)
    • S1
    • S2
  • constructor(S1: Geom_Surface, S2: Geom_Surface, U1min: number, U1max: number, V1min: number, V1max: number, U2min: number, U2max: number, V2min: number, V2max: number): GeomAPI_ExtremaSurfaceSurface

    Computes the extrema distances between the portion of the surface S1 limited by the two values of parameter (U1min,U1max) in the u parametric direction, and by the two values of parameter (V1min,V1max) in the v parametric direction, and.

    • the portion of the surface S2 limited by the two values of parameter (U2min,U2max) in the u parametric direction, and by the two values of parameter (V2min,V2max) in the v parametric direction.
    Parameters (10)
    • S1
    • S2
    • U1min
    • U1max
    • V1min
    • V1max
    • U2min
    • U2max
    • V2min
    • V2max

Instance methods(11)

  • Initializes this algorithm with the given arguments and computes the extrema distances between the surfaces <S1> and <S2>.

    Parameters (2)
    • S1
    • S2
  • Init(S1: Geom_Surface, S2: Geom_Surface, U1min: number, U1max: number, V1min: number, V1max: number, U2min: number, U2max: number, V2min: number, V2max: number): void

    Initializes this algorithm with the given arguments and computes the extrema distances between - the portion of the surface S1 limited by the two values of parameter (U1min,U1max) in the u parametric direction, and by the two values of parameter (V1min,V1max) in the v parametric direction, and.

    • the portion of the surface S2 limited by the two values of parameter (U2min,U2max) in the u parametric direction, and by the two values of parameter (V2min,V2max) in the v parametric direction.
    Parameters (10)
    • S1
    • S2
    • U1min
    • U1max
    • V1min
    • V1max
    • U2min
    • U2max
    • V2min
    • V2max
  • NbExtrema(): number

    Returns the number of extrema computed by this algorithm. Note: if this algorithm fails, NbExtrema returns 0.

  • Points(Index: number, P1: gp_Pnt, P2: gp_Pnt): void

    Returns the points P1 on the first surface and P2 on the second surface, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (3)
    • Index
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • Parameters(Index: number, U1: number, V1: number, U2: number, V2: number): { U1: number; V1: number; U2: number; V2: number }

    Returns the parameters (U1,V1) of the point on the first surface, and (U2,V2) of the point on the second surface, which are the ends of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (5)
    • Index
    • U1
    • V1
    • U2
    • V2
    Returns

    A result object with fields:

    • U1: updated value from the call.
    • V1: updated value from the call.
    • U2: updated value from the call.
    • V2: updated value from the call.
  • Distance(Index: number): number

    Computes the distance between the end points of the extremum of index Index computed by this algorithm. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbExtrema ], where NbExtrema is the number of extrema computed by this algorithm.

    Parameters (1)
    • Index
  • IsParallel(): boolean

    Returns True if the surfaces are parallel.

  • NearestPoints(P1: gp_Pnt, P2: gp_Pnt): void

    Returns the points P1 on the first surface and P2 on the second surface, which are the ends of the shortest extremum computed by this algorithm. Exceptions StdFail_NotDone if this algorithm fails.

    Parameters (2)
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
  • LowerDistanceParameters(U1: number, V1: number, U2: number, V2: number): { U1: number; V1: number; U2: number; V2: number }

    Returns the parameters (U1,V1) of the point on the first surface and (U2,V2) of the point on the second surface, which are the ends of the shortest extremum computed by this algorithm. Exceptions - StdFail_NotDone if this algorithm fails.

    Parameters (4)
    • U1
    • V1
    • U2
    • V2
    Returns

    A result object with fields:

    • U1: updated value from the call.
    • V1: updated value from the call.
    • U2: updated value from the call.
    • V2: updated value from the call.
  • LowerDistance(): number

    Computes the distance between the end points of the shortest extremum computed by this algorithm. Exceptions StdFail_NotDone if this algorithm fails.

  • return the algorithmic object from Extrema

GeomAPI_IntCS

This class implements methods for computing intersection points and segments between a.

Constructors(2)

  • Creates an empty object. Use the function Perform for further initialization of the algorithm by the curve and the surface.

  • Computes the intersections between the curve C and the surface S. Warning Use function IsDone to verify that the intersections are computed successfully.

    Parameters (2)
    • C
    • S

Instance methods(8)

  • This function Initializes an algorithm with the curve C and the surface S and computes the intersections between C and S. Warning Use function IsDone to verify that the intersections are computed successfully.

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

    Returns true if the intersections are successfully computed.

  • NbPoints(): number

    Returns the number of Intersection Points if IsDone returns True. else NotDone is raised.

  • Point(Index: number): gp_Pnt

    Returns the Intersection Point of range <Index>in case of cross intersection. Raises NotDone if the computation has failed or if the computation has not been done raises OutOfRange if Index is not in the range <1..NbPoints>.

    Parameters (1)
    • Index
  • Parameters(Index: number, U: number, V: number, W: number): { U: number; V: number; W: number }

    Returns parameter W on the curve and (parameters U,V) on the surface of the computed intersection point of index Index in case of cross intersection. Exceptions StdFail_NotDone if intersection algorithm fails or is not initialized. Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of computed intersection points.

    Parameters (4)
    • Index
    • U
    • V
    • W
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
    • W: updated value from the call.
  • Parameters(Index: number, U1: number, V1: number, U2: number, V2: number): { U1: number; V1: number; U2: number; V2: number }

    Returns the parameters of the first (U1,V1) and the last (U2,V2) points of curve's segment on the surface in case of tangential intersection. Index is the number of computed intersection segments. Exceptions StdFail_NotDone if intersection algorithm fails or is not initialized. Standard_OutOfRange if Index is not in the range [ 1,NbSegments ], where NbSegments is the number of computed intersection segments.

    Parameters (5)
    • Index
    • U1
    • V1
    • U2
    • V2
    Returns

    A result object with fields:

    • U1: updated value from the call.
    • V1: updated value from the call.
    • U2: updated value from the call.
    • V2: updated value from the call.
  • NbSegments(): number

    Returns the number of computed intersection segments in case of tangential intersection. Exceptions StdFail_NotDone if the intersection algorithm fails or is not initialized.

  • Segment(Index: number): Geom_Curve

    Returns the computed intersection segment of index Index in case of tangential intersection. Intersection segment is a portion of the initial curve tangent to surface. Exceptions StdFail_NotDone if intersection algorithm fails or is not initialized. Standard_OutOfRange if Index is not in the range [ 1,NbSegments ], where NbSegments is the number of computed intersection segments.

    Parameters (1)
    • Index

GeomAPI_Interpolate

This class is used to interpolate a BsplineCurve passing through an array of points, with a C2 Continuity if tangency is not requested at the point. If tangency is requested at the point the continuity will be C1. If Perodicity is requested the curve will be closed and the junction will be the first point given. The curve will than be only C1 Describes functions for building a constrained 3D BSpline curve. The curve is defined by a table of points through which it passes, and if required:

  • by a parallel table of reals which gives the value of the parameter of each point through which the resulting BSpline curve passes, and
  • by vectors tangential to these points. An Interpolate object provides a framework for:
  • defining the constraints of the BSpline curve,
  • implementing the interpolation algorithm, and
  • consulting the results.

Constructors(2)

  • constructor(Points: NCollection_HArray1_gp_Pnt, PeriodicFlag: boolean, Tolerance: number): GeomAPI_Interpolate

    Initializes an algorithm for constructing a constrained BSpline curve passing through the points of the table Points. Tangential vectors can then be assigned, using the function Load. If PeriodicFlag is true, the constrained BSpline curve will be periodic and closed. In this case, the junction point is the first point of the table Points. The tolerance value Tolerance is used to check that:

    • points are not too close to each other, or
    • tangential vectors (defined using the function Load) are not too small. The resulting BSpline curve will be "C2" continuous, except where a tangency constraint is defined on a point through which the curve passes (by using the Load function). In this case, it will be only "C1" continuous. Once all the constraints are defined, use the function Perform to compute the curve. Warning
    • There must be at least 2 points in the table Points.
    • If PeriodicFlag is false, there must be as many parameters in the array Parameters as there are points in the array Points.
    • If PeriodicFlag is true, there must be one more parameter in the table Parameters: this is used to give the parameter on the resulting BSpline curve of the junction point of the curve (which is also the first point of the table Points). Exceptions
    • Standard_ConstructionError if the distance between two consecutive points in the table Points is less than or equal to Tolerance.
    • Standard_OutOfRange if:
    • there are less than two points in the table Points, or
    • conditions relating to the respective number of elements in the parallel tables Points and Parameters are not respected.
    Parameters (3)
    • Points
    • PeriodicFlag
    • Tolerance
  • constructor(Points: NCollection_HArray1_gp_Pnt, Parameters: NCollection_HArray1_double, PeriodicFlag: boolean, Tolerance: number): GeomAPI_Interpolate

    Initializes an algorithm for constructing a constrained BSpline curve passing through the points of the table Points, where the parameters of each of its points are given by the parallel table Parameters. Tangential vectors can then be assigned, using the function Load. If PeriodicFlag is true, the constrained BSpline curve will be periodic and closed. In this case, the junction point is the first point of the table Points. The tolerance value Tolerance is used to check that:

    • points are not too close to each other, or
    • tangential vectors (defined using the function Load) are not too small. The resulting BSpline curve will be "C2" continuous, except where a tangency constraint is defined on a point through which the curve passes (by using the Load function). In this case, it will be only "C1" continuous. Once all the constraints are defined, use the function Perform to compute the curve. Warning
    • There must be at least 2 points in the table Points.
    • If PeriodicFlag is false, there must be as many parameters in the array Parameters as there are points in the array Points.
    • If PeriodicFlag is true, there must be one more parameter in the table Parameters: this is used to give the parameter on the resulting BSpline curve of the junction point of the curve (which is also the first point of the table Points). Exceptions
    • Standard_ConstructionError if the distance between two consecutive points in the table Points is less than or equal to Tolerance.
    • Standard_OutOfRange if:
    • there are less than two points in the table Points, or
    • conditions relating to the respective number of elements in the parallel tables Points and Parameters are not respected.
    Parameters (4)
    • Points
    • Parameters
    • PeriodicFlag
    • Tolerance

Instance methods(5)

  • Load(InitialTangent: gp_Vec, FinalTangent: gp_Vec, Scale: boolean): void

    Assigns this constrained BSpline curve to be tangential to vectors InitialTangent and FinalTangent at its first and last points respectively (i.e. the first and last points of the table of points through which the curve passes, as defined at the time of initialization).

    Parameters (3)
    • InitialTangent
    • FinalTangent
    • Scale
  • Load(Tangents: NCollection_Array1_gp_Vec, TangentFlags: NCollection_HArray1_bool, Scale: boolean): void

    Assigns this constrained BSpline curve to be tangential to vectors defined in the table Tangents, which is parallel to the table of points through which the curve passes, as defined at the time of initialization. Vectors in the table Tangents are defined only if the flag given in the parallel table TangentFlags is true: only these vectors are set as tangency constraints.

    Parameters (3)
    • Tangents
    • TangentFlags
    • Scale
  • Perform(): void

    Computes the constrained BSpline curve. Use the function IsDone to verify that the computation is successful, and then the function Curve to obtain the result.

  • Returns the computed BSpline curve. Raises StdFail_NotDone if the interpolation fails.

  • IsDone(): boolean

    Returns true if the constrained BSpline curve is successfully constructed. Note: in this case, the result is given by the function Curve.

GeomAPI_IntSS

This class implements methods for computing the intersection curves between two surfaces. The result is curves from Geom. The "domain" used for a surface is the natural parametric domain unless the surface is a RectangularTrimmedSurface from Geom.

Constructors(2)

  • Constructs an empty object. Use the function Perform for further initialization algorithm by two surfaces.

  • Computes the intersection curves between the two surfaces S1 and S2. Parameter Tol defines the precision of curves computation. For most cases the value 1.0e-7 is recommended to use. Warning Use the function IsDone to verify that the intersections are successfully computed.I.

    Parameters (3)
    • S1
    • S2
    • Tol

Instance methods(4)

  • Perform(S1: Geom_Surface, S2: Geom_Surface, Tol: number): void

    Initializes an algorithm with the given arguments and computes the intersection curves between the two surfaces S1 and S2. Parameter Tol defines the precision of curves computation. For most cases the value 1.0e-7 is recommended to use. Warning Use function IsDone to verify that the intersections are successfully computed.

    Parameters (3)
    • S1
    • S2
    • Tol
  • IsDone(): boolean

    Returns True if the intersection was successful.

  • NbLines(): number

    Returns the number of computed intersection curves. Exceptions StdFail_NotDone if the computation fails.

  • Line(Index: number): Geom_Curve

    Returns the computed intersection curve of index Index. Exceptions StdFail_NotDone if the computation fails. Standard_OutOfRange if Index is out of range [1, NbLines] where NbLines is the number of computed intersection curves.

    Parameters (1)
    • Index

GeomAPI_PointsToBSpline

This class is used to approximate a BsplineCurve passing through an array of points, with a given Continuity. Describes functions for building a 3D BSpline curve which approximates a set of points. A PointsToBSpline object provides a framework for:

  • defining the data of the BSpline curve to be built,
  • implementing the approximation algorithm, and consulting the results.

Constructors(5)

  • Constructs an empty approximation algorithm. Use an Init function to define and build the BSpline curve.

  • constructor(Points: NCollection_Array1_gp_Pnt, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSpline

    Approximate a BSpline Curve passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (5)
    • Points
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • constructor(Points: NCollection_Array1_gp_Pnt, ParType: Approx_ParametrizationType, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSpline

    Approximate a BSpline Curve passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (6)
    • Points
    • ParType
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • constructor(Points: NCollection_Array1_gp_Pnt, Parameters: NCollection_Array1_double, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSpline

    Approximate a BSpline Curve passing through an array of Point, which parameters are given by the array <Parameters>. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (6)
    • Points
    • Parameters
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • constructor(Points: NCollection_Array1_gp_Pnt, Weight1: number, Weight2: number, Weight3: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSpline

    Approximate a BSpline Curve passing through an array of Point using variational smoothing algorithm, which tries to minimize additional criterium: Weight1CurveLength + Weight2Curvature + Weight3*Torsion.

    Parameters (7)
    • Points
    • Weight1
    • Weight2
    • Weight3
    • DegMax
    • Continuity
    • Tol3D

Instance methods(6)

  • Init(Points: NCollection_Array1_gp_Pnt, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximate a BSpline Curve passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (5)
    • Points
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • Init(Points: NCollection_Array1_gp_Pnt, ParType: Approx_ParametrizationType, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximate a BSpline Curve passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (6)
    • Points
    • ParType
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • Init(Points: NCollection_Array1_gp_Pnt, Parameters: NCollection_Array1_double, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximate a BSpline Curve passing through an array of Point, which parameters are given by the array <Parameters>. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (6)
    • Points
    • Parameters
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • Init(Points: NCollection_Array1_gp_Pnt, Weight1: number, Weight2: number, Weight3: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximate a BSpline Curve passing through an array of Point using variational smoothing algorithm, which tries to minimize additional criterium: Weight1CurveLength + Weight2Curvature + Weight3*Torsion.

    Parameters (7)
    • Points
    • Weight1
    • Weight2
    • Weight3
    • DegMax
    • Continuity
    • Tol3D
  • Returns the computed BSpline curve. Raises StdFail_NotDone if the curve is not built.

  • IsDone(): boolean

GeomAPI_PointsToBSplineSurface

This class is used to approximate or interpolate a BSplineSurface passing through an Array2 of points, with a given continuity. Describes functions for building a BSpline surface which approximates or interpolates a set of points. A PointsToBSplineSurface object provides a framework for:

  • defining the data of the BSpline surface to be built,
  • implementing the approximation algorithm or the interpolation algorithm, and consulting the results. In fact, class contains 3 algorithms, 2 for approximation and 1 for interpolation. First approximation algorithm is based on usual least square criterium: minimization of square distance between samplimg points and result surface.
    Second approximation algorithm uses least square criterium and additional minimization of some local characteristic of surface (first, second and third partial derivative), which allows managing shape of surface. Interpolation algorithm produces surface, which passes through sampling points.
    There is accordance between parametrization of result surface S(U, V) and indexes of array Points(i, j): first index corresponds U parameter of surface, second - V parameter of surface. So, points of any j-th column Points(*, j) represent any V isoline of surface, points of any i-th row Point(i, *) represent any U isoline of surface.
    For each sampling point parameters U, V are calculated according to type of parametrization, which can be Approx_ChordLength, Approx_Centripetal or Approx_IsoParametric. Default value is Approx_ChordLength. For ChordLength parametrisation U(i) = U(i-1) + P(i).Distance(P(i-1)), For Centripetal type U(i) = U(i-1) + std::sqrt(P(i).Distance(P(i-1))). Centripetal type can get better result for irregular distances between points.
    Approximation and interpolation algorithms can build periodical surface along U direction, which corresponds columns of array Points(i, j), if corresponding parameter (thePeriodic, see comments below) of called methods is set to True. Algorithm uses first row Points(1, *) as periodic boundary, so to avoid getting wrong surface it is necessary to keep distance between corresponding points of first and last rows of Points: Points(1, *) != Points(Upper, *).

Constructors(5)

  • Constructs an empty algorithm for approximation or interpolation of a surface. Use:

    • an Init function to define and build the BSpline surface by approximation, or
    • an Interpolate function to define and build the BSpline surface by interpolation.
  • constructor(Points: NCollection_Array2_gp_Pnt, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSplineSurface

    Approximates a BSpline Surface passing through an array of Points. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (5)
    • Points
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • constructor(Points: NCollection_Array2_gp_Pnt, ParType: Approx_ParametrizationType, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSplineSurface

    Approximates a BSpline Surface passing through an array of Points. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (6)
    • Points
    • ParType
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • constructor(Points: NCollection_Array2_gp_Pnt, Weight1: number, Weight2: number, Weight3: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSplineSurface

    Approximates a BSpline Surface passing through an array of points using variational smoothing algorithm, which tries to minimize additional criterium: Weight1CurveLength + Weight2Curvature + Weight3*Torsion.

    Parameters (7)
    • Points
    • Weight1
    • Weight2
    • Weight3
    • DegMax
    • Continuity
    • Tol3D
  • constructor(ZPoints: NCollection_Array2_double, X0: number, dX: number, Y0: number, dY: number, DegMin?: number, DegMax?: number, Continuity?: GeomAbs_Shape, Tol3D?: number): GeomAPI_PointsToBSplineSurface

    Approximates a BSpline Surface passing through an array of Points.
    The points will be constructed as follow: P(i,j) = gp_Pnt( X0 + (i-1)*dX, Y0 + (j-1)*dY, ZPoints(i,j) )
    The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D 4- the parametrization of the surface will verify: S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );

    Parameters (9)
    • ZPoints
    • X0
    • dX
    • Y0
    • dY
    • DegMin
    • DegMax
    • Continuity
    • Tol3D

Instance methods(9)

  • Init(Points: NCollection_Array2_gp_Pnt, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximates a BSpline Surface passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (5)
    • Points
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • Init(Points: NCollection_Array2_gp_Pnt, ParType: Approx_ParametrizationType, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number, thePeriodic: boolean): void

    Approximates a BSpline Surface passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D.

    Parameters (7)
    • Points
    • ParType
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
    • thePeriodic
  • Init(Points: NCollection_Array2_gp_Pnt, Weight1: number, Weight2: number, Weight3: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximates a BSpline Surface passing through an array of point using variational smoothing algorithm, which tries to minimize additional criterium: Weight1CurveLength + Weight2Curvature + Weight3*Torsion.

    Parameters (7)
    • Points
    • Weight1
    • Weight2
    • Weight3
    • DegMax
    • Continuity
    • Tol3D
  • Init(ZPoints: NCollection_Array2_double, X0: number, dX: number, Y0: number, dY: number, DegMin: number, DegMax: number, Continuity: GeomAbs_Shape, Tol3D: number): void

    Approximates a BSpline Surface passing through an array of Points.
    The points will be constructed as follow: P(i,j) = gp_Pnt( X0 + (i-1)*dX, Y0 + (j-1)*dY, ZPoints(i,j) )
    The resulting BSpline will have the following properties: 1- his degree will be in the range [Degmin,Degmax] 2- his continuity will be at least <Continuity> 3- the distance from the point <Points> to the BSpline will be lower to Tol3D 4- the parametrization of the surface will verify: S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );

    Parameters (9)
    • ZPoints
    • X0
    • dX
    • Y0
    • dY
    • DegMin
    • DegMax
    • Continuity
    • Tol3D
  • Interpolate(Points: NCollection_Array2_gp_Pnt, thePeriodic: boolean): void

    Interpolates a BSpline Surface passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be 3. 2- his continuity will be C2.

    Parameters (2)
    • Points
    • thePeriodic
  • Interpolate(Points: NCollection_Array2_gp_Pnt, ParType: Approx_ParametrizationType, thePeriodic: boolean): void

    Interpolates a BSpline Surface passing through an array of Point. The resulting BSpline will have the following properties: 1- his degree will be 3. 2- his continuity will be C2.

    Parameters (3)
    • Points
    • ParType
    • thePeriodic
  • Interpolate(ZPoints: NCollection_Array2_double, X0: number, dX: number, Y0: number, dY: number): void

    Interpolates a BSpline Surface passing through an array of Points.
    The points will be constructed as follow: P(i,j) = gp_Pnt( X0 + (i-1)*dX, Y0 + (j-1)*dY, ZPoints(i,j) )
    The resulting BSpline will have the following properties: 1- his degree will be 3 2- his continuity will be C2. 4- the parametrization of the surface will verify: S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );

    Parameters (5)
    • ZPoints
    • X0
    • dX
    • Y0
    • dY
  • Returns the approximate BSpline Surface.

  • IsDone(): boolean

GeomAPI_ProjectPointOnCurve

This class implements methods for computing all the orthogonal projections of a 3D point onto a 3D curve.

Constructors(3)

Instance methods(13)

  • Init(P: gp_Pnt, Curve: Geom_Curve): void

    Init the projection of a point.
    on a curve <Curve>

    Parameters (2)
    • P
    • Curve
  • Init(P: gp_Pnt, Curve: Geom_Curve, Umin: number, Usup: number): void

    Init the projection of a point.
    on a curve <Curve> limited by the two points of parameter Umin and Usup.

    Parameters (4)
    • P
    • Curve
    • Umin
    • Usup
  • Init(Curve: Geom_Curve, Umin: number, Usup: number): void

    Init the projection of a point.
    on a curve <Curve> limited by the two points of parameter Umin and Usup.

    Parameters (3)
    • Curve
    • Umin
    • Usup
  • Perform(P: gp_Pnt): void

    Performs the projection of a point on the current curve.

    Parameters (1)
    • P
  • NbPoints(): number

    Returns the number of computed orthogonal projection points. Note: if this algorithm fails, NbPoints returns 0.

  • Point(Index: number): gp_Pnt

    Returns the orthogonal projection on the curve. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (1)
    • Index
  • Parameter(Index: number): number

    Returns the parameter on the curve of the point, which is the orthogonal projection. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (1)
    • Index
  • Parameter(Index: number, U: number): { U: number }

    Returns the parameter on the curve of the point, which is the orthogonal projection. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.-.

    Parameters (2)
    • Index
    • U
    Returns

    A result object with fields:

    • U: updated value from the call.
  • Distance(Index: number): number

    Computes the distance between the point and its orthogonal projection on the curve. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (1)
    • Index
  • Returns the nearest orthogonal projection of the point on the curve. Exceptions: StdFail_NotDone if this algorithm fails.

  • Returns the parameter on the curve of the nearest orthogonal projection of the point. Exceptions: StdFail_NotDone if this algorithm fails.

  • LowerDistance(): number

    Computes the distance between the point and its nearest orthogonal projection on the curve. Exceptions: StdFail_NotDone if this algorithm fails.

  • Extrema(): any

    return the algorithmic object from Extrema

GeomAPI_ProjectPointOnSurf

This class implements methods for computing all the orthogonal projections of a point onto a surface.

Constructors(5)

Instance methods(17)

  • Init(P: gp_Pnt, Surface: Geom_Surface, Algo: Extrema_ExtAlgo): void

    Init the projection of a point.
    on a surface <Surface>. The solution are computed in the domain [Umin,Usup] [Vmin,Vsup] of the surface.

    Parameters (3)
    • P
    • Surface
    • Algo
  • Init(P: gp_Pnt, Surface: Geom_Surface, Tolerance: number, Algo: Extrema_ExtAlgo): void
    Parameters (4)
    • P
    • Surface
    • Tolerance
    • Algo
  • Init(Surface: Geom_Surface, Umin: number, Usup: number, Vmin: number, Vsup: number, Algo: Extrema_ExtAlgo): void
    Parameters (6)
    • Surface
    • Umin
    • Usup
    • Vmin
    • Vsup
    • Algo
  • Init(P: gp_Pnt, Surface: Geom_Surface, Umin: number, Usup: number, Vmin: number, Vsup: number, Algo: Extrema_ExtAlgo): void

    Init the projection for many points on a surface <Surface>. The solutions will be computed in the domain [Umin,Usup] [Vmin,Vsup] of the surface.

    Parameters (7)
    • P
    • Surface
    • Umin
    • Usup
    • Vmin
    • Vsup
    • Algo
  • Init(Surface: Geom_Surface, Umin: number, Usup: number, Vmin: number, Vsup: number, Tolerance: number, Algo: Extrema_ExtAlgo): void
    Parameters (7)
    • Surface
    • Umin
    • Usup
    • Vmin
    • Vsup
    • Tolerance
    • Algo
  • Init(P: gp_Pnt, Surface: Geom_Surface, Umin: number, Usup: number, Vmin: number, Vsup: number, Tolerance: number, Algo: Extrema_ExtAlgo): void
    Parameters (8)
    • P
    • Surface
    • Umin
    • Usup
    • Vmin
    • Vsup
    • Tolerance
    • Algo
  • Sets the Extrema search algorithm - Grad or Tree. By default the Extrema is initialized with Grad algorithm.

    Parameters (1)
    • theAlgo
  • SetExtremaFlag(theExtFlag: Extrema_ExtFlag): void

    Sets the Extrema search flag - MIN or MAX or MINMAX. By default the Extrema is set to search the MinMax solutions.

    Parameters (1)
    • theExtFlag
  • Perform(P: gp_Pnt): void

    Performs the projection of a point on the current surface.

    Parameters (1)
    • P
  • IsDone(): boolean
  • NbPoints(): number

    Returns the number of computed orthogonal projection points. Note: if projection fails, NbPoints returns 0.

  • Point(Index: number): gp_Pnt

    Returns the orthogonal projection on the surface. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (1)
    • Index
  • Parameters(Index: number, U: number, V: number): { U: number; V: number }

    Returns the parameters (U,V) on the surface of the orthogonal projection. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (3)
    • Index
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • Distance(Index: number): number

    Computes the distance between the point and its orthogonal projection on the surface. Index is a number of a computed point. Exceptions Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where NbPoints is the number of solution points.

    Parameters (1)
    • Index
  • Returns the nearest orthogonal projection of the point on the surface. Exceptions StdFail_NotDone if projection fails.

  • LowerDistanceParameters(U: number, V: number): { U: number; V: number }

    Returns the parameters (U,V) on the surface of the nearest computed orthogonal projection of the point. Exceptions StdFail_NotDone if projection fails.

    Parameters (2)
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • LowerDistance(): number

    Computes the distance between the point and its nearest orthogonal projection on the surface. Exceptions StdFail_NotDone if projection fails.