NVIDIA / modulus-sym

Framework providing pythonic APIs, algorithms and utilities to be used with Modulus core to physics inform model training as well as higher level abstraction for domain experts
https://developer.nvidia.com/modulus
Apache License 2.0
193 stars 73 forks source link

🐛[BUG]: Rotating a Line gives the new line an interior. #196

Open ahallback opened 1 month ago

ahallback commented 1 month ago

Version

1.6.0

On which installation method(s) does this occur?

No response

Describe the issue

Rotation of a Line() class somehow produces an interior for the line. It seems that the SDF might be calculated wrong for the rotated line. The interior seems to be sampled from the area between the x-axis and the new line.

Minimum reproducible example

import numpy as np from modulus.sym.geometry.primitives_2d import Line

line = Line((0,0), (0, 42), normal=1) line = line.rotate(angle=np.pi/2 + 0.1) s = line.sample_interior( nr_points=1000, ) var_to_polyvtk(s, f"interior") print("Volume: {:.3f}".format(np.sum(s["area"])))

Relevant log output

No response

Environment details

No response

Other/Misc.

No response