Bitbybit Docs
    Preparing search index...

    Class OCCTFillets

    对 OpenCascade 形状的边进行倒圆角和倒角:圆角用给定半径的圆弧面替换锐边,倒角则用给定距离的平斜面替换。边通过 shapes.edge.getEdges 列出顺序中从 0 开始的索引选择,或直接传入;平面轮廓和面通过 fillet2d 在其角点处倒圆角,其角点索引从 1 开始。不合适的半径(例如大于相邻面)会使内核失败,因此请从小值开始。每个方法都返回新形状。

    Index

    Constructors

    2d fillets

    • 用给定半径的圆弧对平面线框或面的角进行圆角。

      没有 indexes 时每个角都以 radius 圆角。给出 indexes(沿轮廓从 1 开始计数)时,只对这些角圆角,每个使用 radiusradiusList 中对应的条目,其长度与 indexes 相同。带自由曲线边的线框使用 fillet3DWire

      Parameters

      Returns Promise<TopoDSShapePointer>

      倒圆角后的线框或面

      const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 10, length: 5, center: [0, 0, 0], direction: [0, 1, 0] });
      const rounded = await bitbybit.occt.fillets.fillet2d({ shape: rectangle, radius: 1 });
      const twoCorners = await bitbybit.occt.fillets.fillet2d({ shape: rectangle, radiusList: [1, 2], indexes: [1, 3] });
    • 用给定半径的圆弧连接位于同一平面内的两条边,修剪边使其与圆弧相接,并将三段作为一个线框返回。

      平面由 planeOrigin 和其法线 planeDirection 给出。当有多条圆弧可用时,solution 按索引选取一条;-1 取离 planeOrigin 最近的那条。

      Parameters

      Returns Promise<TopoDSWirePointer>

      由第一条边、圆弧和第二条边组成的线框

      const corner = await bitbybit.occt.fillets.filletTwoEdgesInPlaneIntoAWire({
      edge1: horizontal,
      edge2: vertical,
      planeOrigin: [0, 0, 0],
      planeDirection: [0, 1, 0],
      radius: 1,
      solution: -1,
      });

    3d chamfers

    • 按距离对形状的边进行倒角,以模型单位表示,将每条锐边切成一条平面窄带。

      没有 indexes 时每条边都以 distance 倒角。给出 indexes(按 shapes.edge.getEdges 列出的顺序从 0 开始计数)时,只对这些边倒角,每条使用 distancedistanceList 中对应的条目,按边的顺序。

      Parameters

      Returns Promise<TopoDSShapePointer>

      边已倒角的形状

      const beveled = await bitbybit.occt.fillets.chamferEdges({ shape: box, distance: 1 });
      
    • 对形状的给定边进行倒角,每条有自己的距离。

      这些边必须属于该形状;distanceList 按位置与它们配对,长度必须相同,否则抛出错误。

      Parameters

      Returns Promise<TopoDSShapePointer>

      边已倒角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const beveled = await bitbybit.occt.fillets.chamferEdgesList({ shape: box, edges: [edges[0], edges[1]], distanceList: [1, 2] });
    • 用不对称倒角对形状的一条边进行倒角:distance1face(在该边相交的两个面之一)上测量,distance2 在另一个面上测量。

      该面决定哪一侧使用哪个距离;交换它们可翻转倒角。

      Parameters

      Returns Promise<TopoDSShapePointer>

      该边已倒角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const faces = await bitbybit.occt.shapes.face.getFaces({ shape: box });
      const beveled = await bitbybit.occt.fillets.chamferEdgeTwoDistances({ shape: box, edge: edges[0], face: faces[0], distance1: 1, distance2: 2 });

    3d fillets

    • 用圆角半径对形状的边进行圆角,以模型单位表示。

      没有 indexes 时每条边都以 radius 圆角。给出 indexes(按 shapes.edge.getEdges 列出的顺序从 0 开始计数)时,只对这些边圆角,每条使用 radiusradiusList 中对应的条目,按边的顺序与所选边配对。

      Parameters

      Returns Promise<TopoDSShapePointer>

      边已倒圆角的形状

      const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 20, height: 5, center: [0, 0, 0] });
      const rounded = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 1 });
      const twoEdges = await bitbybit.occt.fillets.filletEdges({ shape: box, radiusList: [1, 2], indexes: [0, 3] });
    • 对形状的给定边进行圆角,每条有自己的半径。

      这些边必须属于该形状;radiusList 按位置与它们配对,长度必须相同,否则抛出错误。

      Parameters

      Returns Promise<TopoDSShapePointer>

      边已倒圆角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const rounded = await bitbybit.occt.fillets.filletEdgesList({ shape: box, edges: [edges[0], edges[1]], radiusList: [1, 2] });
    • 用沿边变化的半径对形状的一条边进行圆角。

      paramsU 是沿边的位置,表示为从起点 0 到终点 1 的分数,radiusList 给出每个位置处的半径;内核在它们之间平滑过渡。两个列表的长度必须相同,否则抛出错误。

      Parameters

      Returns Promise<TopoDSShapePointer>

      该边已倒圆角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const tapered = await bitbybit.occt.fillets.filletEdgeVariableRadius({ shape: box, edge: edges[0], radiusList: [0.5, 2, 0.5], paramsU: [0, 0.5, 1] });
    • 对形状的多条边进行圆角,每条使用相同的沿边变化的半径轮廓。

      paramsU 是沿每条边的位置,表示为 0 到 1 的分数,radiusList 是每个位置处的半径;两个列表的长度必须相同,否则抛出错误。

      Parameters

      Returns Promise<TopoDSShapePointer>

      这些边已倒圆角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const tapered = await bitbybit.occt.fillets.filletEdgesSameVariableRadius({ shape: box, edges: [edges[0], edges[2]], radiusList: [0.5, 2, 0.5], paramsU: [0, 0.5, 1] });
    • 对形状的多条边进行圆角,每条有自己的沿边变化的半径轮廓。

      radiusListsparamsULists 每条边各有一个列表,按边的顺序排列;在每一对中,位置是沿边 0 到 1 的分数,半径在该处生效。三个列表的长度必须相同,否则抛出错误。

      Parameters

      Returns Promise<TopoDSShapePointer>

      这些边已倒圆角的形状

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      const tapered = await bitbybit.occt.fillets.filletEdgesVariableRadius({
      shape: box,
      edges: [edges[0], edges[2]],
      radiusLists: [[0.5, 2], [2, 0.5]],
      paramsULists: [[0, 1], [0, 1]],
      });
    • 对不在同一平面内的线框的角进行圆角。

      内核没有直接的 3D 线框圆角,因此线框沿 direction 被拉伸成壳体,壳体被圆角,然后从中读回圆角后的线框;direction 不得与线框平行,并且必须为圆角留出空间。

      Parameters

      Returns Promise<TopoDSShapePointer>

      倒圆角后的线框

      const rounded = await bitbybit.occt.fillets.fillet3DWire({ shape: zigzagWire, radius: 0.5, direction: [0, 5, 0] });
      
    • 对不在同一平面内的多个线框的角进行圆角,与 fillet3DWire 对一个线框所做的相同,全部使用相同的半径、索引和方向。

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      倒圆角后的线框,顺序相同

      const rounded = await bitbybit.occt.fillets.fillet3DWires({ shapes: [wireA, wireB], radius: 0.5, direction: [0, 5, 0] });