Bitbybit Docs
    Bereite Suchindex vor...

    Klasse OCCTW

    Die OpenCascade-API (OCCT), wie sie aus einem Skript erreicht wird: jede Methode des occt-Kernels, asynchron, wobei die Formen im Kernel leben und als Referenzen weitergegeben werden, plus io-Lader, die STEP- und IGES-Dateien lesen, die als File oder als Text übergeben werden. Die Dienstklassen sind auf dem kerneleigenen OCCTService dokumentiert.

    Hierarchie (Zusammenfassung anzeigen)

    Index

    Konstruktoren

    Eigenschaften

    shapes: OCCTShapes
    geom: OCCTGeom
    fillets: OCCTFillets
    transforms: OCCTTransforms
    operations: OCCTOperations
    booleans: OCCTBooleans
    dimensions: OCCTDimensions
    shapeFix: OCCTShapeFix
    assembly: OCCTAssembly
    brepGraph: OCCTBrepGraph
    corners: OCCTCorners
    draft: OCCTDraft
    path: OCCTPath
    svg: OCCTSVG
    context: ContextBase
    occWorkerManager: OCCTWorkerManager

    convert

    • Triangulates a shape and returns every triangle as three points, in one flat list over all faces.

      precision is the meshing tolerance in model units: smaller values follow curved surfaces more closely and give more triangles. adjustYtoZ swaps the Y and Z axes for tools that treat Z as up, and reversedPoints flips the winding of each triangle.

      Parameter

      Rückgabewert Promise<Point3[][]>

      One list of three points per triangle

      const triangles = await bitbybit.occt.shapeFacesToPolygonPoints({ shape: sphere, precision: 0.01, adjustYtoZ: false, reversedPoints: false });
      
    • Triangulates a shape into a mesh for drawing: one entry per face with its vertices, normals, UVs and triangle indexes, one per edge with its points, and the vertex points.

      precision is the meshing tolerance in model units; smaller values follow curved surfaces more closely and cost more triangles. adjustYtoZ swaps Y and Z. A null shape gives empty lists.

      Parameter

      Rückgabewert Promise<DecomposedMeshDto>

      The mesh as face, edge and point lists

      const mesh = await bitbybit.occt.shapeToMesh({ shape: sphere, precision: 0.01, adjustYtoZ: false });
      console.log(mesh.faceList.length, mesh.edgeList.length);

    memory

    • Frees the memory a shape holds inside the kernel; the shape cannot be used afterwards. Call it for intermediate results a script no longer needs, so long sessions do not run out of memory.

      Parameter

      Rückgabewert Promise<void>

      const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] });
      const rounded = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 1 });
      await bitbybit.occt.deleteShape({ shape: box });
    • Frees the memory several shapes hold inside the kernel; they cannot be used afterwards. Call it for intermediate results a script no longer needs, so long sessions do not run out of memory.

      Parameter

      Rückgabewert Promise<void>

      await bitbybit.occt.deleteShapes({ shapes: [box, cylinder] });
      
    • Frees every shape the kernel holds at once, including the ones your variables still point to, so nothing created before can be used afterwards. Call it when starting over rather than between steps.

      Rückgabewert Promise<void>

      await bitbybit.occt.cleanAllCache();