compas_convert
Conversions of COMPAS geometry objects to CAD specific objects.
Supported CAD environments
- Rhino/Grasshopper
- Blender (planned)
Installation
pip install compas_convert
python -m compas_rhino.install
This will install the package into your Rhino environment and add a grasshopper component next to the COMPAS package's components.
Documentation
The function convert which you can import from the top level of the package
(from compas_convert import convert) will convert compas object to CAD object
or CAD object to compas object. It does this based on the environment and the
input object.
You can also use normal converter functions:
from compas.geometry import Point
from compas_convert.rhino import point_to_rhino_point
compas_pt = Point(10, 10, 0)
rhino_pt = point_to_rhino_pt(compas_pt)
Under the hood
Converter functions can be found in subpackages named after the CAD software it
converts to and from. The modules are named compas_to_* and *_to_compas. The
convert functions are decorated with the decorator
compas_convert.register_converter where possible input types are specified and
the output type.
This metadata is used by the function compas_convert.convert which on its
first use maps types and converters and uses that mapping to convert object
without the need to specify either input type or output type. Input type or
output type can however be specified to override the default.
Conversion diagrams
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.1.4] 2021-11-08
Changed
- compas bumped to
<1.11.
[0.1.3] 2021-06-18
Added
- Grasshopper component for universal converter.
Changed
SmartConverterrenamed toUniversalConverter.
[0.1.2] 2021-06-14
Added
- Universal converter (SmartConverter) added which converts input object based on type.
MIT License
Copyright (c) 2021 Anton Tetov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for compas-convert 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| compas_convert-0.1.4.tar.gz | 160.8 kB | Without provenance | Details for compas_convert-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| compas_convert-0.1.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for compas_convert-0.1.4-py2.py3-none-any.whl |
Total release size: 178.7 kB
Release files / compas_convert-0.1.4.tar.gz
| Download URL | compas_convert-0.1.4.tar.gz |
|---|---|
| Size | 160.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
913d5e65057d097fff0101b11b8961152292c52a03bdaea479d3ed48432871ef
|
|
BLAKE2b-256 checksum How to use checksums |
e14aa7b9c47a8726f1851300d278e8580b0cdca9d8ae94d81e09b511f6f975dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / compas_convert-0.1.4-py2.py3-none-any.whl
| Download URL | compas_convert-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ba93a6c87776481f30e90604bccb403eabf3f88195ec26b4fafc8e6171ca8fdf
|
|
BLAKE2b-256 checksum How to use checksums |
504302d9fd2e063b72df5ca4f9af9766bdac65b6ea390a3ac3feb56dd9e7ced7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for compas-convert 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.