waterfall-cad-0.6.1.0: Declarative CAD/Solid Modeling Library
Safe HaskellNone
LanguageHaskell2010

Waterfall.Solids

Synopsis

Documentation

data Solid Source #

The Boundary Representation of a solid object.

Alternatively, a region of 3d Space.

Under the hood, this is represented by an OpenCascade Shape. The underlying shape should either be a Solid, or a CompSolid.

While you shouldn't need to know what this means to use the library, please feel free to report a bug if you're able to construct a Solid where this isnt' the case (without using internal functions).

Instances

Instances details
Monoid Solid Source # 
Instance details

Defined in Waterfall.Internal.Solid

Methods

mempty :: Solid #

mappend :: Solid -> Solid -> Solid #

mconcat :: [Solid] -> Solid #

Semigroup Solid Source #

While Solid could form a Semigroup via either union3D or intersection3D. the default Semigroup is from union3D.

The Semigroup from intersection3D can be obtained using Meet from the lattices package.

Instance details

Defined in Waterfall.Internal.Solid

Methods

(<>) :: Solid -> Solid -> Solid #

sconcat :: NonEmpty Solid -> Solid #

stimes :: Integral b => b -> Solid -> Solid #

BoundedJoinSemiLattice Solid Source # 
Instance details

Defined in Waterfall.Internal.Solid

Methods

bottom :: Solid #

Lattice Solid Source # 
Instance details

Defined in Waterfall.Internal.Solid

Methods

(\/) :: Solid -> Solid -> Solid #

(/\) :: Solid -> Solid -> Solid #

Boolean Solid Source # 
Instance details

Defined in Waterfall.Booleans

Transformable Solid Source # 
Instance details

Defined in Waterfall.Transforms

emptySolid :: Solid Source #

An empty solid

Be warned that complement emptySolid does not appear to work correctly.

unitCube :: Solid Source #

A cube with side lengths of 1, one vertex on the origin, another on \( (1, 1, 1) \)

centeredCube :: Solid Source #

A cube with side lengths of 1, centered on the origin

box :: V3 Double -> Solid Source #

A cuboid, one vertex on the origin, another on a given point

unitSphere :: Solid Source #

A sphere with radius of 1, centered on the origin

unitCylinder :: Solid Source #

A cylinder with radius 1, length 1, one of it's circular faces centered on the origin, the other centered on \( (0, 0, 1) \)

centeredCylinder :: Solid Source #

A cylinder with radius 1, length 1, centered on the origin,

unitCone :: Solid Source #

A cone With a point at the origin and a circular face with Radius 1, centered on \( (0, 0, 1) \)

torus Source #

Arguments

:: Double

The Major Radius (Distance from center of torus to center of cube)

-> Double

The Minor Radius (Distance from center of torus to center of )

-> Solid 

A Torus, with the axis of revolution about the Z axis

Warning, this will generate malformed geometry if asked to generate a Spindle Torus (when the Major Radius is smaller than the Minor Radius)

tetrahedron :: Solid Source #

Regular Tetrahedron with unit side lengths

One vertex is in the Z direction

octahedron :: Solid Source #

Regular Octahedron with unit side lengths

The vertices of the Octahedra lie on the X, Y and Z axes

dodecahedron :: Solid Source #

Regular Dodecahedron with unit side lengths

icosahedron :: Solid Source #

Regular Icosahedron with unit side lengths

prism :: Double -> Shape -> Solid Source #

Extruded a 2D face into a prism with a given length \(len\).

One of the prisms faces lies on the plane \(z = 0\), the other on the plane \(z = len\).

volume :: Solid -> Double Source #

Volume of the Solid

centerOfMass :: Solid -> V3 Double Source #

Center Of Mass of the Solid

momentOfInertia Source #

Arguments

:: V3 Double

Point on the Axis of the Moment

-> V3 Double

Direction of the Axis of the Moment

-> Solid 
-> Double 

Moment of Inertia of the Solid around a particular point and axis