-
Notifications
You must be signed in to change notification settings - Fork 34
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
Some minor bug fixes and some cleaning #96
Conversation
schustermartin
commented
Nov 12, 2020
- 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.
…uld only work if that float is XY.0 .
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.
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 |
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.
tube.translate
should never be zero
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.
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.
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.
For both, translation and rotation.