Skip to content

1.1.1

Latest

Choose a tag to compare

@matas-bitbybit-dev matas-bitbybit-dev released this 26 Jun 08:23
d3f52bd

Release Notes v1.1.1

This release brings SVG into the CAD kernel, a brand-new generic 2D path builder, and an upgrade to curves and periodic wires - Beziers, B-Splines and interpolated/symmetric wires now behave properly across the seam, with new tangent and seam controls. On top of that: deep shape introspection (debug info), degree-rebuild and face-UV tools, and new BabylonJS rendering features - glTF tooling with KHR material variants, and decals for projecting images onto meshes.

If you build parametric drawings, import vector artwork, work with smooth/closed curves, or need finer control over rendering and materials, this one is for you.


New CAD Features (OCCT)

Import SVG drawings as real geometry

You can now turn any SVG document into OCCT wires and faces, laid on the ground and aligned per your import options. Paths, basic shapes, and styling are all understood.

  • bitbybit.occt.svg.loadSVG
    • Parses an SVG document and builds a single compound shape containing every drawable element. Perfect when you want to draw, extrude, or transform the whole drawing as one shape.
  • bitbybit.occt.svg.loadSVGStructured
    • Parses an SVG document and returns one shape per drawable element, each bundled with its resolved fill / stroke / stroke-width metadata - plus parser warnings and the SVG viewBox. Use this when you need per-element shapes together with their colours and styles. (Face building is best-effort and optional.)

A generic 2D path builder

A new, SVG-agnostic path vocabulary that also powers the SVG importer under the hood.

  • bitbybit.occt.path.shapeFromPath
    • Describe a complex path with a familiar line / quadratic / cubic / arc vocabulary and build a wire, a compound of wires, or a face (when makeFaces is set) in a single call.

Better curves, splines & periodic wires

A substantial overhaul of how Bezier curves, B-Splines and interpolated wires behave - especially in closed / periodic situations, where they are now genuinely smooth across the seam instead of merely meeting end-to-end.

  • bitbybit.occt.shapes.wire.createBSpline
    • New periodic option builds a true closed, tangent-continuous B-Spline (continuous across the seam).
    • New tangent control: enforce a startTangent / endTangent (non-periodic), or supply per-point tangents (entries left undefined are inferred), plus a choice of parametrization.
  • bitbybit.occt.shapes.wire.createBezier and createBezierWeights
    • New periodic option builds a smooth closed curve that wraps the control polygon and is continuous across the seam - unlike plain closed, which only meets C0 by repeating the first point.
    • New optional degree lets you keep fewer control points while still following the control polygon.
  • bitbybit.occt.shapes.wire.interpolatePoints
    • Gains the same tangent and periodic controls for smoother, more predictable interpolated wires.
  • bitbybit.occt.shapes.wire.interpolatePointsSymmetric
    • Reworked into a dedicated, always-closed (periodic) interpolation that derives its own tangents from the points - ideal for clean, symmetric loops (needs at least 3 points).

Seam control for periodic wires

  • bitbybit.occt.shapes.wire.moveWireSeamByParameter - move the seam (origin) of a periodic wire/edge to a given parameter value.
  • bitbybit.occt.shapes.wire.moveWireSeamByLength - move the seam by an arc length from the current start. (Non-periodic shapes are returned unchanged.)

Face UV controls

  • bitbybit.occt.shapes.face.flipFaceUV - swap U/V and/or reverse the U or V direction of a face's parametrization.
  • bitbybit.occt.shapes.face.normalizeFaceParametrization - normalize a face's U/V parametrization (with sampling and tolerance) for consistent, predictable UVs downstream.

Shape introspection - "debug info"

Look inside a shape to understand the geometry it is actually made of. Each call returns structured analysis of the underlying curves/surfaces - type, degree, poles, knots, periodicity, length/area, counts, endpoints, and more.

  • bitbybit.occt.shapes.edge.debugInfo - curve type, degree, poles/knots, periodicity, range, length, start/end.
  • bitbybit.occt.shapes.face.debugInfo - surface type and parametric details.
  • bitbybit.occt.shapes.shell.debugInfo - face/edge counts, total surface area, per-face info.
  • bitbybit.occt.shapes.solid.debugInfo - aggregate introspection for solids.

These are valuable when debugging imported or generated geometry, or when deciding how to process a shape downstream.

Rebuild curve/surface degree

Normalize the mathematical degree of edges and faces - handy before lofting, joining, or exporting.

  • bitbybit.occt.shapes.edge.rebuildEdgeDegree - rebuild an edge's curve to a target degree.
  • bitbybit.occt.shapes.face.rebuildFaceDegree - rebuild a face's surface to target U/V degrees, with tolerance and optional trim preservation (keepTrim).

New Rendering Features (BabylonJS)

glTF tooling & KHR material variants

Beyond simply importing a model, you can now keep the full asset graph and drive it.

  • bitbybit.babylon.gltf.loadAssetContainerFromUrl / loadAssetContainer
    • Load a glTF/glb keeping the rich AssetContainer (meshes, materials, animations, root node) instead of collapsing it into a single mesh.
  • bitbybit.babylon.gltf.getRootNode / getMeshes - reach into the loaded asset.
  • Material variants (KHR_materials_variants) - listMaterialVariants, selectMaterialVariant, getSelectedMaterialVariant, resetMaterialVariant. Switch a product between its predefined material sets (e.g. colourways) at runtime.
  • Animations - getAnimationGroups, listAnimationGroupNames, playAnimationGroup, stopAnimationGroup.

Decals - project images onto meshes

Two complementary techniques, so you can pick the right tool for the job.

  • bitbybit.babylon.decal.createMeshDecal - a classic geometry decal: a clipped child mesh that hugs the surface. Works on any material and any static mesh.
  • bitbybit.babylon.decal.enableDecalMap + projectDecal + clearDecalMap - a modern texture-space decal map: no extra geometry, follows deformation, and multiple projections accumulate into a single map (requires good UVs).

Image textures for projection

  • bitbybit.babylon.texture.createImage - create a clamp-wrapped, alpha-aware texture from a URL, data URL, or uploaded asset, ready to feed into either decal path.

Fixes & Under the Hood

  • OCCT worker cache - the worker cache helper now detects shape pointers nested inside deeper JSON structures, so caching and cleanup work correctly for structured results (such as loadSVGStructured).
  • Draw fix for grids - corrected grid drawing behaviour.
  • Docs / Learn content updated.

Dependencies

  • BabylonJS engine updated from 9.11 -> 9.13 (@babylonjs/core, @babylonjs/gui, @babylonjs/loaders, @babylonjs/materials, @babylonjs/serializers).
  • ThreeJS engine updated from 0.184.0 -> 0.185.0
  • PlayCanvas engine updated from 2.18.1 -> 2.20.0