Skip to content

Releases: bitbybit-dev/bitbybit

0.20.4

28 May 12:56
4b14e73
Compare
Choose a tag to compare

Bitbybit [Version 0.20.4] Released! 🎉 Open Docs, App Examples & Basic Shape Creation!

We're excited to roll out an update to Bitbybit, focusing on community & docs.

🌟 Highlights:

  • Docs & Examples Unleashed! Our full documentation from learn.bitbybit.dev is now open-sourced and living in this repository! Plus, app examples are now part of the monorepo for easier access and contribution.
  • Some fundamental OCCT Shape Primitives: Create Edges, Wires, and Faces with by using base geometry structures - points, lines, segments, polylines, or meshes.
  • STEP Export Enhanced: New option to select the coordinate system (BabylonJS Left-Handed or ThreeJS Right-Handed) when saving STEP files for seamless interoperability.

** New Features Deeper Dive:**

  • Community & Developer Experience:
    • 🔥 Docs from learn.bitbybit.dev open-sourced in this repo!
    • 🔥 App examples are now part of the monorepo.
  • Core Utilities:
    • bitbybit.line.createSegment: Easily create a line segment as [Point3, Point3].
  • OCCT Edge Creation (bitbybit.occt.shapes.edge):
    • fromBaseLine, fromBaseLines, fromBaseSegment, fromBaseSegments, fromPoints, fromBasePolyline, fromBaseTriangle, fromBaseMesh.
  • OCCT Wire Creation (bitbybit.occt.shapes.wire):
    • fromBaseLine, fromBaseLines, fromBaseSegment, fromBaseSegments, fromPoints, fromBasePolyline, fromBaseTriangle, fromBaseMesh.
  • OCCT Face Creation (bitbybit.occt.shapes.face):
    • fromBaseTriangle: Create a face from a triangle.
    • fromBaseMesh: Create faces from mesh triangles (can be used for converting JSCAD/Manifold meshes to OCCT BREP).
  • Export:
    • Extra option for saving STEP files: choose between Left-Handed (BabylonJS) or Right-Handed (ThreeJS) coordinate systems.

Check out the updated docs and examples.

0.20.3

05 May 09:56
5a4261e
Compare
Choose a tag to compare

This turned out to be quite a huge release with a lot of new features and fixes.

  1. Most important features are related to new hexagon grid implementations.
  2. Bitbybit now supports mesh-mesh, triangle-triangle, polyline-polyline and line-line intersections.
  3. You can now convert entities between different kernels in these orders OCCT > JSCAD / OCCT > MANIFOLD / JSCAD > MANIFOLD / MANIFOLD > JSCAD.

FULL LIST OF FEATURES

OpenCascade (OCCT) Operations:

  • bitbybit.occt.shapes.face.subdivideToHexagonWires: Divides a given face (a bounded surface) of an OpenCascade (OCCT) shape into a pattern of hexagonal cells. The output is a collection of wire shapes (polylines or loops) representing the boundaries of these hexagonal cells. If face has curvatures, those are followed by wires. It supports various patternization parameters.
  • bitbybit.occt.shapes.face.subdivideToHexagonHoles: Takes a face (a bounded surface) of an OpenCascade (OCCT) shape and creates a pattern of hexagonal holes within it. The result is typically the original face with the hexagonal areas removed. It supports various patternization parameters.
  • bitbybit.occt.shapes.face.hexagonsInGrid: Creates a grid pattern of hexagonal shapes using OpenCascade (OCCT). Unlike wire.hexagonsInGrid, this function returns the hexagons as actual face shapes (flat planar surfaces bounded by the hexagonal outlines).
  • bitbybit.occt.shapes.wire.hexagonsInGrid: Creates a grid pattern of hexagonal shapes using OpenCascade (OCCT). The output consists of wires (boundary outlines) of the hexagons, arranged in a grid.
  • bitbybit.occt.shapeFacesToPolygonPoints: Creates very simple mesh representation from the B-Rep representation given the precision. These representations can be easily converted to JSCAD or MANIFOLD kernel meshes
  • bitbybit.occt.booleans.meshMeshIntersectionWires: Performs a boolean intersection operation between the triangle meshes derived from two OpenCascade (OCCT) shapes. Allows specifying different meshing precision for each shape. The algorithm intersects these generated meshes and returns the intersection geometry as a collection of wire shapes (polylines or polygons) representing the intersection curves.
  • bitbybit.occt.booleans.meshMeshIntersectionPoints: Performs a boolean intersection operation between the triangle meshes derived from two OpenCascade (OCCT) shapes, potentially using different meshing precisions. This algorithm intersects the meshes and returns only the distinct points that lie on the intersection curves.
  • bitbybit.occt.booleans.meshMeshIntersectionOfShapesWires: Performs mesh-based boolean intersection between a primary OpenCascade (OCCT) shape and a list of other OCCT shapes. Each shape can have its own meshing precision. The algorithm intersects the mesh of the primary shape with the meshes of all other shapes and returns the combined intersection geometry as a collection of wire shapes.
  • bitbybit.occt.booleans.meshMeshIntersectionOfShapesPoints: Performs mesh-based boolean intersection between a primary OpenCascade (OCCT) shape and a list of other OCCT shapes, allowing individual meshing precisions. Intersects the meshes and returns the distinct points lying on the combined intersection curves.

Manifold Operations:

  • bitbybit.manifold.manifold.shapes.fromPolygonPoints: Constructs a 3D shape within the Manifold geometry kernel from a list of polygons, where each polygon is defined by an ordered list of its triangle points. This allows creating Manifold models from simpler polygonal data.
  • bitbybit.manifold.toPolygonPoints: Converts a 3D model created with the Manifold geometry library into a collection of polygons defined by their vertex points. This extracts the mesh data from the Manifold shape.

JSCAD Operations:

  • bitbybit.jscad.toPolygonPoints: Converts a 3D model created with the JSCAD library into a simpler representation: a collection of polygons, where each polygon is defined by a list of its vertex points. This effectively extracts the mesh data from the JSCAD shape.

Mesh Operations:

  • bitbybit.mesh.signedDistanceToPlane: Calculates the shortest distance from a point (e.g., a mesh vertex) to a defined plane. The distance is 'signed', meaning it's positive if the point is on one side of the plane (typically the side pointed to by the plane's normal) and negative if on the other.
  • bitbybit.mesh.calculateTrianglePlane: Determines the mathematical definition of the infinite plane on which a given triangle (defined by its three vertices) lies.
  • bitbybit.mesh.triangleTriangleIntersection: Detects whether two triangles in 3D space intersect. If they do, it can compute the line segment representing their intersection.
  • bitbybit.mesh.meshMeshIntersectionSegments: Computes the intersection between two 3D meshes. The result is returned as a collection of individual line segments, representing where the faces (triangles) of one mesh penetrate the faces of the other.
  • bitbybit.mesh.meshMeshIntersectionPolylines: Computes the intersection between two 3D meshes. Similar to meshMeshIntersectionSegments, but attempts to connect the intersection segments into continuous polylines (chains of connected line segments), providing a more structured representation of the intersection paths or loops.
  • bitbybit.mesh.meshMeshIntersectionPoints: Computes the distinct points where the surfaces of two distinct 3D meshes intersect each other.

Point Operations:

  • bitbybit.point.twoPointsAlmostEqual: Determines if two 3D points are located at virtually the same position, within a predefined small tolerance. This is essential for comparing point locations reliably, accounting for potential floating-point inaccuracies.
  • bitbybit.point.stretchPointsDirFromCenter: Moves a collection of points radially outward from, or inward towards, a specified center point. Each point is moved along the direction vector from the center to the point itself, scaled by a given factor. A factor > 1 stretches points away, 0 < factor < 1 pulls them closer, and factor < 0 reflects them through the center.
  • bitbybit.point.hexGridScaledToFit: Generates a grid of hexagonal cells (with pointy or flat tops) arranged within a specified rectangular boundary. The size of the individual hexagons is automatically scaled so that the overall grid fits exactly within the given width and height dimensions. Returns both the center points of the hexagons and the vertices defining each hexagonal polygon.
  • bitbybit.point.sortPoints: Sorts a list of 3D points based on their coordinates. The sorting order is primarily by the X coordinate, then by the Y coordinate for points with the same X, and finally by the Z coordinate for points with the same X and Y. This is known as lexicographical sorting.
  • bitbybit.point.maxFilletRadius: Calculates the largest possible radius for a circular fillet (rounded corner) that can be smoothly inserted at a corner formed by two connected line segments (sharing endpoint C). The fillet arc must be tangent to both segments and lie entirely between them without extending beyond their original lengths.
  • bitbybit.point.maxFilletRadiusHalfLine: Calculates the largest possible radius for a circular fillet at a corner C, with an additional constraint: the points where the fillet arc touches the two segments (P1-C and P2-C) must lie within the first half of each segment's length, measured from the corner C. This ensures the fillet doesn't consume too much of the segment length.
  • bitbybit.point.maxFilletsHalfLine: Applies the 'half-line' fillet calculation (maxFilletRadiusHalfLine) to every internal corner of a shape defined by a sequence of points (potentially forming a polyline). If the shape is marked as closed, it also calculates the fillet radius for the corners connecting the last point back to the first. Returns the maximum possible fillet radius for each corner under the half-line constraint.
  • bitbybit.point.safestPointsMaxFilletHalfLine: Analyzes a collection of points (potentially forming multiple corners or polylines) and determines the single largest fillet radius that can be safely applied uniformly to all potential corners using the 'half-line' constraint (maxFilletRadiusHalfLine). This 'safest' radius is the minimum value among all the maximum possible fillet radii calculated for each individual corner, ensuring no fillet overlaps or violates constraints when applied globally.

Line Operations:

  • bitbybit.line.lineToSegment: Converts line data structure {start: [number, number, number], end: [number, number, number]} to segment [[number, number, number], [number, number, number]].
  • bitbybit.line.linesToSegments: Converts a collection of line representations into their corresponding segments.
  • bitbybit.line.segmentToLine: Converts segment representation to line representation.
  • bitbybit.line.segmentsToLines: Converts segments to lines.
  • bitbybit.line.lineLineIntersection: Calculates the point where two lines in 3D space intersect, if such a point exists. Can look for intersections beyond start and end points if they exist.

Polyline Operations:

  • bitbybit.polyline.sortSegmentsIntoPolylines: Takes a collection of disconnected line segments in the form of [[number, number, number], [number, number, number]] and attempts to connect them end-to-end (head-to-tail) based on proximity of endpoints, forming one or more continuous polylines. Useful for organizing fragmented geometric data into coherent paths.
  • bitbybit.polyline.polylineToLines: Deconstructs a polyline (a sequence of connected line segments) into a collection of infinite lines, where each line corresponds to one of the segments of the polyline.
  • bitbybit.polyline.polylineToSegments: Deconstructs a polyline into its individual c...
Read more

0.20.2

24 Apr 21:01
ddcc531
Compare
Choose a tag to compare

Among other things Bitbybit gained powers to create texts and dimensions in OCCT. Also Bitbybit now uses BabylonJS v8.4.0 and ThreeJS v0.176.0. These methods were added:

  • bitbybit.occt.dimensions.simpleLinearLengthDimension - Creates simple linear length dimension between two points - measuring units. You can configure direction, label size, offset and other aspects.
  • bitbybit.occt.dimensions.simpleAngularDimension - Creates simple angular dimension. By default we output degrees, but you can opt to use radians.
  • bitbybit.occt.dimensions.pinWithLabel - Creates pin label. It can be used to explain things about the models or mark important things in the 3D scene.
  • bitbybit.text.vectorChar - Create points for a single character (Implementation based on Dr. A. V. Hershey simplex font). Implementation borrowed from JSCAD kernel, which is open-sourced under MIT.
  • bitbybit.text.vectorText - Create points for a the text of characters using vectorChar.
  • bitbybit.vector.vectorsTheSame - Checks whether two vectors are the same within given tolerance
  • bitbybit.point.boundingBoxOfPoints - Gets bounding box on collection of points
  • bitbybit.point.normalFromThreePoints - Gets normal vector by providing three points. It has also an option to return reversed vector.
  • bitbybit.occt.shapes.wire.createLineWireWithExtensions - Creates a line wire, but allows users to extend the line beyond the start and ed points. If negative extension is provided line gets shorter.
  • bitbybit.occt.shapes.wire.midPointOnWire - Useful method to simply get a point on 0.5 param of the wire.
  • bitbybit.occt.shapes.wire.textWires - Create occt text wires based on vectorText explained before - returns wires
  • bitbybit.occt.shapes.wire.textWiresWithData - Create occt text wires but return additional information about the text, such as total with, height, etc.
  • bitbybit.occt.transforms.alignNormAndAxis - Powerful and very useful method to transform geometry from one coordinate system to the other precisely. Our other align algorithms were not as specific.

0.20.0

09 Apr 08:25
37d82af
Compare
Choose a tag to compare
  • occt bounding box and bounding sphere methods implemented on operations
  • Babylonjs v8.1.1
  • ThreeJS v0.175.0
  • dates implemented into the base

0.19.9

20 Mar 17:40
6873538
Compare
Choose a tag to compare
  • Switch to use MakePipe instead of MakePipeShell when creating cylindrical or ngon pipes. It is just more stable and the approach of calculating medium tangents was not really working well anyway. Now expectation is that users will provide nice continuous path where this method will succeed better.
  • Update to BabylonJS 7.54.0
  • isWireClosed exposed from OCCT
  • New OpenCascade.js build with some new functionality which will be exposed in the future.

0.19.7

19 Mar 11:55
451c0dc
Compare
Choose a tag to compare
  • New OpenCascade.js build that includes GeomAPI_ProjectPointOnCurve for splitting wires in generic way.
  • Fixed and improved cylindrical and n-gon pipe algorithms to support closed and periodic spines.
  • Re-written algorithm to split wires by providing a list of points.
  • Additional option for revolved extrude to allow for non-solid results in cases when wires are being extruded
  • Update to BabylonJS v7.53.3
  • Implemented separate import that can include bitbybit-occt wasm file from jsdelivr CDN directly

0.19.6

06 Mar 22:05
3d5bb8e
Compare
Choose a tag to compare
  • Additional edge methods to interpret multiple shapes in one go, also helper functions to check if edge is linear or circular. It is now possible to filter points that are on multiple faces in one go. Fixed base inputs that were not included in Bit object. Introduced originOnCenter properties for cylinder, cube, and box. Cylinder now also takes in the angle property.
  • BabylonJS update
  • ThreeJS update

0.19.4

07 Feb 17:02
2d6a4e6
Compare
Choose a tag to compare
  • Added fillet2dShapes method
  • Added fillet3DWires method
  • Added method to get all edge lengths on the shape
  • Update to BabylonJS v7.48.0
  • Updated Readmes to link to Crafts webshop

0.19.3

05 Feb 14:44
43aead9
Compare
Choose a tag to compare
  • Split OCCT shape with other shapes by using new BOPAlgo_Builder methods
  • Decompose OCCT compound shape to constituent parts
  • Greased lines now use PBR materials, as it's easier to update colours
  • update to BABYLONJS v7.47.2
  • update to THREEJS v0.173.0

0.19.2

25 Jan 05:48
5a95284
Compare
Choose a tag to compare
  • Update to babylonjs v7.45.0
  • Update to threejs v0.172.0
  • Best way to support links on Readme
  • .step extension added automatically to filename if needed