OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    BRepLib Class Reference

    The BRepLib package provides general utilities for BRep. More...

    #include <BRepLib.hxx>

    Static Public Member Functions

    static void Precision (const double P)
     Computes the max distance between edge and its 2d representation on the face. Sets the default precision. The current Precision is returned.
    static double Precision ()
     Returns the default precision.
    static void Plane (const occ::handle< Geom_Plane > &P)
     Sets the current plane to P.
    static const occ::handle< Geom_Plane > & Plane ()
     Returns the current plane.
    static bool CheckSameRange (const TopoDS_Edge &E, const double Confusion=1.0e-12)
     checks if the Edge is same range IGNORING the same range flag of the edge Confusion argument is to compare real numbers idenpendently of any model space tolerance
    static void SameRange (const TopoDS_Edge &E, const double Tolerance=1.0e-5)
     will make all the curve representation have the same range domain for the parameters. This will IGNORE the same range flag value to proceed. If there is a 3D curve there it will the range of that curve. If not the first curve representation encountered in the list will give its range to the all the other curves.
    static bool BuildCurve3d (const TopoDS_Edge &E, const double Tolerance=1.0e-5, const GeomAbs_Shape Continuity=GeomAbs_C1, const int MaxDegree=14, const int MaxSegment=0)
     Computes the 3d curve for the edge <E> if it does not exist. Returns True if the curve was computed or existed. Returns False if there is no planar pcurve or the computation failed. <MaxSegment> >= 30 in approximation.
    static bool BuildCurves3d (const TopoDS_Shape &S, const double Tolerance, const GeomAbs_Shape Continuity=GeomAbs_C1, const int MaxDegree=14, const int MaxSegment=0)
     Computes the 3d curves for all the edges of return False if one of the computation failed. <MaxSegment> >= 30 in approximation.
    static bool BuildCurves3d (const TopoDS_Shape &S)
     Computes the 3d curves for all the edges of return False if one of the computation failed.
    static void BuildPCurveForEdgeOnPlane (const TopoDS_Edge &theE, const TopoDS_Face &theF)
     Builds pcurve of edge on face if the surface is plane, and updates the edge.
    static void BuildPCurveForEdgeOnPlane (const TopoDS_Edge &theE, const TopoDS_Face &theF, occ::handle< Geom2d_Curve > &aC2D, bool &bToUpdate)
     Builds pcurve of edge on face if the surface is plane, but does not update the edge. The output are the pcurve and the flag telling that pcurve was built.
    template<class TCont>
    static void BuildPCurveForEdgesOnPlane (const TCont &theLE, const TopoDS_Face &theF)
     Builds pcurves of edges on face if the surface is plane, and update the edges.
    static bool UpdateEdgeTol (const TopoDS_Edge &E, const double MinToleranceRequest, const double MaxToleranceToCheck)
     Checks if the edge has a Tolerance smaller than MaxToleranceToCheck if so it will compute the radius of the cylindrical pipe surface that MinToleranceRequest is the minimum tolerance before it is useful to start testing. Usually it should be around 10e-5 contains all the curve representation of the edge returns True if the Edge tolerance had to be updated.
    static bool UpdateEdgeTolerance (const TopoDS_Shape &S, const double MinToleranceRequest, const double MaxToleranceToCheck)
     Checks all the edges of the shape whose Tolerance is smaller than MaxToleranceToCheck Returns True if at least one edge was updated MinToleranceRequest is the minimum tolerance before it is useful to start testing. Usually it should be around 10e-5.
    static void SameParameter (const TopoDS_Edge &theEdge, const double Tolerance=1.0e-5)
     Computes new 2d curve(s) for the edge <theEdge> to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on the Edge.
    static TopoDS_Edge SameParameter (const TopoDS_Edge &theEdge, const double theTolerance, double &theNewTol, const bool IsUseOldEdge)
     Computes new 2d curve(s) for the edge <theEdge> to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on the Edge. theNewTol is a new tolerance of vertices of the input edge (not applied inside the algorithm, but pre-computed). If IsUseOldEdge is true then the input edge will be modified, otherwise the new copy of input edge will be created. Returns the new edge as a result, can be ignored if IsUseOldEdge is true.
    static void SameParameter (const TopoDS_Shape &S, const double Tolerance=1.0e-5, const bool forced=false)
     Computes new 2d curve(s) for all the edges of to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on an Edge.
    static void SameParameter (const TopoDS_Shape &S, BRepTools_ReShape &theReshaper, const double Tolerance=1.0e-5, const bool forced=false)
     Computes new 2d curve(s) for all the edges of to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on an Edge. theReshaper is used to record the modifications of input shape to prevent any modifications on the shape itself. Thus the input shape (and its subshapes) will not be modified, instead the reshaper will contain a modified empty-copies of original subshapes as substitutions.
    static void UpdateTolerances (const TopoDS_Shape &S, const bool verifyFaceTolerance=false)
     Replaces tolerance of FACE EDGE VERTEX by the tolerance Max of their connected handling shapes. It is not necessary to use this call after SameParameter. (called in).
    static void UpdateTolerances (const TopoDS_Shape &S, BRepTools_ReShape &theReshaper, const bool verifyFaceTolerance=false)
     Replaces tolerance of FACE EDGE VERTEX by the tolerance Max of their connected handling shapes. It is not necessary to use this call after SameParameter. (called in) theReshaper is used to record the modifications of input shape to prevent any modifications on the shape itself. Thus the input shape (and its subshapes) will not be modified, instead the reshaper will contain a modified empty-copies of original subshapes as substitutions.
    static void UpdateInnerTolerances (const TopoDS_Shape &S)
     Checks tolerances of edges (including inner points) and vertices of a shape and updates them to satisfy "SameParameter" condition.
    static bool OrientClosedSolid (TopoDS_Solid &solid)
     Orients the solid forward and the shell with the orientation to have matter in the solid. Returns False if the solid is unOrientable (open or incoherent).
    static GeomAbs_Shape ContinuityOfFaces (const TopoDS_Edge &theEdge, const TopoDS_Face &theFace1, const TopoDS_Face &theFace2, const double theAngleTol)
     Returns the order of continuity between two faces connected by an edge.
    static void EncodeRegularity (const TopoDS_Shape &S, const double TolAng=1.0e-10)
     Encodes the Regularity of edges on a Shape. Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edges's regularity are coded before, nothing is done.
    static void EncodeRegularity (const TopoDS_Shape &S, const NCollection_List< TopoDS_Shape > &LE, const double TolAng=1.0e-10)
     Encodes the Regularity of edges in list <LE> on the shape Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edges's regularity are coded before, nothing is done.
    static void EncodeRegularity (TopoDS_Edge &E, const TopoDS_Face &F1, const TopoDS_Face &F2, const double TolAng=1.0e-10)
     Encodes the Regularity between <F1> and <F2> by <E> Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edge's regularity is coded before, nothing is done.
    static void SortFaces (const TopoDS_Shape &S, NCollection_List< TopoDS_Shape > &LF)
     Sorts in LF the Faces of S on the complexity of their surfaces (Plane,Cylinder,Cone,Sphere,Torus,other).
    static void ReverseSortFaces (const TopoDS_Shape &S, NCollection_List< TopoDS_Shape > &LF)
     Sorts in LF the Faces of S on the reverse complexity of their surfaces (other,Torus,Sphere,Cone,Cylinder,Plane).
    static bool EnsureNormalConsistency (const TopoDS_Shape &S, const double theAngTol=0.001, const bool ForceComputeNormals=false)
     Corrects the normals in Poly_Triangulation of faces, in such way that normals at nodes lying along smooth edges have the same value on both adjacent triangulations. Returns TRUE if any correction is done.
    static void UpdateDeflection (const TopoDS_Shape &S)
     Updates value of deflection in Poly_Triangulation of faces by the maximum deviation measured on existing triangulation.
    static void BoundingVertex (const NCollection_List< TopoDS_Shape > &theLV, gp_Pnt &theNewCenter, double &theNewTol)
     Calculates the bounding sphere around the set of vertexes from the theLV list. Returns the center (theNewCenter) and the radius (theNewTol) of this sphere. This can be used to construct the new vertex which covers the given set of other vertices.
    static bool FindValidRange (const Adaptor3d_Curve &theCurve, const double theTolE, const double theParV1, const gp_Pnt &thePntV1, const double theTolV1, const double theParV2, const gp_Pnt &thePntV2, const double theTolV2, double &theFirst, double &theLast)
     For an edge defined by 3d curve and tolerance and vertices defined by points, parameters on curve and tolerances, finds a range of curve between vertices not covered by vertices tolerances. Returns false if there is no such range. Otherwise, sets theFirst and theLast as its bounds.
    static bool FindValidRange (const TopoDS_Edge &theEdge, double &theFirst, double &theLast)
     Finds a range of 3d curve of the edge not covered by vertices tolerances. Returns false if there is no such range. Otherwise, sets theFirst and theLast as its bounds.
    static void ExtendFace (const TopoDS_Face &theF, const double theExtVal, const bool theExtUMin, const bool theExtUMax, const bool theExtVMin, const bool theExtVMax, TopoDS_Face &theFExtended)
     Enlarges the face on the given value.

    Detailed Description

    The BRepLib package provides general utilities for BRep.

    • FindSurface : Class to compute a surface through a set of edges.
    • Compute missing 3d curve on an edge.

    Member Function Documentation

    ◆ BoundingVertex()

    void BRepLib::BoundingVertex ( const NCollection_List< TopoDS_Shape > & theLV,
    gp_Pnt & theNewCenter,
    double & theNewTol )
    static

    Calculates the bounding sphere around the set of vertexes from the theLV list. Returns the center (theNewCenter) and the radius (theNewTol) of this sphere. This can be used to construct the new vertex which covers the given set of other vertices.

    ◆ BuildCurve3d()

    bool BRepLib::BuildCurve3d ( const TopoDS_Edge & E,
    const double Tolerance = 1.0e-5,
    const GeomAbs_Shape Continuity = GeomAbs_C1,
    const int MaxDegree = 14,
    const int MaxSegment = 0 )
    static

    Computes the 3d curve for the edge <E> if it does not exist. Returns True if the curve was computed or existed. Returns False if there is no planar pcurve or the computation failed. <MaxSegment> >= 30 in approximation.

    ◆ BuildCurves3d() [1/2]

    bool BRepLib::BuildCurves3d ( const TopoDS_Shape & S)
    static

    Computes the 3d curves for all the edges of return False if one of the computation failed.

    ◆ BuildCurves3d() [2/2]

    bool BRepLib::BuildCurves3d ( const TopoDS_Shape & S,
    const double Tolerance,
    const GeomAbs_Shape Continuity = GeomAbs_C1,
    const int MaxDegree = 14,
    const int MaxSegment = 0 )
    static

    Computes the 3d curves for all the edges of return False if one of the computation failed. <MaxSegment> >= 30 in approximation.

    ◆ BuildPCurveForEdgeOnPlane() [1/2]

    void BRepLib::BuildPCurveForEdgeOnPlane ( const TopoDS_Edge & theE,
    const TopoDS_Face & theF )
    static

    Builds pcurve of edge on face if the surface is plane, and updates the edge.

    ◆ BuildPCurveForEdgeOnPlane() [2/2]

    void BRepLib::BuildPCurveForEdgeOnPlane ( const TopoDS_Edge & theE,
    const TopoDS_Face & theF,
    occ::handle< Geom2d_Curve > & aC2D,
    bool & bToUpdate )
    static

    Builds pcurve of edge on face if the surface is plane, but does not update the edge. The output are the pcurve and the flag telling that pcurve was built.

    ◆ BuildPCurveForEdgesOnPlane()

    template<class TCont>
    void BRepLib::BuildPCurveForEdgesOnPlane ( const TCont & theLE,
    const TopoDS_Face & theF )
    inlinestatic

    Builds pcurves of edges on face if the surface is plane, and update the edges.

    ◆ CheckSameRange()

    bool BRepLib::CheckSameRange ( const TopoDS_Edge & E,
    const double Confusion = 1.0e-12 )
    static

    checks if the Edge is same range IGNORING the same range flag of the edge Confusion argument is to compare real numbers idenpendently of any model space tolerance

    ◆ ContinuityOfFaces()

    GeomAbs_Shape BRepLib::ContinuityOfFaces ( const TopoDS_Edge & theEdge,
    const TopoDS_Face & theFace1,
    const TopoDS_Face & theFace2,
    const double theAngleTol )
    static

    Returns the order of continuity between two faces connected by an edge.

    ◆ EncodeRegularity() [1/3]

    void BRepLib::EncodeRegularity ( const TopoDS_Shape & S,
    const double TolAng = 1.0e-10 )
    static

    Encodes the Regularity of edges on a Shape. Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edges's regularity are coded before, nothing is done.

    ◆ EncodeRegularity() [2/3]

    void BRepLib::EncodeRegularity ( const TopoDS_Shape & S,
    const NCollection_List< TopoDS_Shape > & LE,
    const double TolAng = 1.0e-10 )
    static

    Encodes the Regularity of edges in list <LE> on the shape Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edges's regularity are coded before, nothing is done.

    ◆ EncodeRegularity() [3/3]

    void BRepLib::EncodeRegularity ( TopoDS_Edge & E,
    const TopoDS_Face & F1,
    const TopoDS_Face & F2,
    const double TolAng = 1.0e-10 )
    static

    Encodes the Regularity between <F1> and <F2> by <E> Warning: <TolAng> is an angular tolerance, expressed in Rad. Warning: If the edge's regularity is coded before, nothing is done.

    ◆ EnsureNormalConsistency()

    bool BRepLib::EnsureNormalConsistency ( const TopoDS_Shape & S,
    const double theAngTol = 0.001,
    const bool ForceComputeNormals = false )
    static

    Corrects the normals in Poly_Triangulation of faces, in such way that normals at nodes lying along smooth edges have the same value on both adjacent triangulations. Returns TRUE if any correction is done.

    ◆ ExtendFace()

    void BRepLib::ExtendFace ( const TopoDS_Face & theF,
    const double theExtVal,
    const bool theExtUMin,
    const bool theExtUMax,
    const bool theExtVMin,
    const bool theExtVMax,
    TopoDS_Face & theFExtended )
    static

    Enlarges the face on the given value.

    Parameters
    [in]theFThe face to extend
    [in]theExtValThe extension value
    [in]theExtUMinDefines whether to extend the face in UMin direction
    [in]theExtUMaxDefines whether to extend the face in UMax direction
    [in]theExtVMinDefines whether to extend the face in VMin direction
    [in]theExtVMaxDefines whether to extend the face in VMax direction
    [in]theFExtendedThe extended face

    ◆ FindValidRange() [1/2]

    bool BRepLib::FindValidRange ( const Adaptor3d_Curve & theCurve,
    const double theTolE,
    const double theParV1,
    const gp_Pnt & thePntV1,
    const double theTolV1,
    const double theParV2,
    const gp_Pnt & thePntV2,
    const double theTolV2,
    double & theFirst,
    double & theLast )
    static

    For an edge defined by 3d curve and tolerance and vertices defined by points, parameters on curve and tolerances, finds a range of curve between vertices not covered by vertices tolerances. Returns false if there is no such range. Otherwise, sets theFirst and theLast as its bounds.

    ◆ FindValidRange() [2/2]

    bool BRepLib::FindValidRange ( const TopoDS_Edge & theEdge,
    double & theFirst,
    double & theLast )
    static

    Finds a range of 3d curve of the edge not covered by vertices tolerances. Returns false if there is no such range. Otherwise, sets theFirst and theLast as its bounds.

    ◆ OrientClosedSolid()

    bool BRepLib::OrientClosedSolid ( TopoDS_Solid & solid)
    static

    Orients the solid forward and the shell with the orientation to have matter in the solid. Returns False if the solid is unOrientable (open or incoherent).

    ◆ Plane() [1/2]

    const occ::handle< Geom_Plane > & BRepLib::Plane ( )
    static

    Returns the current plane.

    ◆ Plane() [2/2]

    void BRepLib::Plane ( const occ::handle< Geom_Plane > & P)
    static

    Sets the current plane to P.

    ◆ Precision() [1/2]

    double BRepLib::Precision ( )
    static

    Returns the default precision.

    ◆ Precision() [2/2]

    void BRepLib::Precision ( const double P)
    static

    Computes the max distance between edge and its 2d representation on the face. Sets the default precision. The current Precision is returned.

    ◆ ReverseSortFaces()

    void BRepLib::ReverseSortFaces ( const TopoDS_Shape & S,
    NCollection_List< TopoDS_Shape > & LF )
    static

    Sorts in LF the Faces of S on the reverse complexity of their surfaces (other,Torus,Sphere,Cone,Cylinder,Plane).

    ◆ SameParameter() [1/4]

    TopoDS_Edge BRepLib::SameParameter ( const TopoDS_Edge & theEdge,
    const double theTolerance,
    double & theNewTol,
    const bool IsUseOldEdge )
    static

    Computes new 2d curve(s) for the edge <theEdge> to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on the Edge. theNewTol is a new tolerance of vertices of the input edge (not applied inside the algorithm, but pre-computed). If IsUseOldEdge is true then the input edge will be modified, otherwise the new copy of input edge will be created. Returns the new edge as a result, can be ignored if IsUseOldEdge is true.

    ◆ SameParameter() [2/4]

    void BRepLib::SameParameter ( const TopoDS_Edge & theEdge,
    const double Tolerance = 1.0e-5 )
    static

    Computes new 2d curve(s) for the edge <theEdge> to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on the Edge.

    ◆ SameParameter() [3/4]

    void BRepLib::SameParameter ( const TopoDS_Shape & S,
    BRepTools_ReShape & theReshaper,
    const double Tolerance = 1.0e-5,
    const bool forced = false )
    static

    Computes new 2d curve(s) for all the edges of to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on an Edge. theReshaper is used to record the modifications of input shape to prevent any modifications on the shape itself. Thus the input shape (and its subshapes) will not be modified, instead the reshaper will contain a modified empty-copies of original subshapes as substitutions.

    ◆ SameParameter() [4/4]

    void BRepLib::SameParameter ( const TopoDS_Shape & S,
    const double Tolerance = 1.0e-5,
    const bool forced = false )
    static

    Computes new 2d curve(s) for all the edges of to have the same parameter as the 3d curve. The algorithm is not done if the flag SameParameter was True on an Edge.

    ◆ SameRange()

    void BRepLib::SameRange ( const TopoDS_Edge & E,
    const double Tolerance = 1.0e-5 )
    static

    will make all the curve representation have the same range domain for the parameters. This will IGNORE the same range flag value to proceed. If there is a 3D curve there it will the range of that curve. If not the first curve representation encountered in the list will give its range to the all the other curves.

    ◆ SortFaces()

    void BRepLib::SortFaces ( const TopoDS_Shape & S,
    NCollection_List< TopoDS_Shape > & LF )
    static

    Sorts in LF the Faces of S on the complexity of their surfaces (Plane,Cylinder,Cone,Sphere,Torus,other).

    ◆ UpdateDeflection()

    void BRepLib::UpdateDeflection ( const TopoDS_Shape & S)
    static

    Updates value of deflection in Poly_Triangulation of faces by the maximum deviation measured on existing triangulation.

    ◆ UpdateEdgeTol()

    bool BRepLib::UpdateEdgeTol ( const TopoDS_Edge & E,
    const double MinToleranceRequest,
    const double MaxToleranceToCheck )
    static

    Checks if the edge has a Tolerance smaller than MaxToleranceToCheck if so it will compute the radius of the cylindrical pipe surface that MinToleranceRequest is the minimum tolerance before it is useful to start testing. Usually it should be around 10e-5 contains all the curve representation of the edge returns True if the Edge tolerance had to be updated.

    ◆ UpdateEdgeTolerance()

    bool BRepLib::UpdateEdgeTolerance ( const TopoDS_Shape & S,
    const double MinToleranceRequest,
    const double MaxToleranceToCheck )
    static

    Checks all the edges of the shape whose Tolerance is smaller than MaxToleranceToCheck Returns True if at least one edge was updated MinToleranceRequest is the minimum tolerance before it is useful to start testing. Usually it should be around 10e-5.

    Warning: The method is very slow as it checks all. Use only in interfaces or processing assimilate batch

    ◆ UpdateInnerTolerances()

    void BRepLib::UpdateInnerTolerances ( const TopoDS_Shape & S)
    static

    Checks tolerances of edges (including inner points) and vertices of a shape and updates them to satisfy "SameParameter" condition.

    ◆ UpdateTolerances() [1/2]

    void BRepLib::UpdateTolerances ( const TopoDS_Shape & S,
    BRepTools_ReShape & theReshaper,
    const bool verifyFaceTolerance = false )
    static

    Replaces tolerance of FACE EDGE VERTEX by the tolerance Max of their connected handling shapes. It is not necessary to use this call after SameParameter. (called in) theReshaper is used to record the modifications of input shape to prevent any modifications on the shape itself. Thus the input shape (and its subshapes) will not be modified, instead the reshaper will contain a modified empty-copies of original subshapes as substitutions.

    ◆ UpdateTolerances() [2/2]

    void BRepLib::UpdateTolerances ( const TopoDS_Shape & S,
    const bool verifyFaceTolerance = false )
    static

    Replaces tolerance of FACE EDGE VERTEX by the tolerance Max of their connected handling shapes. It is not necessary to use this call after SameParameter. (called in).


    The documentation for this class was generated from the following file: