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

Make top_radius the top for PositionCone3dModifier #96

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/modifier/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ impl InitModifier for PositionCone3dModifier {
// Truncated cone height
let h0 = {0};
// Random height ratio
let alpha_h = pow(rand(), 1.0 / 3.0);
// Random delta height from top
let alpha_h = 1.0 - pow(rand(), 1.0 / 3.0);
// Random delta height from bottom
let h = h0 * alpha_h;
// Top radius
let rt = {1};
// Bottom radius
let rb = {2};
// Radius at height h
let r0 = rt + (rb - rt) * alpha_h;
let r0 = rb + (rt - rb) * alpha_h;
// Random delta radius
let alpha_r = sqrt(rand());
// Random radius at height h
Expand Down