Skip to content

Conversation

@gaborpapp
Copy link
Contributor

Improving the docs on major, minor radius as discussed in #2057.
Fixed ratio method.
Adding radiusCentered method that follows a more usual naming for torus creation when a circle of radius r is rotated around an axis. I used r and R for minor and major radius in this method, to make it more clear that those variables are used for other distances by the class.

//! Specifies the major and minor radius as a ratio (minor : major). Resulting torus will fit unit cube.
Torus& ratio( float ratio ) { ratio = math<float>::clamp( ratio ); mRadiusMajor = 1; mRadiusMinor = 1 - ratio; return *this; }
//! Specifies the major and minor radius separately.
Torus& ratio( float ratio ) { ratio = math<float>::clamp( ratio ); mRadiusMajor = 1; mRadiusMinor = ratio; return *this; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are a nice improvement IMO. though isn't it a breaking change? Though I'm not against it in this case, I don't think the ratio() method is used as much. @paulhoux what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a breaking change indeed, but I think ratio() was not working according to its documentation. if ratio = minor / major and major = 1 then minor should be equal to ratio and not 1 - ratio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants