Bitbybit Docs
    Preparing search index...

    Class OCCTShapeFix

    Repairs for OpenCascade shapes that came out of a file or an operation with small defects: gaps between edges, edges too short to matter, wires whose edges point different ways, tolerances that drifted. Run basicShapeRepair on a shape that fails shapes.shape.isValid or refuses a boolean; the wire fixes clean up outlines before they become faces. Every method returns a new shape.

    Index

    Constructors

    shape

    • Runs the kernel's general repair over a shape: closes small gaps, fixes wire and face defects and brings tolerances into the given range.

      precision is the size of defect to look for, minTolerance and maxTolerance bound the tolerances the repaired shape may carry, all in model units. Try it first on any shape that fails shapes.shape.isValid.

      Parameters

      Returns Promise<TopoDSShapePointer>

      The repaired shape

      const fixed = await bitbybit.occt.shapeFix.basicShapeRepair({ shape: imported, precision: 0.001, maxTolerance: 0.01, minTolerance: 0.0001 });
      

    wire

    • Removes edges shorter than precsmall from a wire and closes the gaps they leave, so a tiny sliver no longer breaks a fillet or a face.

      With lockvtx true the existing vertices are kept in place; otherwise they may move to close the gap. A precsmall of 0 uses the wire's own tolerance.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The cleaned wire

      const clean = await bitbybit.occt.shapeFix.fixSmallEdgeOnWire({ shape: wire, lockvtx: false, precsmall: 0.001 });
      
    • Rebuilds a wire so its edges run head to tail in one direction along it.

      A wire assembled from loose edges can hold edges pointing against the flow; this walks the wire in order and joins the edges again the right way round, which some operations need.

      Parameters

      Returns Promise<TopoDSWirePointer>

      The wire with consistently oriented edges

      const ordered = await bitbybit.occt.shapeFix.fixEdgeOrientationsAlongWire({ shape: wire });