Redefine Cone
and Torus
: φ::Tuple{T,T}
=> φ::T
#240
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the definition of the polar angle
φ
for bothCone
andTorus
as requested in #215 and #236.φ
is can now only be full 2π (Nothing
) or a number (T
), whereφ = 50°
describes the range from0°
to50°
.This is explicitly required in the source code by demanding
φ::TP where {TP <: Union{Nothing,T}}
.I also added tests for
Cone
andTorus
which should cover most (if not all) of the cases that we describe and increase the code coverage. I also spotted some bugs while running the tests that are fixed with this PR.I tried out some combinations of rotations and translations, and the implementation seems to be right
(basically, we set
φ
to be the width of the formerφ
interval and add a rotation around theZ
axis byφ[1]
).Full 2π Cone
Partial Cone
The tricky part is when intervals need to be converted to the new
φ
syntax, e.g. when determining theEllipticalSurfaces
that describeφ
cross-sections of aTorus
.Then
θ::Tuple{T,T}
is converted to the "new"φ::T
throughφ = abs(-(θ...))
and a rotation aroundθ[1]
:Another nice thing is that the bulletized point contacts from SigGen configuration files now look quite decent, as they are not constructed using
CSGDifference
anymore: