Clean-room Parasolid XT (.x_b, .x_t, .x_p, .x_d) and Siemens NX (.prt) reader, writer, B-rep inspector & native STEP AP214/AP242 exporter.
flowchart LR
XT[".x_b / .x_t / .x_p / .x_d"] --> P["xtopen Parser<br/>(Built-in Schema)"]
P --> N["XtNode Graph<br/>& Topology Validation"]
N --> M["BrepModel<br/>(Analytic, NURBS, p-curves)"]
M --> STEP["Native STEP AP214 / AP242<br/>(Zero Dependencies)"]
M --> JSON["JSON / Inspection CLI"]
N --> XT2["write_xb / write_xt<br/>Roundtrip"]
STEP --> FC["FreeCAD Macro<br/>& Optional OCCT"]
- Zero runtime dependencies — pure Python 3.10+ standard library (
cadquery-ocpis strictly optional). - Self-contained XT schema — built-in schema from public XT documentation; no external
.s_tfiles needed. - Full container support — Form-1 & Form-2 binary
.x_b, text.x_t, partition.x_p, deltaPMARKstreams.x_d, plus Siemens NX.prt(SPLMSSTR& legacyOLE2/CFB) embedded Parasolid B-rep extraction. - Native STEP AP214 / AP242 export — planes, cylinders, cones, spheres, tori, extruded/revolved/offset surfaces, rational & non-rational NURBS, circles, ellipses, intersection sample curves, 2D p-curve 3D lifting, multi-body shells, assembly hierarchies (
ASSEMBLY/INSTANCE/TRANSFORM), and face/body colors, names & transparency (SDL/TYSA_*) (--units mm|m). - Roundtrip & CAD integrations —
write_xb,write_xt,xb_to_xt,xt_to_xb, optionalxtopen.occt_bridge,freecad/ImportParasolid.FCMacro, companion Rust SolidCraft plugins & live browser WASM viewer.
pip install xtopen
# or for optional OpenCASCADE checks:
pip install "xtopen[occt]"
xtopen convert model.x_b model.step --units mm --schema AP214
xtopen info model.x_bimport xtopen
parsed = xtopen.load_xb("part.x_b")
report = xtopen.validate(parsed)
xtopen.export_step(parsed, "part.step", schema="AP214", units="mm")For optional OpenCASCADE checks:
pip install -e ".[occt]"| Command | Description |
|---|---|
xtopen info <file> [--json] |
Show container header, node histogram, topology counts, bounding box, and Euler characteristic |
xtopen validate <file> [--json] |
Validate stream completeness, loop vertex closure, edge pairing, and curve/surface bounds |
xtopen dump <file> [--nodes-only] [-o out.json] |
Export structured B-rep model or raw XT records to JSON |
xtopen convert <in> <out> [--units mm|m] [--schema AP214|AP242] |
Convert between .prt, .x_b, .x_t, and .step/.stp |
xtopen extract-prt <file.prt> <out_dir> |
Extract embedded .x_b streams (and preview thumbnail) from an NX .prt file |
| Category | Supported Nodes |
|---|---|
| Topology | ASSEMBLY (10), INSTANCE (11), BODY (12), SHELL (13), FACE (14), LOOP (15), EDGE (16), HALFEDGE (17), VERTEX (18), REGION (19) |
| Surfaces | PLANE (50), CYLINDER (51), CONE (52), SPHERE (53), TORUS (54), OFFSET_SURF (60), SWEPT_SURF (67), SPUN_SURF (68), B_SURFACE (124) / NURBS_SURF (126) |
| Curves | LINE (30), CIRCLE (31), ELLIPSE (32), INTERSECTION (38), TRIMMED_CURVE (133), B_CURVE (134) / NURBS_CURVE (136), SP_CURVE (137) |
| Data & Attribs | POINT (29), LIST (70), ATTRIB_DEF (80), ATTRIBUTE (81), *_VALUES (82..89, 98), TRANSFORM (100), WORLD (101), KEY (102) |
- XT Binary Schema Parity: Verified
4,251 / 4,251.x_bfiles (0errors,0field mismatches) using only the built-in schema, plus.x_pand.x_dpartition/delta containers. - STEP Export Validation (OCCT): Verified
304 / 304stratified corpus.x_bconversions load cleanly in OpenCASCADESTEPControl_Reader(0Part-21 syntax errors,303 / 304 = 99.7%BRepCheck_Analyzer.IsValid()). - Known Limitations: Procedural rolling-ball fillets (
BLENDED_EDGE 56) have no exact analytic STEP representation and fall back to placeholder planes.
If xtopen helps your work, voluntary donations are welcome (details):
- Bitcoin (BTC):
bc1qqptjmpr684xglyqsp743ruufnwpsjv4dlzk9tx - YooMoney: yoomoney.ru/to/4100118415983435 (
4100118415983435)
MIT License — see LICENSE.