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

bezier.tri yields two different element orientation #725

Open
scdivi opened this issue Oct 13, 2022 · 2 comments
Open

bezier.tri yields two different element orientation #725

scdivi opened this issue Oct 13, 2022 · 2 comments

Comments

@scdivi
Copy link
Contributor

scdivi commented Oct 13, 2022

Hi,

I could create a VTK (or STL) based on extracting bezier.tri as connectivity to a set of vertices as follows:

bezier = domain.sample('bezier', 10)
points = bezier.eval(geom)
export.vtk(vtkpath, bezier.tri, points)

However, after exporting the generated geometry to a tool and observing the normal direction in each element, it shows that every alternative element has a inverted element orientation (see image below). I think this is not intentional and it would be better to rotate the orientation all to a direction.

For now, a simple fix is done using the following lines:

# Change element orientation
tri = bezier.tri.copy()
tri[1::2, 1] = bezier.tri[1::2, 2]
tri[1::2, 2] = bezier.tri[1::2, 1]

image

@gertjanvanzwieten
Copy link
Contributor

To my knowledge the VTK file format does not make any promises about simplex orientations, so we don't consider the current situation an error. Which is not to say that we wouldn't consider changing the situation if it turns out that flipping elements helps a certain workflow. Can you explain in what practical scenario you are running into this issue?

@scdivi
Copy link
Contributor Author

scdivi commented Oct 13, 2022

The flipping helps if we create a (multipatch) domain and geometry in nutils and export the sampled points and bezier triangulation to write an STL file or any other format that can be used in an existing commercial tool. With the right orientation one can use these exported files to run simulations in other platforms and compare it with IGA simulation based on nutils.

Without the right orientation, the exported STL surfaces act strange with application of normal forces, etc.

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

2 participants