sysmlv2_geometry provides a public, SysML-based specification for
sharing geometry information. The idea is that SysML serves as the platform technology that enables specifications to becomce life connections between tools and processes.
The project currently focuses on two complementary capabilities:
- A generic, CAD-agnostic representation of assemblies that captures translation, rotation, and ownership relationships between components.
- A concrete connector that reads assembly data from Onshape and converts it into the common representation.
The intent is to grow this repository into a hub for multiple CAD and digital engineering tools so that they can all feed geometry into SysML v2 models through a single, consistent API.
- Generic assembly structure – The
geometry_apipackage exposes endpoints for importing a geometric assembly from SysML and exporting it to SysML. The components in this module serve as python-space representation which can be used to write integrations to other tools such as the: - Onshape connector – The
onshape_connectorpackage exports geometry assemblies to onshape. It can create new assemblies and position sub-assemblies into the correct locations as specified in SysML. - Transformation utilities – The
transformation_apipackage bundles Christoph Gohlke'stransformations.pyhelpers, which are used for converting between transformation matrices, Euler angles, and other pose formats.
.
├── build/ # Packaging or temporary build artifacts
├── examples/ # Sample data (e.g., SysML exports)
├── src/
│ ├── geometry_api/ # Public API for component creation & export
│ ├── onshape_connector/ # Helpers for pulling assemblies from Onshape
│ └── transformation_api/ # Math utilities for poses and transforms
├── tests/ # Pytest suite covering API & connectors
├── requirements*.txt # Runtime and CI dependency pins
└── pyproject.toml # Project metadata (package name, deps, etc.)
The project targets Python 3.8+ and is published under the package name
geometry-api. To install the package locally:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -e .The base dependencies include astropy for Cartesian representations and
numpy for matrix math. Some optional modules (for example, syside or the
Onshape client) may be required depending on which connectors you use.
To access a workspace hosted on Onshape you will need an API key pair. The
connector searches for credentials in the ACCESS_KEY and SECRET_KEY
environment variables or inside a .env file placed either next to the module
or anywhere up the current working directory hierarchy. Once the credentials are
available, you can call the helper utilities in onshape_connector to
retrieve assembly instances, their hierarchical paths, and the transforms that
locate each component.
The repository uses pytest. After installing the project along with the
additional requirements listed in requirements.txt, run:
pytestSeveral tests rely on sample SysML outputs and mocked Onshape data to exercise export and transformation logic.
This repository is intended to evolve into a broad geometry interface. Planned improvements include:
- Additional CAD connectors beyond Onshape.
- Richer metadata for components (materials, display properties, etc.).
- Higher-level orchestration scripts and examples for end-to-end workflows.
Contributions that add new tool integrations or extend the generic assembly model are especially welcome.