Skip to content

runxel/step2ifc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

step2ifc

Convert STEP (ISO 10303-21) files to IFC by 1:1 entity translation — no unnecessary tessellation, no meshing, no re-fitting.

STEP and IFC both descend from the same EXPRESS geometric schema, so most geometry entities have a direct counterpart: CARTESIAN_POINTIfcCartesianPoint, ADVANCED_FACEIfcAdvancedFace, B_SPLINE_SURFACE_WITH_KNOTSIfcBSplineSurfaceWithKnots, and so on. step2ifc exploits that correspondence and writes the translated entities directly via ifcopenshell's low-level API, preserving the original B-rep exactly as authored.

Why not just use a CAD kernel?

Most STEP→IFC converters load the file into OpenCascade (or similar), evaluate the geometry, and emit tessellated meshes. That works, but it:

  • loses the analytical representation (splines become triangles),
  • depends on the kernel's tolerance and healing behaviour, and
  • bloats the IFC output with geometry that can no longer be edited as B-rep.

step2ifc skips the kernel entirely. If your STEP file contains a NURBS surface, the IFC file contains the same NURBS surface — same control points, same knots, same weights, nothing gets altered. (That is, as long there is a correspondence. See Status)

Scope

  • In scope: geometric entities (points, curves, surfaces, topology, solids) with direct EXPRESS counterparts in IFC.
  • Out of scope: product structure / PDM data (assemblies, PRODUCT_DEFINITION, material and property metadata). The tool wraps the translated geometry in a minimal IFC spatial hierarchy (IfcProjectIfcSiteIfcBuildingElementProxy) so the output is a valid IFC file, nothing more.

Install

Requires Python 3.13+ and uv.

git clone <repo-url> step2ifc
cd step2ifc
uv sync

Usage

uv run step2ifc input.stp output.ifc
uv run step2ifc input.stp output.ifc --schema IFC4X3
uv run step2ifc input.stp output.ifc -vv    # log every unmapped or failing entity

Options:

Flag Description
--schema {IFC4,IFC4X3} Target IFC schema (default: IFC4)
-v / -vv Increase log verbosity

Status

Early; just a Proof-of-Concept. The entity mapping table in src/step2ifc/mapping.py currently covers the common geometric entities (points, curves, surfaces, topology, B-rep solids) and is expected to grow as real-world STEP inputs are encountered.

There is at least one entity that has no IFC equivalent: CONICAL_SURFACE.
If this type comes up we would need to triangulate again.

Dependencies

OpenCascade is intentionally not a runtime dependency, yet. That might change to prevent the conversion from failing (see above.)

About

Convert STEP files to IFC directly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages