Skip to content
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

feat: export simulation geometry to CAD models (STEP) #667

Merged
merged 22 commits into from
Mar 24, 2024
Merged

Conversation

wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Mar 15, 2024

Briefly, what does this PR introduce?

This PR exports the geometry to STEP files for CAD import and dimensioning. There are no real settings to tweak, but to increase the level at which volumes are exported, hints can be added to the yaml file. Detectors can also be removed (currently only the ACTS subassemblies are removed since they don't do anything).

There are 'issues' that need to be addressed, but they have to be addressed in npsim:

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

@github-actions github-actions bot added the topic: infrastructure Regarding build system, CI, CD label Mar 15, 2024
@wdconinc
Copy link
Contributor Author

This now works "well enough" for merging: imported y-up and created a back view with left view section drawing.
image
(source: https://cad.onshape.com/documents/9fb38cc05081c441e152b5e1/w/441fcb286b98a55b7de89480/e/fe210e22e03730344768d9d6?renderMode=0&uiState=65f905d605a2a05c1bde1005, which is import of artifact at https://github.com/eic/epic/actions/runs/8336052681)

As I wrote, caveats:

  • cm/mm confusion: the STEP file needs scaling by factor 10,
  • barrel hcal is bypassed due lack of support for TGeoTessellated,
  • too complicated for freecad? fails to load...
  • requires "fast" geometry, don't attempt on local full geometry with fibers and all.

@wdconinc wdconinc requested a review from veprbl March 19, 2024 03:36
@wdconinc wdconinc enabled auto-merge March 19, 2024 03:52
@wdconinc
Copy link
Contributor Author

Now with the tracking detectors (except not yet MPGDOuterBarrel), and as a sliced section view:
image

@wdconinc
Copy link
Contributor Author

Now with MPGD properly resolved:
image

@wdconinc wdconinc requested a review from sly2j March 22, 2024 23:37
Co-authored-by: Dmitry Kalinkin <[email protected]>
@wdconinc
Copy link
Contributor Author

This now exports also things like epic_drich_only.stp, but the drawback is that you don't get good info on where the interaction point is in these CAD models. This imports in FreeCAD for those who prefer that for CAD (I can't see how FreeCAD can be told to import models with Y as pointing up, instead of having Z as pointing up, so my rotations are off).
epic_drich_only

@wdconinc wdconinc added this pull request to the merge queue Mar 24, 2024
Merged via the queue into main with commit ae2e7e5 Mar 24, 2024
86 checks passed
@wdconinc wdconinc deleted the step-export branch March 24, 2024 23:35
wdconinc added a commit that referenced this pull request Mar 25, 2024
### Briefly, what does this PR introduce?
This PR exports the geometry to STEP files for CAD import and
dimensioning. There are no real settings to tweak, but to increase the
level at which volumes are exported, hints can be added to the yaml
file. Detectors can also be removed (currently only the ACTS
subassemblies are removed since they don't do anything).

There are 'issues' that need to be addressed, but they have to be
addressed in npsim:
- units are off (npdet_to_step use the cm value from TGeo and writes
them as inch values in STEP) eic/npsim#20,
- some shapes cannot be exported; not sure yet which ones and it makes
more sense to bypass them in npsim
eic/npsim#21.

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [x] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
No.

---------

Co-authored-by: Dmitry Kalinkin <[email protected]>
@veprbl veprbl added this to the 24.04.0 milestone Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Regarding build system, CI, CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants