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

Some minor bug fixes and some cleaning #96

Merged

Conversation

schustermartin
Copy link
Collaborator

  • Fixed some edge cases where in(...) function was returning false results due to forth and back conversion between Cylindrical and Cartesian Points. This is done by skipping trigonometric conversions where unnecessary.
  • Fixed in(...) function for the Cone Primitive. So far translate vector was not taken into account.
  • Switched to the use of RotationsPackage for VolumePrimitives (not used so far, just how general structure could look like).
  • Got rid of some unnecessary lines of code (expressing the same in less lines).

…tion matrices; Note: they still don't really do anything yet, but this is the structure we envision.

Fixed the in() function to respect the translation vector for Cones.
… also Conversions that occasionally led to numerical issues.(Even false returns of the in() function.)

Summarized some lines into a single line where applicable.
Copy link
Collaborator

@fhagemann fhagemann left a comment

Choose a reason for hiding this comment

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

Right now, the translate vector of Tube should never be zero. But we can leave it like this.

@@ -56,20 +56,14 @@ function Geometry(T::DataType, t::Val{:tube}, dict::Dict{Union{Any,String}, Any}
end

function in(point::CartesianPoint{T}, tube::Tube{T}) where T
ismissing(tube.translate) ? nothing : point -= tube.translate
(ismissing(tube.translate) || tube.translate == CartesianVector{T}(0.0,0.0,0.0)) ? nothing : point -= tube.translate
Copy link
Collaborator

Choose a reason for hiding this comment

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

tube.translate should never be zero

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, we have to change the general struct of our primitives anyhow when we add Rotations.
This if ismissing should never appear. I guess we will use parametric types to handle this on compilation level.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For both, translation and rotation.

@lmh91 lmh91 merged commit ba86e64 into JuliaPhysics:master Nov 12, 2020
@schustermartin schustermartin deleted the some_fixes_to_some_volume_primitives branch November 12, 2020 17:37
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

Successfully merging this pull request may close these issues.

3 participants