| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Waterfall.Fillet
Contents
Synopsis
- roundFillet :: Double -> Solid -> Solid
- roundConditionalFillet :: ((V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid
- roundIndexedConditionalFillet :: (Integer -> (V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid
- chamfer :: Double -> Solid -> Solid
- conditionalChamfer :: ((V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid
- indexedConditionalChamfer :: (Integer -> (V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid
- whenNearlyEqual :: Epsilon a => Lens' point a -> r -> (point, point) -> Maybe r
Rounds
Fillet that adds radiused faces that are tangent to the two faces either side of an edge.
Sometimes, it may not be possible to construct a fillet because there is not enough space next to one of the fillet edges, Or because the geometry is too complicated for the fillet algorithm.
roundFillet :: Double -> Solid -> Solid Source #
Add a round with a given radius to every edge of a solid
Because this is applied to both internal (concave) and external (convex) edges, it may technically produce both Rounds and Fillets
roundConditionalFillet :: ((V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid Source #
Add rounds with the given radius to each edge of a solid, conditional on the endpoints of the edge.
This can be used to selectively round/fillet a Solid.
roundIndexedConditionalFillet :: (Integer -> (V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid Source #
Add rounds with the given radius to each edge of a solid, conditional on the endpoints of the edge, and the index of the edge.
This can be used to selectively round/fillet a Solid.
In general, relying on the edge index is inelegant, however, if you consider a Solid with a semicircular face, there's no way to select either the curved or the flat edge of the semicircle based on just the endpoints.
Being able to selectively round/fillet based on edge index is an "easy" way to round/fillet these shapes.
Chamfers
Adds flat faces at a constant angle to the two faces either side of an edge.
chamfer :: Double -> Solid -> Solid Source #
Add a round with a given radius to every edge of a solid
This is applied to both internal (concave) and external (convex) edges
conditionalChamfer :: ((V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid Source #
Add chamfers with the given size to each edge of a solid, conditional on the endpoints of the edge.
This can be used to selectively chamfer a Solid.
indexedConditionalChamfer :: (Integer -> (V3 Double, V3 Double) -> Maybe Double) -> Solid -> Solid Source #
Add chamfers of the given size to each edge of a solid, conditional on the endpoints of the edge, and the index of the edge.
This can be used to selectively chamfer a Solid.
In general, relying on the edge index is inelegant, however, if you consider a Solid with a semicircular face, there's no way to select either the curved or the flat edge of the semicircle based on just the endpoints.
Being able to selectively chamfer based on edge index is an "easy" way to chamfer these shapes.
Utility Methods
whenNearlyEqual :: Epsilon a => Lens' point a -> r -> (point, point) -> Maybe r Source #
Returns a value when the target of a lens on a two points are close to one another.
This can be used in combination with roundConditionalFillet/conditionalChamfer.
Selecting only horizontal edges:
roundConditionalFillet (whenNearlyEqual _z 2)
Selecting only vertical edges:
roundConditionalFillet (whenNearlyEqual _xy 2)