struct PF3d::Tri
- PF3d::Tri
- Struct
- Value
- Object
Defined in:
pf3d/tri.crConstructors
- .new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, normal : PF2d::Vec3(Float64) | Nil = nil, clipped : Bool = false)
- .new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), t1 : PF2d::Vec3(Float64), t2 : PF2d::Vec3(Float64), t3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, clipped : Bool = false)
Instance Method Summary
-
#*(mat : PF2d::Matrix)
Multiply all points by a Matrix, returning a new Tri
-
#clip(plane : PF2d::Vec, plane_normal : PF2d::Vec)
Split the triangle based on which points are inside of a given plane Returns a tuple of 0-2 triangles
- #clipped : Bool
- #map_points(&)
-
#normal
Return the normal assuming clockwise pointing winding
- #normal=(normal : PF2d::Vec3(Float64) | Nil)
- #p1 : PF2d::Vec3(Float64)
- #p1=(p1 : PF2d::Vec3(Float64))
- #p2 : PF2d::Vec3(Float64)
- #p2=(p2 : PF2d::Vec3(Float64))
- #p3 : PF2d::Vec3(Float64)
- #p3=(p3 : PF2d::Vec3(Float64))
- #shade : Float64
- #shade=(shade : Float64)
- #split(p1, p2, p3, t1, t2, t3)
- #t1 : PF2d::Vec3(Float64)
- #t1=(t1 : PF2d::Vec3(Float64))
- #t2 : PF2d::Vec3(Float64)
- #t2=(t2 : PF2d::Vec3(Float64))
- #t3 : PF2d::Vec3(Float64)
- #t3=(t3 : PF2d::Vec3(Float64))
-
#x
Get the average x value
-
#y
Get the average y value
-
#z
Get the average z value
- #z=(value : Float64)
Constructor Detail
def self.new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, normal : PF2d::Vec3(Float64) | Nil = nil, clipped : Bool = false)
#
def self.new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), t1 : PF2d::Vec3(Float64), t2 : PF2d::Vec3(Float64), t3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, clipped : Bool = false)
#
Instance Method Detail
def clip(plane : PF2d::Vec, plane_normal : PF2d::Vec)
#
Split the triangle based on which points are inside of a given plane Returns a tuple of 0-2 triangles