-
Notifications
You must be signed in to change notification settings - Fork 32
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
STL import #3270
Comments
This issue should include using STL imports as individual magnet components, not just an entire simulation |
I don't see a specific "import stl" function in Radia - |
We have had problems getting import radia
import numpy
p = [[0, 0, 0], [1, 1, 0], [0, 1, 0], [0.5, 0.5, 1]]
f = [[0, 1, 2], [0, 1, 3], [0, 3, 2], [3, 1, 2]]
g_id = radia.ObjPolyhdr(p, f)
d = radia.ObjDrwVTK(g_id, "Axes->No")
numpy.array([round(x, 6) for x in d["polygons"]["vertices"]]).reshape(-1, 3).tolist()
[
[1.0, 0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 0.0],
[0.0, 1.0, 0.0], [0.0, 0.0, 0.0], [1.0, 0.0, 0.0],
[1.0, 1.0, 0.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0],
[1.0, 1.0, 0.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0]
] The generated vertices are missing points supplied to the function and include points not supplied. They are also all in the same plane. The function also sometimes causes a segfault. We are exploring using @cchall or @j-edelen, have you had success using |
I've been able to use |
I think it was just the face indexing. Radia uses 1-based indexing. import radia
import numpy
p = [[0, 0, 0], [1, 1, 0], [0, 1, 0], [0.5, 0.5, 1]]
f = numpy.array([[0, 1, 2], [0, 1, 3], [0, 3, 2], [3, 1, 2]]) + 1
g_id = radia.ObjPolyhdr(p, f.tolist())
d = radia.ObjDrwVTK(g_id, "Axes->No")
numpy.array([round(x, 6) for x in d["polygons"]["vertices"]]).reshape(-1, 3).tolist()
[[0.0, 1.0, 0.0],
[1.0, 1.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[1.0, 1.0, 0.0],
[0.5, 0.5, 1.0],
[0.0, 0.0, 0.0],
[0.5, 0.5, 1.0],
[0.0, 1.0, 0.0],
[0.5, 0.5, 1.0],
[1.0, 1.0, 0.0],
[0.0, 1.0, 0.0]] |
Oh, for goodness sake. @Benbenbenin0 does that info help? |
Yup, feature works... |
All sub-tasks completed |
This may end up being part of the Phase 2a but the initial steps are not too complicated so I'll make this issue for it. The plan is to copy the warpvnd interface
(edited to mention that approach won't work here, because we have to let Radia create the object and then display it, not feed an arbitrary stl file to Radia)
The text was updated successfully, but these errors were encountered: