Code Monkey home page Code Monkey logo

mccad-library's Introduction

McCAD: a CAD to Monte Carlo conversion library

McCAD is a library for the conversion of CAD solid models into the input syntax of a variety of Monte Carlo codes; from Boundary Representation "BREP" to Constructive Solid Geometry "CSG". The library is written in C++ and consists of two main algorithms:

1- Decompostion:
  • carries out tasks pertinent to the simplification of complex solids by means of decomposition into their primitive convex subsolids.
2- Void generation & Conversion:
  • carries out tasks pertinent to the generation of void cells and conversion of the primitive solids into MCNP input syntax, and later on to other MC codes.

Useful links:

  • [Older version] McCAD-SALOME: McCAD library integrated with the Salome platform:
  • [Older version] McCAD-FreeCAD: an improved McCAD library integrated with the opensource CAD software FreeCAD:
  • csg2csg: a tool for the translation between a variety of Monte Carlo code formats:

Dependencies:

1- CMake (version 3.25.2):
  • the standard build system for McCAD library.
2- Boost C++ Libraries (version 1.81.0):
  • used for multiprocessing.
3- Open CASCADE Technology (version 7.7.0):
  • the geometry engine used for manipulating and decomposing solids.

Installation:

Please refer to the "Installation from Source" section in the manual.

General notes on Usage:

1- The library assumes a clean CAD model, one with no intersections/overlapping.
  • while in theory the library won't report an error with intersections/overlapping as solids are processed individually, it will cause issue for void generation and conversion!
2- There are known bugs with the decomposition algorithm which are currently being investigated.
  • a list of bugs and proposed workaround can be found in the "Known issues" section in the manual.

Reporting issues:

Please don't hesitate to report any issues with running the code or errors in the manual by:

Citation:

Please use the citation below to reference the code in published articles: Harb, M.; Leichtle, D.; Fischer, U. A Novel Algorithm for CAD to CSG Conversion in McCAD. J. Nucl. Eng. 2023, 4, 436-447. https://doi.org/10.3390/jne4020031

mccad-library's People

Contributors

cwegmann avatar moatazharb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mccad-library's Issues

Decomposition of solid with B-spline surfaces

I successfully run decompositon process on the example file "SS_-793e-2.stp" and the result looks good. But when I try to run McCad.exe to decompose a model in a STEP file which is generated by SOLIDWORKS, I get the result as blow:

 > Decomposing 1 shape(s) from the input STEP file(s)
    -- The current verion doesn't support processing of surfaces of type B-spline surface. Solid will be rejected!
 > Results:
   - Decomposition failed for 1 input shape(s).
   - Decomposition succeeded for 0 input shape(s).

Here are some questions:

  1. Did I use a version of McCad that too old to handle B-spline surfaces or it is just not configured properly?
  2. What CAD software you used to make exampe file "SS_-793e-2.stp"?

After converting some step files, I only get Volumes.i, but I don’t get the MCFile.i I want

Here is the .STEP file I used.
4.txt
Here is the McCADInputConfig.i file that I configured.
McCADInputConfig.txt
Here is the what I did on the command line. I would like to ask whether there is a problem with the file I configured or there are some non-convertible entities in the step file that make it impossible to convert from mcnp file to step file.

C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin>C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin\McCAD.exe` read
Running McCAD v1.1 / 2023-08-03 18:03:38


** Loading STEP file(s) **


Processing C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin\test\4.stp
Loading input solids.
OpenCascade surfaces tally:
==========================
- Planes: 277
- Cylinders: 345
- Tori: 6
- Cones: 0
- Spheres: 0
- B-Splines: 0
- Bezier Surfaces: 0
- Surfaces of Revolution: 0
- Surfaces of Extrusion: 0
- Offset Surfaces: 0
- Uknown Surfaces: 0
Execution time [m]: 0.013042

C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin>C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin\McCAD.exe run
Running McCAD v1.1 / 2023-08-03 18:03:44


** Loading STEP file **


Processing C:\Users\Administrator\Downloads\McCAD-Library-master\build\bin\test\4.stp
Loading input solids.
OpenCascade surfaces tally:
==========================
- Planes: 277
- Cylinders: 345
- Tori: 6
- Cones: 0
- Spheres: 0
- B-Splines: 0
- Bezier Surfaces: 0
- Surfaces of Revolution: 0
- Surfaces of Extrusion: 0
- Offset Surfaces: 0
- Uknown Surfaces: 0


** Starting decomposition **


Decomposing 23 shape(s) from the input STEP file(s)

  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a cylindrical solid
  • Decomposing a mixed solid
  • Decomposing a mixed solid

Issue with build in Microsoft Visual Studio

I am unable to perform the build -> build all step as governed by the McCAD v1.1 installation manual. I have placed cmake, boost, and the McCAD library in the D: drive and verified that the paths are correct in the command arguments from CMakeSettings.json. The only thing that shows up under the build option in the Menu is "Run Code Analysis on Solution." I am unsure if I need a specific file open in Microsoft Visual Studio (I have never used this program before). Please help if you can.

Installation Help

I have been attempting to install McCAD for Windows with the goal of being able to do 3D visualization of MCNP models.

Following the instructions, I have been able to build the McCAD executable in Visual Studio without any errors being returned. However, I am getting the following errors when I attempt to run McCAD:

image
image
image

Any advice on how to resolve these errors would be greatly appreciated.

It may be worth pointing out that I have installed newer versions of some of the supporting software than what is specified in the installation instructions:

 CMAKE version 3.28.1 (3.25.2 is specified in the installation instructions)
 Boost C++ version 1.84 (1.81 is specified in the installation instructions)

Update:
In case it helps, the following is my Visual Studio installation details. I kept the default options other than switching to Windows 10 SDK.

image

Thanks,
Aaron

Question about McCAD

Dear McCad developers,

I have one question and one issue.
Question: Is McCAD library 1.1 similar to McCAD salome 0.5.1 in terms of performance and capabilities?
Issue: I tried to compile McCAD library 1.1 following the documentation. The compilation does not find the info.hpp file. I replaced the call to info.hpp with the manual version number in the code files. The compilation went well with this change but when I try to run McCAD, I get a segmentation fault with no backtrace. I compiled on ubuntu 22.04.

Thank you in advance for your help.
Best

Installation Precision

During the installation process, there are a few ambiguities that lead to the user running into troubles.

When the manual says on page 6, "after successful installation there will be different folders for the toolkits that come with a full installation of opencascade; such as freeimage, ffmpeg, openvr, vtk, etc. It is recommended to add the full path to all bin folders to the Windows ”Path” environment variable." :

  1. Please add that the PATH variable needs to also contain the full path to "C:\OpenCASCADE-7.7.0-vc14-64\opencascade-7.7.0\win64\vc14\bin"
  2. Please add that for openvr, the full path to the bin folder should include the openvr-x.xx.xx-64/bin/win64 folder as well.

Help Using McCAD for Converting MCNP input to CAD Format

I have installed McCAD with the goal of using it for interactive 3D visualization of MCNP models. https://www.inr.kit.edu/english/780.php included the following statement regarding McCAD:

McCad is an open source interface programme which automatically translates 3D CAD geometry into a geometry description suitable 
for Monte Carlo particle transport codes. At present McCad supports the MC codes MCNP5 and Tripoli4. McCad can visualize MCNP 
models in 3D and make them available for CAD systems.

Based on the last sentence in this paragraph, it sounds like McCAD can be used to convert MCNP models into a CAD format. However, I have been unable to figure how to use this feature. I also didn't see anything in the manual regarding it.

I would greatly appreciate it if someone could provide me some guidance on how to use this feature in McCAD.

Unable to run example

I am attempting to run the example SS_-793e-2 from the Command prompt. After following directions from the manual and editing McCADInputConfig.i I type McCAD run in command prompt and it attempts to load the stp file but nothing happens. I have tried placing the stp file in various locations (the c drive, within the bin folder) but no luck. Anyone know where I should place the stp file so it can read it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.