How to implement .obj model in Cubit (especially for DAGMC)

Hello developers!
I am using DAGMC for particle transport through CAD models, which are primarily generated from the Cubit modeling function. In the nuclear industry, most geometries are simple and uniform, which makes them easy to build using Cubit’s geometry engine.

However, DAGMC supports unstructured meshes, and I don’t want to be restricted to geometries composed only of simple shapes. I want to use more complex models, such as irregular shapes created in software like Blender, ZBrush, and others.

As a test, I imported the well-known Utah teapot model in .obj format into DAGMC, and it worked fine:

I know that when using DAGMC, it’s necessary to create a bounding box to represent the outer space, which I can subtract from the existing model. This will allow the outer space to be represented as an independent volume. Below is the bounding box I created:

However, when I try to implement the subtraction, I get the following error message:

ERROR: Performing SUBTRACTION with volumes containing geometry
from different modeling engines is not allowed.
Delete uncommon geometry on these volumes before operation.
ERROR: SUBTRACT boolean operation failed

This makes sense because the .obj file uses a different facet engine compared to Cubit’s native engine. To resolve this, I set the geometry engine to facet and then created the bounding box, hoping that it would match the teapot and allow the subtraction to work.

As shown below, the sheet bodies represent my teapot, and Volume 8 is the bounding box. When I perform the subtraction, something unexpected happens: six bounding boxes are created, and the teapot disappears. It seems that the subtraction process has altered something fundamental, but I can’t pinpoint why, which is quite puzzling.

I’ve attached the teapot file to this post as well:

Seems like this web doesn’t allow uploading .obj, so I changed it to .txt beforehands.
teapot.txt (205.7 KB)

Additionally, I’ve tried modifying the .obj model using other modeling software like Rhino. I converted the model into several surfaces, exported it as a .stp file, and then loaded it into Cubit, where subtraction worked fine. However, this process has its own limitations. First, the .obj file already contains meshing information, so converting it to surfaces and importing into Cubit requires an additional meshing step. Second, this transformation compromises the precision of the original facet model.

I believe the development of DAGMC aims to facilitate Monte Carlo simulations on various CAD models, and .obj is one of the simplest formats. I’m wondering if there are techniques I might be missing that could allow me to work directly with .obj models.

Thank you so much for your help!

Hello @RavenBro,
the teapot model consists of 6 sheet bodies that are not connected with each other. If you just try to subtract all bodies from the bounding volume then you will do 6 subtractions.

Also if you try to unite the teapot bodies just as they are you won’t get really a usable volume. You will basically just get a single surface that doesn’t have a thickness.

It’s better if you would try to import a .obj where the imported geometry can be stitched together to a volume.

If you got a .obj that actually represents a volume it should normally work that you can subtract it from a bounding box.