fusion-energy / cad_to_dagmc

Convert CAD geometry (STP files) or Cadquery assemblies to DAGMC h5m files
MIT License
24 stars 6 forks source link

cadquery imprint #38

Closed shimwell closed 12 months ago

shimwell commented 1 year ago

We should make use of the latest cadquery innovations such as imprinting which is proposed on this PR https://github.com/CadQuery/cadquery/pull/1353

To test this we need ocp version 7.7.1 which is on the dev label for the cadquery channel and can be installed like this

conda install -c "cadquery/label/dev" ocp
shimwell commented 1 year ago

To install all the packages needed for testing

conda env create --file environment.yml 
name: cadquery-dev
channels:
  - cadquery/label/dev
  - cadquery
  - conda-forge
dependencies:
  - python=3.9
  - ipython
  - ocp=7.7.1
  - occt=7.7.1
  - pyparsing>=2.1.9
  - sphinx=5.0.1
  - sphinx_rtd_theme
  - black=19.10b0
  - click=8.0.4
  - mypy
  - codecov
  - pytest
  - pytest-cov
  - ezdxf
  - ipython
  - typing_extensions
  - nptyping=2.0.1
  - nlopt
  - path
  - casadi
  - multimethod >=1.7,<2.0
  - python-gmsh
  - gmsh

Then I run pip install to get the branch of cadquery installed

pip install git+https://github.com/CadQuery/cadquery.git@imprinting

I also need openmc with DAGMC for the testing

conda install -c conda-forge -y "openmc=0.13.3=dagmc*nompi*"
shimwell commented 1 year ago

@adam-urbanczyk I figured out how to install from a label using conda, see comments above for a yml example or a command line example. So I shall get on with testing now.

shimwell commented 1 year ago

This screenshot shows two cubes in contact that are imprinted and then can be passed in memory to gmsh and meshed.

Note gmsh finds 12 faces to mesh which is the correct number.

Screenshot from 2023-06-28 22-52-00