Converts a STEP file into a binary glTF (GLB), keeping the assembly tree as glTF nodes along with part names, colors, materials and placements.
stepData is the file as text, ArrayBuffer or Uint8Array. The mesh settings say how finely
curved surfaces are triangulated: meshPrecision is the deflection, meshAngle the angular
deflection. Z-up becomes glTF's Y-up. Failure throws.
The STEP file content and the meshing settings
The GLB file as bytes
Converts a STEP file into a binary glTF (GLB) like convertStepToGltf, with every option
exposed.
The read flags choose what to take from the file (colors, names, materials, layers, properties), the mesh settings how finely to triangulate, the export settings how the glTF is written (merged faces, 16-bit indexes, naming, scale). Switch off what you do not need.
The STEP file content and the reading, meshing and export settings
The GLB file as bytes
const options = new Bit.Inputs.OCCT.ConvertStepToGltfAdvancedDto();
options.stepData = stepText;
options.readColors = true;
options.readNames = true;
options.meshDeflection = 0.005;
options.mergeFaces = true;
options.adjustZtoY = true;
const glb = await bitbybit.occt.io.convertStepToGltfAdvanced(options);
Converts a STEP file into a binary glTF (GLB) like convertStepToGltf and compresses the
geometry with Draco, which makes the file much smaller at the cost of a Draco-capable loader.
The Draco settings set the compression level and how many bits positions, normals, texture coordinates and colors keep; fewer bits mean a smaller file and less precision.
The STEP file content, the meshing settings and the Draco settings
The GLB file as bytes
Converts a STEP file into a binary glTF (GLB) with every reading, meshing and writing option
exposed, as convertStepToGltfAdvanced does, and compresses the geometry with Draco.
The Draco settings set the compression level and how many bits positions, normals, texture coordinates and colors keep; fewer bits mean a smaller file and less precision.
The STEP file content, the reading, meshing and export settings, and the Draco settings
The GLB file as bytes
Reads the assembly structure of a STEP file without building geometry: every part and sub-assembly as a node with its id, name, whether it is an assembly, its visibility, its color and its placement matrix.
The nodes come in depth-first order, so children follow their parent. A file that cannot be parsed reports its error in the result.
The STEP file content
The list of nodes, the format version and any error
Turns the wires of a shape into DXF path records, the first step of a 2D DXF export.
The shape must lie flat on the XZ ground plane, since DXF drawings are two-dimensional. The
deflection settings say how closely curved edges are followed. Give the paths a layer with
dxfPathsWithLayer and write the file with dxfCreate.
The shape and the deflection settings
The DXF paths
Puts DXF paths on a named layer with a color, making one part of a DXF drawing.
A drawing may hold several parts, each with its own layer and color; dxfCreate writes them
into one file.
The paths, the layer name and the color
The paths as one layered part
Writes DXF parts into one DXF file and returns its text.
colorFormat chooses AutoCAD's indexed colors or true color, acadVersion the DXF version:
AC1009 is R12, the most widely readable, AC1015 is 2000. fileName and tryDownload matter
only where a browser download can be started.
The layered parts, the color format, the DXF version and the download options
The DXF file as text
Writes a shape as STEP, the standard exchange format for exact CAD geometry, and starts a browser download of the file.
With adjustYtoZ true the shape is turned so this library's Y-up becomes STEP's Z-up;
fromRightHanded skips the mirror that swap otherwise includes. fileName names the download
and tryDownload false skips it. saveShapeSTEPAndReturn gives the file's text instead.
The shape, the file name, the axis adjustment and the download options
Nothing; the download starts when the file is ready
Writes a shape as STEP, the standard exchange format for exact CAD geometry, and returns the file's text.
With adjustYtoZ true the shape is turned so this library's Y-up becomes STEP's Z-up;
fromRightHanded skips the mirror that swap otherwise includes. fileName and tryDownload
matter only where a browser download can be started.
The shape, the file name, the axis adjustment and the download options
The STEP file as text
Triangulates a shape, writes it as STL, the mesh format 3D printers read, and starts a browser download of the file.
precision is the meshing tolerance in model units; smaller values follow curved surfaces more
closely and make a bigger file. adjustYtoZ turns Y-up into Z-up. fileName names the
download, tryDownload false skips it. saveShapeStlAndReturn gives the text instead.
The shape, the file name, the meshing precision, the axis adjustment and the download options
Nothing; the download starts when the file is ready
Triangulates a shape and writes it as STL, the mesh format 3D printers and slicers read, returning the file's text.
precision is the meshing tolerance in model units; smaller values follow curved surfaces
more closely and make a bigger file. adjustYtoZ turns the shape so Y-up becomes Z-up.
fileName and tryDownload only matter where a download can start.
The shape, the file name, the meshing precision, the axis adjustment and the download options
The STL file as text
Lit un fichier STEP ou IGES, donné sous forme de File, en une seule forme.
L'extension du fichier décide du type : .step, .stp sont STEP, .iges, .igs sont IGES.
adjustZtoY transforme le Z vers le haut du fichier en Y vers le haut. Un fichier qui ne peut pas être lu donne undefined.
Le fichier et l'ajustement des axes
La forme chargée
Lit un fichier STEP ou IGES, donné sous forme de texte, en une seule forme ; fileType dit dans lequel des
deux formats le texte est.
adjustZtoY transforme le Z vers le haut du fichier en Y vers le haut. Un texte qui ne peut pas être lu donne undefined.
Le texte du fichier, son format et l'ajustement des axes
La forme chargée
Lire et écrire des fichiers CAO avec OCCT : tout ce que
iooffre sur le noyau, plus des chargeurs qui prennent un fichier STEP ou IGES comme objet File ou comme son texte et renvoient une forme. Les fichiers sont Z vers le haut par convention, doncadjustZtoYtourne la forme chargée vers le Y vers le haut de cette bibliothèque sauf s'il est mis à faux.