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

Temp body created when trying to perform an intersection on bodies which do not intersect. #1192

Open
2 tasks done
rmanno91 opened this issue May 8, 2024 · 7 comments · May be fixed by #1258
Open
2 tasks done

Temp body created when trying to perform an intersection on bodies which do not intersect. #1192

rmanno91 opened this issue May 8, 2024 · 7 comments · May be fixed by #1258
Assignees
Labels
bug Something isn't working

Comments

@rmanno91
Copy link
Contributor

rmanno91 commented May 8, 2024

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

When trying to perform an intersection between two bodies which do not intersect we can find a temp body within the saved geometry which is not shown in the pygeometry design.

from the scdocx:
image

from design object:
image
image
image

I have added a script to reproduce the problem.

📝 Steps to reproduce

import os
from pathlib import Path
from ansys.geometry.core.math import (
    UNITVECTOR3D_X,
    UNITVECTOR3D_Y,
    Plane,
    Point2D,
    Point3D,
)
from ansys.geometry.core.misc import DEFAULT_UNITS
from ansys.geometry.core.sketch import Sketch
from ansys.geometry.core.connection.launcher import launch_modeler_with_geometry_service
from ansys.geometry.core.designer import DesignFileFormat

modeler = launch_modeler_with_geometry_service()
design = modeler.create_design("RVE")

unit = DEFAULT_UNITS.LENGTH

plane = Plane(
    Point3D([1 / 2, 1 / 2, 0.0], unit=unit),
    UNITVECTOR3D_X,
    UNITVECTOR3D_Y,
)
box_plane = Sketch(plane)
box_plane.box(Point2D([0.0, 0.0]), width=1, height=1)

box = design.extrude_sketch("Matrix", box_plane, 1)

p = Point3D([1.0, 1.0, 1.5], unit=unit)
plane = Plane(p, UNITVECTOR3D_X, UNITVECTOR3D_Y)
sketch_fibres = Sketch(plane)
sketch_fibres.circle(Point2D([0.0, 0.0], unit=unit), radius=0.5)
fibre = design.extrude_sketch("fibre", sketch_fibres, 1)


box_copy = box.copy(design)
try:
    fibre.intersect(box_copy)
except:
    design.delete_body(box_copy)
    
design.plot(show_edges=True)

file_path = Path(os.getcwd(), "trial.scdocx")

design.download(
            file_location=file_path,
            format=DesignFileFormat.SCDOCX,
        )

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2024 R2

🐍 Which Python version are you using?

3.12

📦 Installed packages

accessible-pygments==0.0.4
alabaster==0.7.16
annotated-types==0.6.0
ansys-api-dbu==0.3.0
ansys-api-geometry==0.4.1
ansys-api-mapdl==0.5.1
ansys-api-meshing-prime==0.1.2
ansys-api-platform-instancemanagement==1.0.0
ansys-geometry-core @ git+https://github.com/ansys/pyansys-geometry@0ff8a6d869526d4c01cfc06b894aeb933fd533a4
ansys-mapdl-core==0.67.0
ansys-mapdl-reader==0.53.0
-e git+https://github.com/ansys-internal/pymaterialdesigner@65e7b9aa0f8dc3ef5f740f2e128adf2c40382bf6#egg=ansys_material_designer_core
ansys-materials-manager @ git+https://github.com/ansys/pymaterials-manager@a2560dc48e2c53686d20ae53ba642021186dc3c1
ansys-math-core==0.1.5
ansys-meshing-prime @ git+https://github.com/ansys/pyprimemesh@b77076cbf11ee4eec404f929c4d10a758ecc3a7e
ansys-platform-instancemanagement==1.1.2
ansys-sphinx-theme==0.15.2
ansys-tools-path==0.5.2
appdirs==1.4.4
Babel==2.14.0
beartype==0.18.5
beautifulsoup4==4.12.3
build==1.2.1
cachetools==5.3.3
certifi==2024.2.2
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.2.1
coverage==7.4.4
cycler==0.12.1
distlib==0.3.8
docutils==0.21.1
filelock==3.13.4
flit==3.9.0
flit_core==3.9.0
fonttools==4.51.0
geomdl==5.3.1
google-api-core==2.18.0
google-api-python-client==2.126.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.63.0
grpcio==1.62.2
grpcio-health-checking==1.48.2
httplib2==0.22.0
identify==2.5.36
idna==3.7
imagesize==1.4.1
importlib_metadata==7.1.0
iniconfig==2.0.0
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.functools==4.0.1
Jinja2==3.1.3
keyring==25.1.0
kiwisolver==1.4.5
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.8.4
mdurl==0.1.2
more-itertools==10.2.0
nh3==0.2.17
nodeenv==1.8.0
numpy==1.26.4
numpydoc==1.7.0
packaging==24.0
pillow==10.3.0
Pint==0.23
pkginfo==1.10.0
platformdirs==4.2.0
pluggy==1.5.0
pooch==1.8.1
pre-commit==3.7.0
proto-plus==1.23.0
protobuf==3.20.3
psutil==5.9.8
pyansys-tools-versioning==0.5.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pydantic==2.7.0
pydantic_core==2.18.1
pydata-sphinx-theme==0.14.4
Pygments==2.17.2
pyiges==0.3.1
pyparsing==3.1.2
pyproject_hooks==1.0.0
pytest==8.1.1
pytest-cov==5.0.0
python-dateutil==2.9.0.post0
pyvista==0.43.5
pywin32-ctypes==0.2.2
PyYAML==6.0.1
readme_renderer==43.0
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.7.1
rsa==4.9
scipy==1.13.0
scooby==0.9.2
semver==3.0.2
setuptools==69.5.1
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.3.7
sphinx-copybutton==0.5.2
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
tabulate==0.9.0
tomli_w==1.0.0
tqdm==4.66.2
twine==5.0.0
typing_extensions==4.11.0
uritemplate==4.1.1
urllib3==2.2.1
virtualenv==20.25.3
vtk==9.3.0
wheel==0.43.0
zipp==3.18.1
@rmanno91 rmanno91 added the bug Something isn't working label May 8, 2024
@rmanno91 rmanno91 changed the title Temp body created when trying to performe an intersection on bodies which do not intersect. Temp body created when trying to perform an intersection on bodies which do not intersect. May 8, 2024
@RobPasMue
Copy link
Member

Thanks @rmanno91 - let me look into it soon

@RobPasMue RobPasMue self-assigned this May 8, 2024
@RobPasMue
Copy link
Member

RobPasMue commented May 8, 2024

I can verify this behavior. I believe this might be an underlying library issue (SC/DMS/Discovery)... are you interested in having that "temp" body? Because I believe you aren't.

@RobPasMue
Copy link
Member

Okay so, after verifying with @rmanno91, they are not interested in having that body (which makes total sense).

We should delete this "temp" file whenever these operations occur. Pinging @ansys/pyansys-geometry-maintainers. This is an issue happening in SC/DMS/Discovery... Happened as well in 24r1 - let's try to fix this before 24r2.

@RobPasMue
Copy link
Member

Seems to be fixed in the latest dev version - I will give it a try and implement a test for this.

@rmanno91
Copy link
Contributor Author

Seems to be fixed in the latest dev version - I will give it a try and implement a test for this.

Thanks Roberto, I will have a go on my end too.

@RobPasMue
Copy link
Member

Hi @rmanno91 - see #1258 ... seems like it still isn't fixed. I reported it back to @b-matteo

@RobPasMue
Copy link
Member

This test will verify that the change is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants