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

Q3D sink creation from selection #4550

Closed
2 tasks done
arifroni opened this issue Apr 19, 2024 · 8 comments
Closed
2 tasks done

Q3D sink creation from selection #4550

arifroni opened this issue Apr 19, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@arifroni
Copy link

arifroni commented Apr 19, 2024

Before submitting the issue

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

Description of the bug

when i want to create a sink from an object, it works, to some extent. But when I use a face ID, it doesn't work.

image
image

when I want to specify axisdir, I expected I can define 6 faces of that object. but it only works on 4 faces. 0&1 are same, 3&4 are same. In the picture you can see, I couldn't create on to and bottom faces.
image
image

Steps To Reproduce

<>

Which Operating System are you using?

Windows

Which Python version are you using?

3.10

Installed packages

<>

@arifroni arifroni added the bug Something isn't working label Apr 19, 2024
@Samuelopez-ansys
Copy link
Member

Hi @arifroni ,

An ID is an integer, and you are passing an string "FaceID148803", you just need to split the string and the number, and pass the number (148803).

In addition, you could use this method: sink the other methods will be deprecated (PyAEDT v0.8.9):

q3dapp.sink(assignment=148803)

@arifroni
Copy link
Author

arifroni commented Apr 22, 2024

Thanks. Regarding the second problem, i couldnt make direction work in sink method.

But with assign_sink_to_objectface method, I realized if height is small compared to x and y size, it doesn't work (cant create sink on xy plane, top and bottom). for example:

for a box size of 1mm x 1mm x 5um, when i use

for i in range (6):
    q3dapp.assign_sink_to_objectface('Box5', direction=i, name="Axis="+str(i))

six sinks are created on all yz and xz planes.

but for a box size of 0.1mm x 0.1mm x 5um, it creates 6 sinks on all 6 faces.

@Samuelopez-ansys
Copy link
Member

Sorry, I am not following you, what are you trying to do?

@arifroni
Copy link
Author

I have 16 copper pads (rectangle box). i want to create 16 sinks on the bottom face of those boxes. My goal was to rename the boxes to meaningful name (Gate1, Gate2 ....Gate16). What I wanted was that, I will select the boxes in q3d and run the script. script will capture my selections (objs = q3dapp.modeler.selections). And then loop through and create sink on the bottom face.

for i in range(len(objs)):
    q3dapp.assign_sink_to_objectface(objs[i], direction=1, name=objs[i])

As I said before this works, as long as the thickness of the boxes are higher than what I have (my boxes are 5um thick).
To recreate the problem you can do the following:

Create two boxes (box1 and box2).
box1: 1mm x 1mm x 0.005mm
box2: 0.1mm x 0.1mm x 0.005mm

then run this:

for i in range (6):
    q3dapp.assign_sink_to_objectface('Box1', direction=i, name="Box1_Axis="+str(i))
    q3dapp.assign_sink_to_objectface('Box2', direction=i, name="Box1_Axis="+str(i))

you should see that box1 has 6 sinks on all the faces. But box2 has 6 sinks on 4 faces. My box size in the project is in the range of box1. Thats why i cant create sinks in my project. If i just increase my box heights to 7um from 5um, command works.

I hope its more clear now.

@Samuelopez-ansys
Copy link
Member

@arifroni Why don't you get directly the bottom face? With PyAEDT is quite simple:

app = pyaedt.Q3d(specified_version="2024.1", new_desktop_session=False)

bot_face_b1 = app.modeler['Box1'].bottom_face_z

app.sink(bot_face_b1, name="Box1_Axis1")

bot_face_b2 = app.modeler['Box2'].bottom_face_z

app.sink(bot_face_b2, name="Box2_Axis")

app.release_desktop(False, False)

You can get all object faces just doing: app.modeler['Box1'].faces, and decide which one you want to assign the sink. In addition, PyAEDT gives you the bottom and top ones depending on the axis ( bottom_face_z), please let me know if this is what you need.

@Samuelopez-ansys
Copy link
Member

@arifroni Any feedback?

@arifroni
Copy link
Author

this works. But i noticed bottom_face_z gives me bottom Z face with respect to Global coordinate system. Is there any way to change that? Lets say i am working on "my_new_CS", which is rotated from Global. i want bottom face z with respect to "my_new_CS" instead of Global, is that possible.

@Samuelopez-ansys
Copy link
Member

Hi @arifroni ,

No, the information provided app.modeler['Box2'].bottom_face_z is always refered to the Global. If you need it with any other coordinate system, create a new Issue, and the community will try to perform the implementation, or if you know how to do it, please you could aso contribute.

Thank you!

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

No branches or pull requests

2 participants