Bitbybit Docs
    Bereite Suchindex vor...

    Klasse DrawComplete

    Zeichnet alles in die Szene: Kernel-Formen, Punkte, Linien, Polylinien, Kurven, Meshes und Tags laufen alle über drawAnyAsync, das den passenden Renderer für die Entität wählt und das gezeichnete Objekt zurückgibt. Die options-Methoden bauen die Zeichenoptionen mit Standardwerten für jede Art von Entität, createPBRMaterial und createTexture erstellen Materialien für die Flächenslots, und ein gezeichnetes Objekt kann an Ort und Stelle neu gezeichnet werden, indem es zurückgegeben wird.

    Hierarchie (Zusammenfassung anzeigen)

    Index

    Konstruktoren

    draw

    • Draws any kind of geometry after all input promises are resolved. Inputs can also be non-promise like.

      Typenparameter

      • E extends any

      Parameter

      • inputs: DrawAny<E>

        Contains options and entities to be drawn

      Rückgabewert Promise<Drawn<E, Mesh>>

      BabylonJS Mesh Promise

    • Draws a grid mesh on the ground plane in 3D space. This helps to orient yourself in the world.

      Parameter

      Rückgabewert Mesh

    draw async

    • Draws any entity into the scene, as drawAnyAsync does, without giving the drawn object back; for the last step of a script that only needs the result to appear.

      Parameter

      • inputs: DrawAny

        The entity to draw and the optional drawing options

      Rückgabewert Promise<void>

      const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] });
      await bitbybit.draw.drawAnyAsyncNoReturn({ entity: box });

    draw sync

    • Draws an entity that needs no kernel work, as drawAny does, without giving the drawn object back; points, lines, polylines and tags qualify, kernel shapes do not.

      Parameter

      • inputs: DrawAny

        The entity to draw and the optional drawing options

      Rückgabewert void

      bitbybit.draw.drawAnyNoReturn({ entity: [[0, 0, 0], [5, 5, 5], [10, 0, 0]] });
      
    • Draws an entity that needs no kernel work into the scene right away and gives back the drawn object: points, lines, polylines, tags and nodes.

      Kernel shapes from OCCT, JSCAD and Manifold must go through drawAnyAsync, which waits for the kernel to mesh them.

      Typenparameter

      • E extends any

      Parameter

      • inputs: DrawAny<E>

        The entity to draw, the optional drawing options and the previous result when updating

      Rückgabewert Drawn<E, Mesh>

      What drawing the entity produces: a scene object for geometry, the tag or tags for a tag, an axis triad for a node; undefined for an empty list

      const options = bitbybit.draw.optionsSimple({ colours: "#00ff00", size: 0.5, opacity: 1, updatable: false, hidden: false, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1, colorMapStrategy: Bit.Inputs.Base.colorMapStrategyEnum.lastColorRemainder, arrowSize: 0, arrowAngle: 15 });
      const drawn = bitbybit.draw.drawAny({ entity: [[0, 0, 0], [5, 5, 5], [10, 0, 0]], options });

    grid

    • Draws a grid on the ground plane, as drawGridMesh does, without giving the mesh back.

      Parameter

      Rückgabewert void

      bitbybit.draw.drawGridMeshNoReturn({ width: 400, height: 400, subdivisions: 10, majorUnitFrequency: 10, minorUnitVisibility: 0.45, gridRatio: 0.5, opacity: 0.5, backFaceCulling: false, mainColor: "#ffffff", secondaryColor: "#ffffff" });
      

    material

    • Creates an image texture from a URL for the texture slots of createPBRMaterial, with tiling, offset, rotation and filtering that mean the same in every renderer.

      Parameter

      • inputs: GenericTextureDto

        The image URL and the tiling, offset, rotation, flip and sampling options

      Rückgabewert Texture

      The engine's texture

      const texture = bitbybit.draw.createTexture({ url: "https://example.com/wood.jpg", name: "wood", uScale: 2, vScale: 2, uOffset: 0, vOffset: 0, wAng: 0, invertY: false, invertZ: false, samplingMode: Bit.Inputs.Draw.samplingModeEnum.trilinear });
      
    • Creates a physically based material from settings that mean the same in every renderer: base color, metallic and roughness, opacity, emissive glow, the texture slots and the alpha and side options; put it in the faceMaterial of the drawing options.

      Parameter

      • inputs: GenericPBRMaterialDto

        The name, colors, metallic and roughness values, opacity, textures and rendering options

      Rückgabewert PBRMetallicRoughnessMaterial

      The engine's material

      const material = bitbybit.draw.createPBRMaterial({ name: "steel", baseColor: "#c0c0c0", metallic: 1, roughness: 0.4, alpha: 1, emissiveColor: "#000000", emissiveIntensity: 1, zOffset: 0, zOffsetUnits: 0, alphaMode: Bit.Inputs.Draw.alphaModeEnum.opaque, alphaCutoff: 0.5, doubleSided: false, wireframe: false, unlit: false });
      const options = bitbybit.draw.optionsOcctShapeMaterial({ precision: 0.01, faceMaterial: material, drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2 });

    options

    • Builds the most used drawing options for OCCT shapes, precision, face and edge colors and two-sided rendering, with defaults for what is left out.

      Parameter

      Rückgabewert DrawOcctShapeSimpleOptions

      The drawing options

      const options = bitbybit.draw.optionsOcctShapeSimple({ precision: 0.01, drawFaces: true, faceColour: "#ff0000", drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1 });
      
    • Builds drawing options for OCCT shapes whose faces use a full engine material, as createPBRMaterial makes one, plus the precision and edge style.

      Parameter

      Rückgabewert DrawOcctShapeMaterialOptions

      The drawing options

      const material = bitbybit.draw.createPBRMaterial({ name: "steel", baseColor: "#c0c0c0", metallic: 1, roughness: 0.4, alpha: 1, emissiveColor: "#000000", emissiveIntensity: 1, zOffset: 0, zOffsetUnits: 0, alphaMode: Bit.Inputs.Draw.alphaModeEnum.opaque, alphaCutoff: 0.5, doubleSided: false, wireframe: false, unlit: false });
      const options = bitbybit.draw.optionsOcctShapeMaterial({ precision: 0.01, faceMaterial: material, drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2 });
    • Builds drawing options for Manifold solids and cross-sections: face color or a full engine material, the line style of cross-sections, normals and the two-sided rendering.

      Parameter

      Rückgabewert DrawManifoldOrCrossSectionOptions

      The drawing options

      const options = bitbybit.draw.optionsManifoldShapeMaterial({ faceOpacity: 1, faceColour: "#ff0000", faceMaterial: material, crossSectionColour: "#ff00ff", crossSectionWidth: 2, crossSectionOpacity: 1, computeNormals: false, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1 });
      const drawn = await bitbybit.draw.drawAnyAsync({ entity: solid, options });