Bitbybit Docs
    Preparing search index...

    Class OCCTEdge

    Edges in OpenCascade: single curves between two vertices, straight, circular, elliptical or free-form. Build them from points and lines, as arcs, circles and ellipses, or as lines and circles tangent to other curves in a plane; cut, lengthen and blend them; read them back as points, lengths, tangents and centers; and pick edges out of any shape. Edges join end to end into wires, which shapes.wire handles. Parameters along an edge run from 0 at its start to 1 at its end; angles are in degrees.

    Index

    Constructors

    constraint

    debug

    edit

    extract

    frames

    from

    from base

    get

    get circular edge

    is

    primitives

    rebuild

    seam

    shapes

    Constructors

    constraint

    • Draws the straight lines from two points that just touch a circle, one tangent line from each point.

      positionResult keeps the solutions on one side of the circle or all of them, and circleRemainder adds the piece of the circle between the touching points. It is replaced by linesTangentToTwo, which takes curves other than circles too.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      The tangent lines, and the circle piece when asked for

      Use linesTangentToTwo once per point, with the point as a vertex (shapes.vertex.vertexFromPoint) and a frame in the circle's plane; it gives no circle piece. It is removed in a future major version and works until then.

      const tangents = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle({
      circle,
      point1: [20, 0, 0],
      point2: [-20, 0, 0],
      tolerance: 1e-7,
      positionResult: Bit.Inputs.OCCT.positionResultEnum.all,
      circleRemainder: Bit.Inputs.OCCT.circleInclusionEnum.none,
      });
    • Draws the two straight lines from a point that just touch a circle.

      positionResult keeps the solution on one side of the circle or both, and circleRemainder adds the piece of the circle between the touching points. It is replaced by linesTangentToTwo, which takes curves other than circles too.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      The tangent lines, and the circle piece when asked for

      Use linesTangentToTwo with the point as a vertex (shapes.vertex.vertexFromPoint) and a frame in the circle's plane; it gives no circle piece. It is removed in a future major version and works until then.

      const tangents = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle({
      circle,
      point: [20, 0, 0],
      tolerance: 1e-7,
      positionResult: Bit.Inputs.OCCT.positionResultEnum.all,
      circleRemainder: Bit.Inputs.OCCT.circleInclusionEnum.none,
      });
    • Draws the straight lines that just touch two circles at once, like a belt around two pulleys.

      positionResult keeps the lines on one side or all of them, and circleRemainders adds the outside or inside pieces of the circles between the touching points, which completes the belt shape. It is replaced by linesTangentToTwo, which takes curves other than circles too.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      The tangent lines, and the circle pieces when asked for

      Use linesTangentToTwo with the two circles and a frame in their plane; it gives no circle pieces. It is removed in a future major version and works until then.

      const belt = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles({
      circle1,
      circle2,
      tolerance: 1e-7,
      positionResult: Bit.Inputs.OCCT.positionResultEnum.all,
      circleRemainders: Bit.Inputs.OCCT.twoCircleInclusionEnum.outside,
      });
    • Draws the circles of a given radius that just touch two circles at once.

      It is replaced by circlesTangentToTwoWithRadius, which takes curves other than circles too.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      The tangent circles

      Use circlesTangentToTwoWithRadius with the two circles and a frame in their plane. It is removed in a future major version and works until then.

      const circles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles({ circle1, circle2, tolerance: 1e-7, radius: 3 });
      
    • Draws the circles of a given radius that pass through a point and just touch a circle.

      It is replaced by circlesTangentToTwoWithRadius, which takes a vertex and a curve other than a circle too.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      The tangent circles

      Use circlesTangentToTwoWithRadius with the circle, the point as a vertex (shapes.vertex.vertexFromPoint) and a frame in the circle's plane. It is removed in a future major version and works until then.

      const circles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt({ circle, point: [15, 0, 0], tolerance: 1e-7, radius: 3 });
      
    • Draws every circle that touches three edges, or passes through the vertices among them, in the plane of a frame.

      Straight edges count as endless lines and arcs as whole circles unless onArgumentsOnly is set; other curves are touched within their ends. A circle that is one of the edges is left out.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One whole circle per solution

      const circles = await bitbybit.occt.shapes.edge.circlesTangentToThree({
      shapes: [sideA, sideB, sideC],
      frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] },
      tolerance: 1e-7,
      onArgumentsOnly: true,
      });
    • Draws every circle of a given radius that touches two edges, or passes through the vertices among them, in the plane of a frame.

      Straight edges count as endless lines and arcs as whole circles unless onArgumentsOnly is set; other curves are touched within their ends. A circle that is one of the given edges is left out.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One whole circle per solution

      const fillets = await bitbybit.occt.shapes.edge.circlesTangentToTwoWithRadius({
      shapes: [wall, floor],
      frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] },
      radius: 2,
      tolerance: 1e-7,
      onArgumentsOnly: true,
      });
    • Draws every circle centered on an edge that touches two other edges, or passes through the vertices among them, in the plane of a frame.

      Straight edges count as endless lines and arcs as whole circles, the edge of centers too, unless onArgumentsOnly is set, which also keeps each center within centerOn. Other curves are touched within their ends.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One whole circle per solution

      const circles = await bitbybit.occt.shapes.edge.circlesTangentToTwoCenteredOn({
      shapes: [top, bottom],
      centerOn: axis,
      frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] },
      tolerance: 1e-7,
      onArgumentsOnly: false,
      });
    • Draws every straight line that touches two curved edges, or touches one and passes through a vertex, in the plane of a frame.

      Each line runs from the first shape to the second, like a belt between two wheels. Arcs count as whole circles unless onArgumentsOnly is set; straight edges and two vertices are refused.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One line per solution, from contact to contact

      const belt = await bitbybit.occt.shapes.edge.linesTangentToTwo({
      shapes: [wheelA, wheelB],
      frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] },
      angularTolerance: 1e-6,
      onArgumentsOnly: false,
      });
    • Draws every straight line that touches a curved edge at an angle to a straight reference edge, in the plane of a frame.

      The angle, in degrees, turns counterclockwise about the frame's normal. Each line runs from its touch to the reference's line; a parallel one is centered on its touch, as long as the reference.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One line per solution, from the touch to the reference

      const tangents = await bitbybit.occt.shapes.edge.linesTangentAtAngle({
      shape: arc,
      reference: baseLine,
      frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] },
      angle: 30,
      angularTolerance: 1e-6,
      onArgumentsOnly: false,
      });

    debug

    • Collects diagnostic facts about the curve of an edge: its type and degree, control point and knot counts, whether it is rational, periodic or closed, its parameter range and period, its length and its end points.

      Parameters

      Returns Promise<EdgeDebugInfo>

      The report about the edge's curve

      const info = await bitbybit.occt.shapes.edge.debugInfo({ shape: edge });
      

    edit

    • Cuts an edge into pieces at places given as fractions from 0 at its start to 1 at its end.

      The pieces keep the edge's curve and direction, so the pieces of an arc are arcs. Fractions follow the parameter, not the length; ends and repeats are skipped, so n places inside the edge give n + 1 pieces.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      The pieces, in order from the start

      const [firstHalf, secondHalf] = await bitbybit.occt.shapes.edge.splitEdgeAtParams({ shape: arc, params: [0.5] });
      
    • Cuts an edge into pieces at places given as lengths along it from its start, in model units.

      Each piece runs along the edge's own curve and keeps its direction. Lengths at or past the ends and repeats are skipped, so n lengths inside the edge give n + 1 pieces.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      The pieces, in order from the start

      const pieces = await bitbybit.occt.shapes.edge.splitEdgeAtLengths({ shape: edge, lengths: [2, 5] });
      
    • Lengthens an edge before its start and past its end, carrying its curve on the way it runs.

      A line stays a line and an arc an arc, up to a full circle. Other curves become B-splines ending that far along the end's tangent, bending smoothly across the join; one still turning there gains a little more.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      A new, longer edge running the same way

      const longer = await bitbybit.occt.shapes.edge.extendEdge({ shape: edge, atStart: 0, atEnd: 2 });
      
    • Bridges the gap from the end of one edge to the start of another with a smooth Bezier edge that leaves and arrives along their tangents.

      With matchCurvature it also bends as each edge bends at its end. bulge sets how long it holds each tangent; edges whose ends already meet are refused.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The blend edge

      const bridge = await bitbybit.occt.shapes.edge.blendBetweenEdges({ from: first, to: second, matchCurvature: true, bulge: 1 });
      const path = await bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire({ shapes: [first, bridge, second] });

    extract

    • Finds the point a fraction of the way along an edge: 0 is the start, 1 the end, 0.5 the middle of the parameter range.

      The fraction follows the curve's own parameter, which for a free-form curve is not evenly spread by length; use pointOnEdgeAtLength for a distance.

      Parameters

      Returns Promise<Point3>

      The point on the edge

      const middle = await bitbybit.occt.shapes.edge.pointOnEdgeAtParam({ shape: edge, param: 0.5 });
      
    • Turns every edge of a shape into a run of points that follows its curve closely enough to draw it, one list per edge.

      The deflection settings say how tightly the points hug curved edges; a wire's edges come in their order along the wire.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per edge

      const polylines = await bitbybit.occt.shapes.edge.edgesToPoints({
      shape: wire,
      angularDeflection: 0.1,
      curvatureDeflection: 0.1,
      minimumOfPoints: 2,
      uTolerance: 1e-9,
      minimumLength: 1e-7,
      });
    • Finds the direction the edge is heading at a fraction of the way along it, from 0 at the start to 1 at the end.

      Parameters

      Returns Promise<Vector3>

      The tangent direction

      const tangent = await bitbybit.occt.shapes.edge.tangentOnEdgeAtParam({ shape: arc, param: 0.5 });
      
    • Finds the direction each edge in a list is heading at the same fraction along it.

      Parameters

      Returns Promise<Point3[]>

      One tangent per edge, in the same order

      const tangents = await bitbybit.occt.shapes.edge.tangentsOnEdgesAtParam({ shapes: edges, param: 0.5 });
      
    • Finds the point a given distance along an edge from its start, measured along the curve in model units.

      Parameters

      Returns Promise<Point3>

      The point on the edge

      const point = await bitbybit.occt.shapes.edge.pointOnEdgeAtLength({ shape: edge, length: 2.5 });
      
    • Finds the point at the same distance from the start along each edge in a list.

      Parameters

      Returns Promise<Point3[]>

      One point per edge, in the same order

      const points = await bitbybit.occt.shapes.edge.pointsOnEdgesAtLength({ shapes: edges, length: 2.5 });
      
    • Finds the direction the edge is heading at a given distance along it from its start, measured along the curve.

      Parameters

      Returns Promise<Vector3>

      The tangent direction

      const tangent = await bitbybit.occt.shapes.edge.tangentOnEdgeAtLength({ shape: arc, length: 2.5 });
      
    • Finds the direction each edge in a list is heading at the same distance from its start.

      Parameters

      Returns Promise<Vector3[]>

      One tangent per edge, in the same order

      const tangents = await bitbybit.occt.shapes.edge.tangentsOnEdgesAtLength({ shapes: edges, length: 2.5 });
      
    • Reads the point where an edge starts, in the edge's own direction.

      Parameters

      Returns Promise<Point3>

      The start point

      const start = await bitbybit.occt.shapes.edge.startPointOnEdge({ shape: edge });
      
    • Reads the start point of each edge in a list.

      Parameters

      Returns Promise<Point3[]>

      One start point per edge, in the same order

      const starts = await bitbybit.occt.shapes.edge.startPointsOnEdges({ shapes: edges });
      
    • Reads the point where an edge ends, in the edge's own direction.

      Parameters

      Returns Promise<Point3>

      The end point

      const end = await bitbybit.occt.shapes.edge.endPointOnEdge({ shape: edge });
      
    • Reads the end point of each edge in a list.

      Parameters

      Returns Promise<Point3[]>

      One end point per edge, in the same order

      const ends = await bitbybit.occt.shapes.edge.endPointsOnEdges({ shapes: edges });
      
    • Places points along an edge at equal steps of its parameter, from start to end.

      nrOfDivisions steps give one more point than that; removeStartPoint and removeEndPoint drop the ends. On a free-form curve equal parameter steps are not equal distances; use divideEdgeByEqualDistanceToPoints for those.

      Parameters

      Returns Promise<Point3[]>

      The points along the edge, in order

      const points = await bitbybit.occt.shapes.edge.divideEdgeByParamsToPoints({ shape: edge, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Places points along each edge in a list at equal steps of its parameter, one list per edge.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per edge, in the same order

      const points = await bitbybit.occt.shapes.edge.divideEdgesByParamsToPoints({ shapes: edges, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Places points along an edge at equal distances measured along its curve, from start to end.

      nrOfDivisions steps give one more point than that; removeStartPoint and removeEndPoint drop the ends.

      Parameters

      Returns Promise<Point3[]>

      The points along the edge, in order

      const points = await bitbybit.occt.shapes.edge.divideEdgeByEqualDistanceToPoints({ shape: edge, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Places points along each edge in a list at equal distances along its curve, one list per edge.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per edge, in the same order

      const points = await bitbybit.occt.shapes.edge.divideEdgesByEqualDistanceToPoints({ shapes: edges, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      

    frames

    • Finds a frame on an edge at a parameter, from 0 where the edge starts in its own direction. kind sets how it follows: carried from the start without twisting, across the edge level with up, or in the plane it bends in; Frenet frames throw where the edge runs straight, level ones where it runs along up.

      Parameters

      Returns Promise<Bit.Inputs.Base.Frame>

      The frame at that place

      const frame = await bitbybit.occt.shapes.edge.frameOnEdgeAtParam({ shape: edge, param: 0.5, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] });
      
    • Finds a frame on an edge at a length from its start, as frameOnEdgeAtParam finds it at a parameter.

      Parameters

      Returns Promise<Bit.Inputs.Base.Frame>

      The frame at that place

      const frame = await bitbybit.occt.shapes.edge.frameOnEdgeAtLength({ shape: edge, length: 2, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] });
      
    • Finds frames on an edge at several parameters in one pass. Rotation-minimizing frames are carried along the whole edge from its start, so each is the frame a swept profile would ride on there.

      Parameters

      Returns Promise<Bit.Inputs.Base.Frame[]>

      One frame per parameter, in the same order

      const frames = await bitbybit.occt.shapes.edge.framesOnEdgeAtParams({ shape: edge, params: [0, 0.5, 1], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] });
      
    • Finds frames on an edge at several lengths from its start in one pass, as framesOnEdgeAtParams finds them at parameters.

      Parameters

      Returns Promise<Bit.Inputs.Base.Frame[]>

      One frame per length, in the same order

      const frames = await bitbybit.occt.shapes.edge.framesOnEdgeAtLengths({ shape: edge, lengths: [0, 1, 2], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] });
      

    from

    from base

    • Makes a straight edge from a line object of the form { start, end }.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The straight edge

      const edge = await bitbybit.occt.shapes.edge.fromBaseLine({ line: { start: [0, 0, 0], end: [10, 0, 0] } });
      
    • Makes one straight edge per line object of the form { start, end }.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One edge per line, in the same order

      const edges = await bitbybit.occt.shapes.edge.fromBaseLines({ lines: [{ start: [0, 0, 0], end: [10, 0, 0] }, { start: [10, 0, 0], end: [10, 10, 0] }] });
      
    • Makes a straight edge from a segment, a pair of points [start, end].

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The straight edge

      const edge = await bitbybit.occt.shapes.edge.fromBaseSegment({ segment: [[0, 0, 0], [10, 0, 0]] });
      
    • Makes one straight edge per segment, each a pair of points [start, end].

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One edge per segment, in the same order

      const edges = await bitbybit.occt.shapes.edge.fromBaseSegments({ segments: [[[0, 0, 0], [10, 0, 0]], [[10, 0, 0], [10, 10, 0]]] });
      
    • Joins each point to the next with a straight edge, so a list of points becomes a chain of edges.

      The edges are returned loose; shapes.wire.createPolylineWire makes the joined wire directly.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One edge per pair of neighboring points

      const edges = await bitbybit.occt.shapes.edge.fromPoints({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]] });
      
    • Makes one straight edge per segment of a polyline object; a closed polyline also gets the edge from its last point back to its first.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      One edge per segment, in order

      const edges = await bitbybit.occt.shapes.edge.fromBasePolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]], isClosed: true } });
      
    • Makes the three straight edges of a triangle given as three points.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      Its three edges

      const edges = await bitbybit.occt.shapes.edge.fromBaseTriangle({ triangle: [[0, 0, 0], [10, 0, 0], [0, 10, 0]] });
      
    • Makes the three straight edges of every triangle of a mesh, all in one flat list.

      A triangle whose edges cannot be built is skipped with a warning rather than stopping the rest.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      The edges of all the triangles

      const edges = await bitbybit.occt.shapes.edge.fromBaseMesh({ mesh: triangles });
      

    get

    • Picks one edge out of a shape by its position, counting from 0, in the order the kernel walks the shape.

      The shape must be an edge, a wire or something built from them; an index beyond the last edge throws an error.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The edge at that index

      const first = await bitbybit.occt.shapes.edge.getEdge({ shape: wire, index: 0 });
      
    • Lists every edge of a shape in the order the kernel walks it, which is not the order along a wire; use getEdgesAlongWire for that.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      The edges found in the shape

      const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box });
      
    • Lists the edges of a wire in the order they follow each other along it, each oriented to run in the wire's direction.

      A single edge is returned as a one-element list.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      Its edges in order along the wire

      const ordered = await bitbybit.occt.shapes.edge.getEdgesAlongWire({ shape: wire });
      
    • Lists only the circular edges of a wire, in the order they follow each other along it.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      Its circular edges in order

      const arcs = await bitbybit.occt.shapes.edge.getCircularEdgesAlongWire({ shape: roundedRectangle });
      
    • Lists only the straight edges of a wire, in the order they follow each other along it.

      Parameters

      Returns Promise<TopoDSEdgePointer[]>

      Its straight edges in order

      const straights = await bitbybit.occt.shapes.edge.getLinearEdgesAlongWire({ shape: roundedRectangle });
      
    • Lists the end points of every edge of a shape, with repeats removed, so a corner where several edges meet appears once.

      The points come in no particular order.

      Parameters

      Returns Promise<Point3[]>

      The unique end points of the edges

      const corners = await bitbybit.occt.shapes.edge.getCornerPointsOfEdgesForShape({ shape: box });
      
    • Measures the length of an edge along its curve, in model units.

      Parameters

      Returns Promise<number>

      The length

      const len = await bitbybit.occt.shapes.edge.getEdgeLength({ shape: edge });
      
    • Measures every edge of a shape along its curve, in model units.

      Parameters

      Returns Promise<number[]>

      One length per edge, in the order getEdges lists them

      const lengths = await bitbybit.occt.shapes.edge.getEdgeLengthsOfShape({ shape: box });
      
    • Measures each edge in a list along its curve, in model units.

      Parameters

      Returns Promise<number[]>

      One length per edge, in the same order

      const lengths = await bitbybit.occt.shapes.edge.getEdgesLengths({ shapes: edges });
      
    • Finds the center of mass of an edge, the balance point of its curve; for a straight edge that is its midpoint, for an arc a point inside the curve.

      Parameters

      Returns Promise<Point3>

      The center of mass point

      const center = await bitbybit.occt.shapes.edge.getEdgeCenterOfMass({ shape: edge });
      
    • Finds the center of mass of each edge in a list.

      Parameters

      Returns Promise<Point3[]>

      One point per edge, in the same order

      const centers = await bitbybit.occt.shapes.edge.getEdgesCentersOfMass({ shapes: edges });
      

    get circular edge

    • Finds the center of the circle a circular edge lies on.

      An edge that is not circular throws an error.

      Parameters

      Returns Promise<Point3>

      The center point

      const center = await bitbybit.occt.shapes.edge.getCircularEdgeCenterPoint({ shape: arc });
      
    • Reads the radius of the circle a circular edge lies on.

      An edge that is not circular throws an error.

      Parameters

      Returns Promise<number>

      The radius in model units

      const radius = await bitbybit.occt.shapes.edge.getCircularEdgeRadius({ shape: arc });
      
    • Reads the normal of the plane a circular edge lies in.

      An edge that is not circular throws an error.

      Parameters

      Returns Promise<Vector3>

      The unit normal of the circle's plane

      const normal = await bitbybit.occt.shapes.edge.getCircularEdgePlaneDirection({ shape: arc });
      

    is

    • Tells whether an edge is a straight line.

      Parameters

      Returns Promise<boolean>

      True when the edge is straight

      const straight = await bitbybit.occt.shapes.edge.isEdgeLinear({ shape: edge });
      
    • Tells whether an edge lies on a circle, whether a full circle or an arc.

      Parameters

      Returns Promise<boolean>

      True when the edge is circular

      const round = await bitbybit.occt.shapes.edge.isEdgeCircular({ shape: edge });
      

    primitives

    • Makes a straight edge between two points, the simplest edge there is.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The straight edge

      const edge = await bitbybit.occt.shapes.edge.line({ start: [0, 0, 0], end: [10, 0, 0] });
      
    • Makes a circular arc that starts at the first point, passes through the middle one and ends at the last.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The arc edge

      const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints({ start: [0, 0, 0], middle: [5, 5, 0], end: [10, 0, 0] });
      
    • Makes a circular arc from one point to another that leaves the first point in a given direction.

      The tangent fixes the plane and the radius of the arc.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The arc edge

      const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent({ start: [0, 0, 0], tangentVec: [0, 1, 0], end: [10, 0, 0] });
      
    • Cuts an arc out of a circle edge between two points on it.

      sense picks which way round the circle the arc runs from the first point to the second.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The arc edge

      const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints({ circle, start: [10, 0, 0], end: [0, 0, 10], sense: true });
      
    • Cuts an arc out of a circle edge between two angles, in degrees, measured around the circle from its own start.

      sense picks which way round the circle the arc runs from the first angle to the second.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The arc edge

      const quarter = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles({ circle, alphaAngle1: 0, alphaAngle2: 90, sense: true });
      
    • Cuts an arc out of a circle edge that starts at a point on the circle and spans a given angle, in degrees.

      sense picks which way round the circle the arc runs.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The arc edge

      const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle({ circle, point: [10, 0, 0], alphaAngle: 45, sense: true });
      
    • Makes a full circle as one closed edge, lying in the plane whose normal is direction.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The circle edge

      const circle = await bitbybit.occt.shapes.edge.createCircleEdge({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a full ellipse as one closed edge, lying in the plane whose normal is direction.

      radiusMajor must not be smaller than radiusMinor, or the kernel refuses the ellipse.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      The ellipse edge

      const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge({ center: [0, 0, 0], direction: [0, 1, 0], radiusMinor: 3, radiusMajor: 6 });
      

    rebuild

    • Rebuilds the curve of an edge as a B-spline of a given degree, within a tolerance.

      Lowering the degree simplifies the curve, raising it gives later operations more freedom; either way the new curve stays within tolerance of the old.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      A new edge with the rebuilt curve

      const simpler = await bitbybit.occt.shapes.edge.rebuildEdgeDegree({ shape: edge, degree: 3, tolerance: 1e-3 });
      

    seam

    • Moves the seam of a closed periodic edge, the point where it starts and ends, to a given parameter along the curve.

      The geometry does not change; only where the edge is considered to begin.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      A new edge starting at the seam

      const rotated = await bitbybit.occt.shapes.edge.moveEdgeSeamByParameter({ shape: circle, parameter: 1.57 });
      
    • Moves the seam of a closed periodic edge, the point where it starts and ends, by a distance along the curve from its current start.

      The geometry does not change; only where the edge is considered to begin.

      Parameters

      Returns Promise<TopoDSEdgePointer>

      A new edge starting at the seam

      const rotated = await bitbybit.occt.shapes.edge.moveEdgeSeamByLength({ shape: circle, length: 2.5 });
      

    shapes

    • Merges faces that lie on the same surface and edges on the same curve, which removes the internal seams a boolean or a fuse leaves behind.

      It is shapes.shape.unifySameDomain with edges and faces both unified and B-splines left as they are.

      Parameters

      Returns Promise<TopoDSShapePointer>

      The shape without internal seams

      const clean = await bitbybit.occt.shapes.edge.removeInternalEdges({ shape: fused });