Skip to content

body.imprint_projected_curves() not working as expected #1622

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

Closed
2 tasks done
sp-claim opened this issue Jan 13, 2025 · 6 comments · Fixed by #1715
Closed
2 tasks done

body.imprint_projected_curves() not working as expected #1622

sp-claim opened this issue Jan 13, 2025 · 6 comments · Fixed by #1715
Assignees
Labels
bug Something isn't working

Comments

@sp-claim
Copy link

🔍 Before submitting the issue

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

🐞 Description of the bug

Hi,

I am using Ansys geometry service 2024R2 with Python 3.13 and ansys-geometry-core 0.76 & PrimeMesh. Everything has been installed on a clean environment.
I have the following problem:

I created a body and tried projecting a sketch onto it. The sketch consits of a single circle. But if I try to project onto the body it results in just a line.

If I create a surface from that sketch everything looks normal. It is unclear if its a bug right now.

📝 Steps to reproduce

from ansys.geometry.core import launch_modeler_with_spaceclaim
from ansys.geometry.core import launch_modeler_with_geometry_service
from ansys.geometry.core import launch_modeler
from ansys.geometry.core.materials import Material, MaterialProperty, MaterialPropertyType
from ansys.geometry.core.math import UNITVECTOR3D_Z, Frame, Plane, Point2D, Point3D, UnitVector3D, UNITVECTOR3D_X,
UNITVECTOR3D_Y
from ansys.geometry.core.misc import UNITS
from ansys.geometry.core.sketch import Sketch
from ansys.geometry.core.misc import DEFAULT_UNITS, Distance

modeler = launch_modeler(mode="spaceclaim",version=242)

pxy=Plane(origin=Point3D([0,0,-100],unit=UNITS.mm),direction_x=UNITVECTOR3D_X,direction_y=UNITVECTOR3D_Y)
s1=Sketch(pxy)
s1.box(Point2D([1550/2,0],unit=UNITS.mm),1550,100)
design=modeler.create_design("smirror")
mbody=design.extrude_sketch("mb",sketch=s1,distance=Distance(200,unit=UNITS.mm))
cylplane=Plane(origin=Point3D([0,0,0],unit=UNITS.mm),direction_x=UNITVECTOR3D_X,direction_y=UNITVECTOR3D_Z)
s2=Sketch(cylplane)
s2.circle(center=Point2D([50,0],unit=UNITS.mm),radius=Distance(10,unit=UNITS.mm))
face=design.create_surface("cyl",sketch=s2)
testface=mbody.imprint_projected_curves(direction=UNITVECTOR3D_Y,sketch=s2,closest_face=True)

design.export_to_scdocx()
modeler.close()

Image

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2024R2

🐍 Which Python version are you using?

3.13

📦 Installed packages

aiohappyeyeballs==2.4.4
aiohttp==3.11.11
aiosignal==1.3.2
ansys-api-dbu==0.3.6
ansys-api-geometry==0.4.16
ansys-geometry-core==0.7.6
ansys-tools-path==0.7.1
ansys-tools-visualization-interface==0.7.0
attrs==24.3.0
beartype==0.19.0
certifi==2024.12.14
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
contourpy==1.3.1
cycler==0.12.1
flexcache==0.3
flexparser==0.4
fonttools==4.55.3
frozenlist==1.5.0
grpcio==1.67.1
grpcio-health-checking==1.67.1
idna==3.10
kiwisolver==1.4.8
matplotlib==3.10.0
more-itertools==10.5.0
msgpack==1.1.0
multidict==6.1.0
numpy==2.2.1
packaging==24.2
pillow==11.1.0
Pint==0.24.4
platformdirs==4.3.6
pooch==1.8.2
propcache==0.2.1
protobuf==5.29.3
pyparsing==3.2.1
python-dateutil==2.9.0.post0
pyvista==0.44.1
requests==2.32.3
scipy==1.15.0
scooby==0.10.0
semver==3.0.2
six==1.17.0
trame==3.7.6
trame-client==3.5.1
trame-server==3.2.7
trame-vtk==2.8.14
trame-vuetify==2.8.0
typing_extensions==4.12.2
urllib3==2.3.0
vtk==9.4.1
websockets==14.1
wslink==2.2.2
yarl==1.18.3
@sp-claim sp-claim added the bug Something isn't working label Jan 13, 2025
@RobPasMue
Copy link
Member

Hi @sp-claim - thanks for opening the issue! I will try to investigate on my side as soon as I can and get back to you :)

@RobPasMue RobPasMue self-assigned this Jan 14, 2025
@sp-claim
Copy link
Author

@RobPasMue Projecting the circle in Z-Direction works. The orientation of the plane the sketch is without any impact.

XZ Plane -->Y-Projection--> Line on faces with Y Normal vector
XY Plane -->Y-Projection--> Line on faces with Y Normal vector
ZY Plane -->Y-Projection--> Line on faces with Y Normal vector

XY Plane -->Z-Projection--> circle on face with Z-Normal vector
XZ Plane -->Z-Projection-->circle on face with Z-Normal vector
YZ Plane -->Z-Projection-->circle on face with Z-Normal vector

This seems odd to me. Seems like the sketch orientation is always the same after passing the object to the function.

@jonahrb
Copy link
Contributor

jonahrb commented Feb 3, 2025

@RobPasMue @sp-claim i believe found the issue here, the plane is hardcoded on the backend to be the XY plane, this was an oversight for an original workflow. We must change the ImprintCurves, ProjectCurves, and ImprintProjectedCurves proto's to include a plane and use the provided plane.

@jonahrb jonahrb linked a pull request Feb 3, 2025 that will close this issue
9 tasks
@RobPasMue
Copy link
Member

FYI @sp-claim - we are working on a fix for this but sadly it won't be available on your side earlier than 25R2 since it implies modifying the server shipped with the Ansys installation. Sorry for the inconveniences!

@RobPasMue RobPasMue assigned jonahrb and unassigned RobPasMue Feb 4, 2025
@sp-claim
Copy link
Author

sp-claim commented Feb 4, 2025 via email

@RobPasMue
Copy link
Member

Hi @sp-claim! The server we mention is shared by all products (SpaceClaim, Discovery and the Geometry Service). Consequently, it will also be fixed on SpaceClaim. Thanks for bringing the problem to our attention!

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