Repository navigation
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
upAxisinput in place of theadjustZtoYandadjustYtoZflags, 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:
setDocLabelColorandsetDocLabelNameanswer the document they changed, where they answeredtrue
orfalse. A label the document does not have, or one that names no part, instance or assembly, is
refused with anInputErrorinstead of answeringfalse: drop the test of the answer and catch the
refusal.- A document reference is tagged
occ-document:TDocStdDocumentPointer.typewas"occ-entity". - Through the worker, a change answers a new reference. Every call that changes a document, and
buildAssemblyDocumentgiven anexistingDocument, 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:
internalVerticesModedefaults to true in
occt.io.convertStepToGltf,convertStepToGltfAdvanced,assembly.manager.exportDocumentToGltfand 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.failedorocct.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 anInputErrorbefore 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.vectorCharandtext.vectorTextdraw accented Latin letters with their marks, and Ø, Đ, Ł, Æ,
Œ and ß, where they drew a question mark.io.dxf.dxfReadgives single-line texts and hatches in each part'stextsandhatches, where it left
them out with a warning. Multi-line text and dimensions are still named inwarnings.assembly.query.getDocumentPmigives each datum of a STEP file once, under the label every tolerance's
datumsnames, where it could list a datum once for each tolerance referring to it.occt.design.toTypeScriptwritesupAxis: Bit.Inputs.Base.upAxisConversionEnum.keepfor a STEP or
IGES asset, where it wroteadjustZtoY: false.- Deprecated:
adjustZtoYandadjustYtoZ, in favour ofupAxis(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.addDocumentPmiadds 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,createPmiDatumandcreatePmiTolerancebuild the items. A
shape is a part's label and a face, edge or vertex of it, counted asshapes.face.getFace,
shapes.edge.getEdgeandshapes.vertex.getVerticescount them, or the whole part. A dimension given
startandendgets a picture drawn asio.drawing.dimensionPicturedraws 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.removeDocumentPmiremoves 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,
andaddDocumentPmiwrites into it as into a fresh one.assembly.manager.exportDocumentToStepwrites a document holding PMI as STEP AP242 with the items and
their pictures, each part's in its own context and units.assembly.query.getDocumentAnnotationsreads 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 byupAxis. A part placed twice shows its annotations twice.getDocumentPmialso gives each item's shapes asshapeRefs, the part and indexaddDocumentPmi
takes, and each tolerance'sdatumLetters,diameterZoneandmaterial, so what is read can be written
again.setDocLabelColorsandsetDocLabelNamescolour 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
loadStepToDocreturns it: its parts in the document's colours, front and back, a part it leaves
uncoloured in grey, with its edges and, withdrawAnnotations, its dimensions, tolerances and datums. It
draws whatgetDocumentAnnotationsreturns on its own, and whathatchedSectionByFramereturns: the cut
faces, their outlines and the hatch lines.- Document options in their own group:
draw.optionsOcctDocument(upAxis, which defaults to
zUpToYUpasocct.io.loadSTEPorIGESturns a shape, meshing, edges and annotations) takes the pieces
thatdraw.optionsMeshing,draw.optionsEdgesanddraw.optionsAnnotationsbuild, each with its
defaults when left out.optionsAnnotationsdraws one saved view's annotations alone, by name, and fills
their letters or draws their outlines.draw.optionsHatchedSectionsets the cut faces' colour, their
outlines and the hatch lines' colour and width.optionsOcctShapeis unchanged.
Views and sections
operations.hatchedSectionByFramecuts 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 besidehiddenLinesof the same frame. A shape whose cut faces
come withinspacingof an earlier shape's is hatched at another angle unlessneighbourAnglesis false.operations.hiddenLinesByKinddraws a shape ashiddenLinesdoes, 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.tidyon 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.textmakes a line of text for a part'stexts, in the single-line stroke font,
placed by a point on its baseline with ananchor, arotationand awidthFactor.textSizemeasures
it andtextStrokesgives its strokes. SVG draws the strokes, DXF writes a text fitted to their width. - Hatches:
io.drawing.hatchmakes a region for a part'shatches, what its boundaries enclose, a
boundary inside another cutting a hole, filled solid or withansi31,ansi32oransi37lines 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,clippedHatchLinesandhatchOutlinesgive the
lines and outlines for a renderer that draws them itself. - Dimensions:
io.drawing.dimensionPicturedraws 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.dimensionExtentgives the box it fills without drawing the letters. - Line weights and dashes: a part's
lineWeightsets the width of its lines (in DXF the nearest
standard line weight), andlineTypeScaleonio.dxf.dxfCreateandio.svg.svgCreatesets the length of
a dash pattern's unit.io.svg.pathDatawithcubicsOnlywrites every curve as cubic Beziers. - Reading back:
io.dxf.dxfReadreads single-line texts and hatches, andio.svg.svgReadreads the
texts and hatchessvgCreatewrites back as paths. - Inches:
io.drawing.scalePartsscales 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'sunit
only labels the drawing. mesh.triangulateLoopsfills 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 anupAxisinput replaces the
adjustZtoYandadjustYtoZflags ofocct.shapeToMesh,shapesToMeshesand
shapeFacesToPolygonPoints;occt.io.saveShapeSTEP,saveShapeStl,saveShapeObj,saveShapePlyand
theirAndReturntwins;occt.io.loadSTEPorIGES,loadSTEPorIGESFromText,loadStland
convertStepToGltfAdvancedwith its Draco form;occt.recipes.build;manifold.recipes.build,meshes
andsurfaceMeshes;recipes.surfaceMeshes; andifc.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
keeporyUpToZUp, file
readers and recipeskeeporzUpToYUp, a document's drawing and annotations all three. Another is
refused with anInputErrornaming the ones it takes; base'scheckedUpAxismakes 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 anupAxisleft at its default. A flag beside anupAxis, 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 asocct.fillet.insideOutorocct.chamfer.insideOutotherwise. The*WithHistorytwins number
their history on the repaired solid, or are refused asocct.fillet.historyUnnumberedor
occt.chamfer.historyUnnumberedwhen 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
InputErrornaming 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,buildAssemblyDocumentgiven anexistingDocument) 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: underlatest, 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;
underexactit 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.startedTheRunstarts 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.releaseDocumentVersionsfrees the versions a caller no longer holds.
deleteDocumentgiven 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/baseships 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_CHANGESsays in words what each conventions level changes and in
which operations, andCONVENTIONS_SURFACE, made from it, gainsgetDocumentAnnotationsand
hiddenLinesByKind. The engine-independent pieces behind document, annotation and hatch drawing
(annotationsDrawingOf,hatchesDrawingOf,documentDrawOptionsOfand 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,DrawingPlanand their reports),uniton the nesting outputs
for the DXF and SVG cut files, and pipeline types for the new operations.@bitbybit-dev/mcp:list_namespacewithout a path lists the methods of thebitbybitobject itself,
such assetConventions;describeshows 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 setinternalVerticesModeto 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/three0.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.