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

npdet_to_step cannot handle TGeoTessellation #21

Open
wdconinc opened this issue Mar 20, 2024 · 0 comments
Open

npdet_to_step cannot handle TGeoTessellation #21

wdconinc opened this issue Mar 20, 2024 · 0 comments

Comments

@wdconinc
Copy link
Contributor

Environment: (where does this bug occur, have you tried other environments)

  • Which branch (often main for latest released):
  • Which version (or HEAD for the most recent on git):
  • Any specific OS or system where the issue occurs? eic-shell
  • Any special versions of ROOT or Geant4?

Steps to reproduce: (give a step by step account of how to trigger the bug)

  1. In eic-shell, with /opt/detector/setup.sh
  2. npdet_to_step part -l 4 HcalBarrel -o bhcal $DETECTOR_PATH/epic_bhcal.xml

Expected Result: (what do you expect when you execute the steps above)

Should export STEP file.

Actual Result: (what do you get when you execute the steps above)

nightly> wdconinc@menelaos:~/git/npsim$ npdet_to_step part -l 4 HcalBarrel -o bhcal $DETECTOR_PATH/epic_bhcal.xml 
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for include/TGeoToStep.h
   requested to autoload type TGeoToStep
terminate called after throwing an instance of 'std::domain_error'
  what():  Unknown Shape
Aborted (core dumped)

Due to

throw std::domain_error("Unknown Shape");
.

Two step resolution:

  1. catch exception in
    fShape = fRootShape.OCC_SimpleShape(currentVolume->GetShape());
    and/or
    Mothershape = fRootShape.OCC_SimpleShape(motherVol->GetShape());
    (depending on which one causes it), and just bypass trying to convert and include it,
  2. add support for conversion in
    TopoDS_Shape TGeoToOCC::OCC_SimpleShape(TGeoShape *TG_Shape)
    .
github-merge-queue bot pushed a commit to eic/epic that referenced this issue Mar 24, 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]>
wdconinc added a commit to eic/epic that referenced this issue 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]>
wdconinc added a commit that referenced this issue Apr 10, 2024
### Briefly, what does this PR introduce?
This PR adds support for TGeoTessellated volumes in the export to STEP.
Storing meshes in STEP is not really the most efficient way (BHCAL is
71MB as STEP), but it simplifies some workflows.

### What kind of change does this PR introduce?
- [x] Bug fix (issue #21)
- [ ] 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?
Yes, adds support for TGeoTessellated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant