Bitbybit Docs
    Preparing search index...

    Class ManifoldRecipesBeta

    Building recipes: solids described as data - polygons, circles, extrusions, turns and lofts, cuts, unions, openings, transforms and triangle meshes - by a package that does not build geometry itself, such as one that reads building models. Every result is a watertight mesh solid, so walls with their openings cut and roofs clipped come back ready to draw or to combine further.

    Experimental: the recipe format may still change before it is declared stable.

    Index

    Constructors

    build

    • Beta

      Builds each root of a recipe as a solid placed by its matrix, in root order.

      Shared nodes are built once. An invalid recipe throws before anything is built; a root the kernel cannot build, such as an open mesh, throws naming its node unless emptyWhenFailed is set. Circles get circularSegments sides; tolerance and millimetresPerUnit are not applied.

      Parameters

      Returns Promise<ManifoldPointer[]>

      One solid per root, in root order

      const recipe = await bitbybit.ifc.geometry.recipe({ model });
      const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true });
    • Beta

      Builds a recipe into the meshes its roots draw, each step several roots place meshed once in its own coordinates, and gives every root a placement: its mesh, its matrix and its tag.

      Turns and moves fold into the placements, so a door type placed a hundred times is one mesh; normals split at edges sharper than minSharpAngle.

      Parameters

      • inputs: BuildRecipeMeshesDto

        The recipe, how finely circles are divided, whether Z turns into Y, whether failures are skipped, and where normals split

      Returns Promise<RecipeMeshesDto>

      The meshes and one placement per root, in root order

      const recipe = await bitbybit.ifc.geometry.recipe({ model });
      const { meshes, placements } = await bitbybit.manifold.recipes.meshes({ recipe, adjustZtoY: true, emptyWhenFailed: true });
    • Beta

      Gives the roots of a recipe made of triangle meshes alone as meshes, placed as build places its solids, without building anything.

      build gives an open mesh back empty, since it cannot be a solid; this gives it as the surface it is, its openings left uncut. A root holding any other step comes back as an empty mesh.

      Parameters

      Returns Promise<Bit.Inputs.Manifold.DecomposedManifoldMeshDto[]>

      One mesh per asked root, in the order asked, ready to draw

      const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true });
      const meshes = await bitbybit.manifold.manifold.manifoldsToMeshes({ manifolds: solids });
      const open = meshes.flatMap((mesh, index) => mesh.triVerts.length === 0 ? [index] : []);
      const surfaces = await bitbybit.manifold.recipes.surfaceMeshes({ recipe, roots: open, adjustZtoY: true });