Conversions between compas objects and CAD specific objects.
Conversions of COMPAS geometry objects to CAD specific objects.
Supported CAD environments
- Blender (planned)
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.
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
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
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.
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.
- compas bumped to
- Grasshopper component for universal converter.
- Universal converter (SmartConverter) added which converts input object based on type.
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.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for compas_convert-0.1.4-py2.py3-none-any.whl