OpenCascade.js
API ReferenceModelingAlgorithmsTKFillet

ChFi2d

OCCT package ChFi2d: ChFi2d, ChFi2d_AnaFilletAlgo, ChFi2d_Builder, ChFi2d_ChamferAPI, and 4 more bound classes.

ChFi2d

This package contains the algorithms used to build fillets or chamfers on planar wire.
This package provides two algorithms for 2D fillets: ChFi2d_Builder - it constructs a fillet or chamfer for linear and circular edges of a face. ChFi2d_FilletAPI - it encapsulates two algorithms: ChFi2d_AnaFilletAlgo - analytical constructor of the fillet.
It works only for linear and circular edges, having a common point. ChFi2d_FilletAlgo - iteration recursive method constructing the fillet edge for any type of edges including ellipses and b-splines. The edges may even have no common point. ChFi2d_ChamferAPI - an algorithm for construction of chamfers between two linear edges of a plane.
The algorithms ChFi2d_AnaFilletAlgo and ChFi2d_FilletAlgo may be used directly or via the interface class ChFi2d_FilletAPI.

Constructors(1)

Static methods(2)

ChFi2d_AnaFilletAlgo

An analytical algorithm for calculation of the fillets. It is implemented for segments and arcs of circle only.

Constructors(3)

Instance methods(4)

  • Init(theWire: TopoDS_Wire, thePlane: gp_Pln): void

    Initializes the class by a wire consisting of two edges.

    Parameters (2)
    • theWire
    • thePlane
  • Init(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, thePlane: gp_Pln): void

    Initializes the class by two edges.

    Parameters (3)
    • theEdge1
    • theEdge2
    • thePlane
  • Perform(radius: number): boolean

    Calculates a fillet.

    Parameters (1)
    • radius
  • Retrieves a result (fillet and shrinked neighbours).

    Parameters (2)
    • e1
      Mutated in place; read the updated value from this argument after the call.
    • e2
      Mutated in place; read the updated value from this argument after the call.

ChFi2d_Builder

This class contains the algorithm used to build fillet on planar wire.

Constructors(2)

Instance methods(20)

ChFi2d_ChamferAPI

A class making a chamfer between two linear edges.

Constructors(3)

Instance methods(4)

  • Init(theWire: TopoDS_Wire): void

    Initializes the class by a wire consisting of two libear edges.

    Parameters (1)
    • theWire
  • Init(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge): void

    Initializes the class by two linear edges.

    Parameters (2)
    • theEdge1
    • theEdge2
  • Perform(): boolean

    Constructs a chamfer edge. Returns true if the edge is constructed.

  • Result(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, theLength1: number, theLength2: number): TopoDS_Edge
    Parameters (4)
    • theEdge1
    • theEdge2
    • theLength1
    • theLength2

ChFi2d_ConstructionError

Properties(13)

ChFi2d_FilletAlgo

Algorithm that creates fillet edge: arc tangent to two edges in the start and in the end vertices. Initial edges must be located on the plane and must be connected by the end or start points (shared vertices are not obligatory). Created fillet arc is created with the given radius, that is useful in sketcher applications.
The algorithm is iterative that allows to create fillet on any curves of initial edges, that supports projection of point and C2 continuous. Principles of algorithm can de reduced to the Newton method:

  1. Splitting initial edge into N segments where probably only 1 root can be found. N depends on the complexity of the underlying curve.
  2. On each segment compute value and derivative of the function:argument of the function is the parameter on the curvetake point on the curve by the parameter: point of tangencymake center of fillet: perpendicular vector from the point of tagencymake projection from the center to the second curvelength of the projection minus radius of the fillet is result of the functionderivative of this function in the point is computed by value in point with small shift
  3. Using Newton search method take the point on the segment where function value is most close to zero. If it is not enough close, step 2 and 3 are repeated taking as start or end point the found point.
  4. If solution is found, result is created on point on root of the function (as a start point), point of the projection onto second curve (as an end point) and center of arc in found center. Initial edges are cut by the start and end point of tangency.

Constructors(3)

Instance methods(5)

  • Init(theWire: TopoDS_Wire, thePlane: gp_Pln): void

    Initializes a fillet algorithm: accepts a wire consisting of two edges in a plane.

    Parameters (2)
    • theWire
    • thePlane
  • Init(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, thePlane: gp_Pln): void

    Initializes a fillet algorithm: accepts two edges in a plane.

    Parameters (3)
    • theEdge1
    • theEdge2
    • thePlane
  • Perform(theRadius: number): boolean

    Constructs a fillet edge. Returns true, if at least one result was found.

    Parameters (1)
    • theRadius
  • NbResults(thePoint: gp_Pnt): number

    Returns number of possible solutions. <thePoint> chooses a particular fillet in case of several fillets may be constructed (for example, a circle intersecting a segment in 2 points). Put the intersecting (or common) point of the edges.

    Parameters (1)
    • thePoint
  • Result(thePoint: gp_Pnt, theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, iSolution: number): TopoDS_Edge

    Returns result (fillet edge, modified edge1, modified edge2), nearest to the given point <thePoint> if iSolution == -1. <thePoint> chooses a particular fillet in case of several fillets may be constructed (for example, a circle intersecting a segment in 2 points). Put the intersecting (or common) point of the edges.

    Parameters (4)
    • thePoint
    • theEdge1
      Mutated in place; read the updated value from this argument after the call.
    • theEdge2
      Mutated in place; read the updated value from this argument after the call.
    • iSolution

ChFi2d_FilletAPI

An interface class for 2D fillets.
Open CASCADE provides two algorithms for 2D fillets: ChFi2d_Builder - it constructs a fillet or chamfer for linear and circular edges of a face. ChFi2d_FilletAPI - it encapsulates two algorithms: ChFi2d_AnaFilletAlgo - analytical constructor of the fillet.
It works only for linear and circular edges, having a common point. ChFi2d_FilletAlgo - iteration recursive method constructing the fillet edge for any type of edges including ellipses and b-splines. The edges may even have no common point.
The algorithms ChFi2d_AnaFilletAlgo and ChFi2d_FilletAlgo may be used directly or via this ChFi2d_FilletAPI class. This class chooses an appropriate algorithm analyzing the arguments (a wire or two edges).

Constructors(3)

Instance methods(5)

  • Init(theWire: TopoDS_Wire, thePlane: gp_Pln): void

    Initializes a fillet algorithm: accepts a wire consisting of two edges in a plane.

    Parameters (2)
    • theWire
    • thePlane
  • Init(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, thePlane: gp_Pln): void

    Initializes a fillet algorithm: accepts two edges in a plane.

    Parameters (3)
    • theEdge1
    • theEdge2
    • thePlane
  • Perform(theRadius: number): boolean

    Constructs a fillet edge. Returns true if at least one result was found.

    Parameters (1)
    • theRadius
  • NbResults(thePoint: gp_Pnt): number

    Returns number of possible solutions. <thePoint> chooses a particular fillet in case of several fillets may be constructed (for example, a circle intersecting a segment in 2 points). Put the intersecting (or common) point of the edges.

    Parameters (1)
    • thePoint
  • Result(thePoint: gp_Pnt, theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, iSolution: number): TopoDS_Edge

    Returns result (fillet edge, modified edge1, modified edge2), nearest to the given point <thePoint> if iSolution == -1 <thePoint> chooses a particular fillet in case of several fillets may be constructed (for example, a circle intersecting a segment in 2 points). Put the intersecting (or common) point of the edges.

    Parameters (4)
    • thePoint
    • theEdge1
      Mutated in place; read the updated value from this argument after the call.
    • theEdge2
      Mutated in place; read the updated value from this argument after the call.
    • iSolution

FilletPoint

Private class. Corresponds to the point on the first curve, computed fillet function and derivative on it.

Constructors(1)

  • constructor(theParam: number): FilletPoint

    Creates a point on a first curve by parameter on this curve.

    Parameters (1)
    • theParam

Instance methods(18)

  • setParam(theParam: number): void

    Changes the point position by changing point parameter on the first curve.

    Parameters (1)
    • theParam
  • getParam(): number

    Returns the point parameter on the first curve.

  • getNBValues(): number

    Returns number of found values of function in this point.

  • getValue(theIndex: number): number

    Returns value of function in this point.

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

    Returns derivatives of function in this point.

    Parameters (1)
    • theIndex
  • isValid(theIndex: number): boolean

    Returns true if function is valid (rediuses vectors of fillet do not intersect any curve).

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

    Returns the index of the nearest value.

    Parameters (1)
    • theIndex
  • setParam2(theParam2: number): void

    Defines the parameter of the projected point on the second curve.

    Parameters (1)
    • theParam2
  • getParam2(): number

    Returns the parameter of the projected point on the second curve.

  • setCenter(thePoint: gp_Pnt2d): void

    Center of the fillet.

    Parameters (1)
    • thePoint
  • Center of the fillet.

  • appendValue(theValue: number, theValid: boolean): void

    Appends value of the function.

    Parameters (2)
    • theValue
    • theValid
  • calculateDiff(argNo0: FilletPoint): boolean

    Computes difference between this point and the given. Stores difference in myD.

    Parameters (1)
    • argNo0
  • FilterPoints(argNo0: FilletPoint): void

    Filters out the values and leaves the most optimal one.

    Parameters (1)
    • argNo0
  • Returns a pointer to created copy of the point warning: this is not the full copy! Copies only: myParam, myV, myD, myValid.

  • hasSolution(theRadius: number): number

    Returns the index of the solution or zero if there is no solution.

    Parameters (1)
    • theRadius
  • LowerValue(): number

    For debug only.

  • remove(theIndex: number): void

    Removes the found value by the given index.

    Parameters (1)
    • theIndex