#π how do i make this faster + general code review
20 messages Β· Page 1 of 1 (latest)
Click here to see this code in our pastebin.
@worn iris
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
in contains_batched(), you create the variable l, but then proceed to use len(points) again
I see that you also only use l once after that
instead I would just use len(points) in that one instance
oh ill correct that thx
ye some parts are chat gpt + hand fix
welp, I'm out
proove me wrong but i think i understand most of it
xs, ys, zs = np.meshgrid(
np.arange(size[0]),
np.arange(size[1]),
np.arange(size[2]),
indexing="ij",
)
points = np.stack((xs, ys, zs), axis=-1).reshape(-1, 3)
this part upsets me the rest i get and now that i think about it only like the batcher is chatgpt code
just ask chatgpt to unserialize it into a forloop so you can see whats happening
whats serialized?
instead of a oneliner
also its obvious that the mesh.contains(chunk) call is taking minutes but idk how to optimize that
do i break up the model? if so how?
or pethaps im wromg and it just looks like it on my phone
Oh this ye it isnt a oneliner its 2 lines + format
I mostly get it the part that upsets me is that np is supposed to have nice vecor capabilities yet i have to do this instead of a crossproduct
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.