Skip to content

1.8.0

Latest

Choose a tag to compare

@matas-bitbybit-dev matas-bitbybit-dev released this 24 Nov 08:32
c8e0885

Release Notes v1.8.0

A release on top of 1.7.0, about assembly documents with PMI, drawings with texts, hatches and dimensions,
and OCCT kernels on OpenCascade 8.0.2:

  • New OCCT kernels built on OpenCascade 8.0.2. Fillets and chamfers refuse a result that leaves the box of
    what they round, and repair one that came out inside out.
  • PMI in assembly documents: read with its pictures, written to STEP AP242 and removed, and label setters
    that answer the document.
  • An assembly document drawn whole with its annotations, and hatched sections, in Babylon.js, three.js and
    PlayCanvas.
  • Drawings with texts, hatches and dimension pictures, written to DXF and SVG, read back from DXF, and
    scaled to inches.
  • One upAxis input in place of the adjustZtoY and adjustYtoZ flags, which still work.

Upgrading from 1.7.0

Code that tests what setDocLabelColor or setDocLabelName answers, or reads the type of a document
reference, needs changing; other code runs as it did. 27 functions were added and none removed, so the
reference counts 2,267. Most new members are marked beta; operations.hiddenLinesByKind,
mesh.triangulateLoops and the upAxis inputs are not. Outputs that differ from 1.7.0:

  • setDocLabelColor and setDocLabelName answer the document they changed, where they answered true
    or false. A label the document does not have, or one that names no part, instance or assembly, is
    refused with an InputError instead of answering false: drop the test of the answer and catch the
    refusal.
  • A document reference is tagged occ-document: TDocStdDocumentPointer.type was "occ-entity".
  • Through the worker, a change answers a new reference. Every call that changes a document, and
    buildAssemblyDocument given an existingDocument, answers a reference to the version it made, and the
    document a load or a build returned no longer changes. Code that goes on using the reference it loaded
    still reads the latest change by default (see The OCCT worker).
  • glTF exports put vertices inside flat and cylindrical faces: internalVerticesMode defaults to true in
    occt.io.convertStepToGltf, convertStepToGltfAdvanced, assembly.manager.exportDocumentToGltf and their
    Draco forms, where triangles could cut straight across a wide cylindrical face such as a bore. Set it false
    for the 1.7.0 output.
  • Meshes from the new kernels can differ slightly: a sphere of radius 10 meshed at precision 0.01 gives
    15,381 vertex coordinates, where it gave 15,318.
  • Fillets and chamfers refuse more: a result that leaves the box of what they round is refused as
    occt.fillet.failed or occt.chamfer.failed, where it could come back invalid, and a solid that came out
    inside out, which came back as it was, is repaired or refused with a new code (see OCCT kernels). A 3D
    fillet radius not above 0 is an InputError before the kernel runs, where it reached the kernel.
  • Variable-radius fillets read positions as fractions of the edge's length, 0 to 1, and put each radius
    at its own position, two radii included; 1.7.0 put the first and last at the ends of the edge's curve and
    the others along its parameter. A position outside 0 to 1, such as [0, 50, 100], is refused: divide it
    by the range.
  • text.vectorChar and text.vectorText draw accented Latin letters with their marks, and Ø, Đ, Ł, Æ,
    Œ and ß, where they drew a question mark.
  • io.dxf.dxfRead gives single-line texts and hatches in each part's texts and hatches, where it left
    them out with a warning. Multi-line text and dimensions are still named in warnings.
  • assembly.query.getDocumentPmi gives each datum of a STEP file once, under the label every tolerance's
    datums names, where it could list a datum once for each tolerance referring to it.
  • occt.design.toTypeScript writes upAxis: Bit.Inputs.Base.upAxisConversionEnum.keep for a STEP or
    IGES asset, where it wrote adjustZtoY: false.
  • Deprecated: adjustZtoY and adjustYtoZ, in favour of upAxis (see Up axis). They keep their place
    in the constructors, no longer carry a default, and go in the next major version.

Assembly documents and PMI

  • assembly.manager.addDocumentPmi adds dimensions, geometric tolerances and datums to a document, all
    of them or, when one is refused, none. Dimensions state a linear distance, an angle, a diameter, a radius
    or a curve length; tolerances flatness, circularity, cylindricity, parallelism, perpendicularity, position
    or a profile of a surface, with a diameter zone and a material condition where they take one. Calls add
    up.
  • createPmiShape, createPmiDimension, createPmiDatum and createPmiTolerance build the items. A
    shape is a part's label and a face, edge or vertex of it, counted as shapes.face.getFace,
    shapes.edge.getEdge and shapes.vertex.getVertices count them, or the whole part. A dimension given
    start and end gets a picture drawn as io.drawing.dimensionPicture draws it; any item takes a picture
    of its own.
  • Datum letters: a letter names one datum in a document. A letter given twice in one call, or again on
    other shapes, is refused, as is a datum no tolerance of its call refers to; a tolerance refers to the
    datums of its own call, so a datum the document holds is given again on its shapes.
  • assembly.manager.removeDocumentPmi removes every dimension, datum and tolerance with their pictures,
    and the saved views that showed only them. The document then writes to STEP as one that never held PMI,
    and addDocumentPmi writes into it as into a fresh one.
  • assembly.manager.exportDocumentToStep writes a document holding PMI as STEP AP242 with the items and
    their pictures, each part's in its own context and units.
  • assembly.query.getDocumentAnnotations reads the dimensions, tolerances and datums as a STEP AP242
    file draws them, each with its plane, its lines and its letters as loops to fill, and the views the file
    saved, in the document's axes or turned by upAxis. A part placed twice shows its annotations twice.
  • getDocumentPmi also gives each item's shapes as shapeRefs, the part and index addDocumentPmi
    takes, and each tolerance's datumLetters, diameterZone and material, so what is read can be written
    again.
  • setDocLabelColors and setDocLabelNames colour or rename many labels in one change. All four label
    setters check every label, and every name, before anything changes.

Drawing documents and sections

  • draw.drawAnyAsync, in Babylon.js, three.js and PlayCanvas, draws an assembly document as
    loadStepToDoc returns it: its parts in the document's colours, front and back, a part it leaves
    uncoloured in grey, with its edges and, with drawAnnotations, its dimensions, tolerances and datums. It
    draws what getDocumentAnnotations returns on its own, and what hatchedSectionByFrame returns: the cut
    faces, their outlines and the hatch lines.
  • Document options in their own group: draw.optionsOcctDocument (upAxis, which defaults to
    zUpToYUp as occt.io.loadSTEPorIGES turns a shape, meshing, edges and annotations) takes the pieces
    that draw.optionsMeshing, draw.optionsEdges and draw.optionsAnnotations build, each with its
    defaults when left out. optionsAnnotations draws one saved view's annotations alone, by name, and fills
    their letters or draws their outlines. draw.optionsHatchedSection sets the cut faces' colour, their
    outlines and the hatch lines' colour and width. optionsOcctShape is unchanged.

Views and sections

  • operations.hatchedSectionByFrame cuts shapes with the plane of a frame and gives, for each shape,
    its cut faces, their hatch lines as edges and each face's hatch as drawing data in the frame's
    coordinates, which writes to DXF or SVG beside hiddenLines of the same frame. A shape whose cut faces
    come within spacing of an earlier shape's is hatched at another angle unless neighbourAngles is false.
  • operations.hiddenLinesByKind draws a shape as hiddenLines does, with the edges sorted into sharp
    edges, outlines of curved faces and smooth edges, seen and hidden, so a drawing can give each its own line
    weight.
  • tidy on both: a curve seen edge-on becomes a line, and a hidden edge lying wholly under other edges
    is left out.

Drawings

  • Texts: io.drawing.text makes a line of text for a part's texts, in the single-line stroke font,
    placed by a point on its baseline with an anchor, a rotation and a widthFactor. textSize measures
    it and textStrokes gives its strokes. SVG draws the strokes, DXF writes a text fitted to their width.
  • Hatches: io.drawing.hatch makes a region for a part's hatches, what its boundaries enclose, a
    boundary inside another cutting a hole, filled solid or with ansi31, ansi32 or ansi37 lines at an
    angle and spacing. DXF writes them as hatches with the ANSI patterns, scaled from the inch patterns in an
    inch drawing; SVG fills them with patterns. hatchLines, clippedHatchLines and hatchOutlines give the
    lines and outlines for a renderer that draws them itself.
  • Dimensions: io.drawing.dimensionPicture draws a linear, diameter, radius or angular dimension: its
    lines, filled arrowheads, and its value with any tolerance in the stroke font, reading from left to right
    or from bottom to top. dimensionExtent gives the box it fills without drawing the letters.
  • Line weights and dashes: a part's lineWeight sets the width of its lines (in DXF the nearest
    standard line weight), and lineTypeScale on io.dxf.dxfCreate and io.svg.svgCreate sets the length of
    a dash pattern's unit. io.svg.pathData with cubicsOnly writes every curve as cubic Beziers.
  • Reading back: io.dxf.dxfRead reads single-line texts and hatches, and io.svg.svgRead reads the
    texts and hatches svgCreate writes back as paths.
  • Inches: io.drawing.scaleParts scales parts about the origin, text heights, hatch spacings and line
    weights included, such as by 1/25.4 to turn millimetres into inches before writing; a writer's unit
    only labels the drawing.
  • mesh.triangulateLoops fills closed loops lying in one plane with triangles, outlines and holes taken
    from how they nest, under the even-odd or the non-zero rule (Base.loopFillRuleEnum).

Up axis

  • Base.upAxisConversionEnum (keep, zUpToYUp, yUpToZUp) in an upAxis input replaces the
    adjustZtoY and adjustYtoZ flags of occt.shapeToMesh, shapesToMeshes and
    shapeFacesToPolygonPoints; occt.io.saveShapeSTEP, saveShapeStl, saveShapeObj, saveShapePly and
    their AndReturn twins; occt.io.loadSTEPorIGES, loadSTEPorIGESFromText, loadStl and
    convertStepToGltfAdvanced with its Draco form; occt.recipes.build; manifold.recipes.build, meshes
    and surfaceMeshes; recipes.surfaceMeshes; and ifc.geometry.toShapes. Each default is the turn its
    flag's default made.
  • Each method takes the turns it can make: shape meshes and file writers keep or yUpToZUp, file
    readers and recipes keep or zUpToYUp, a document's drawing and annotations all three. Another is
    refused with an InputError naming the ones it takes; base's checkedUpAxis makes the same check.
  • The flags still work: a flag at its old default decides nothing; set the other way it chooses its turn,
    and wins over an upAxis left at its default. A flag beside an upAxis, or the other flag, asking for
    another turn is refused, naming both.

OCCT kernels

  • Built on OpenCascade 8.0.2. All three kernels are rebuilt.
  • Fillets and chamfers (3D, 2D, of a wire's corners and at a corner by point) refuse a result that
    leaves the box of what they round by more than its own tolerance, such as the invalid solid, far wider than
    the box, that OCCT 8.0.2 makes of a box rounded past half its side.
  • An inside-out result is repaired: a solid that came out inside out, as OCCT 8.0.2 gives the rounded or
    chamfered tips of a bored spur gear, is handed back repaired when it is then valid and inside the box, and
    refused as occt.fillet.insideOut or occt.chamfer.insideOut otherwise. The *WithHistory twins number
    their history on the repaired solid, or are refused as occt.fillet.historyUnnumbered or
    occt.chamfer.historyUnnumbered when two of its faces cannot be told apart.
  • Checked first: a 3D fillet radius, or a corner-by-point radius or distance, that is not a finite number
    above 0, a variable-radius position outside 0 to 1, and one position given two radii are each an
    InputError naming its place in its list, before the kernel runs.
  • Variable-radius fillets put each radius at its fraction of the edge's length from the start of its
    curve, whatever the edge's orientation. Positions come in any order, an end without one takes the nearest
    radius, and between positions the radius may overshoot.

The OCCT worker

  • Assembly documents are values. A call that changes a document (the label setters, addDocumentPmi,
    removeDocumentPmi, buildAssemblyDocument given an existingDocument) never changes the document a
    load or a build returned: it makes a version and answers a reference to it, which always reads as that
    change left it. Pass it on to an export, a read or the next change. Used directly, without the worker, a
    change is made in place and answers the document it was given.
  • OCCTWorkerManager.setDocumentReferences: under latest, the default, a reference to a document as
    loaded reads the last change of the run, so code that ignores what a change answered exports the change;
    under exact it reads the document as loaded, for a dataflow graph that runs again only what changed. A
    reference to a version reads that version under both. startedTheRun starts a run from the documents as
    made.
  • Versions are bounded: the worker frees the least recently used versions and makes a freed version
    again from its changes when it is read. releaseDocumentVersions frees the versions a caller no longer holds.
    deleteDocument given a version frees that one alone, given the document it frees every version too, and
    it refuses what is not a document reference.

Licensing

  • @bitbybit-dev/occt's NOTICE names OCCT's copyright, licence (LGPL-2.1 with the Open CASCADE
    exception) and warranty, and your right to modify OCCT and relink the kernel with it. It says where the
    OCCT source of each kernel is published and how to get its relinking kit, and carries a written offer of
    both, valid for at least three years after a kernel is last distributed.
  • Hershey fonts: @bitbybit-dev/base ships a NOTICE with the terms and acknowledgements of the stroke
    font's data, and @bitbybit-dev/occt's names them too, since the kernel measures text with the font's
    widths.

Tooling and docs

  • @bitbybit-dev/core: CONVENTION_CHANGES says in words what each conventions level changes and in
    which operations, and CONVENTIONS_SURFACE, made from it, gains getDocumentAnnotations and
    hiddenLinesByKind. The engine-independent pieces behind document, annotation and hatch drawing
    (annotationsDrawingOf, hatchesDrawingOf, documentDrawOptionsOf and others) are exported for an
    engine of your own.
  • @bitbybit-dev/cad-cloud-sdk: types and request validation for the drawing-sheet routes
    (DrawingDrawBody, DrawingInspectBody, DrawingPlan and their reports), unit on the nesting outputs
    for the DXF and SVG cut files, and pipeline types for the new operations.
  • @bitbybit-dev/mcp: list_namespace without a path lists the methods of the bitbybit object itself,
    such as setConventions; describe shows what each conventions level changes in an operation, and each
    engine's own documentation where they differ; get_guide("coordinates") opens the new guide section.
  • Guides: the geometry guide has a section on coordinate systems and conventions levels, and the IFC
    guide says to set the level when the library is set up.
  • create-app and examples: the sheet-metal-unfold app draws each bend's line where it lies on the flat
    pattern and in the DXF's bend layer, and lists the bends; the cloud templates and the API example decode
    Draco-compressed glTF; the templates' glTF exports set internalVerticesMode to true.
  • Languages: every locale has the texts of the new and changed members.

Dependencies

  • No engine or kernel library changed: BabylonJS 9.35.0, three.js 0.187.0 (@types/three 0.187.0),
    PlayCanvas 2.24.0, Manifold 3.5.4 and JSCAD 2.13.0; new OCCT kernels on OpenCascade 8.0.2. Every package is
    versioned 1.8.0.