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

SoA or AoS? #22

Closed
Helveg opened this issue Jan 18, 2021 · 3 comments
Closed

SoA or AoS? #22

Helveg opened this issue Jan 18, 2021 · 3 comments

Comments

@Helveg
Copy link
Contributor

Helveg commented Jan 18, 2021

What do you think is computationally most efficient inside of Blender? A structure of arrays (x_vector, y_vector, z_vector, radius_vector) or an array of structures [point1, point2, point3]?

In the new API this information is only ever used once in principle to iterate over and "extrude" the CurveContainer. Once the Blender object for a Cell is constructed we throw away the data that constructed it to reduce memory and in the (I think rare) case that someone wants to read something about the cell they just constructed I'd like to read that out of the Blender object.

For these purposes, SoA or AoS?

@Helveg
Copy link
Contributor Author

Helveg commented Jan 18, 2021

Since I'd like to keep this a minimal effort endeavour and prevent "premature optimization" I'm mostly in favor of keeping the current description, the coords, unless problems arise or were already known to you?

Could you tell me though where the logic is that parses the coords from the RPC into the coords that are used in the CurveContainer, they seem to be different in nature, the latter being numpy-like?

@JustasB
Copy link
Owner

JustasB commented Jan 19, 2021

So the SoA format was chosen because that's the format used by the optimized Blender foreach_set method when setting the coordinates of the bezier curves.

Take a look at this method, I think this will answer your 2nd question:

def add_spline(self, coords, radii, smooth):

BTW, the sections are constructed by creating a Bezier curve object in Blender and then assigning radius to the 3D points:
image

@Helveg
Copy link
Contributor Author

Helveg commented Jan 19, 2021

Ok!

@Helveg Helveg closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants