Importing surfaces in Coreform Cubit in ACIS format --- avoiding multiple surfaces in a volume

Hi there,

I created a surface in Gocad (https://www.pdgm.com/products/skua-gocad) and exported it in ACIS format (.avs). When I try to import it in Coreform Cubit (v. 2020.2) I obtain one volume that is composed of several hundreds of surfaces.

I can use the following command to obtain one single surface:

cubit.cmd("Composite Create surface all")

However, the above command can take quite some time for the case where there are several hundreds of surfaces. Additionally, every time I open the cubit project I have to rerun the above command again in order to obtain one single surface. The purpose of having a single surface is that I want to use it to webcut volumes for example.

My questions is:

  1. Is there a way to import the .avs surface from Gocad and avoid having multiple surfaces in a single volume?

A working example is provided in the attached file with some comments and questions. Let me know if you can help.

Thank you for the help.

ExampleAcisSurfaceProblem.zip (6.6 MB)

Instead of composite try doing a stitch. This allows you to specify a tolerance. The default is to try to simplify adjoining planar surfaces into a single surface.

cubit.cmd('stitch body all tolerance .006 ')

I will take a look at the actual problem tomorrow morning.

Karl

Hi Karl,

Thank you for the reply. I tried the command that you suggested but it does not solve the problem. Look forward to hearing from you tomorrow then.

Thanks in advance.

Importing the AVS file creates facet based geometry. This is essentially the same as creating a composite surface. I get a single continuous surface with the AVS import.

The GOCAD generated ACIS file is made up of individual spline surfaces. The spline surfaces do not appear to have C1 (first derivative) continuity. There is no way to create a continuous spline automatically in Cubit on import.

You can recreate the surface as a single entity and save that. Mesh the composited surface and create an ACIS surface from the mapped mesh.

composite create surf all
compress  # just so I'm not working with surface 1259
surface 1 size 1000
mesh surface 1
create surface net from mapped surface 1 heal
delete surface 1

There is a time penalty for doing this the first time, but you can save this model and work on the ACIS model in subsequent steps.

This does presume that you can create a mapped mesh of the surface. If you have complex horizons (at least that’s what the petro engineers I worked with a decade ago called them) coming from GOCAD, that may not always be possible.

Karl

Hi @karl

Thank you very much for the reply. I tried the solution that you proposed and it solved the problem. Below is the complete code that I am using now.

A follow up question: I understand that if the surfaces coming out from GOCAD are complex (they can be), so there is no way to create a mapped mesh of the surface (applying the solution below). However, is there any workaround for this problem?

Let me know if you have any insights on how to import complex surfaces from GOCAD into Cubit. I am confident that I will run into this problem sooner or later.

Thank you,
Josimar

## Importing ACIS surface (.avs format)
surface='Surface'
cubit.cmd("import avs './{}.avs' merge make_elements stitch".format(surface))
## This is to reverse the Z direction
cubit.cmd("volume all reflect z")
cubit.cmd("delete mesh")
cubit.cmd("surf all size 1000")
#cubit.cmd("surface all scheme map") ## This generate 1 volume with 1 surface. This does not always work for complex surfaces.
cubit.cmd("surface all scheme pave") ## This creates 1 volume with multiples surface inside it
cubit.cmd("mesh surface all")
cubit.cmd("create acis surf all")
cubit.cmd("delete volume 1")
cubit.cmd("Composite Create surface all")
###

cubit.cmd("compress") # just so I'm not working with surface 1259
cubit.cmd("surf all size 1000")
cubit.cmd("surface all scheme submap") ## This does not always work for complex surfaces.
cubit.cmd("mesh surface all")
cubit.cmd("create surface net from mapped surface 1 heal")
cubit.cmd("delete surface 1")
cubit.cmd("compress")
cubit.cmd("set geometry engine acis")
cubit.cmd("export Acis './Surface_1.sat' overwrite")

Hi Josimar,

Just a total aside, I would highly recommend using the python 3 f-strings.
cubit.cmd( f"import avs './{surface}.avs' merge make_elements stitch" )
I find that in the end this is much more readable code.

You may have to deal with the irregular surface as a composite. Contact me when you have a specific case and we can take a look at it.

Karl

1 Like

Hi @karl and @gvernon,

Thanks for the suggestion regarding the python 3 f-strings

The approach suggested above only work when the surfaces can be meshed using map or submap. I have another surface that is more complex, in this case I can only mesh it using the pave scheme and therefore the command create surface net from mapped surface 1 heal does not work.

I have the following questions:

  1. If I use the composite surface option to create a single surface from the hundreds of subsurfaces, how do I webcut a volume with it?
  2. Are there any drawback in working with composite surfaces?

Thank you,
Josimar

Hi Josimar,

There are limitations with composite surfaces. In the image below I rotated and scaled the original body so I could use it as a tool body to cut with. The yellow body is a composite. The original body was an ACIS surface created with the net surface command. Notice that at the intersection, all the vertices get created because the underlying surfaces were used to calculate the intersection curves.

image

Mixing facet based geometry and ACIS geometry is disallowed for a number of cases. For example, you can’t create a lofted volume between a composite surface and an ACIS surface.

If you want to upload your more complex surface here, I can take a look at it.

Karl

One other thing to keep in mind is that compositing is a virtual operation and doesn’t actually modify the underlying ACIS geometry. All that does, effectively, is tell the Cubit meshing algorithms to ignore the internal surfaces’ curves while meshing.

When meshing composite surfaces we use the render facets. Thus meshing performance is closely related to the number of render facets. For improved performance, make sure you’re using a large graphics tolerance angle:

graphics tolerance angle 15 # or higher e.g. 45

Hi @karl and @gvernon,

Thank you for the suggestions. It is proving to be quite cumbersome to import surfaces from GOCAD to Cubit and obtain an ACIS geometry.

For example, I can’t get the attached surface to work for example. Could you help?

What I would like to do is the following:

  1. Export the surface from Gocad in .avs format and import it in Cubit (this is what I am sending you)
  2. Remesh the surface and then export this new surface in ACIS format (.sat)
  3. The ultimate goal is to use the .sat surface to perform volume decomposition in my model (e.g webcut) to set different meshing sizes for different volumes (and different material ids, etcs).

It might be that I am overthinking this, but is there any workaround to get the acis surface from the Gocad facet surface?

Below is the code that I am using to try to conver the .avs surface to .sat. Note that the code breaks because it is not possible to use the map scheme to mesh the surface (see figure below). If I use other scheme (e.g trimesh), then I have to use the composite create surface all which I am trying to avoid.

Let me know what you think about all this.

Thank you in advance,
Josimar

surfaceNames=['Surface']
surface=surfaceNames[0]
cubit.cmd("import avs './{}.avs' feature_angle 0 spline merge make_elements stitch".format(surface))
## This is to reverse the Z direction
cubit.cmd("volume all reflect z")
cubit.cmd("delete mesh")
cubit.cmd("surf all size 500")
cubit.cmd("surface all scheme map")
cubit.cmd("mesh surface all")
cubit.cmd("create acis surf all")
cubit.cmd("delete volume 1")
#cubit.cmd("Composite Create surface all")
cubit.cmd("set geometry engine acis")
cubit.cmd("export Acis './output/{}.sat' overwrite".format(surface))

Link to surface:
Surface.zip (4.2 MB)

Surface after trying to mesh using map

Hi Josimar,

This is still cumbersome but at least it works.

  1. You need a feature angle slightly greater than 90 to create vertices at the corner. Without this there was only one bounding curve, I’m surprised that the mapping algorithm worked at all.

  2. There is no need to make the elements on import and then immediately delete them.

  3. I moved the reverse surface orientation to the ACIS surface. This will be much faster than a reflect unless you really need to reflect all the z coordinates.

  4. I changed the mesh size back to 1000. You can use 500 but I got tired of waiting for the ACIS surface creation.

  5. The big thing was introducing a smoothing step. This fixes up the mesh.

    surfaceNames=[‘Surface’]
    surface=surfaceNames[0]
    cubit.cmd(“import avs ‘./{}.avs’ feature_angle 100 spline merge stitch”.format(surface))
    cubit.cmd(“surf all size 1000”)
    cubit.cmd(“surface all scheme map”)
    cubit.cmd(“mesh surface all”)
    cubit.cmd(“smooth surface all”)
    cubit.cmd(“create acis surf all”)
    cubit.cmd(“delete volume 1”)
    cubit.cmd(“reverse surface all”)
    cubit.cmd(“set geometry engine acis”)
    cubit.cmd(“export Acis ‘./output/{}.sat’ overwrite”.format(surface))

image

Karl

Hi @karl,

Thank you for solving this problem. I have one more clarification questions:

You mentioned that the feature angle slightly greater than 90 to create vertices at the corner. How did you figure it out that it should be slightly than 90? Was it by trial and error only?

Thank you,
Josimar

Hi Josimar,

It was a little trial and error. My first clue was when I realized there was only one bounding curve on the surface. I knew that I wanted to break the curves at the 90 degree corners. I also knew that I wanted to provide a little bit of mathematical tolerance on the 90 degree calculation so I bumped it some.

So it was a combination of a realization of what is going on, a lot of experience with numerical analysis, and a little trial and error. :smile:

Karl

1 Like

Thank you @karl, it is clear now.