Bitbybit Docs
    Preparing search index...

    Class OCCTSelectEdges

    Choosing the edges of an OpenCascade shape by what they are, where they lie and how they meet, so that "the edges round the top" still names the right edges after a parameter changes. Every method returns edge indexes as shapes.edge.getEdges counts them, from 0, which fillets, the getters and the other selectors take as they are. indexes limits a filter to edges chosen before, keeping their order; left out, every edge is a candidate, and an empty list chooses nothing. Degenerate edges, the poles of a sphere, are never chosen.

    Index

    Constructors

    by geometry

    • Chooses the edges that run along one kind of curve, such as the straight edges of a part or the circular rims of its holes.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const rims = await bitbybit.occt.select.edges.ofType({ shape: part, type: Bit.Inputs.OCCT.curveTypeEnum.circle });
      
    • Chooses the straight edges that run within angle degrees of direction, either way along it: an angle of 0 finds the edges parallel to it.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const upright = await bitbybit.occt.select.edges.along({ shape: part, direction: [0, 0, 1], angle: 0 });
      
    • Chooses the edges whose length lies between min and max, both included.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const short = await bitbybit.occt.select.edges.byLength({ shape: part, min: 0, max: 2 });
      
    • Chooses the circular edges whose radius lies between min and max, both included.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const rims = await bitbybit.occt.select.edges.byRadius({ shape: part, min: 1.9, max: 2.1 });
      
    • Chooses the edges where two faces meet at an outside corner, the ridges a fillet rounds off; faces meeting within tangentAngle degrees of smooth count as neither.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const ridges = await bitbybit.occt.select.edges.convex({ shape: part, tangentAngle: 1 });
      
    • Chooses the edges where two faces meet at an inside corner, the valleys a fillet fills; faces meeting within tangentAngle degrees of smooth count as neither.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const valleys = await bitbybit.occt.select.edges.concave({ shape: part, tangentAngle: 1 });
      

    by position

    • Chooses the edges whose centres lie furthest along direction, with any others within tolerance of them: the edges round the top along z.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const topEdges = await bitbybit.occt.select.edges.extreme({ shape: part, direction: [0, 0, 1], tolerance: 1e-7 });
      
    • Chooses the edges whose centres lie inside a box lined up with the axes, given by two opposite corners in either order.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const near = await bitbybit.occt.select.edges.inBox({ shape: part, corner: [0, 0, 9], oppositeCorner: [10, 10, 11] });
      
    • Chooses the edges whose centres lie within radius of center.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const around = await bitbybit.occt.select.edges.inSphere({ shape: part, center: [5, 5, 10], radius: 6 });
      
    • Chooses the count edges whose centres lie nearest point, nearest first; edges as near as each other keep their order.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges, nearest first

      const [picked] = await bitbybit.occt.select.edges.nearest({ shape: part, point: [5, 0, 10], count: 1 });
      
    • Chooses the edges that lie in a plane, given by a point on it and its normal: every point of an edge within tolerance of the plane.

      Parameters

      Returns Promise<number[]>

      The indexes of the chosen edges

      const outline = await bitbybit.occt.select.edges.onPlane({ shape: part, origin: [0, 0, 0], normal: [0, 0, 1] });
      

    by relation

    • Chooses the edges that bound any of the given faces, counted as shapes.face.getFaces counts them.

      Parameters

      Returns Promise<number[]>

      The indexes of the edges, in order

      const rim = await bitbybit.occt.select.edges.ofFaces({ shape: part, indexes: [5] });
      
    • Chooses the edges where a face of indexes meets a different face of otherIndexes, such as the edges round a top face where it meets the sides.

      Parameters

      Returns Promise<number[]>

      The indexes of the edges, in order

      const seam = await bitbybit.occt.select.edges.between({ shape: part, indexes: [5], otherIndexes: [0, 1, 2, 3] });
      
    • Grows the given edges into the chains they continue smoothly: two edges meeting where their tangents turn by no more than angle degrees are one chain, as a fillet runs along.

      Parameters

      Returns Promise<number[]>

      The indexes of the edges in the chains, in order

      const loop = await bitbybit.occt.select.edges.tangentChain({ shape: rounded, indexes: [3], angle: 1 });
      

    order

    • Orders edges by how far along direction their centres lie, from the lowest to the highest; edges level with each other keep their order.

      Parameters

      Returns Promise<number[]>

      The indexes of the edges, sorted

      const leftToRight = await bitbybit.occt.select.edges.sortAlong({ shape: part, direction: [1, 0, 0] });
      
    • Sorts edges along direction and groups them by level: a group ends where the next centre lies more than tolerance beyond the group's first.

      Parameters

      Returns Promise<number[][]>

      One list of edge indexes per level, from the lowest

      const levels = await bitbybit.occt.select.edges.groupAlong({ shape: part, direction: [0, 0, 1], tolerance: 0.01 });