Bitbybit Docs
    Preparing search index...

    Class IFCWGeometryBeta

    A model's geometry: everything geometry offers in the IFC worker, plus toShapes, toDocument and toStep, which hand the model's recipe to OpenCascade, so circles stay circles and the results measure, cut and export like any other shape. They need both the IFC and the OCCT workers.

    Hierarchy (View Summary)

    Index

    Constructors

    recipes

    • Beta

      Describes the geometry of a model's elements as a recipe, ready for a kernel to build.

      Each element with a body becomes one root, placed by its matrix and tagged with its GlobalId; openings are cut from their hosts rather than becoming roots. An element that cannot be described is left out, and geometry.unsupported lists it with the reason.

      Parameters

      Returns Promise<Recipe>

      A recipe with one root per element

      const recipe = await bitbybit.ifc.geometry.recipe({ model });
      console.log(recipe.roots.length, recipe.millimetresPerUnit);
    • Beta

      Lists the elements whose geometry geometry.recipe leaves out, each with what it could not describe, such as a profile type that is not supported yet.

      An element asked for in elements is listed too when it has no body to describe, such as an opening, a storey or an element without a 'Body' representation.

      Parameters

      Returns Promise<GeometryProblemDto[]>

      The elements left out, empty when every one is described

      const problems = await bitbybit.ifc.geometry.unsupported({ model });
      problems.forEach((problem) => console.log(problem.type, problem.message));
    • Beta

      Builds a model's elements as OpenCascade shapes, one per element in the order geometry.recipe lists them, each placed where the model puts it, in the model's units.

      An element the kernel cannot build comes back as an empty compound unless emptyWhenFailed is false; geometry.unsupported lists the elements the recipe leaves out.

      Parameters

      Returns Promise<TopoDSShapePointer[]>

      One shape per element

      const shapes = await bitbybit.ifc.geometry.toShapes({ model });
      await bitbybit.draw.drawAnyAsync({ entity: shapes });
    • Beta

      Builds a model's elements into an OpenCascade assembly document for STEP or glTF: a product per element with its GlobalId and IFC type as properties, nested in its site, building and storey, by IFC class unless groupByClass is false, one part per type placed many times.

      Millimetres unless STEP can state the model's unit; delete it with occt.assembly.manager.deleteDocument.

      Parameters

      • inputs: GeometryToDocumentDto<IfcModelPointer>

        The model, the elements, the top assembly's name, whether a failed element stops the build, how meshes are built, and whether storeys are grouped by class

      Returns Promise<TDocStdDocumentPointer>

      The document handle

      const document = await bitbybit.ifc.geometry.toDocument({ model, name: "House" });
      const gltf = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document, fileName: "house.glb" });
      await bitbybit.occt.assembly.manager.deleteDocument({ document });
    • Beta

      Writes a model's elements as a STEP file of OpenCascade shapes, as toDocument builds them, and gives back its bytes.

      Elements stored as triangle meshes are written as tessellated geometry unless facetedMeshes is set. A model of a million mesh triangles writes some 280 MB of STEP and needs the 64-bit kernel, or the elements written in parts.

      Parameters

      • inputs: GeometryToStepDto<IfcModelPointer>

        The model, the elements, the top assembly's name, the file name, whether a failed element stops the export, how meshes are built, compression, download and whether storeys are grouped by class

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The STEP file's bytes

      const step = await bitbybit.ifc.geometry.toStep({ model, name: "House", fileName: "house.step", tryDownload: true });
      console.log(step.length);