Bitbybit Docs
    Preparing search index...

    Class OCCTCurves

    Construction curves of OpenCascade: 2D curves in a plane or in the UV space of a surface (circles, ellipses, segments, trimmed pieces), which feed shapes.edge.makeEdgeFromGeom2dCurveAndSurface, and circle and ellipse wires. The 2D curves have no topology and cannot be drawn; a point on them is read with get2dPointFrom2dCurveOnParam.

    Index

    Constructors

    create

    • Cuts a piece out of a 2D curve between the parameters u1 and u2.

      On a closed curve such as a circle the parameters run around it, so a trimmed circle is an arc. The result cannot be drawn on its own.

      Parameters

      Returns Promise<Geom2dCurvePointer>

      The trimmed 2D curve

      const arc = await bitbybit.occt.geom.curves.geom2dTrimmedCurve({ shape: circle2d, u1: 0, u2: 1.57, sense: true, adjustPeriodic: true });
      

    get

    • Evaluates a 2D curve at a parameter and returns the 2D point there.

      The parameter is in the curve's own range, not a fraction: a circle runs from 0 to two pi, a segment from 0 to its length.

      Parameters

      Returns Promise<Point2>

      The point as two numbers

      const point = await bitbybit.occt.geom.curves.get2dPointFrom2dCurveOnParam({ shape: circle2d, param: 1.57 });
      

    primitives

    • Creates a 2D ellipse curve in a plane, for constructions in the UV space of a surface.

      direction is the direction of the major axis; radiusMajor must be at least radiusMinor, and sense flips the curve's direction. The curve cannot be drawn; wrap it with shapes.edge.makeEdgeFromGeom2dCurveAndSurface.

      Parameters

      • inputs: Geom2dEllipseDto

        The center, the major axis direction, the two radii and the direction sense

      Returns Promise<Geom2dCurvePointer>

      The 2D ellipse curve

      const ellipse = await bitbybit.occt.geom.curves.geom2dEllipse({ center: [0, 0], direction: [1, 0], radiusMinor: 1, radiusMajor: 2, sense: false });
      
    • Creates a straight 2D curve segment between two 2D points, for constructions in the UV space of a surface.

      The segment cannot be drawn on its own.

      Parameters

      Returns Promise<Geom2dCurvePointer>

      The 2D segment curve

      const segment = await bitbybit.occt.geom.curves.geom2dSegment({ start: [0, 0], end: [1, 0] });
      
    • Creates a full circle as a closed single-edge wire, lying in the plane whose normal is direction.

      The same as shapes.wire.createCircleWire, kept here beside the 2D curves.

      Parameters

      Returns Promise<GeomCurvePointer>

      The circle wire

      const circle = await bitbybit.occt.geom.curves.geomCircleCurve({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] });
      
    • Creates a full ellipse as a closed single-edge wire, lying in the plane whose normal is direction.

      The same as shapes.wire.createEllipseWire, kept here beside the 2D curves; radiusMajor must not be smaller than radiusMinor.

      Parameters

      Returns Promise<GeomCurvePointer>

      The ellipse wire

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