Draws a grid mesh on the ground plane in 3D space. This helps to orient yourself in the world.
Describes various parameters of the grid mesh like size, colour, etc.
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.
The entity to draw and the optional drawing options
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.
The entity to draw and the optional drawing options
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.
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 });
Draws a grid on the ground plane, as drawGridMesh does, without giving the mesh back.
The size, line spacing, colors and opacity of the grid
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.
The image URL and the tiling, offset, rotation, flip and sampling options
The engine's texture
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.
The name, colors, metallic and roughness values, opacity, textures and rendering options
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 });
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.
The options to start from
The drawing options
Builds drawing options for OCCT shapes whose faces use a full engine material, as
createPBRMaterial makes one, plus the precision and edge style.
The options to start from
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.
The options to start from
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 });
Creates draw options for basic geometry types like points, lines, polylines, surfaces and jscad meshes
option definition
options
Creates draw options for occt shape geometry like edges, wires, faces, shells, solids and compounds
option definition
options
Creates draw options for babylon js nodes
option definition
options
رسم أي شيء في المشهد: أشكال النواة والنقاط والخطوط والخطوط متعددة الأضلاع والمنحنيات والشبكات والوسوم تمر جميعها عبر
drawAnyAsync، الذي يختار المصيّر المناسب للكيان ويعيد الكائن المرسوم. تبني دوالoptionsخيارات الرسم بقيم افتراضية لكل نوع من الكيانات، وتصنعcreatePBRMaterialوcreateTextureالمواد لخانات الأوجه، ويمكن إعادة رسم كائن مرسوم في مكانه بتمريره مرة أخرى.