Provides work with triangle.
alias Vector!(3,T,"x y z") vectype
vectype[3] pnt
vectype perp()
- perpendicular calced as cross mul of segments [p0 to p1] and [p0 to p2]vectype norm()
-perp.e
T area()
-perp.len / 2
- area of trianglevectype center()
- center point
-
Triangle!T tr(X)( in Matrix!(4,4,X) mtr )
- transform all 3 points of triangle with transform matrixmtr
-
Segment!(T)[3] toSegments()
-- return segments [p0 to p1], [p1 to p2], [p2 to p0] -
Segment!T altitude( in vectype pp )
- return altitude to point from triangle plane -
Segment!T project(F)( in Segment!F seg )
- return projection ofseg
to triangle plane -
vectype intersect(F)( in Segment!F seg )
- return interseciont ofseg
with triangle plane