-
Notifications
You must be signed in to change notification settings - Fork 176
Fixed octa spheroid() symmetry. #1781
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes asymmetry issues in the octagon-style spheroid generation by replacing the original implementation with a new approach that properly handles sphere geometry.
- Introduces a new
_make_octa_sphere()function that creates symmetrical octahedral spheroids - Removes the old octagon implementation that relied on
spherical_to_xyz()and caused malformation - Restructures the spheroid function to handle the octa style separately from other styles
Comments suppressed due to low confidence (1)
shapes3d.scad:3424
- The variable octa_steps is removed but was used to calculate subdivision levels. The new implementation uses a different calculation (quantup(segs(r),4)/4) which may produce different subdivision behavior, potentially affecting backward compatibility.
vsides = max(2,ceil(hsides/2)),
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Should we wait for the dust to settle on the OpenSCAD PR so that they match? I haven't been paying close attention to the discussion about the optimization of the sphere. Also I wonder (haven't looked) how the "octa" sphere works with circum=true and whether it just calls the regular octasphere or also needs updating. |
|
The circum=true octa sphere basically does |
|
As for waiting for the final builtin version, that could take years, and the existing implementation in BOSL2 is definitely a bug. This code fixes the asymmetries, even if it is not pixel perfect to the eventual design. We can correct it for an exact match if and when it actually becomes an available thing. |
|
Also, based on the statistics, this code is slightly better than the proposals so far. |
|
ECHO: "new octa:" |
|
BTW, I've checked the icosa sphere, and it does not appear to have the same flaw. |
|
I think that the PR will settle. If you have something better than what's being talked in the PR we should post it there, probably. I'm not saying wait for it to appear in OpenSCAD, but wait for the PR to solidify and then we should match the PR. |
…um ellipse orientation.
79e06c9 to
235db32
Compare
The octagon style of spheroid() was malformed and asymmetrical due to the use of spherical_to_xyz(). This code fixes that.