OpenCascade.js
API ReferenceModelingDataTKBRep

BRep

OCCT package BRep: BRep_Builder, BRep_Curve3D, BRep_CurveOn2Surfaces, BRep_CurveOnClosedSurface, and 17 more bound classes.

BRep_Builder

A framework providing advanced tolerance control. It is used to build Shapes. If tolerance control is required, you are advised to:

  1. build a default precision for topology, using the classes provided in the BRepAPI package
  2. update the tolerance of the resulting shape. Note that only vertices, edges and faces have meaningful tolerance control. The tolerance value must always comply with the condition that face tolerances are more restrictive than edge tolerances which are more restrictive than vertex tolerances. In other words: Tol(Vertex) >= Tol(Edge) >= Tol(Face). Other rules in setting tolerance include:
  • you can open up tolerance but should never restrict it
  • an edge cannot be included within the fusion of the tolerance spheres of two vertices

Constructors(1)

Instance methods(52)

BRep_Curve3D

Representation of a curve by a 3D curve.

Constructors(1)

Static methods(2)

Instance methods(6)

BRep_CurveOn2Surfaces

Defines a continuity between two surfaces.

Constructors(1)

Static methods(2)

Instance methods(10)

BRep_CurveOnClosedSurface

Representation of a curve by two pcurves on a closed surface.

Constructors(1)

Static methods(2)

Instance methods(14)

BRep_CurveOnSurface

Representation of a curve by a curve in the parametric space of a surface.

Constructors(1)

Static methods(2)

Instance methods(11)

BRep_CurveRepresentation

Root class for the curve representations. Contains a location.

Static methods(2)

Instance methods(39)

BRep_GCurve

Root class for the geometric curves representation. Contains a range. Contains a first and a last parameter.

Static methods(2)

Instance methods(9)

  • SetRange(First: number, Last: number): void
    Parameters (2)
    • First
    • Last
  • Range(First: number, Last: number): { First: number; Last: number }
    Parameters (2)
    • First
    • Last
  • First(): number
  • First(F: number): void
    Parameters (1)
    • F
  • Last(): number
  • Last(L: number): void
    Parameters (1)
    • L
  • D0(U: number, P: gp_Pnt): void

    Computes the point at parameter U.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • Update(): void

    Recomputes any derived data after a modification. This is called when the range is modified.

BRep_PointOnCurve

Representation by a parameter on a 3D curve.

Constructors(1)

Static methods(2)

Instance methods(5)

BRep_PointOnCurveOnSurface

Representation by a parameter on a curve on a surface.

Constructors(1)

Static methods(2)

Instance methods(5)

BRep_PointOnSurface

Representation by two parameters on a surface.

Constructors(1)

Static methods(2)

Instance methods(5)

BRep_PointRepresentation

Root class for the points representations. Contains a location and a parameter.

Static methods(2)

Instance methods(19)

BRep_PolygonOnClosedSurface

Representation by two 2d polygons in the parametric space of a surface.

Constructors(1)

Static methods(2)

Instance methods(5)

BRep_PolygonOnClosedTriangulation

A representation by two arrays of nodes on a triangulation.

Constructors(1)

Static methods(2)

Instance methods(5)

BRep_PolygonOnSurface

Representation of a 2D polygon in the parametric space of a surface.

Constructors(1)

Static methods(2)

Instance methods(7)

BRep_PolygonOnTriangulation

A representation by an array of nodes on a triangulation.

Constructors(1)

Static methods(2)

Instance methods(7)

BRep_TEdge

The TEdge from BRep is inherited from the TEdge from TopoDS. It contains the geometric data.
The TEdge contains a:

  • tolerance.
  • same parameter flag.
  • same range flag.
  • Degenerated flag.
  • list of curve representation.

Constructors(1)

Static methods(2)

Instance methods(13)

BRep_TFace

The Tface from BRep is based on the TFace from TopoDS. The TFace contains:

  • A surface, a tolerance and a Location.
  • A NaturalRestriction flag, when this flag is True the boundary of the face is known to be the parametric space (Umin, UMax, VMin, VMax).
  • An optional list of triangulations. If there are any triangulations the surface can be absent.
    The Location is used for the Surface.
    The triangulation is in the same reference system than the TFace. A point on mySurface must be transformed with myLocation, but not a point on the triangulation.
    The Surface may be shared by different TFaces but not the Triangulation, because the Triangulation may be modified by the edges.

Constructors(1)

Static methods(2)

Instance methods(16)

  • Returns face surface.

  • Surface(theSurface: Geom_Surface): void

    Sets surface for this face.

    Parameters (1)
    • theSurface
  • Returns the face location.

  • Location(theLocation: TopLoc_Location): void

    Sets the location for this face.

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

    Returns the face tolerance.

  • Tolerance(theTolerance: number): void

    Sets the tolerance for this face.

    Parameters (1)
    • theTolerance
  • Returns TRUE if the boundary of this face is known to be the parametric space (Umin, UMax, VMin, VMax).

  • NaturalRestriction(theRestriction: boolean): void

    Sets the flag that is TRUE if the boundary of this face is known to be the parametric space.

    Parameters (1)
    • theRestriction
  • Triangulation(thePurpose: number): Poly_Triangulation

    Returns the triangulation of this face according to the mesh purpose.

    Parameters (1)
    • thePurpose
      a mesh purpose to find appropriate triangulation (NONE by default).
    Returns

    an active triangulation in case of NONE purpose, the first triangulation appropriate for the input purpose, just the first triangulation if none matching other criteria and input purpose is AnyFallback or null handle if there is no any suitable triangulation.

  • Triangulation(theTriangulation: Poly_Triangulation, theToReset: boolean): void

    Sets input triangulation for this face.

    Parameters (2)
    • theTriangulation
      triangulation to be set
    • theToReset
      flag to reset triangulations list to new list with only one input triangulation. If theTriangulation is NULL internal list of triangulations will be cleared and active triangulation will be nullified. If theToReset is TRUE internal list of triangulations will be reset to new list with only one input triangulation that will be active. Else if input triangulation is contained in internal triangulations list it will be made active, else the active triangulation will be replaced to input one.
  • Returns a copy of the TShape with no sub-shapes. The new Face has no triangulation.

  • Returns the list of available face triangulations.

  • Triangulations(theTriangulations: NCollection_List_handle_Poly_Triangulation, theActiveTriangulation: Poly_Triangulation): void

    Sets input list of triangulations and currently active triangulation for this face. If list is empty internal list of triangulations will be cleared and active triangulation will be nullified. Else this list will be saved and the input active triangulation be saved as active. Use NULL active triangulation to set the first triangulation in list as active. Note: the method throws exception if there is any NULL triangulation in input list or if this list doesn't contain input active triangulation.

    Parameters (2)
    • theTriangulations
    • theActiveTriangulation
  • Returns number of available face triangulations.

  • Returns current active triangulation.

BRep_Tool

Provides class methods to access to the geometry of BRep shapes.

Constructors(1)

Static methods(52)

  • IsClosed(S: TopoDS_Shape): boolean

    If S is Shell, returns True if it has no free boundaries (edges). If S is Wire, returns True if it has no free ends (vertices). (Internal and External sub-shepes are ignored in these checks) If S is Edge, returns True if its vertices are the same. For other shape types returns S.Closed().

    Parameters (1)
    • S
  • Returns True if <E> has two PCurves in the parametric space of <F>. i.e. <F> is on a closed surface and <E> is on the closing curve.

    Parameters (2)
    • E
    • F
  • Returns True if <E> has two PCurves in the parametric space of . i.e. is a closed surface and <E> is on the closing curve.

    Parameters (3)
    • E
    • S
    • L
  • Returns True if <E> has two arrays of indices in the triangulation <T>.

    Parameters (3)
    • E
    • T
    • L
  • Returns the geometric surface of the face. Returns in <L> the location for the surface.

    Parameters (2)
    • F
    • L
      Mutated in place; read the updated value from this argument after the call.
  • Returns the geometric surface of the face. It can be a copy if there is a Location.

    Parameters (1)
    • F
  • Triangulation(theFace: TopoDS_Face, theLocation: TopLoc_Location, theMeshPurpose: number): Poly_Triangulation

    Returns the triangulation of the face according to the mesh purpose.

    Parameters (3)
    • theFace
      the input face to find triangulation.
    • theLocation
      the face location. Mutated in place; read the updated value from this argument after the call.
    • theMeshPurpose
      a mesh purpose to find appropriate triangulation (NONE by default).
    Returns

    an active triangulation in case of NONE purpose, the first triangulation appropriate for the input purpose, just the first triangulation if none matching other criteria and input purpose is AnyFallback or null handle if there is no any suitable triangulation.

  • Returns all triangulations of the face.

    Parameters (2)
    • theFace
      the input face.
    • theLocation
      the face location. Mutated in place; read the updated value from this argument after the call.
    Returns

    list of all available face triangulations.

  • Returns the tolerance of the face.

    Parameters (1)
    • F
  • Returns the tolerance for <E>.

    Parameters (1)
    • E
  • Returns the tolerance.

    Parameters (1)
    • V
  • Returns the NaturalRestriction flag of the face.

    Parameters (1)
    • F
  • Returns True if <F> has a surface, false otherwise.

    Parameters (1)
    • F
  • Returns True if <E> is a 3d curve or a curve on surface.

    Parameters (1)
    • E
  • Curve(E: TopoDS_Edge, L: TopLoc_Location, First: number, Last: number): { returnValue: Geom_Curve; First: number; Last: number; [Symbol.dispose](): void }

    Returns the 3D curve of the edge. May be a Null handle. Returns in <L> the location for the curve. In <First> and <Last> the parameter range.

    Parameters (4)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    • First
    • Last
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Curve(E: TopoDS_Edge, First: number, Last: number): { returnValue: Geom_Curve; First: number; Last: number; [Symbol.dispose](): void }

    Returns the 3D curve of the edge. May be a Null handle. In <First> and <Last> the parameter range. It can be a copy if there is a Location.

    Parameters (3)
    • E
    • First
    • Last
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the 3D polygon of the edge. May be a Null handle. Returns in <L> the location for the polygon.

    Parameters (2)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
  • CurveOnSurface(E: TopoDS_Edge, L: TopLoc_Location, First: number, Last: number): { C: Geom2d_Curve; S: Geom_Surface; First: number; Last: number; [Symbol.dispose](): void }

    Returns the curve associated to the edge in the parametric space of the surface. Returns a NULL handle if this curve does not exist. Returns in <First> and <Last> the parameter range. If the surface is a plane the curve can be not stored but created a new each time. The flag pointed by <theIsStored> serves to indicate storage status. It is valued if the pointer is non-null.

    Parameters (4)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    • First
    • Last
    Returns

    A result object with fields:

    • C: owned by the returned envelope.
    • S: owned by the returned envelope.
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • CurveOnSurface(E: TopoDS_Edge, F: TopoDS_Face, First: number, Last: number, theIsStored: boolean): { returnValue: Geom2d_Curve; First: number; Last: number; [Symbol.dispose](): void }

    Returns the curve associated to the edge in the parametric space of the face. Returns a NULL handle if this curve does not exist. Returns in <First> and <Last> the parameter range. If the surface is a plane the curve can be not stored but created a new each time. The flag pointed by <theIsStored> serves to indicate storage status. It is valued if the pointer is non-null.

    Parameters (5)
    • E
    • F
    • First
    • Last
    • theIsStored
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • CurveOnSurface(E: TopoDS_Edge, L: TopLoc_Location, First: number, Last: number, Index: number): { C: Geom2d_Curve; S: Geom_Surface; First: number; Last: number; [Symbol.dispose](): void }

    Returns in , , <L> the 2d curve, the surface and the location for the edge <E> of rank <Index>. and are null if the index is out of range. Returns in <First> and <Last> the parameter range.

    Parameters (5)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    • First
    • Last
    • Index
    Returns

    A result object with fields:

    • C: owned by the returned envelope.
    • S: owned by the returned envelope.
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • CurveOnSurface(E: TopoDS_Edge, S: Geom_Surface, L: TopLoc_Location, First: number, Last: number, theIsStored: boolean): { returnValue: Geom2d_Curve; First: number; Last: number; [Symbol.dispose](): void }

    Returns the curve associated to the edge in the parametric space of the surface. Returns a NULL handle if this curve does not exist. Returns in <First> and <Last> the parameter range. If the surface is a plane the curve can be not stored but created a new each time. The flag pointed by <theIsStored> serves to indicate storage status. It is valued if the pointer is non-null.

    Parameters (6)
    • E
    • S
    • L
    • First
    • Last
    • theIsStored
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • CurveOnPlane(E: TopoDS_Edge, S: Geom_Surface, L: TopLoc_Location, First: number, Last: number): { returnValue: Geom2d_Curve; First: number; Last: number; [Symbol.dispose](): void }

    For the planar surface builds the 2d curve for the edge by projection of the edge on plane. Returns a NULL handle if the surface is not planar or the projection failed.

    Parameters (5)
    • E
    • S
    • L
    • First
    • Last
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • First: updated value from the call.
    • Last: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the polygon associated to the edge in the parametric space of the face. Returns a NULL handle if this polygon does not exist.

    Parameters (2)
    • E
    • F
  • PolygonOnSurface(E: TopoDS_Edge, L: TopLoc_Location): { C: Poly_Polygon2D; S: Geom_Surface; [Symbol.dispose](): void }

    Returns in , , <L> a 2d curve, a surface and a location for the edge <E>. and are null if the edge has no polygon on surface.

    Parameters (2)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • C: owned by the returned envelope.
    • S: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the polygon associated to the edge in the parametric space of the surface. Returns a NULL handle if this polygon does not exist.

    Parameters (3)
    • E
    • S
    • L
  • PolygonOnSurface(E: TopoDS_Edge, L: TopLoc_Location, Index: number): { C: Poly_Polygon2D; S: Geom_Surface; [Symbol.dispose](): void }

    Returns in , , <L> the 2d curve, the surface and the location for the edge <E> of rank <Index>. and are null if the index is out of range.

    Parameters (3)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    • Index
    Returns

    A result object with fields:

    • C: owned by the returned envelope.
    • S: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Returns in.
    , <T>, <L> a polygon on triangulation, a triangulation and a location for the edge <E>.
    and <T> are null if the edge has no polygon on triangulation.

    Parameters (2)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • P: owned by the returned envelope.
    • T: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the polygon associated to the edge in the parametric space of the face. Returns a NULL handle if this polygon does not exist.

    Parameters (3)
    • E
    • T
    • L
  • PolygonOnTriangulation(E: TopoDS_Edge, L: TopLoc_Location, Index: number): { P: Poly_PolygonOnTriangulation; T: Poly_Triangulation; [Symbol.dispose](): void }

    Returns in.
    , <T>, <L> a polygon on triangulation, a triangulation and a location for the edge <E> for the range index. and are null if the edge has no polygon on triangulation.

    Parameters (3)
    • E
    • L
      Mutated in place; read the updated value from this argument after the call.
    • Index
    Returns

    A result object with fields:

    • P: owned by the returned envelope.
    • T: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the SameParameter flag for the edge.

    Parameters (1)
    • E
  • SameRange(E: TopoDS_Edge): boolean

    Returns the SameRange flag for the edge.

    Parameters (1)
    • E
  • Returns True if the edge is degenerated.

    Parameters (1)
    • E
  • Range(E: TopoDS_Edge, First: number, Last: number): { First: number; Last: number }

    Gets the range of the 3d curve.

    Parameters (3)
    • E
    • First
    • Last
    Returns

    A result object with fields:

    • First: updated value from the call.
    • Last: updated value from the call.
  • Range(E: TopoDS_Edge, S: Geom_Surface, L: TopLoc_Location, First: number, Last: number): { First: number; Last: number }

    Gets the range of the edge on the pcurve on the surface.

    Parameters (5)
    • E
    • S
    • L
    • First
    • Last
    Returns

    A result object with fields:

    • First: updated value from the call.
    • Last: updated value from the call.
  • Range(E: TopoDS_Edge, F: TopoDS_Face, First: number, Last: number): { First: number; Last: number }

    Gets the range of the edge on the pcurve on the face.

    Parameters (4)
    • E
    • F
    • First
    • Last
    Returns

    A result object with fields:

    • First: updated value from the call.
    • Last: updated value from the call.
  • Gets the UV locations of the extremities of the edge.

    Parameters (5)
    • E
    • S
    • L
    • PFirst
      Mutated in place; read the updated value from this argument after the call.
    • PLast
      Mutated in place; read the updated value from this argument after the call.
  • UVPoints(E: TopoDS_Edge, F: TopoDS_Face, PFirst: gp_Pnt2d, PLast: gp_Pnt2d): void

    Gets the UV locations of the extremities of the edge.

    Parameters (4)
    • E
    • F
    • PFirst
      Mutated in place; read the updated value from this argument after the call.
    • PLast
      Mutated in place; read the updated value from this argument after the call.
  • Sets the UV locations of the extremities of the edge.

    Parameters (5)
    • E
    • S
    • L
    • PFirst
    • PLast
  • SetUVPoints(E: TopoDS_Edge, F: TopoDS_Face, PFirst: gp_Pnt2d, PLast: gp_Pnt2d): void

    Sets the UV locations of the extremities of the edge.

    Parameters (4)
    • E
    • F
    • PFirst
    • PLast
  • Returns True if the edge is on the surfaces of the two faces.

    Parameters (3)
    • E
    • F1
    • F2
  • Returns True if the edge is on the surfaces.

    Parameters (5)
    • E
    • S1
    • S2
    • L1
    • L2
  • Returns True if the edge has regularity on some two surfaces.

    Parameters (1)
    • E
  • Returns the continuity.

    Parameters (3)
    • E
    • F1
    • F2
  • Returns the continuity.

    Parameters (5)
    • E
    • S1
    • S2
    • L1
    • L2
  • Returns the max continuity of edge between some surfaces or GeomAbs_C0 if there are no such surfaces.

    Parameters (1)
    • theEdge
  • Returns the 3d point.

    Parameters (1)
    • V
  • Returns the parameter of <V> on <E>. Throws Standard_NoSuchObject if no parameter on edge.

    Parameters (2)
    • V
    • E
  • Parameter(theV: TopoDS_Vertex, theE: TopoDS_Edge, theParam: number): { returnValue: boolean; theParam: number }

    Finds the parameter of <theV> on <theE>.

    Parameters (3)
    • theV
      input vertex
    • theE
      input edge
    • theParam
      calculated parameter on the curve
    Returns

    A result object with fields:

    • returnValue: TRUE if done
    • theParam: calculated parameter on the curve
  • Returns the parameters of the vertex on the pcurve of the edge on the face.

    Parameters (3)
    • V
    • E
    • F
  • Returns the parameters of the vertex on the pcurve of the edge on the surface.

    Parameters (4)
    • V
    • E
    • S
    • L
  • Returns the parameters of the vertex on the face.

    Parameters (2)
    • V
    • F
  • MaxTolerance(theShape: TopoDS_Shape, theSubShape: TopAbs_ShapeEnum): number

    Returns the maximum tolerance of input shape subshapes.

    Parameters (2)
    • theShape
    • theSubShape

BRep_TVertex

The TVertex from BRep inherits from the TVertex from TopoDS. It contains the geometric data.
The TVertex contains a 3d point, location and a tolerance.

Constructors(1)

Static methods(2)

Instance methods(9)