@@ -147,7 +147,7 @@ function _in(pt::CartesianPoint, c::Cylinder{T,OpenPrimitive}; csgtol::T = csg_d
147147 abs (pt. z) < c. hZ - csgtol && hypot (pt. x, pt. y) < c. r - csgtol
148148end
149149
150- function surfaces (t:: Cylinder{T} ) where {T}
150+ function surfaces (t:: Cylinder{T,ClosedPrimitive } ) where {T}
151151 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
152152 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
153153 mantle = FullConeMantle {T,:inwards} ((t. r, t. r), t. φ, t. hZ, t. origin, t. rotation)
@@ -180,7 +180,7 @@ function _in(pt::CartesianPoint, c::PartialCylinder{T,OpenPrimitive}; csgtol::T
180180 abs (pt. z) + csgtol < c. hZ && r < c. r - csgtol && _in_angular_interval_closed (φ, c. φ, csgtol = zero (T)) && r * sin (min (φ, c. φ - φ, T (π/ 2 ))) > csgtol
181181end
182182
183- function surfaces (t:: PartialCylinder{T} ) where {T}
183+ function surfaces (t:: PartialCylinder{T,ClosedPrimitive } ) where {T}
184184 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
185185 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
186186 mantle = PartialConeMantle {T,:inwards} ((t. r, t. r), t. φ, t. hZ, t. origin, t. rotation)
@@ -200,6 +200,7 @@ function surfaces(t::PartialCylinder{T}) where {T}
200200 (e_top, e_bot, mantle, poly_l, poly_r)
201201end
202202
203+
203204# ###################################################################
204205# ###################################################################
205206
@@ -231,7 +232,7 @@ function _in(pt::CartesianPoint, c::VaryingCylinder{T,OpenPrimitive}; csgtol::T
231232 hypot (pt. x, pt. y) < radius_at_z (c. hZ, c. r[1 ][1 ], c. r[2 ][1 ], pt. z) - csgtol * hypot (2 * c. hZ, c. r[2 ][1 ] - c. r[1 ][1 ]) / (2 * c. hZ)
232233end
233234
234- function surfaces (t:: VaryingCylinder{T} ) where {T}
235+ function surfaces (t:: VaryingCylinder{T,ClosedPrimitive } ) where {T}
235236 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
236237 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
237238 mantle = FullConeMantle {T,:inwards} ((t. r[1 ][1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -277,7 +278,7 @@ function _in(pt::CartesianPoint, c::PartialVaryingCylinder{T,OpenPrimitive}; csg
277278 _in_angular_interval_open (atan (pt. y, pt. x), c. φ, csgtol = zero (T)) && r * sin (min (φ, c. φ - φ, T (π/ 2 ))) > csgtol
278279end
279280
280- function surfaces (t:: PartialVaryingCylinder{T} ) where {T}
281+ function surfaces (t:: PartialVaryingCylinder{T,ClosedPrimitive } ) where {T}
281282 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
282283 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
283284 mantle = PartialConeMantle {T,:inwards} ((t. r[1 ][1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -338,7 +339,7 @@ function _in(pt::CartesianPoint, c::VaryingTube{T,OpenPrimitive}; csgtol::T = cs
338339 r < radius_at_z (c. hZ, c. r[1 ][2 ], c. r[2 ][2 ], pt. z) - csgtol * hypot (2 * c. hZ, c. r[2 ][2 ] - c. r[1 ][2 ]) / (2 * c. hZ)
339340end
340341
341- function surfaces (t:: VaryingTube{T} ) where {T}
342+ function surfaces (t:: VaryingTube{T,ClosedPrimitive } ) where {T}
342343 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
343344 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
344345 inner_mantle = FullConeMantle {T,:outwards} ((t. r[1 ][1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -389,7 +390,7 @@ function _in(pt::CartesianPoint, c::PartialVaryingTube{T,OpenPrimitive}; csgtol:
389390 r < radius_at_z (c. hZ, c. r[1 ][2 ], c. r[2 ][2 ], pt. z) - csgtol * hypot (2 c. hZ, c. r[2 ][2 ] - c. r[1 ][2 ]) / 2 c. hZ
390391end
391392
392- function surfaces (t:: PartialVaryingTube{T} ) where {T}
393+ function surfaces (t:: PartialVaryingTube{T,ClosedPrimitive } ) where {T}
393394 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
394395 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
395396 inner_mantle = PartialConeMantle {T,:outwards} ((t. r[1 ][1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -427,15 +428,15 @@ function _in(pt::CartesianPoint, c::Cone{T,CO,Tuple{Tuple{Nothing,T},Nothing}};
427428 _in (pt, Cone {T,CO} (((c. r[1 ][2 ],), (zero (T),)), c. φ, c. hZ, c. origin, c. rotation); csgtol)
428429end
429430
430- function surfaces (t:: UpwardCone{T} ) where {T}
431+ function surfaces (t:: UpwardCone{T,ClosedPrimitive } ) where {T}
431432 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
432433 outer_mantle = FullConeMantle {T,:inwards} ( (t. r[1 ][2 ], zero (T)), t. φ, t. hZ, t. origin, t. rotation)
433434 e_bot = EllipticalSurface {T} (r = t. r[1 ][2 ], φ = t. φ, origin = bot_center_pt, rotation = t. rotation)
434435 # normals of the surfaces show inside the volume primitives.
435436 e_bot, outer_mantle
436437end
437438
438- function surfaces (t:: PartialUpwardCone{T} ) where {T}
439+ function surfaces (t:: PartialUpwardCone{T,ClosedPrimitive } ) where {T}
439440 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
440441 outer_mantle = PartialConeMantle {T,:inwards} ( (t. r[1 ][2 ], zero (T)), t. φ, t. hZ, t. origin, t. rotation)
441442 e_bot = EllipticalSurface {T} (r = t. r[1 ][2 ], φ = t. φ, origin = bot_center_pt, rotation = t. rotation)
@@ -469,15 +470,15 @@ function _in(pt::CartesianPoint, c::Cone{T,CO,Tuple{Nothing,Tuple{Nothing,T}}};
469470 _in (pt, Cone {T,CO} (((zero (T),), (c. r[2 ][2 ],)), c. φ, c. hZ, c. origin, c. rotation); csgtol)
470471end
471472
472- function surfaces (t:: DownwardCone{T} ) where {T}
473+ function surfaces (t:: DownwardCone{T,ClosedPrimitive } ) where {T}
473474 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
474475 outer_mantle = FullConeMantle {T,:inwards} ( (zero (T), t. r[2 ][2 ]), t. φ, t. hZ, t. origin, t. rotation)
475476 e_top = EllipticalSurface {T} (r = t. r[2 ][2 ], φ = t. φ, origin = top_center_pt, rotation = - t. rotation * RotZ {T} (π))
476477 # normals of the surfaces show inside the volume primitives.
477478 e_top, outer_mantle
478479end
479480
480- function surfaces (t:: PartialDownwardCone{T} ) where {T}
481+ function surfaces (t:: PartialDownwardCone{T,ClosedPrimitive } ) where {T}
481482 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
482483 outer_mantle = PartialConeMantle {T,:inwards} ( (t. r[2 ][2 ], zero (T)), t. φ, t. hZ, t. origin, t. rotation)
483484 e_bot = EllipticalSurface {T} (r = t. r[2 ][2 ], φ = t. φ, origin = bot_center_pt, rotation = t. rotation)
@@ -512,7 +513,7 @@ function _in(pt::CartesianPoint, c::Cone{T,CO,Tuple{Tuple{T,T},T}}; csgtol::T =
512513 _in (pt, Cone {T,CO} ((c. r[1 ], (c. r[2 ], c. r[2 ])), c. φ, c. hZ, c. origin, c. rotation); csgtol)
513514end
514515
515- function surfaces (t:: TopClosedTube{T} ) where {T}
516+ function surfaces (t:: TopClosedTube{T,ClosedPrimitive } ) where {T}
516517 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
517518 # top_center_pt = _transform_into_global_coordinate_system(CartesianPoint{T}(zero(T), zero(T), +t.hZ), t)
518519 inner_mantle = FullConeMantle {T,:outwards} ((t. r[1 ][1 ], t. r[2 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -523,7 +524,7 @@ function surfaces(t::TopClosedTube{T}) where {T}
523524 e_bot, inner_mantle, outer_mantle
524525end
525526
526- function surfaces (t:: PartialTopClosedTube{T} ) where {T}
527+ function surfaces (t:: PartialTopClosedTube{T,ClosedPrimitive } ) where {T}
527528 bot_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), - t. hZ), t)
528529 # top_center_pt = _transform_into_global_coordinate_system(CartesianPoint{T}(zero(T), zero(T), +t.hZ), t)
529530 inner_mantle = PartialConeMantle {T,:outwards} ((t. r[1 ][1 ], t. r[2 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -562,7 +563,7 @@ function _in(pt::CartesianPoint, c::Cone{T,CO,Tuple{T,Tuple{T,T}}}; csgtol::T =
562563 _in (pt, Cone {T,CO} (((c. r[1 ], c. r[1 ]), c. r[2 ]), c. φ, c. hZ, c. origin, c. rotation); csgtol)
563564end
564565
565- function surfaces (t:: BottomClosedTube{T} ) where {T}
566+ function surfaces (t:: BottomClosedTube{T,ClosedPrimitive } ) where {T}
566567 # bot_center_pt = _transform_into_global_coordinate_system(CartesianPoint{T}(zero(T), zero(T), -t.hZ), t)
567568 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
568569 inner_mantle = FullConeMantle {T,:outwards} ((t. r[1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
@@ -573,7 +574,7 @@ function surfaces(t::BottomClosedTube{T}) where {T}
573574 e_top, inner_mantle, outer_mantle
574575end
575576
576- function surfaces (t:: PartialBottomClosedTube{T} ) where {T}
577+ function surfaces (t:: PartialBottomClosedTube{T,ClosedPrimitive } ) where {T}
577578 # bot_center_pt = _transform_into_global_coordinate_system(CartesianPoint{T}(zero(T), zero(T), -t.hZ), t)
578579 top_center_pt = _transform_into_global_coordinate_system (CartesianPoint {T} (zero (T), zero (T), + t. hZ), t)
579580 inner_mantle = PartialConeMantle {T,:outwards} ((t. r[1 ], t. r[2 ][1 ]), t. φ, t. hZ, t. origin, t. rotation)
0 commit comments