|
1 | | -# sysmlv2_dls |
2 | | -Fundamental design language generators for SysML v2 |
| 1 | +# sysmlv2_geometry |
3 | 2 |
|
4 | | -pip install syside-license syside --index-url https://gitlab.com/api/v4/projects/69960816/packages/pypi/simple --upgrade |
| 3 | +## Overview |
| 4 | +`sysmlv2_geometry` provides a public, Python-based interface for building and |
| 5 | +sharing geometry information that can be consumed by SysML v2 tooling. The |
| 6 | +project currently focuses on two complementary capabilities: |
| 7 | + |
| 8 | +1. A generic, CAD-agnostic representation of assemblies that captures |
| 9 | + translation, rotation, and ownership relationships between components. |
| 10 | +2. A concrete connector that reads assembly data from Onshape and converts it |
| 11 | + into the common representation. |
| 12 | + |
| 13 | +The intent is to grow this repository into a hub for multiple CAD and digital |
| 14 | +engineering tools so that they can all feed geometry into SysML v2 models |
| 15 | +through a single, consistent API. |
| 16 | + |
| 17 | +## Key capabilities |
| 18 | +- **Generic assembly structure** – The `geometry_api` package exposes endpoints |
| 19 | + for creating components, nesting them, and exporting the resulting hierarchy |
| 20 | + as SysML v2 textual notation. This makes it possible to describe assemblies |
| 21 | + even when the original CAD system is not available. |
| 22 | +- **Onshape connector** – The `onshape_connector` package authenticates with the |
| 23 | + Onshape public API, walks assembly occurrences, and maps part poses into the |
| 24 | + generic structure. This is the first CAD integration, with more connectors |
| 25 | + planned. |
| 26 | +- **Transformation utilities** – The `transformation_api` package bundles |
| 27 | + Christoph Gohlke's `transformations.py` helpers, which are used for converting |
| 28 | + between transformation matrices, Euler angles, and other pose formats. |
| 29 | + |
| 30 | +## Repository layout |
| 31 | +``` |
| 32 | +. |
| 33 | +├── build/ # Packaging or temporary build artifacts |
| 34 | +├── examples/ # Sample data (e.g., SysML exports) |
| 35 | +├── src/ |
| 36 | +│ ├── geometry_api/ # Public API for component creation & export |
| 37 | +│ ├── onshape_connector/ # Helpers for pulling assemblies from Onshape |
| 38 | +│ └── transformation_api/ # Math utilities for poses and transforms |
| 39 | +├── tests/ # Pytest suite covering API & connectors |
| 40 | +├── requirements*.txt # Runtime and CI dependency pins |
| 41 | +└── pyproject.toml # Project metadata (package name, deps, etc.) |
| 42 | +``` |
| 43 | + |
| 44 | +## Installation |
| 45 | +The project targets Python 3.8+ and is published under the package name |
| 46 | +`geometry-api`. To install the package locally: |
| 47 | + |
| 48 | +```bash |
| 49 | +python -m venv .venv |
| 50 | +source .venv/bin/activate |
| 51 | +pip install --upgrade pip |
| 52 | +pip install -e . |
| 53 | +``` |
| 54 | + |
| 55 | +The base dependencies include `astropy` for Cartesian representations and |
| 56 | +`numpy` for matrix math. Some optional modules (for example, `syside` or the |
| 57 | +Onshape client) may be required depending on which connectors you use. |
| 58 | + |
| 59 | +## Configuring the Onshape connector |
| 60 | +To access a workspace hosted on Onshape you will need an API key pair. The |
| 61 | +connector searches for credentials in the `ACCESS_KEY` and `SECRET_KEY` |
| 62 | +environment variables or inside a `.env` file placed either next to the module |
| 63 | +or anywhere up the current working directory hierarchy. Once the credentials are |
| 64 | +available, you can call the helper utilities in `onshape_connector` to |
| 65 | +retrieve assembly instances, their hierarchical paths, and the transforms that |
| 66 | +locate each component. |
| 67 | + |
| 68 | +## Testing |
| 69 | +The repository uses `pytest`. After installing the project along with the |
| 70 | +additional requirements listed in `requirements.txt`, run: |
| 71 | + |
| 72 | +```bash |
| 73 | +pytest |
| 74 | +``` |
| 75 | + |
| 76 | +Several tests rely on sample SysML outputs and mocked Onshape data to exercise |
| 77 | +export and transformation logic. |
| 78 | + |
| 79 | +## Roadmap |
| 80 | +This repository is intended to evolve into a broad geometry interface. Planned |
| 81 | +improvements include: |
| 82 | + |
| 83 | +- Additional CAD connectors beyond Onshape. |
| 84 | +- Richer metadata for components (materials, display properties, etc.). |
| 85 | +- Higher-level orchestration scripts and examples for end-to-end workflows. |
| 86 | + |
| 87 | +Contributions that add new tool integrations or extend the generic assembly |
| 88 | +model are especially welcome. |
0 commit comments