Catalog PyPI
PACKAGE EXPLORERView in registry

abs-hdf5

PyPI

A Python + C++ toolkit for reading CAD B-Rep data from HDF5, sampling surfaces/curves, and generating blue-noise point clouds.

blue-noisecadgeometryhdf5sampling
Versions collected1
Direct dependencies5From release 1.0.0
Last observed20 Oct, 17:37 UTC

README

Version 1.0.0 documentation

Better STEP: A Standardized B-Rep Dataset and Pipeline for Reproducible CAD Evaluation

image

ABS-HDF5

ABS-HDF5 reads B-Rep geometry from HDF5 files as a standard half-edge data structure, allowing you to navigate topology (faces, edges, halfedges, loops), sample points directly from continuous parametric surfaces and curves, and evaluate normals and derivatives. It supports user-specified tasks, and provides fast Poisson-disk downsampling for blue-noise point cloud generation.

HDF5 files are produced by steptohdf5, a companion converter that turns STEP/STP CAD files into the format ABS reads.

Install

pip install abs-hdf5

Usage

Reading and traversing topology

read_parts loads the full B-Rep structure into memory as linked Python objects.

from abs import read_parts

parts = read_parts('model.hdf5')
face = parts[0].faces[1]

adjacent_faces = face.find_adjacent_faces()
loop = face.loops[0]

Sampling points with user-defined labels

sample_parts generates points on parametric surfaces and curves and passes them to your callbacks. Each callback receives the topological entity and the sampled points, and returns whatever per-point values your task needs including labels, normals, primitive types, etc.

from abs import read_parts, sample_parts
import numpy as np

def face_func(face, points):
    return np.zeros(points.shape[0])

def edge_func(edge, points):
    return np.ones(points.shape[0])

parts = read_parts('model.hdf5')
face_points, face_labels, edge_points, edge_labels = sample_parts(
    parts, num_samples=5000, face_func=face_func, edge_func=edge_func
)

Computing normals

Normals are evaluated directly from the underlying parametric surfaces.

def get_normals(face, points):
    return face.normal(points)

face_points, face_normals, _, _ = sample_parts(
    parts, num_samples=5000, face_func=get_normals
)

Extracting the mesh

The mesh is stored independently from the B-Rep topology. get_mesh concatenates all per-face triangulations into a single consistent mesh.

from abs.utils import read_meshes, get_mesh

meshes = read_meshes('model.hdf5')
V, F = get_mesh(meshes)

Examples

For a full set of worked examples, loading models, traversing topology, computing normals, primitive segmentation, and mesh extraction, see the abs/use_cases.ipynb notebook.

Dataset

The dataset comprises over one million B-Rep models converted from two large-scale public CAD collections:

  • ABC — ~1,000,000 models
  • Fusion 360 Gallery — Assembly (162,707 parts), Joint (23,029 parts), Reconstruction (27,958 parts), and Segmentation (35,680 parts)

Each model is stored in HDF5 as a collection of parts, where every part contains its geometry, topology, and an optional triangular mesh. Once converted, no CAD kernel is required to read or process the data.

The dataset can be downloaded here: [link coming soon]

Converting your own STEP files

To convert your own STEP files, please refer to the steptohdf5 repository.

Contributing

Contributions are welcome. Please open an issue before submitting larger changes.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.02 May 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:4938b1247f7bdaa30348095b7214f80ddcb192bdca6a6519ed3649c04f4b3e5e