Bitbybit Docs
    Preparing search index...

    Class OCCTWire

    Wires in OpenCascade: chains of edges joined end to end, open like a path or closed like an outline. Build them from points and curves (polylines, B-splines, Beziers, interpolations, helices, spirals), as ready-made flat outlines (circles, rectangles, stars, beam profiles, text) that lie on the ground plane unless direction says otherwise, or by joining and splitting existing edges and wires; read them back as points, tangents, lengths and centers; map them onto faces or project them onto shapes. Parameters along a wire run from 0 at its start to 1 at its end and follow each edge's own parameter, not distance. A closed wire is what shapes.face fills to make a face.

    Index

    Constructors

    beam profiles

    build

    debug

    edit

    extract

    extract from wires

    from base

    get

    multiple

    place

    primitives

    rebuild

    seam

    via points

    via wires

    Constructors

    beam profiles

    • Makes the closed outline of an I-beam cross-section: two horizontal flanges joined by a vertical web.

      width is the flange width, height the total height, webThickness and flangeThickness the wall thicknesses; alignment says which point of the profile's box sits on center, rotation turns it in its plane, in degrees. It lies on the ground, ready to extrude.

      Parameters

      • inputs: IBeamProfileDto

        The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The I-beam outline wire

      const profile = await bitbybit.occt.shapes.wire.createIBeamProfileWire({
      width: 10,
      height: 20,
      webThickness: 2,
      flangeThickness: 3,
      alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
      rotation: 0,
      center: [0, 0, 0],
      direction: [0, 1, 0],
      });
    • Makes the closed outline of an H-beam cross-section: two vertical flanges joined by a horizontal web, an I-beam on its side.

      width is the total width, height the flange height, webThickness and flangeThickness the wall thicknesses; alignment says which point of the profile's box sits on center, rotation turns it in its plane, in degrees.

      Parameters

      • inputs: HBeamProfileDto

        The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The H-beam outline wire

      const profile = await bitbybit.occt.shapes.wire.createHBeamProfileWire({
      width: 20,
      height: 10,
      webThickness: 2,
      flangeThickness: 3,
      alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
      rotation: 0,
      center: [0, 0, 0],
      direction: [0, 1, 0],
      });
    • Makes the closed outline of a T-beam cross-section: a horizontal flange with a vertical web hanging from its middle.

      width is the flange width, height the total height, webThickness and flangeThickness the wall thicknesses; alignment says which point of the profile's box sits on center, rotation turns it in its plane, in degrees. It lies on the ground.

      Parameters

      • inputs: TBeamProfileDto

        The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The T-beam outline wire

      const profile = await bitbybit.occt.shapes.wire.createTBeamProfileWire({
      width: 10,
      height: 12,
      webThickness: 2,
      flangeThickness: 2,
      alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
      rotation: 0,
      center: [0, 0, 0],
      direction: [0, 1, 0],
      });
    • Makes the closed outline of a U-beam cross-section, a channel: a web with two flanges of flangeWidth standing up from its ends.

      width and height are the total size, webThickness and flangeThickness the wall thicknesses; alignment says which point of the profile's box sits on center, rotation turns it in its plane, in degrees. It lies on the ground.

      Parameters

      • inputs: UBeamProfileDto

        The profile size, the thicknesses, the flange width, the alignment, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The U-beam outline wire

      const profile = await bitbybit.occt.shapes.wire.createUBeamProfileWire({
      width: 10,
      height: 6,
      webThickness: 1,
      flangeThickness: 1,
      flangeWidth: 3,
      alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
      rotation: 0,
      center: [0, 0, 0],
      direction: [0, 1, 0],
      });

    build

    • Joins edges and wires that touch end to end into one wire.

      The pieces must connect; a set with a gap or a stray piece throws an error. Shapes of other kinds in the list are ignored.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The joined wire

      const outline = await bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire({ shapes: [arc, line1, line2] });
      

    debug

    • Collects diagnostic facts about a wire: how many edges it has, whether it is closed, its total length and, for every edge, the curve report shapes.edge.debugInfo gives.

      An empty or null wire gives a report marked invalid with zero counts.

      Parameters

      Returns Promise<WireDebugInfo>

      The report with the edge count, the closed flag, the length and one entry per edge

      const info = await bitbybit.occt.shapes.wire.debugInfo({ shape: wire });
      console.log(info.nbEdges, info.closed, info.totalLength);

    edit

    • Closes an open wire with a straight edge from its end point back to its start point.

      A wire whose ends already meet is returned as it is.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The closed wire

      const closedWire = await bitbybit.occt.shapes.wire.closeOpenWire({ shape: openWire });
      

    extract

    • Cuts a wire into pieces at the given points.

      Each point is moved to the closest place on the wire before cutting, so it need not lie exactly on it; repeated points are ignored. The pieces come back in order along the wire, from its start to its end.

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      The pieces of the wire, in order

      const pieces = await bitbybit.occt.shapes.wire.splitOnPoints({ shape: wire, points: [[3, 0, 0], [7, 0, 0]] });
      
    • Turns every wire of a shape into a run of points that follows its curves closely enough to draw it, one list per wire.

      The deflection settings say how tightly the points hug curved edges; where one edge ends and the next begins the shared point appears once.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per wire

      const polylines = await bitbybit.occt.shapes.wire.wiresToPoints({
      shape: wire,
      angularDeflection: 0.1,
      curvatureDeflection: 0.1,
      minimumOfPoints: 2,
      uTolerance: 1e-9,
      minimumLength: 1e-7,
      });
    • Places points along a wire at equal steps of its parameter, from start to end.

      nrOfDivisions steps give one more point than that; removeStartPoint and removeEndPoint drop the ends. The parameter follows each edge's own curve parameter, so equal steps are not equal distances; use divideWireByEqualDistanceToPoints for those.

      Parameters

      Returns Promise<Point3[]>

      The points along the wire, in order

      const points = await bitbybit.occt.shapes.wire.divideWireByParamsToPoints({ shape: wire, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Places points along a wire at equal distances measured along its curves, 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 wire, in order

      const points = await bitbybit.occt.shapes.wire.divideWireByEqualDistanceToPoints({ shape: wire, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Finds the point a fraction of the way along a wire: 0 is the start, 1 the end.

      The fraction follows the parameters of the edges, not distance, so 0.5 is not always the middle by length; use pointOnWireAtLength for a distance.

      Parameters

      Returns Promise<Point3>

      The point on the wire

      const point = await bitbybit.occt.shapes.wire.pointOnWireAtParam({ shape: wire, param: 0.25 });
      
    • Finds the point a given distance along a wire from its start, measured along its curves in model units.

      Parameters

      Returns Promise<Point3>

      The point on the wire

      const point = await bitbybit.occt.shapes.wire.pointOnWireAtLength({ shape: wire, length: 2.5 });
      
    • Finds the points at several distances along a wire from its start, measured along its curves in model units.

      Parameters

      Returns Promise<Point3[]>

      One point per distance, in the same order

      const points = await bitbybit.occt.shapes.wire.pointsOnWireAtLengths({ shape: wire, lengths: [1, 2.5, 4] });
      
    • Places points along a wire every length model units from its start, as many as fit.

      includeFirst keeps the point at the start, includeLast appends the end point whatever the spacing, and tryNext asks for one more point a step beyond the last one that fit.

      Parameters

      Returns Promise<Point3[]>

      The points along the wire, in order

      const points = await bitbybit.occt.shapes.wire.pointsOnWireAtEqualLength({ shape: wire, length: 2, tryNext: false, includeFirst: true, includeLast: false });
      
    • Places points along a wire at a repeating pattern of gaps, such as 1, 3, 1, 3, until the wire runs out.

      lengths is the pattern of gaps in model units, repeated from the start; includeFirst keeps the start point, includeLast appends the end point, and tryNext asks for one more point at the next gap past the last.

      Parameters

      Returns Promise<Point3[]>

      The points along the wire, in order

      const points = await bitbybit.occt.shapes.wire.pointsOnWireAtPatternOfLengths({ shape: wire, lengths: [1, 3], tryNext: false, includeFirst: true, includeLast: false });
      
    • Finds the direction the wire is heading at a fraction of the way along it, from 0 at the start to 1 at the end.

      The fraction follows the parameters of the edges, not distance.

      Parameters

      Returns Promise<Vector3>

      The tangent direction

      const tangent = await bitbybit.occt.shapes.wire.tangentOnWireAtParam({ shape: wire, param: 0.5 });
      
    • Finds the direction the wire is heading at a given distance from its start, measured along its curves in model units.

      Parameters

      Returns Promise<Vector3>

      The tangent direction

      const tangent = await bitbybit.occt.shapes.wire.tangentOnWireAtLength({ shape: wire, length: 2.5 });
      
    • Computes the first, second and third derivatives of a wire's curve at a given distance from its start.

      The first derivative is the tangent with its speed, the second tells how the curve bends, the third how that bending changes; all are with respect to the curve's parameter. The distance is measured along the curves in model units.

      Parameters

      Returns Promise<[Vector3, Vector3, Vector3]>

      The three derivative vectors, first to third

      const [first, second, third] = await bitbybit.occt.shapes.wire.derivativesOnWireAtLength({ shape: wire, length: 2.5 });
      
    • Computes the first, second and third derivatives of a wire's curve at a fraction of the way along it, from 0 at the start to 1 at the end.

      The first derivative is the tangent with its speed, the second tells how the curve bends, the third how that bending changes; all are with respect to the curve's parameter.

      Parameters

      Returns Promise<[Vector3, Vector3, Vector3]>

      The three derivative vectors, first to third

      const [first, second, third] = await bitbybit.occt.shapes.wire.derivativesOnWireAtParam({ shape: wire, param: 0.5 });
      
    • Reads the point where a wire starts, in the wire's own direction.

      Parameters

      Returns Promise<Point3>

      The start point

      const start = await bitbybit.occt.shapes.wire.startPointOnWire({ shape: wire });
      
    • Finds the point halfway along a wire's parameter range.

      The parameter follows the edges' own curves, not distance, so on a wire of unequal edges this is not always the middle by length; pointOnWireAtLength with half of getWireLength gives that.

      Parameters

      Returns Promise<Point3>

      The point at parameter 0.5

      const middle = await bitbybit.occt.shapes.wire.midPointOnWire({ shape: wire });
      
    • Reads the point where a wire ends, in the wire's own direction.

      Parameters

      Returns Promise<Point3>

      The end point

      const end = await bitbybit.occt.shapes.wire.endPointOnWire({ shape: wire });
      

    extract from wires

    • Runs divideWireByParamsToPoints on several wires with the same settings.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per wire, in the same order

      const lists = await bitbybit.occt.shapes.wire.divideWiresByParamsToPoints({ shapes: wires, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      
    • Runs divideWireByEqualDistanceToPoints on several wires with the same settings.

      Parameters

      Returns Promise<Point3[][]>

      One list of points per wire, in the same order

      const lists = await bitbybit.occt.shapes.wire.divideWiresByEqualDistanceToPoints({ shapes: wires, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false });
      

    from base

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

      Parameters

      Returns Promise<TopoDSWirePointer>

      The straight wire

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

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      One wire per line, in the same order

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

      Parameters

      Returns Promise<TopoDSWirePointer>

      The straight wire

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

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      One wire per segment, in the same order

      const wires = await bitbybit.occt.shapes.wire.fromBaseSegments({ segments: [[[0, 0, 0], [10, 0, 0]], [[10, 0, 0], [10, 10, 0]]] });
      
    • Joins a list of points in order with straight edges into one wire.

      Fewer than two points throw an error. When the last point repeats the first, the repeat is dropped and the wire is closed back to the first point; otherwise the wire stays open. For a closed outline without repeating a point use createPolygonWire.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The wire through the points

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

      Parameters

      Returns Promise<TopoDSWirePointer>

      The wire

      const outline = await bitbybit.occt.shapes.wire.fromBasePolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 0, 10]], isClosed: true } });
      
    • Makes a closed three-edge wire from a triangle given as three points.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The closed wire

      const outline = await bitbybit.occt.shapes.wire.fromBaseTriangle({ triangle: [[0, 0, 0], [10, 0, 0], [0, 0, 10]] });
      
    • Makes one closed three-edge wire per triangle of a mesh.

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

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      One wire per triangle that could be built

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

    get

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

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

      Parameters

      Returns Promise<TopoDSWirePointer>

      The wire at that index

      const outer = await bitbybit.occt.shapes.wire.getWire({ shape: face, index: 0 });
      
    • Finds the center of mass of a wire, the balance point of its curves; for a circle that is its center, off the wire itself.

      Parameters

      Returns Promise<Point3>

      The center of mass point

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

      Parameters

      Returns Promise<Point3[]>

      One point per wire, in the same order

      const centers = await bitbybit.occt.shapes.wire.getWiresCentersOfMass({ shapes: wires });
      
    • Flips the direction of a wire, so its start becomes its end.

      The edges keep their own order and direction flags; the wire as a whole is marked reversed, which is what most operations read. reversedWireFromReversedEdges rebuilds the wire edge by edge instead.

      Parameters

      Returns Promise<TopoDSWirePointer>

      A new wire running the other way

      const back = await bitbybit.occt.shapes.wire.reversedWire({ shape: wire });
      
    • Flips the direction of a wire by reversing every edge and joining them again in the opposite order.

      The result is a wire that runs the other way through and through, which some operations need where the plain reversedWire flag is not enough.

      Parameters

      Returns Promise<TopoDSWirePointer>

      A new wire running the other way

      const back = await bitbybit.occt.shapes.wire.reversedWireFromReversedEdges({ shape: wire });
      
    • Tells whether a wire is closed, which is when its start and end points coincide within a small tolerance.

      Parameters

      Returns Promise<boolean>

      True when the ends meet

      const wireIsClosed = await bitbybit.occt.shapes.wire.isWireClosed({ shape: wire });
      
    • Measures the length of a wire along its curves, in model units.

      Parameters

      Returns Promise<number>

      The length

      const len = await bitbybit.occt.shapes.wire.getWireLength({ shape: wire });
      
    • Measures the length of each wire in a list along its curves, in model units.

      Parameters

      Returns Promise<number[]>

      One length per wire, in the same order

      const lengths = await bitbybit.occt.shapes.wire.getWiresLengths({ shapes: wires });
      

    multiple

    • Makes one closed polygon wire per point list, as createPolygonWire does.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      • inputs: PolygonsDto

        The polygons and whether to pack them into a compound

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const outlines = await bitbybit.occt.shapes.wire.createPolygons({
      polygons: [{ points: [[0, 0, 0], [5, 0, 0], [5, 0, 5]] }, { points: [[10, 0, 0], [15, 0, 0], [15, 0, 5]] }],
      returnCompound: false,
      });
    • Makes one straight single-edge wire per line definition.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const lines = await bitbybit.occt.shapes.wire.createLines({
      lines: [{ start: [0, 0, 0], end: [10, 0, 0] }, { start: [0, 0, 5], end: [10, 0, 5] }],
      returnCompound: false,
      });
    • Makes one open polyline wire per point list, as createPolylineWire does.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const paths = await bitbybit.occt.shapes.wire.createPolylines({
      polylines: [{ points: [[0, 0, 0], [5, 0, 0], [5, 0, 5]] }, { points: [[10, 0, 0], [15, 0, 0]] }],
      returnCompound: false,
      });
    • Makes one Bezier wire per definition, as createBezier does.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      • inputs: BezierWiresDto

        The Bezier definitions and whether to pack them into a compound

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const curves = await bitbybit.occt.shapes.wire.createBezierWires({
      bezierWires: [{ points: [[0, 0, 0], [5, 0, 10], [10, 0, 0]], closed: false }, { points: [[0, 0, 5], [5, 0, 15], [10, 0, 5]], closed: false }],
      returnCompound: false,
      });
    • Makes one interpolated B-spline wire per definition, as interpolatePoints does.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      • inputs: InterpolateWiresDto

        The interpolation definitions and whether to pack them into a compound

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const curves = await bitbybit.occt.shapes.wire.interpolateWires({
      interpolations: [{ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0]], periodic: false, tolerance: 1e-7 }, { points: [[0, 0, 5], [5, 0, 10], [10, 0, 5]], periodic: false, tolerance: 1e-7 }],
      returnCompound: false,
      });
    • Makes one approximating B-spline wire per definition, as createBSpline does.

      With returnCompound true the wires are packed into one compound shape instead of a list.

      Parameters

      • inputs: BSplinesDto

        The B-spline definitions and whether to pack them into a compound

      Returns Promise<TopoDSCompoundPointer | TopoDSWirePointer[]>

      The wires in order, or one compound holding them

      const curves = await bitbybit.occt.shapes.wire.createBSplines({
      bSplines: [{ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0]], closed: false }, { points: [[0, 0, 5], [5, 0, 10], [10, 0, 5]], closed: false }],
      returnCompound: false,
      });

    place

    • Maps a flat wire drawn on the ground plane onto the surface of a face, as if the drawing were wrapped around it.

      The wire's Z coordinate is read as U and its X coordinate as V, in the face's real UV values, which shapes.face.getUMinBound and its siblings report; a drawing that fits inside those bounds lands on the face.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The wire lying on the face's surface

      const onSurface = await bitbybit.occt.shapes.wire.placeWireOnFace({ wire: flatWire, face: cylinderFace });
      
    • Projects a wire onto a shape along a direction, like casting its shadow onto the surface.

      The result is a compound of the curves where the projection meets the shape's faces, which can be on both its near and far side. Cut a face with it through shapes.face.createFaceFromWireOnFace or use it as a path.

      Parameters

      Returns Promise<TopoDSCompoundPointer>

      A compound of the projected curves

      const shadow = await bitbybit.occt.shapes.wire.project({ wire: circle, shape: sphere, direction: [0, -1, 0] });
      

    primitives

    • Makes a full circle as a closed single-edge wire, lying in the plane whose normal is direction; the default [0, 1, 0] lays it flat on the ground.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The circle wire

      const circle = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Fills a rectangle on the ground plane with a grid of closed hexagon wires, centered on the origin.

      The hexagons are scaled so nrHexagonsInWidth fit across width and nrHexagonsInHeight across height. The scale, fillet and inclusion patterns are read hexagon by hexagon and repeat; the extend flags stretch the outer rows past the edges to cover the rectangle.

      Parameters

      • inputs: HexagonsInGridDto

        The rectangle size, the hexagon counts, the extend flags and the optional patterns

      Returns Promise<TopoDSWirePointer[]>

      One wire per hexagon, row by row

      const cells = await bitbybit.occt.shapes.wire.hexagonsInGrid({
      width: 20,
      height: 10,
      nrHexagonsInWidth: 8,
      nrHexagonsInHeight: 4,
      flatTop: false,
      scalePatternWidth: [0.9],
      scalePatternHeight: [0.9],
      });
    • Makes a closed square wire centered on center.

      direction is the normal of its plane: the default [0, 1, 0] lays it flat on the ground.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The square wire

      const square = await bitbybit.occt.shapes.wire.createSquareWire({ size: 10, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a closed star-shaped wire with numRays points.

      The points reach outerRadius and the notches between them innerRadius; offsetOuterEdges lifts the ray tips out of the plane by that distance, making a 3D star, and half keeps the first half of the rays as an open wire. It lies flat on the ground unless direction says otherwise.

      Parameters

      • inputs: Bit.Inputs.OCCT.StarDto

        The two radii, the number of rays, the center, the plane normal and the options

      Returns Promise<TopoDSWirePointer>

      The star wire

      const star = await bitbybit.occt.shapes.wire.createStarWire({ outerRadius: 5, innerRadius: 2, numRays: 5, center: [0, 0, 0], direction: [0, 1, 0], offsetOuterEdges: 0, half: false });
      
    • Makes a closed wire shaped like a stylized Christmas tree: nrSkirts layers of branches, narrowing from outerDist to innerDist off the trunk line, on a trunk of trunkHeight and trunkWidth.

      Unlike the other flat shapes here it stands upright in the XY plane, tip along Y; direction is the trunk-to-tip direction, rotation spins it about that axis, in degrees.

      Parameters

      • inputs: ChristmasTreeDto

        The tree proportions, the trunk size, the options, the origin and the trunk-to-tip direction

      Returns Promise<TopoDSWirePointer>

      The tree wire

      const tree = await bitbybit.occt.shapes.wire.createChristmasTreeWire({
      height: 10,
      innerDist: 1.5,
      outerDist: 4,
      nrSkirts: 4,
      trunkHeight: 1.5,
      trunkWidth: 1,
      half: false,
      rotation: 0,
      origin: [0, 0, 0],
      direction: [0, 1, 0],
      });
    • Makes a closed regular polygon wire with nrCorners corners, all on a circle of radius.

      direction is the normal of the plane; the default [0, 1, 0] lays it flat on the ground.

      Parameters

      • inputs: NGonWireDto

        The number of corners, the radius, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The polygon wire

      const hexagon = await bitbybit.occt.shapes.wire.createNGonWire({ nrCorners: 6, radius: 5, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a closed parallelogram wire: a rectangle of width and height whose sides lean over by angle degrees.

      With aroundCenter true the shape is centered on center; otherwise it starts there and extends in the positive directions. direction is the plane normal; the default [0, 1, 0] lays it flat on the ground.

      Parameters

      • inputs: ParallelogramDto

        The width, the height, the lean angle, whether to center it, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The parallelogram wire

      const shape = await bitbybit.occt.shapes.wire.createParallelogramWire({ width: 10, height: 5, angle: 30, aroundCenter: true, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a closed heart-shaped wire of two smooth halves that fits roughly into a square of sizeApprox.

      rotation turns it in its plane, in degrees. direction is the plane normal; the default [0, 1, 0] lays it flat on the ground.

      Parameters

      • inputs: Heart2DDto

        The approximate size, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The heart wire

      const heart = await bitbybit.occt.shapes.wire.createHeartWire({ sizeApprox: 10, rotation: 0, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a closed rectangle wire centered on center.

      On the ground plane width runs along X and length along Z; direction is the normal of the plane, and the default [0, 1, 0] keeps the wire flat on the ground.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The rectangle wire

      const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 20, length: 10, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Makes a closed L-shaped wire: two rectangular legs joined at a corner.

      The first leg has widthFirst and lengthFirst, the second widthSecond and lengthSecond; align puts the corner on the outside, inside or middle of the legs, and rotation turns the shape in its plane, in degrees. It lies flat on the ground unless direction says otherwise.

      Parameters

      • inputs: LPolygonDto

        The two leg sizes, the alignment, the rotation, the center and the plane normal

      Returns Promise<TopoDSWirePointer>

      The L-shaped wire

      const outline = await bitbybit.occt.shapes.wire.createLPolygonWire({
      widthFirst: 2,
      lengthFirst: 10,
      widthSecond: 2,
      lengthSecond: 6,
      align: Bit.Inputs.OCCT.directionEnum.outside,
      rotation: 0,
      center: [0, 0, 0],
      direction: [0, 1, 0],
      });
    • Makes a full ellipse as a closed single-edge wire, lying in the plane whose normal is direction.

      radiusMajor must not be smaller than radiusMinor, or the kernel refuses the ellipse; the default direction [0, 1, 0] lays it flat on the ground.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The ellipse wire

      const ellipse = await bitbybit.occt.shapes.wire.createEllipseWire({ center: [0, 0, 0], direction: [0, 1, 0], radiusMinor: 3, radiusMajor: 6 });
      
    • Makes a helix wire, a coil of constant radius that climbs pitch model units per turn until it reaches height.

      It starts beside center and climbs along direction; clockwise reverses the winding. The helix is approximated by a smooth curve within tolerance. A radius, pitch or height of 0 or less gives a null wire.

      Parameters

      • inputs: HelixWireDto

        The radius, the pitch, the height, the base center, the axis direction, the winding and the tolerance

      Returns Promise<TopoDSWirePointer>

      The helix wire

      const spring = await bitbybit.occt.shapes.wire.createHelixWire({ radius: 2, pitch: 1, height: 10, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 });
      
    • Makes a helix wire like createHelixWire, but sized by numTurns instead of a height: the coil climbs pitch model units per turn, numTurns times.

      Parameters

      • inputs: HelixWireByTurnsDto

        The radius, the pitch, the number of turns, the base center, the axis direction, the winding and the tolerance

      Returns Promise<TopoDSWirePointer>

      The helix wire

      const spring = await bitbybit.occt.shapes.wire.createHelixWireByTurns({ radius: 2, pitch: 1, numTurns: 5, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 });
      
    • Makes a conical helix wire whose radius changes evenly from startRadius at the base to endRadius at the top, climbing pitch model units per turn until it reaches height.

      It starts beside center and climbs along direction; clockwise reverses the winding. The curve is approximated within tolerance.

      Parameters

      • inputs: TaperedHelixWireDto

        The start and end radii, the pitch, the height, the base center, the axis direction, the winding and the tolerance

      Returns Promise<TopoDSWirePointer>

      The tapered helix wire

      const cone = await bitbybit.occt.shapes.wire.createTaperedHelixWire({ startRadius: 3, endRadius: 0.5, pitch: 1, height: 8, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 });
      
    • Makes a flat spiral wire in the plane whose normal is direction: numTurns turns whose radius grows evenly from startRadius to endRadius.

      The default direction [0, 1, 0] lays it flat on the ground; clockwise reverses the winding, and the curve is approximated within tolerance.

      Parameters

      • inputs: FlatSpiralWireDto

        The start and end radii, the number of turns, the center, the plane normal, the winding and the tolerance

      Returns Promise<TopoDSWirePointer>

      The spiral wire

      const spiral = await bitbybit.occt.shapes.wire.createFlatSpiralWire({ startRadius: 0.5, endRadius: 5, numTurns: 4, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 });
      
    • Writes text as stroke wires on the ground plane in the single-line Hershey simplex font, one open polyline wire per pen stroke.

      height is the height of a capital letter in model units, lineSpacing and letterSpacing are multiples of it, align lines up lines of different length, and centerOnOrigin moves the block to the origin.

      Parameters

      • inputs: TextWiresDto

        The text, its size and spacing, the alignment and the placement options

      Returns Promise<TopoDSWirePointer[]>

      One wire per stroke, in writing order

      const strokes = await bitbybit.occt.shapes.wire.textWires({
      text: "Hello",
      height: 5,
      lineSpacing: 1.5,
      letterSpacing: 0,
      align: Bit.Inputs.Base.horizontalAlignEnum.left,
      centerOnOrigin: true,
      });
    • Writes text as stroke wires like textWires and packs them into compounds, with the size of the block alongside.

      The result carries compound with the whole text, characters with one compound per character in writing order, width and height as the extent of the block along X and along Z, and center as the middle of the block.

      Parameters

      • inputs: TextWiresDto

        The text, its size and spacing, the alignment and the placement options

      Returns Promise<TextWiresDataDto<TopoDSCompoundPointer>>

      The text compound, the character compounds and the measured size

      const text = await bitbybit.occt.shapes.wire.textWiresWithData({
      text: "Hi",
      height: 5,
      lineSpacing: 1.5,
      letterSpacing: 0,
      align: Bit.Inputs.Base.horizontalAlignEnum.left,
      centerOnOrigin: false,
      });
      console.log(text.width, text.height, text.characters.length);

    rebuild

    • Rebuilds every edge of a wire as a B-spline of a given degree, within a tolerance, and joins the results back into a wire.

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

      Parameters

      Returns Promise<TopoDSWirePointer>

      A new wire with the rebuilt edges

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

    seam

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

      The geometry does not change; only where the wire is considered to begin. Meant for single-edge wires such as circles: each periodic edge is moved, edges that are not periodic stay as they are.

      Parameters

      Returns Promise<TopoDSWirePointer>

      A new wire starting at the seam

      const rotated = await bitbybit.occt.shapes.wire.moveWireSeamByParameter({ shape: circle, parameter: 1.57 });
      
    • Moves the seam of a closed periodic wire, 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 wire is considered to begin. Meant for single-edge wires such as circles: each periodic edge is moved, edges that are not periodic stay as they are.

      Parameters

      Returns Promise<TopoDSWirePointer>

      A new wire starting at the seam

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

    via points

    • Makes a closed wire of straight edges through a list of corner points, adding the edge from the last point back to the first.

      The points need not lie in one plane; a flat face needs a planar outline though.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The closed wire

      const square = await bitbybit.occt.shapes.wire.createPolygonWire({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]] });
      
    • Makes a straight single-edge wire between two points.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The straight wire

      const line = await bitbybit.occt.shapes.wire.createLineWire({ start: [0, 0, 0], end: [10, 0, 0] });
      
    • Makes a straight single-edge wire between two points and lengthens it beyond each of them.

      extensionStart and extensionEnd are distances in model units added past the start and the end along the line; the two points must differ or an error is thrown.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The extended straight wire

      const longer = await bitbybit.occt.shapes.wire.createLineWireWithExtensions({ start: [0, 0, 0], end: [10, 0, 0], extensionStart: 2, extensionEnd: 5 });
      
    • Makes an open wire of straight edges through a list of points, in order.

      The wire is not closed; createPolygonWire adds the edge back to the first point.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The open wire

      const path = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10]] });
      
    • Makes a smooth Bezier wire steered by control points: it starts at the first point, ends at the last and is pulled toward the ones between without passing through them.

      closed appends the first point again so the ends meet; periodic instead builds a closed curve that is smooth across the seam. degree caps how many neighbors shape each part.

      Parameters

      • inputs: BezierDto

        The control points and the closing and degree options

      Returns Promise<TopoDSWirePointer>

      The Bezier wire

      const curve = await bitbybit.occt.shapes.wire.createBezier({ points: [[0, 0, 0], [5, 0, 10], [10, 0, -10], [15, 0, 0]], closed: false, periodic: false });
      
    • Makes a Bezier wire like createBezier, with a weight per control point that says how strongly it pulls the curve.

      A weight above 1 draws the curve toward its point, below 1 lets it go. The weights must match the points: the same count, or one more when closed is true and periodic false, as the first point repeats.

      Parameters

      • inputs: BezierWeightsDto

        The control points, their weights and the closing and degree options

      Returns Promise<TopoDSWirePointer>

      The weighted Bezier wire

      const curve = await bitbybit.occt.shapes.wire.createBezierWeights({
      points: [[0, 0, 0], [5, 0, 10], [10, 0, 0]],
      weights: [1, 3, 1],
      closed: false,
      periodic: false,
      });
    • Makes a smooth B-spline wire that passes through every point in order.

      periodic closes the curve so it is smooth across the seam, which gives nicely shaped loops. parametrization controls the spacing between points: centripetal resists cusps and overshoot when the points are uneven. startTangent and endTangent, or one tangents entry per point, force the curve's direction there.

      Parameters

      • inputs: InterpolationDto

        The points, whether to close the curve, the tolerance, the parametrization and optional tangents

      Returns Promise<TopoDSWirePointer>

      The B-spline wire through the points

      const loop = await bitbybit.occt.shapes.wire.interpolatePoints({
      points: [[0, 0, 0], [10, 0, 5], [10, 0, 15], [0, 0, 10]],
      periodic: true,
      tolerance: 1e-7,
      parametrization: Bit.Inputs.OCCT.bSplineParametrizationEnum.centripetal,
      });
    • Makes a closed, smooth B-spline wire through the points whose shape is mirror-symmetric whenever the points are, with no odd-looking start or end point.

      A plain periodic interpolatePoints can look skewed at its seam for symmetric inputs such as a square or a triangle; this variant does not. It fails with an error if the points cannot be interpolated.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The closed symmetric B-spline wire

      const rounded = await bitbybit.occt.shapes.wire.interpolatePointsSymmetric({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]], tolerance: 1e-7 });
      
    • Makes a smooth B-spline wire that approximates a list of points: it follows them closely but need not pass through each one exactly.

      closed appends the first point again so the ends meet. The fit uses a degree between 3 and 8 and a tolerance of 0.001 model units; use interpolatePoints when the curve must go through the points.

      Parameters

      • inputs: BSplineDto

        The points and whether to close the curve

      Returns Promise<TopoDSWirePointer>

      The B-spline wire

      const curve = await bitbybit.occt.shapes.wire.createBSpline({ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0], [15, 0, 5]], closed: false });
      

    via wires

    • Draws a zig-zag line that bounces between two wires: both are divided into the same number of points and a polyline visits them alternately.

      nrZigZags sets the number of bounces; inverse starts on the second wire; divideByEqualDistance spaces the points by length rather than by parameter; with zigZagsPerEdge true each edge gets its own zig-zag, so edge counts must match.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The zig-zag wire

      const zigzag = await bitbybit.occt.shapes.wire.createZigZagBetweenTwoWires({ wire1: lower, wire2: upper, nrZigZags: 20, inverse: false, divideByEqualDistance: true, zigZagsPerEdge: false });
      
    • Connects the start points of several wires or edges into one new wire and their end points into another.

      wireType makes them polylines or smooth interpolated curves, closed joins the last point back to the first, and tolerance is used for the interpolation. Fewer than two shapes throw an error.

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      Two wires: one through the start points, one through the end points

      const [starts, ends] = await bitbybit.occt.shapes.wire.createWiresBetweenStartEndPointsOfWiresAndEdges({
      shapes: [wireA, wireB, wireC],
      wireType: Bit.Inputs.OCCT.wireFromPointsTypeEnum.interpolated,
      closed: false,
      tolerance: 1e-7,
      });
    • Divides several wires or edges into the same number of points and connects the points at each position into a new wire, like the rungs of a ladder.

      nrOfDivisions steps give one rung more than that; divideByEqualDistance spaces the points by length rather than by parameter; wireType makes the rungs polylines or smooth curves, closed joins each into a loop.

      Parameters

      Returns Promise<TopoDSWirePointer[]>

      One wire per division point, in order along the shapes

      const rungs = await bitbybit.occt.shapes.wire.createWiresBetweenSubdividedPointsOfWiresAndEdges({
      shapes: [rail1, rail2],
      nrOfDivisions: 10,
      divideByEqualDistance: true,
      wireType: Bit.Inputs.OCCT.wireFromPointsTypeEnum.polyline,
      closed: false,
      tolerance: 1e-7,
      });
    • Draws a closed outline around two circles that lie in one plane, joining them with tangent lines: a belt or a capsule shape.

      keepLines picks the outer tangent lines (the belt) or the crossing inner ones; circleRemainders picks which arc of each circle stays in the outline. Each circle wire must consist of a single edge.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The closed outline wire

      const belt = await bitbybit.occt.shapes.wire.createWireFromTwoCirclesTan({
      circle1,
      circle2,
      keepLines: Bit.Inputs.OCCT.twoSidesStrictEnum.outside,
      circleRemainders: Bit.Inputs.OCCT.fourSidesStrictEnum.outside,
      tolerance: 1e-7,
      });