-
Notifications
You must be signed in to change notification settings - Fork 476
Build images #2028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Build images #2028
Changes from all commits
cd6e90b
d597816
b1dd114
1a57544
1478fab
d45fbad
19f191f
853b518
bb64dd6
7843dae
82a3ada
dd92ac7
099dd1a
fd30d24
4e06d0d
e298fc4
0ed819b
273bec4
c9b323f
731e2d0
7f69a9b
416c6a1
90c4e37
2e7447d
aab9018
60f8b4e
6dda726
b895c90
140a5c3
f2e791c
2302fc9
3c99e9a
d9665ae
9acf6e5
2894f21
fef4e74
d2845f4
835544c
43a9fbd
d5f63e2
bf54ac8
6492811
0b03d7b
9150c0c
dd49914
e0eccf5
de8d032
1c2c520
09ac786
2d62098
c50d8de
c5b3901
97a76c7
554f654
b841be5
778cb52
fb455c5
0e6abc5
9d07e62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: Build Apptainer and Docker images with CQ using micromamba | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: master | ||
|
|
||
| env: | ||
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
|
||
| jobs: | ||
| build-test-container: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| container: | ||
| image: ghcr.io/apptainer/apptainer:1.4.1 | ||
| options: --privileged | ||
|
|
||
| name: Build Apptainer | ||
| steps: | ||
|
|
||
| - name: Check out code for the container builds | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Build Container | ||
| run: | | ||
| apptainer build cq.sif images/cq.def | ||
|
|
||
| - name: Test Container | ||
| run: | | ||
| apptainer run cq.sif pytest tests/ | ||
|
|
||
| - name: Store sif | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| path: cq.sif | ||
|
|
||
| - name: Deploy to GHCR | ||
| if: contains( env.BRANCH_NAME, 'master') | ||
| run: | | ||
| echo ${{ secrets.GITHUB_TOKEN }} | apptainer registry login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io | ||
| apptainer push cq.sif oras://ghcr.io/cadquery/cadquery-apptainer:${BRANCH_NAME} | ||
|
|
||
| build-docker-container: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| name: Build Docker | ||
| steps: | ||
|
|
||
| - name: Check out code for the container builds | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Authenticate | ||
| run: | | ||
| echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin | ||
|
|
||
| - name: Build Container | ||
| run: | | ||
| docker build -t ghcr.io/cadquery/cadquery-docker:${BRANCH_NAME} -f images/dockerfile . | ||
|
|
||
| - name: Test | ||
| run: | | ||
| docker run --rm -v $(pwd):/host -w /host ghcr.io/cadquery/cadquery-docker:${BRANCH_NAME} pytest tests/ | ||
|
|
||
| - name: Deploy to GHCR | ||
| #if: contains(env.BRANCH_NAME, 'master') | ||
| run: | | ||
| docker push ghcr.io/cadquery/cadquery-docker:${BRANCH_NAME} | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,46 +18,46 @@ | |
|
|
||
| CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models. Using CadQuery, you can write short, simple scripts that produce high quality CAD models. It is easy to make many different objects using a single script that can be customized. | ||
|
|
||
| CadQuery is often compared to [OpenSCAD](http://www.openscad.org/). Like OpenSCAD, CadQuery is an open-source, script based, parametric model generator. However, CadQuery stands out in many ways and has several key advantages: | ||
|
|
||
| 1. The scripts use a standard programming language, Python, and thus can benefit from the associated infrastructure. This includes many standard libraries and IDEs. | ||
| 2. CadQuery's CAD kernel Open CASCADE Technology ([OCCT](https://en.wikipedia.org/wiki/Open_Cascade_Technology)) is much more powerful than the [CGAL](https://en.wikipedia.org/wiki/CGAL) used by OpenSCAD. Features supported natively by OCCT include NURBS, splines, surface sewing, STL repair, STEP import/export, and other complex operations, in addition to the standard CSG operations supported by CGAL | ||
| 3. Ability to import/export [STEP](https://en.wikipedia.org/wiki/ISO_10303) and the ability to begin with a STEP model, created in a CAD package, and then add parametric features. This is possible in OpenSCAD using STL, but STL is a lossy format. | ||
| 4. CadQuery scripts require less code to create most objects, because it is possible to locate features based on the position of other features, workplanes, vertices, etc. | ||
| 5. CadQuery scripts can build STL, STEP, AMF and 3MF faster than OpenSCAD. | ||
|
|
||
| CadQuery was built to be used as a Python library without any GUI. This makes it great for use cases such as integration into servers, or creating scientific and engineering scripts. Options for visualization are also available including CQ-Editor and JupyterLab. | ||
| CadQuery was built to be used as a Python library without any GUI. This makes it great for use cases such as integration into servers, or creating scientific and engineering scripts. However, it includes internal visualization capabilities. | ||
| Additionally, other options for visualization are also available including CQ-Editor and JupyterLab. | ||
|
|
||
| For those who are interested, the [OCP repository](https://github.com/CadQuery/OCP) contains the current OCCT wrapper used by CQ. | ||
|
|
||
| ### Key features | ||
|
|
||
| * Build 3D models with scripts that are as close as possible to how you would describe the object to a human. | ||
| * Create parametric models that can be very easily customized by end users. | ||
| * Output high quality (loss-less) CAD formats like STEP and DXF in addition to STL, VRML, AMF and 3MF. | ||
| * Provide a non-proprietary, plain text model format that can be edited and executed with only a web browser. | ||
| * Offer advanced modeling capabilities such as fillets, curvilinear extrudes, parametric curves and lofts. | ||
| * Build nested assemblies out of individual parts and other assemblies. | ||
|
|
||
| ### Why this fork | ||
|
|
||
| The original version of CadQuery was built on the FreeCAD API. This was great because it allowed for fast development and easy cross-platform capability. However, we eventually started reaching the limits of the API for some advanced operations and selectors. This 2.0 version of CadQuery is based directly on a Python wrapper of the OCCT kernel. This gives us a great deal more control and flexibility, at the expense of some simplicity and having to handle the cross-platform aspects of deployment ourselves. We believe this is a worthwhile trade-off to allow CadQuery to continue to grow and expand in the future. | ||
|
|
||
| ## Getting started | ||
|
|
||
| To learn more about designing with CadQuery, visit the [documentation](https://cadquery.readthedocs.io/en/latest/intro.html), [examples](https://cadquery.readthedocs.io/en/latest/examples.html), and [cheatsheet](https://cadquery.readthedocs.io/en/latest/_static/cadquery_cheatsheet.html). | ||
|
|
||
| To get started playing around with CadQuery and see its capabilities, take a look at the [CQ-editor GUI](https://github.com/CadQuery/CQ-editor). This easy-to-use IDE is a great way to get started desiging with CadQuery. The CQ-editor installer bundles both CQ-editor and CadQuery (recommended). See the [CQ-editor installation instructions](https://cadquery.readthedocs.io/en/latest/installation.html#adding-a-nicer-gui-via-cq-editor). | ||
| To quickly get started you can use apptainer | ||
|
|
||
| ``` | ||
| apptainer run oras://ghcr.io/cadquery/cadquery-apptainer:master ipython -i -c"from cadquery.func import *; form cadquery.vis import show; show(box(1,1,1))" | ||
| ``` | ||
|
|
||
| or docker/podman. | ||
|
|
||
| ``` | ||
| podman run -it -v /tmp:/tmp -e DISPLAY=$DISPLAY -t ghcr.io/cadquery/cadquery-docker:master ipython -i -c"from cadquery.func import *; from cadquery.vis import show; show(box(1,1,1))" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove extra redundant '-t'.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, the command works for me on linux (with changes): No changes needed, just for future reference. |
||
| ``` | ||
|
|
||
| The CadQuery library (with or without CQ-editor) and its dependencies may be installed using conda, or pip. Note that conda (or the CQ-editor installer) is the better supported option. | ||
| The CadQuery library (with or without CQ-editor) and its dependencies may be installed using conda/mamba/micromamba/pixi, or pip. | ||
| Note that conda-based installation (or the CQ-editor installer) is the better supported option. | ||
|
|
||
| See the documentation for detailed CadQuery [installation instructions](https://cadquery.readthedocs.io/en/latest/installation.html). | ||
|
|
||
| ### CadQuery Installation Via Conda | ||
|
|
||
| To first install the Conda package manager see [Install the Conda Package Manager](https://cadquery.readthedocs.io/en/latest/installation.html#install-the-conda-package-manager), and [Miniforge](https://github.com/conda-forge/miniforge) for a minimal installer. | ||
|
|
||
| ``mamba install`` is recommended over ``conda install`` for faster and less memory intensive cadquery installation. | ||
| ``mamba install`` is recommended over ``conda install`` for faster and less memory intensive CadQuery installation. | ||
|
|
||
| ``` | ||
| # Set up a new environment | ||
|
|
@@ -91,6 +91,29 @@ It is also possible to install the very latest changes directly from CadQuery's | |
| pip install git+https://github.com/CadQuery/cadquery.git | ||
| ``` | ||
|
|
||
| ### Built-in visualization | ||
|
|
||
| CadQuery has built in visualization capabilities using trame and vtk. | ||
|
|
||
| ``` | ||
| from cadquery.func import box, fillet | ||
| from cadquery.vis import show | ||
|
|
||
| b = box(1,1,1) | ||
| show(fillet(b, b.edges("|Z"), 0.1)) | ||
|
|
||
| ``` | ||
|
|
||
| For non-blocking and persistent view one can use. | ||
|
|
||
| ``` | ||
| from cadquery.func import box, fillet | ||
| from cadquery.fig import show | ||
|
|
||
| b = box(1,1,1) | ||
| show(fillet(b, b.edges("|Z"), 0.1)) | ||
|
|
||
| ``` | ||
|
|
||
| ### CQ-editor GUI | ||
|
|
||
|
|
@@ -124,33 +147,10 @@ We also have a [Google Group](https://groups.google.com/forum/#!forum/cadquery) | |
|
|
||
| There is also a [Discord](https://discord.com/invite/Bj9AQPsCfx) server, but the other methods of getting help are much better for newcomers. | ||
|
|
||
| ## Projects using CadQuery | ||
|
|
||
| Here are just a few examples of how CadQuery is being used. | ||
|
|
||
| ### FxBricks Lego Train System | ||
|
|
||
| [FxBricks](https://fxbricks.com/) uses CadQuery in the product development pipeline for their Lego train system. FxBricks has also given back to the community by creating [documentation for their CAD pipeline](https://github.com/fx-bricks/fx-cad-notes). They have also assembled [cq-kit](https://github.com/michaelgale/cq-kit), a library containing utility classes and functions to extend the capabilities of CadQuery. Thanks to @michaelgale and @fx-bricks for this example. | ||
|
|
||
|  | ||
|
|
||
| ### Hexidor Board Game Development | ||
|
|
||
| Hexidor is an expanded take on the Quoridor board game, and the development process has been chronicled [here](https://bruceisonfire.net/2020/04/23/my-adventure-with-flosscad-the-birth-of-hexidor/). CadQuery was used to generate the game board. Thanks to Bruce for this example. | ||
|
|
||
| <img src="https://bruceisonfire.net/wp-content/uploads/2020/04/16-945x709.jpg" alt="Hexidor Board Game" width="400"/> | ||
|
|
||
| ### Spindle assembly | ||
|
|
||
| Thanks to @marcus7070 for this example from [here](https://github.com/marcus7070/spindle-assy-example). | ||
|
|
||
| <img src="./doc/_static/assy.png" width="400"> | ||
|
|
||
| ### 3D Printed Resin Mold | ||
| ## Citing | ||
|
|
||
| Thanks to @eddieliberato for sharing [this example](https://jungletools.blogspot.com/2017/06/an-anti-kink-device-for-novel-high-tech.html) of an anti-kink resin mold for a cable. | ||
| Please use our Zenodo DOI if you use CadQuery for scientific research: https://doi.org/10.5281/zenodo.3955118. | ||
|
|
||
| <img src="https://3.bp.blogspot.com/-2FiHOGUhtxo/WTRsViGdOXI/AAAAAAAAA-E/sb5ehwPVr-EncYC8RM2-v21M3AAmbjUjQCLcB/s1600/Screenshot%2Bfrom%2B2017-06-04%2B22-05-07.png" alt="3D printed resin mold" height="250"/> | ||
|
|
||
| ## License | ||
|
|
||
|
|
@@ -227,6 +227,3 @@ When filing a bug report [issue](https://github.com/CadQuery/cadquery/issues), p | |
|
|
||
| If you find yourself wishing for a feature that does not exist, you are probably not alone. There are bound to be others out there with similar needs. Open an [issue](https://github.com/CadQuery/cadquery/issues) which describes the feature you would like to see, why you need it, and how it should work. | ||
|
|
||
| ## Citing | ||
|
|
||
| Please use our Zenodo DOI if you use CadQuery for scientific research: https://doi.org/10.5281/zenodo.3955118. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: form caquery.vis -> from cadquery.vis
I confirm the command works for me without any other changes except for the typo and using PR branch name rather than master.